[hibernate-commits] Hibernate SVN: r19979 - in core/trunk/documentation/manual/src/main/docbook: de-DE/content and 12 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Jul 20 21:11:37 EDT 2010
Author: steve.ebersole at jboss.com
Date: 2010-07-20 21:11:34 -0400 (Tue, 20 Jul 2010)
New Revision: 19979
Added:
core/trunk/documentation/manual/src/main/docbook/de-DE/content/additionalmodules.po
Modified:
core/trunk/documentation/manual/src/main/docbook/de-DE/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.po
core/trunk/documentation/manual/src/main/docbook/de-DE/author_group.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/basic_mapping.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/collection_mapping.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/configuration.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/filters.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/performance.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/persistent_classes.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/query_sql.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/session_api.po
core/trunk/documentation/manual/src/main/docbook/de-DE/content/tutorial.po
core/trunk/documentation/manual/src/main/docbook/es-ES/author_group.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/basic_mapping.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/collection_mapping.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/configuration.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/filters.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/performance.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/persistent_classes.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/preface.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/query_sql.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/session_api.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/tutorial.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/author_group.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/basic_mapping.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/collection_mapping.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/configuration.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/filters.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/performance.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/persistent_classes.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/preface.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/query_sql.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/session_api.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/tutorial.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/author_group.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/basic_mapping.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/collection_mapping.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/configuration.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/filters.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/performance.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/persistent_classes.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/preface.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/query_sql.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/session_api.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/tutorial.po
core/trunk/documentation/manual/src/main/docbook/pot/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.pot
core/trunk/documentation/manual/src/main/docbook/pot/author_group.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/basic_mapping.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/collection_mapping.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/configuration.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/filters.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/performance.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/persistent_classes.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/preface.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/query_sql.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/session_api.pot
core/trunk/documentation/manual/src/main/docbook/pot/content/tutorial.pot
core/trunk/documentation/manual/src/main/docbook/pt-BR/author_group.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/basic_mapping.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/collection_mapping.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/configuration.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/filters.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/performance.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/persistent_classes.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/preface.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/query_sql.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/session_api.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/tutorial.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/author_group.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/basic_mapping.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/collection_mapping.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/configuration.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/filters.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/performance.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/persistent_classes.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/preface.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/query_sql.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/session_api.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/tutorial.po
Log:
HHH-5397 - Odds and ends from documentation merge : initial POT and PO synchs
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,14 +1,14 @@
-#
+#
# AUTHOR <EMAIL at ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:14\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-02-11T05:38:14\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/author_group.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/author_group.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/author_group.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,10 +1,11 @@
-#
+#
# AUTHOR <EMAIL at ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:14\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-02-11T05:38:14\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
@@ -12,138 +13,215 @@
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
+msgid ""
+"<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</"
+"surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
+msgid ""
+"<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
+msgid "Graphic Design"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
+msgid ""
+"<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> "
+"<email>kreimer at bbs.frc.utn.edu.ar</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
+msgid ""
+"<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></"
+"othercredit>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
+msgid ""
+"<firstname>Alvaro</firstname> <surname>Netto</surname> "
+"<email>alvaronetto at cetip.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
+msgid ""
+"<firstname>Anderson</firstname> <surname>Braulio</surname> "
+"<email>andersonbraulio at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
+msgid ""
+"<firstname>Daniel Vieira</firstname> <surname>Costa</surname> "
+"<email>danielvc at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
+msgid ""
+"<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco."
+"gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
+msgid ""
+"<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
+msgid ""
+"<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> "
+"<email>luizcarlos_rodrigues at yahoo.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
+msgid ""
+"<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel."
+"castelo at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
+msgid ""
+"<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail."
+"com</email>"
msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
+msgid ""
+"<firstname>Pablo L.</firstname> <surname>de Miranda</surname> "
+"<email>pablolmiranda at gmail.com</email>"
msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
+msgid ""
+"<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail."
+"com</email>"
msgstr ""
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid ""
+"<firstname>Rogério</firstname> <surname>Araújo</surname> "
+"<email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid ""
+"<firstname>Wanderson</firstname> <surname>Siqueira</surname> "
+"<email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid ""
+"<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> "
+"<orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</"
+"contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
Added: core/trunk/documentation/manual/src/main/docbook/de-DE/content/additionalmodules.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/additionalmodules.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/additionalmodules.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -0,0 +1,439 @@
+# Language de-DE translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: 2010-07-20 21:02+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Core also offers integration with some external modules/projects. "
+"This includes Hibernate Validator the reference implementation of Bean "
+"Validation (JSR 303) and Hibernate Search."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:35
+#, no-c-format
+msgid "Bean Validation"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:37
+#, no-c-format
+msgid ""
+"Bean Validation standardizes how to define and declare domain model level "
+"constraints. 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. Bean Validation 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, Bean "
+"Validation and its reference implementation Hibernate Validator has been "
+"designed for that purpose."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:48
+#, no-c-format
+msgid ""
+"The integration between Hibernate and Bean Validation 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:54
+#, 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, updates and deletes done by Hibernate."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:62
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in a set of <classname>ConstraintViolation</"
+"classname>s. Among other information, the <classname>ConstraintViolation</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. size limit), and message "
+"strings that may be externalized to a <classname>ResourceBundle</classname>."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:71
+#, no-c-format
+msgid "Adding Bean Validation"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:73
+#, no-c-format
+msgid ""
+"To enable Hibernate's Bean Validation integration, simply add a Bean "
+"Validation provider (preferably Hibernate Validation 4) on your classpath."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:79
+#, no-c-format
+msgid "Configuration"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:81
+#, no-c-format
+msgid "By default, no configuration is necessary."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:83
+#, no-c-format
+msgid ""
+"The <classname>Default</classname> group is validated on entity insert and "
+"update and the database model is updated accordingly based on the "
+"<classname>Default</classname> group as well."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:87
+#, no-c-format
+msgid ""
+"You can customize the Bean Validation integration by setting the validation "
+"mode. Use the <literal>javax.persistence.validation.mode</literal> property "
+"and set it up for example in your <filename>persistence.xml</filename> file "
+"or your <filename>hibernate.cfg.xml</filename> file. Several options are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:96
+#, no-c-format
+msgid ""
+"<literal>auto</literal> (default): enable integration between Bean "
+"Validation and Hibernate (callback and ddl generation) only if Bean "
+"Validation is present in the classpath."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:102
+#, no-c-format
+msgid ""
+"<literal>none</literal>: disable all integration between Bean Validation and "
+"Hibernate"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:107
+#, no-c-format
+msgid ""
+"<literal>callback</literal>: only validate entities when they are either "
+"inserted, updated or deleted. An exception is raised if no Bean Validation "
+"provider is present in the classpath."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:113
+#, no-c-format
+msgid ""
+"<literal>ddl</literal>: only apply constraints to the database schema when "
+"generated by Hibernate. An exception is raised if no Bean Validation "
+"provider is present in the classpath. This value is not defined by the Java "
+"Persistence spec and is specific to Hibernate."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:122
+#, no-c-format
+msgid ""
+"You can use both <literal>callback</literal> and <literal>ddl</literal> "
+"together by setting the property to <literal>callback, dll</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: additionalmodules.xml:126
+#, no-c-format
+msgid ""
+"<persistence ...>\n"
+" <persistence-unit ...>\n"
+" ...\n"
+" <properties>\n"
+" <property name=\"javax.persistence.validation.mode\"\n"
+" value=\"callback, ddl\"/>\n"
+" </properties>\n"
+" </persistence-unit>\n"
+"</persistence>"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:128
+#, no-c-format
+msgid ""
+"This is equivalent to <literal>auto</literal> except that if no Bean "
+"Validation provider is present, an exception is raised."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:132
+#, no-c-format
+msgid ""
+"If you want to validate different groups during insertion, update and "
+"deletion, use:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:137
+#, no-c-format
+msgid ""
+"<literal>javax.persistence.validation.group.pre-persist</literal>: groups "
+"validated when an entity is about to be persisted (default to "
+"<classname>Default</classname>)"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:143
+#, no-c-format
+msgid ""
+"<literal>javax.persistence.validation.group.pre-update</literal>: groups "
+"validated when an entity is about to be updated (default to "
+"<classname>Default</classname>)"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:149
+#, no-c-format
+msgid ""
+"<literal>javax.persistence.validation.group.pre-remove</literal>: groups "
+"validated when an entity is about to be deleted (default to no group)"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:155
+#, no-c-format
+msgid ""
+"<literal>org.hibernate.validator.group.ddl</literal>: groups considered when "
+"applying constraints on the database schema (default to <classname>Default</"
+"classname>)"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:161
+#, no-c-format
+msgid ""
+"Each property accepts the fully qualified class names of the groups "
+"validated separated by a comma (,)"
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:165
+#, no-c-format
+msgid "Using custom groups for validation"
+msgstr ""
+
+#. Tag: programlisting
+#: additionalmodules.xml:167
+#, no-c-format
+msgid ""
+"<persistence ...>\n"
+" <persistence-unit ...>\n"
+" ...\n"
+" <properties>\n"
+" <property name=\"javax.persistence.validation.group.pre-update\"\n"
+" value=\"javax.validation.group.Default, com.acme.group.Strict"
+"\"/>\n"
+" <property name=\"javax.persistence.validation.group.pre-remove\"\n"
+" value=\"com.acme.group.OnDelete\"/>\n"
+" <property name=\"org.hibernate.validator.group.ddl\"\n"
+" value=\"com.acme.group.DDL\"/>\n"
+" </properties>\n"
+" </persistence-unit>\n"
+"</persistence>"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:171
+#, no-c-format
+msgid ""
+"You can set these properties in <filename>hibernate.cfg.xml</filename>, "
+"<filename>hibernate.properties</filename> or programmatically."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:178
+#, no-c-format
+msgid "Catching violations"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:180
+#, no-c-format
+msgid ""
+"If an entity is found to be invalid, the list of constraint violations is "
+"propagated by the <classname>ConstraintViolationException</classname> which "
+"exposes the set of <classname>ConstraintViolation</classname>s."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:185
+#, no-c-format
+msgid ""
+"This exception is wrapped in a <classname>RollbackException</classname> when "
+"the violation happens at commit time. Otherwise the "
+"<classname>ConstraintViolationException</classname> is returned (for example "
+"when calling <methodname>flush()</methodname>. Note that generally, "
+"catchable violations are validated at a higher level (for example in Seam / "
+"JSF 2 via the JSF - Bean Validation integration or in your business layer by "
+"explicitly calling Bean Validation)."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:194
+#, no-c-format
+msgid ""
+"An application code will rarely be looking for a "
+"<classname>ConstraintViolationException</classname> raised by Hibernate. "
+"This exception should be treated as fatal and the persistence context should "
+"be discarded (<classname>EntityManager</classname> or <classname>Session</"
+"classname>)."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:202
+#, no-c-format
+msgid "Database schema"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:204
+#, no-c-format
+msgid ""
+"Hibernate uses Bean Validation constraints to generate an accurate database "
+"schema:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:209
+#, no-c-format
+msgid ""
+"<classname>@NotNull</classname> leads to a not null column (unless it "
+"conflicts with components or table inheritance)"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:214
+#, no-c-format
+msgid ""
+"<classname>@Size.max</classname> leads to a <literal>varchar(max)</literal> "
+"definition for Strings"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:219
+#, no-c-format
+msgid ""
+"<classname>@Min</classname>, <classname>@Max</classname> lead to column "
+"checks (like <code>value <= max</code>)"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:224
+#, no-c-format
+msgid ""
+"<classname>@Digits</classname> leads to the definition of precision and "
+"scale (ever wondered which is which? It's easy now with <classname>@Digits</"
+"classname> :) )"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:230
+#, no-c-format
+msgid ""
+"These constraints can be declared directly on the entity properties or "
+"indirectly by using constraint composition."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:233
+#, no-c-format
+msgid ""
+"For more information check the Hibernate Validator <ulink url=\"http://docs."
+"jboss.org/hibernate/stable/validator/reference/en-US/html/\">reference "
+"documentation</ulink>."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:240
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:243
+#, no-c-format
+msgid "Description"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:245
+#, 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: title
+#: additionalmodules.xml:258
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:260
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Core transparently provided that "
+"the Hibernate Search jar is present on 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:267
+#, no-c-format
+msgid ""
+"Check the Hibernate Search <ulink url=\"http://docs.jboss.org/hibernate/"
+"stable/search/reference/en-US/html/\">reference documentation</ulink> for "
+"more information."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/basic_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/basic_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/basic_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,23 +285,144 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "Grundlagen des O/R Mappings"
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "Mapping-Deklaration"
#. Tag: para
+#: basic_mapping.xml:36
+#, no-c-format
+msgid "Object/relational mappings can be defined in three approaches:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:41
+#, no-c-format
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:46
+#, no-c-format
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
+msgid ""
+"Annotations are split in two categories, the logical mapping annotations "
+"(describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid ""
+"JPA annotations are in the <literal>javax.persistence.*</literal> package. "
+"Hibernate specific extensions are in <literal>org.hibernate.annotations.*</"
+"literal>. You favorite IDE can auto-complete annotations and their "
+"attributes for you (even without a specific \"JPA\" plugin, since JPA "
+"annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
#, fuzzy, no-c-format
+msgid "Here is an example of mapping"
+msgstr "Beginnen wir mit einem Beispiel-Mapping:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
msgid ""
-"Object/relational mappings are usually defined in an XML document. The "
-"mapping document is designed to be readable and hand-editable. The mapping "
-"language is Java-centric, meaning that mappings are constructed around "
-"persistent class declarations and not table declarations."
+"package eg;\n"
+"\n"
+"@Entity \n"
+"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
+"discriminatorType=CHAR)\n"
+"public class Cat {\n"
+" \n"
+" @Id @GeneratedValue\n"
+" public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public BigDecimal getWeight() { return weight; }\n"
+" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+" private BigDecimal weight;\n"
+"\n"
+" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+" public Date getBirthdate() { return birthdate; }\n"
+" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+" private Date birthdate;\n"
+"\n"
+" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+" @NotNull @Column(updatable=false)\n"
+" public ColorType getColor() { return color; }\n"
+" public void setColor(ColorType color) { this.color = color; }\n"
+" private ColorType color;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public String getSex() { return sex; }\n"
+" public void setSex(String sex) { this.sex = sex; }\n"
+" private String sex;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public Integer getLitterId() { return litterId; }\n"
+" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+" private Integer litterId;\n"
+"\n"
+" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+" public Cat getMother() { return mother; }\n"
+" public void setMother(Cat mother) { this.mother = mother; }\n"
+" private Cat mother;\n"
+"\n"
+" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+" public Set<Cat> getKittens() { return kittens; }\n"
+" public void setKittens(Set<Cat> kittens) { this.kittens = "
+"kittens; }\n"
+" private Set<Cat> kittens = new HashSet<Cat>();\n"
+"}\n"
+"\n"
+"@Entity @DiscriminatorValue(\"D\")\n"
+"public class DomesticCat extends Cat {\n"
+"\n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name }\n"
+" private String name;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Dog { ... }"
msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:73
+#, fuzzy, no-c-format
+msgid ""
+"The legacy hbm.xml approach uses an XML schema designed to be readable and "
+"hand-editable. The mapping language is Java-centric, meaning that mappings "
+"are constructed around persistent class declarations and not table "
+"declarations."
+msgstr ""
"Objekt/relationale Mappings sind in der Regel in einem XML-Dokument "
"definiert. Das Mapping-Dokument ist so angelegt, dass es lesbar und manuell "
"veränderbar ist. Die Mapping-Sprache ist Java-zentrisch, d.h. Mappings sind "
@@ -309,6 +430,7 @@
"Deklarationen konstruiert."
#. Tag: para
+#: basic_mapping.xml:78
#, fuzzy, no-c-format
msgid ""
"Please note that even though many Hibernate users choose to write the XML by "
@@ -320,18 +442,157 @@
"gibt, darunter XDoclet, Middlegen und AndroMDA."
#. Tag: para
+#: basic_mapping.xml:82
#, fuzzy, no-c-format
msgid "Here is an example mapping:"
msgstr "Beginnen wir mit einem Beispiel-Mapping:"
+#. Tag: programlisting
+#: basic_mapping.xml:84
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" \n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+" \n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\" \n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\" \n"
+" not-null=\"true\" \n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\" \n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\" \n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:86
#, fuzzy, no-c-format
msgid ""
-"We will now discuss the content of the mapping document. We will only "
-"describe, however, the document elements and attributes that are used by "
-"Hibernate at runtime. The mapping document also contains some extra optional "
-"attributes and elements that affect the database schemas exported by the "
-"schema export tool (for example, the <literal> not-null</literal> attribute)."
+"We will now discuss the concepts of the mapping documents (both annotations "
+"and XML). We will only describe, however, the document elements and "
+"attributes that are used by Hibernate at runtime. The mapping document also "
+"contains some extra optional attributes and elements that affect the "
+"database schemas exported by the schema export tool (for example, the "
+"<literal> not-null</literal> attribute)."
msgstr ""
"Wir gehen nun auf den Inhalt des Mapping-Dokuments ein. Es werden nur die "
"von Hibernate zur Runtime verwendeten Elemente und Attribute des Dokuments "
@@ -341,238 +602,470 @@
"Attribut)."
#. Tag: title
+#: basic_mapping.xml:94
+#, fuzzy, no-c-format
+msgid "Entity"
+msgstr "identity"
+
+#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "Doctype"
-msgstr "Doctype"
+msgid ""
+"An entity is a regular Java object (aka POJO) which will be persisted by "
+"Hibernate."
+msgstr ""
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:99
+#, no-c-format
msgid ""
-"All XML mappings should declare the doctype shown. The actual DTD can be "
-"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
-"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
-"will always look for the DTD in its classpath first. If you experience "
-"lookups of the DTD using an Internet connection, check the DTD declaration "
-"against the contents of your classpath."
+"To mark an object as an entity in annotations, use the <classname>@Entity</"
+"classname> annotation."
msgstr ""
-"Alle XML-Mappings sollten den gezeigten doctype deklarieren. Die "
-"tatsächliche Dokumenttyp-Definition (\"DTD\") kann in der URL oben, im "
-"Verzeichnis <literal>hibernate-x.x.x/src/org/hibernate </literal> oder in "
-"<literal>hibernate3.jar</literal> gefunden werden. Hibernate wird stets "
-"zuerst in seinem Klassenpfad nach der DTD suchen. Falls es bei Ihnen zu "
-"Suchläufen der DTD mittels einer Internetverbindung kommt, überprüfen Sie "
-"Ihre DTD-Deklaration hinsichtlich der Inhalte Ihres Klassenpfads."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:102
#, no-c-format
-msgid "EntityResolver"
-msgstr "EntityResolver"
+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
+#: basic_mapping.xml:104
+#, no-c-format
+msgid ""
+"That's pretty much it, the rest is optional. There are however any options "
+"to tweak your entity mapping, let's explore them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:107
+#, no-c-format
+msgid ""
+"<classname>@Table</classname> lets you define the table the entity will be "
+"persisted into. If undefined, the table name is the unqualified class name "
+"of the entity. You can also optionally define the catalog, the schema as "
+"well as unique constraints on the table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:112
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"TBL_FLIGHT\", \n"
+" schema=\"AIR_COMMAND\", \n"
+" uniqueConstraints=\n"
+" @UniqueConstraint(\n"
+" name=\"flight_number\", \n"
+" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+"public class Flight implements Serializable {\n"
+" @Column(name=\"comp_prefix\")\n"
+" public String getCompagnyPrefix() { return companyPrefix; }\n"
+"\n"
+" @Column(name=\"flight_number\")\n"
+" public String getNumber() { return number; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:114
+#, no-c-format
+msgid ""
+"The constraint name is optional (generated if left undefined). The column "
+"names composing the constraint correspond to the column names as defined "
+"before the Hibernate <classname>NamingStrategy</classname> is applied."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:119
+#, no-c-format
+msgid ""
+"<literal>@Entity.name</literal> lets you define the shortcut name of the "
+"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
+"class name of the class."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:123
+#, no-c-format
+msgid ""
+"Hibernate goes beyond the JPA specification and provide additional "
+"configurations. Some of them are hosted on <classname>@org.hibernate."
+"annotations.Entity</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:129
#, fuzzy, no-c-format
msgid ""
-"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
-"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
-"implementation with the SAXReader it uses to read in the xml files. This "
-"custom <literal>EntityResolver</literal> recognizes two different systemId "
-"namespaces:"
+"<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> "
+"(defaults to false): specifies that <literal>INSERT</literal> / "
+"<literal>UPDATE</literal> SQL should be generated at runtime and contain "
+"only the columns whose values are not null. The <literal>dynamic-update</"
+"literal> and <literal>dynamic-insert</literal> settings are not inherited by "
+"subclasses. Although these settings can increase performance in some cases, "
+"they can actually decrease performance in others."
msgstr ""
-"Wie bereits erwähnt, wird Hibernate zuerst versuchen, DTDs in seinem "
-"Klassenpfad aufzulösen. Dies geschieht, indem eine anwenderdefinierte "
-"<literal>org.xml.sax.EntityResolver</literal>-Implementierung mit dem "
-"SAXReader, der zum Lesen der xml-Dateien verwendet wird, registriert wird. "
-"Dieser anwenderorientierte <literal>EntityResolver</literal> erkennt zwei "
-"verschiedene \"systemId\"-Namensräume."
+"Bitte beachten Sie, dass die <literal>dynamic-update</literal> und "
+"<literal>dynamic-insert</literal> Einstellungen nicht an die Subklassen "
+"vererbt werden und daher auch in den <literal><subclass></literal> "
+"oder <literal><joined-subclass></literal>-Elementen spezifiziert "
+"werden können. Diese Einstellungen können die Performance in einigen Fällen "
+"verbessern, in anderen Fällen jedoch auch verschlechtern. Verwenden Sie sie "
+"daher umsichtig."
#. Tag: para
+#: basic_mapping.xml:140
#, fuzzy, no-c-format
msgid ""
-"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
-"encounters a systemId starting with <literal>http://hibernate.sourceforge."
-"net/</literal>. The resolver attempts to resolve these entities via the "
-"classloader which loaded the Hibernate classes."
+"<literal>selectBeforeUpdate</literal> (defaults to false): specifies that "
+"Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</"
+"literal> unless it is certain that an object is actually modified. Only when "
+"a transient object has been associated with a new session using "
+"<literal>update()</literal>, will Hibernate perform an extra SQL "
+"<literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is "
+"actually required. Use of <literal>select-before-update</literal> will "
+"usually decrease performance. It is useful to prevent a database update "
+"trigger being called unnecessarily if you reattach a graph of detached "
+"instances to a <literal>Session</literal>."
msgstr ""
-"ein <literal>hibernate namespace</literal> wird erkannt, sobald der "
-"\"Resolver\" (Auflöser) einer mit <literal>http://hibernate.sourceforge.net/"
-"</literal> beginnenden systemId begegnet. Der Resolver versucht diese "
-"Entities über den Klassenlader (sog. \"Classloader\"), der die Hibernate-"
-"Klassen geladen hat, aufzulösen."
+"<literal>select-before-update</literal> (optional, Standardeinstellung "
+"<literal>false</literal>): Bestimmt, dass Hibernate <emphasis>nie</emphasis> "
+"ein SQL <literal>UPDATE</literal> durchführt, außer es ist ganz sicher, dass "
+"ein Objekt tatsächlich verändert wurde. In bestimmten Fällen (nur wenn ein "
+"transientes Objekt unter Verwendung von <literal>update()</literal> mit "
+"einer neuen Session in Verbindung gebracht wird), bedeutet dies, dass "
+"Hibernate ein extra SQL <literal>SELECT</literal> durchführen wird, um zu "
+"bestimmen, ob ein <literal>UPDATE</literal> tatsächlich erforderlich ist."
#. Tag: para
+#: basic_mapping.xml:154
#, fuzzy, no-c-format
msgid ""
-"a <literal>user namespace</literal> is recognized whenever the resolver "
-"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
-"The resolver will attempt to resolve these entities via (1) the current "
-"thread context classloader and (2) the classloader which loaded the "
-"Hibernate classes."
+"<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): "
+"determines whether implicit or explicit query polymorphisms is used. "
+"<emphasis>Implicit</emphasis> polymorphisms means that instances of the "
+"class will be returned by a query that names any superclass or implemented "
+"interface or class, and that instances of any subclass of the class will be "
+"returned by a query that names the class itself. <emphasis>Explicit</"
+"emphasis> polymorphisms means that class instances will be returned only by "
+"queries that explicitly name that class. Queries that name the class will "
+"return only instances of subclasses mapped. For most purposes, the default "
+"<literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit "
+"polymorphisms is useful when two different classes are mapped to the same "
+"table This allows a \"lightweight\" class that contains a subset of the "
+"table columns."
msgstr ""
-"ein <literal>user namespace</literal> wird erkannt, sobald der Resolver "
-"einem <literal>classpath://</literal> URL-Protokoll verwendenden systemId "
-"begegnet. Der Resolver wird versuchen, diese Entities über (1) den aktuellen "
-"Thread-Kontext-Klassenlader und (2) den Klassenlader, der die Hibernate-"
-"Klassen geladen hat, aufzulösen."
+"<emphasis>Implicit</emphasis>-Polymorphie bedeutet, dass die Instanzen der "
+"Klasse von einer Anfrage beantwortet werden, die eine Superklasse, ein "
+"implementiertes Interface oder die Klasse zurücksendet und die Instanzen "
+"einer beliebigen Subklasse der betreffenden Klasse von einer die Klasse "
+"selbst nennenden Anfrage zurückgeschickt werden. <emphasis>Explizite</"
+"emphasis> Polymorphie bedeutet, dass die Instanzen der Klasse nur von "
+"Anfragen zurückgeschickt werden, die die Klasse explizit nennen und nur auf "
+"Instanzen, die innerhalb dieser <literal><class></literal> Deklaration "
+"als <literal><subclass></literal> oder <literal><joined-subclass>"
+"</literal> gemappt sind, reagiert wird. In den meisten Fällen ist die "
+"Standardeinstellung <literal>polymorphism=\"implicit\"</literal> angemessen. "
+"Explizite Polymorphie ist insbesondere dann von Nutzen, wenn zwei "
+"verschiedene Klassen ein Mapping zu derselben Tabelle besitzen (es bietet "
+"sich dadurch die Möglichkeit der Erstellung einer \"abgespeckten\" und alle "
+"Tabellenspalten als Teilsatz enthaltenden Klasse)."
#. Tag: para
+#: basic_mapping.xml:171
#, fuzzy, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
-msgstr "Ein Beispiel der Verwendung des Benutzer-Namespacing:"
+msgid ""
+"<literal>persister</literal>: specifies a custom <literal>ClassPersister</"
+"literal>. The <literal>persister</literal> attribute lets you customize the "
+"persistence strategy used for the class. You can, for example, specify your "
+"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
+"or you can even provide a completely new implementation of the interface "
+"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
+"for example, persistence via stored procedure calls, serialization to flat "
+"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
+"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgstr ""
+"Das <literal>persister</literal>-Attribut erlaubt die Anpassung der für die "
+"Klasse zu verwendenden Persistenzstrategie. Sie können zum Beispiel Ihre "
+"eigene Subklasse von <literal>org.hibernate.persister.EntityPersister</"
+"literal> bestimmen oder sogar eine vollständig neue Implementierung des "
+"Interface <literal>org.hibernate.persister.ClassPersister</literal> "
+"bereitsstellen, das z.B. mittels gespeicherter Prozeduraufrufe, "
+"Serialisierung verknüpfungsloser (zweidimensionaler Dateien (sog. \"flat "
+"Files\") oder LDAP Persistenz implementiert. Siehe <literal>org.hibernate."
+"test.CustomPersister</literal> für ein einfaches Beispiel (von \"Persistenz"
+"\" zu einer <literal>Hashtable</literal>)."
#. Tag: para
+#: basic_mapping.xml:185
#, fuzzy, no-c-format
msgid ""
-"Where <literal>types.xml</literal> is a resource in the <literal>your."
-"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
-"custom\">typedef</link>."
+"<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): "
+"determines the optimistic locking strategy. If you enable "
+"<literal>dynamicUpdate</literal>, you will have a choice of optimistic "
+"locking strategies:"
msgstr ""
-"Wo <literal>types.xml</literal> eine Ressource in im <literal>your.domain</"
-"literal> Paket ist und eine anwenderdefinierte <xref linkend=\"mapping-types-"
-"custom\"/>-Typedef enthält."
+"Wenn Sie <literal>dynamic-update</literal> aktivieren, haben Sie die Wahl "
+"zwischen verschiedenen Strategien für das optimistische Sperren:"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:192
#, fuzzy, no-c-format
-msgid "Hibernate-mapping"
-msgstr "hibernate-mapping"
+msgid "<literal>version</literal>: check the version/timestamp columns"
+msgstr "<literal>version</literal> Prüfung der Version-/Zeitstempel-Spalten"
#. Tag: para
+#: basic_mapping.xml:197
#, fuzzy, no-c-format
+msgid "<literal>all</literal>: check all columns"
+msgstr "<literal>all</literal> Prüfung aller Spalten"
+
+#. Tag: para
+#: basic_mapping.xml:201
+#, fuzzy, no-c-format
msgid ""
-"This element has several optional attributes. The <literal>schema</literal> "
-"and <literal>catalog</literal> attributes specify that tables referred to in "
-"this mapping belong to the named schema and/or catalog. If they are "
-"specified, tablenames will be qualified by the given schema and catalog "
-"names. If they are missing, tablenames will be unqualified. The "
-"<literal>default-cascade</literal> attribute specifies what cascade style "
-"should be assumed for properties and collections that do not specify a "
-"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
-"literal> attribute allows you to use unqualified class names in the query "
-"language."
+"<literal>dirty</literal>: check the changed columns, allowing some "
+"concurrent updates"
msgstr ""
-"Dieses Element besitzt mehrere optionale Attribute. Die <literal>schema</"
-"literal> und <literal>catalog</literal>-Attribute spezifizieren, dass die in "
-"diesem Mapping aufgeführten Tabellen zum genannten Schema und/oder Katalog "
-"gehören. Falls bestimmt, werden Tabellennamen durch die gegebenen Schema- "
-"und Katalognamen definiert. Falls nicht vorhanden, so bleiben die "
-"Tabellennamen undefiniert. Das <literal>default-cascade</literal>-Attribut "
-"bestimmt, welcher Weitergabestil (sog. \"Cascade-Style\" für Properties und "
-"Collections angenommen werden sollte, die kein <literal>cascade</literal>-"
-"Attribut spezifizieren. Das <literal>auto-import</literal>-Attribut erlaubt "
-"die Verwendung undefinierter Klassennamen in der Abfragensprache in der "
-"Standardeinstellung."
+"<literal>dirty</literal> Prüfung der veränderten Spalten, Möglichkeit "
+"einiger simultaner Aktualisierungen"
#. Tag: para
+#: basic_mapping.xml:206
#, fuzzy, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
-msgstr "<literal>schema</literal> (optional): Der Name eines Datenbankschemas."
+msgid "<literal>none</literal>: do not use optimistic locking"
+msgstr "<literal>none</literal> verwendet kein optimistisches Sperren"
#. Tag: para
+#: basic_mapping.xml:211
#, fuzzy, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
+msgid ""
+"It is <emphasis>strongly</emphasis> recommended that you use version/"
+"timestamp columns for optimistic locking with Hibernate. This strategy "
+"optimizes performance and correctly handles modifications made to detached "
+"instances (i.e. when <literal>Session.merge()</literal> is used)."
msgstr ""
-"<literal>catalog</literal> (optional): Der Name eines Datenbankkatalogs."
+"Wir empfehlen <emphasis>sehr</emphasis> dringend die Verwendung von Version-/"
+"Zeitstempel-Spalten für das optimistische Sperren mit Hibernate. Im Hinblick "
+"auf die Performance handelt es sich dabei um die beste Strategie, und es ist "
+"auch die einzige Strategie, die Veränderungen an abgesetzten Instanzen "
+"korrekt bearbeitet (d.h. wenn <literal>Session.merge()</literal> verwendet "
+"wird)."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:220
+#, no-c-format
msgid ""
-"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
-"literal>): a default cascade style."
+"Be sure to import <classname>@javax.persistence.Entity</classname> to mark a "
+"class as an entity. It's a common mistake to import <classname>@org."
+"hibernate.annotations.Entity</classname> by accident."
msgstr ""
-"<literal>default-cascade</literal> (optional - die Standardeinstellung "
-"lautet <literal>none</literal>): Ein standardmäßiger Weitergabestil "
-"(\"Cascade-Style\")."
#. Tag: para
+#: basic_mapping.xml:227
#, fuzzy, no-c-format
msgid ""
-"<literal>default-access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing all properties. "
-"It can be a custom implementation of <literal>PropertyAccessor</literal>."
+"Some entities are not mutable. They cannot be updated or deleted by the "
+"application. This allows Hibernate to make some minor performance "
+"optimizations.. Use the <classname>@Immutable</classname> annotation."
msgstr ""
-"<literal>default-access</literal> (optional - der Standard ist "
-"<literal>property</literal>): Die Strategie, die Hibernate für den Zugriff "
-"auf alle Properties benutzen sollte. Kann eine anwenderdefinierte "
-"Implementierung von <literal>PropertyAccessor</literal> sein."
+"Unveränderliche Klassen, <literal>mutable=\"false\"</literal>, können durch "
+"die Anwendung nicht aktualisiert oder gelöscht werden. Dies ermöglicht "
+"Hibernate kleinere Optimierungen hinsichtlich der Performance."
#. Tag: para
+#: basic_mapping.xml:232
#, fuzzy, no-c-format
msgid ""
-"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
-"literal>): the default value for unspecified <literal>lazy</literal> "
-"attributes of class and collection mappings."
+"You can also alter how Hibernate deals with lazy initialization for this "
+"class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false "
+"to disable lazy fetching (not recommended). You can also specify an "
+"interface to use for lazy initializing proxies (defaults to the class "
+"itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. "
+"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
+"the named interface. The persistent object will load when a method of the "
+"proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
-"<literal>default-lazy</literal> (optional - die Standardeinstellung lautet "
-"<literal>true</literal>): Der Standardwert für nicht spezifizierte "
-"<literal>lazy</literal> Attribute von Klassen- und Collection-Mappings."
+"Das optionale <literal>proxy</literal>-Attribut aktiviert die \"lazy "
+"Initialization\" persistenter Instanzen der Klasse. Hibernate wird anfangs "
+"mit CGLIB-Proxies reagieren, die das benannte Interface implementieren. Das "
+"eigentliche persistente Objekt wird geladen, wenn eine Methode des Proxy "
+"aufgerufen wird. Sehen Sie dazu \"Proxies für die Lazy Initialization\" "
+"unten."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:243
+#, no-c-format
msgid ""
-"<literal>auto-import</literal> (optional - defaults to <literal>true</"
-"literal>): specifies whether we can use unqualified class names of classes "
-"in this mapping in the query language."
+"<classname>@BatchSize</classname> specifies a \"batch size\" for fetching "
+"instances of this class by identifier. Not yet loaded instances are loaded "
+"batch-size at a time (default 1)."
msgstr ""
-"<literal>auto-import</literal> (optional - die Standardeinstellung lautet "
-"<literal>true</literal>): Legt fest, ob in der Abfragensprache ein "
-"undefinierter Klassenname verwendet werden kann (von Klassen in diesem "
-"Mapping)."
#. Tag: para
+#: basic_mapping.xml:247
#, fuzzy, no-c-format
msgid ""
-"<literal>package</literal> (optional): specifies a package prefix to use for "
-"unqualified class names in the mapping document."
+"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
+"objects of this class. Use <classname>@Where</classname> for that."
msgstr ""
-"<literal>package</literal> (optional): Spezifiziert einen Paket-Präfix, der "
-"für undefinierte Klassennamen im Mapping-Dokument angenommen werden soll."
+"<literal>where</literal> (optional) legt eine beliebige SQL <literal>WHERE</"
+"literal>-Bedingung zur Verwendung beim Aufruf von Objekten dieser Klasse fest"
#. Tag: para
+#: basic_mapping.xml:251
#, fuzzy, no-c-format
msgid ""
-"If you have two persistent classes with the same unqualified name, you "
-"should set <literal>auto-import=\"false\"</literal>. An exception will "
-"result if you attempt to assign two classes to the same \"imported\" name."
+"In the same vein, <classname>@Check</classname> lets you define an SQL "
+"expression used to generate a multi-row <emphasis>check</emphasis> "
+"constraint for automatic schema generation."
msgstr ""
-"Falls Sie zwei persistente Klassen mit demselben (undefinierten) Namen "
-"besitzen, sollten Sie die Einstellung <literal>auto-import=\"false\"</"
-"literal> vornehmen. Hibernate wird eine Ausnahme melden, wenn Sie versuchen, "
-"zwei Klassen demselben \"importierten\" Namen zuzuordnen."
+"<literal>check</literal> (optional): Ein SQL-Ausdruck wird verwendet, um "
+"eine <emphasis>Datenüberprüfungs</emphasis>bedingung mehrerer Reihen für die "
+"automatische Schemagenerierung zu erstellen. "
#. Tag: para
+#: basic_mapping.xml:255
#, fuzzy, no-c-format
msgid ""
-"The <literal>hibernate-mapping</literal> element allows you to nest several "
-"persistent <literal><class></literal> mappings, as shown above. It is, "
-"however, good practice (and expected by some tools) to map only a single "
-"persistent class, or a single class hierarchy, in one mapping file and name "
-"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
-"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
-"<literal>Animal.hbm.xml</literal>."
+"There is no difference between a view and a base table for a Hibernate "
+"mapping. This is transparent at the database level, although some DBMS do "
+"not support views properly, especially with updates. Sometimes you want to "
+"use a view, but you cannot create one in the database (i.e. with a legacy "
+"schema). In this case, you can map an immutable and read-only entity to a "
+"given SQL subselect expression using <classname>@org.hibernate.annotations."
+"Subselect</classname>:"
msgstr ""
-"Bitte beachten Sie, dass das <literal>hibernate-mapping</literal>-Element es "
-"Ihnen ermöglicht, mehrere persistente <literal><class></literal>-"
-"Mappings (wie oben dargestellt) zu verschachteln. Es ist jedoch eine gute "
-"Angewohnheit (und wird von einigen Tools vorausgesetzt) nur eine einzelne "
-"persistente Klasse (oder eine Einzelklassenhierarchie) in einer Mapping-"
-"Datei zu mappen und diese nach der persistenten Superklasse zu benennen, z."
-"B. <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal> oder - "
-"falls Sie \"Inheritance\" (d.h. Vererbung) verwenden - <literal>Animal.hbm."
-"xml</literal>."
+"Es gibt keinen Unterschied zwischen einer Ansicht und einer Basistabelle für "
+"ein Hibernate Mapping, und wie erwartet ist dies auf Datenbankebene "
+"transparent (bitte beachten Sie, dass einige DBMS Ansichten nicht korrekt "
+"unterstützen, insbesondere im Hinblick auf Aktualisierungen). Manchmal "
+"möchten Sie zwar eine Ansicht verwenden, jedoch wird diese in der Datenbank "
+"nicht erstellt (d.h. mit einem \"Legacy Schema\"). In diesem Fall können Sie "
+"eine unveränderbare und schreibgeschützte Entity zu einem gegebenen SQL "
+"Subselect-Ausdruck mappen:"
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:263
#, fuzzy, no-c-format
-msgid "Class"
-msgstr "subclass"
+msgid ""
+"@Entity\n"
+"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+" + \"from item \"\n"
+" + \"join bid on bid.item_id = item.id \"\n"
+" + \"group by item.name\")\n"
+"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+"public class Summary {\n"
+" @Id\n"
+" public String getId() { return id; }\n"
+" ...\n"
+"}"
+msgstr ""
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
#. Tag: para
+#: basic_mapping.xml:265
#, fuzzy, no-c-format
msgid ""
-"You can declare a persistent class using the <literal>class</literal> "
-"element. For example:"
+"Declare the tables to synchronize this entity with, ensuring that auto-flush "
+"happens correctly and that queries against the derived entity do not return "
+"stale data. The <literal><subselect></literal> is available both as an "
+"attribute and a nested mapping element."
msgstr ""
+"Deklarieren Sie die Tabellen mit denen diese Entity synchronisiert werden "
+"soll und stellen Sie sicher, dass \"Auto-Flush\" ordnungsgemäß abläuft und "
+"Anfragen an die abgeleitete Entity keine alten Daten wiedergeben. "
+"<literal><subselect></literal> ist sowohl als Attribut als auch als "
+"verschachteltes Mapping-Element verfügbar."
+
+#. Tag: para
+#: basic_mapping.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"We will now explore the same options using the hbm.xml structure. You can "
+"declare a persistent class using the <literal>class</literal> element. For "
+"example:"
+msgstr ""
"Sie können unter Verwendung des <literal>class</literal>-Elements eine "
"persistente Klasse deklarieren:"
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, fuzzy, no-c-format
+msgid ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:323
#, fuzzy, no-c-format
msgid ""
"<literal>name</literal> (optional): the fully qualified Java class name of "
@@ -584,6 +1077,7 @@
"angenommen, dass es sich um das Mapping für eine nicht-POJO Entity handelt."
#. Tag: para
+#: basic_mapping.xml:330
#, fuzzy, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to the unqualified class "
@@ -593,6 +1087,7 @@
"undefinierte Klassenname): Der Name der Datenbanktabelle."
#. Tag: para
+#: basic_mapping.xml:335
#, fuzzy, no-c-format
msgid ""
"<literal>discriminator-value</literal> (optional - defaults to the class "
@@ -606,6 +1101,7 @@
"<literal>null</literal> und <literal>not null</literal>."
#. Tag: para
+#: basic_mapping.xml:343
#, fuzzy, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -615,6 +1111,7 @@
"literal>): Legt fest, dass die Instanzen der Klasse (nicht) variabel sind."
#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
#, fuzzy, no-c-format
msgid ""
"<literal>schema</literal> (optional): overrides the schema name specified by "
@@ -625,6 +1122,7 @@
"Schemanamen außer Kraft."
#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
#, fuzzy, no-c-format
msgid ""
"<literal>catalog</literal> (optional): overrides the catalog name specified "
@@ -635,6 +1133,7 @@
"Katalognamen außer Kraft."
#. Tag: para
+#: basic_mapping.xml:361
#, fuzzy, no-c-format
msgid ""
"<literal>proxy</literal> (optional): specifies an interface to use for lazy "
@@ -645,6 +1144,7 @@
"Proxies\"). Sie können den Namen der Klasse selbst festlegen."
#. Tag: para
+#: basic_mapping.xml:367
#, fuzzy, no-c-format
msgid ""
"<literal>dynamic-update</literal> (optional - defaults to <literal>false</"
@@ -657,6 +1157,7 @@
"Werte sich geändert haben."
#. Tag: para
+#: basic_mapping.xml:374
#, fuzzy, no-c-format
msgid ""
"<literal>dynamic-insert</literal> (optional - defaults to <literal>false</"
@@ -669,6 +1170,7 @@
"Werte nicht \"Null\" sind."
#. Tag: para
+#: basic_mapping.xml:381
#, fuzzy, no-c-format
msgid ""
"<literal>select-before-update</literal> (optional - defaults to "
@@ -689,10 +1191,11 @@
"bestimmen, ob ein <literal>UPDATE</literal> tatsächlich erforderlich ist."
#. Tag: para
+#: basic_mapping.xml:393
#, fuzzy, no-c-format
msgid ""
-"<literal>polymorphism</literal> (optional - defaults to <literal>implicit</"
-"literal>): determines whether implicit or explicit query polymorphism is "
+"<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</"
+"literal>): determines whether implicit or explicit query polymorphisms is "
"used."
msgstr ""
"<literal>polymorphism</literal> (optional, Standardeinstellung "
@@ -700,6 +1203,7 @@
"Polymorphie für Anfragen verwendet wird."
#. Tag: para
+#: basic_mapping.xml:399
#, fuzzy, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -710,6 +1214,7 @@
"literal>-Bedingung zur Verwendung beim Aufruf von Objekten dieser Klasse fest"
#. Tag: para
+#: basic_mapping.xml:405
#, fuzzy, no-c-format
msgid ""
"<literal>persister</literal> (optional): specifies a custom "
@@ -719,6 +1224,7 @@
"anwenderdefinierten <literal>ClassPersister</literal>."
#. Tag: para
+#: basic_mapping.xml:410
#, fuzzy, no-c-format
msgid ""
"<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): "
@@ -730,6 +1236,7 @@
"Instanzen dieser Klasse durch den Bezeichner."
#. Tag: para
+#: basic_mapping.xml:416
#, fuzzy, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>version</"
@@ -740,6 +1247,7 @@
"Sperren (sog. \"Optimistic Locking\")."
#. Tag: para
+#: basic_mapping.xml:422
#, fuzzy, no-c-format
msgid ""
"<literal>lazy</literal> (optional): lazy fetching can be disabled by setting "
@@ -750,6 +1258,7 @@
"assoziierter Objekte bei Bedarf) vollständig."
#. Tag: para
+#: basic_mapping.xml:427
#, fuzzy, no-c-format
msgid ""
"<literal>entity-name</literal> (optional - defaults to the class name): "
@@ -757,7 +1266,7 @@
"different tables. It also allows entity mappings that are represented by "
"Maps or XML at the Java level. In these cases, you should provide an "
"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
-"classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
+"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
"<literal>entity-name</literal> (optional, Standardeinstellung ist der "
"Klassenname): Hibernate3 ermöglicht das mehrfache Mappen einer Klasse "
@@ -768,6 +1277,7 @@
"finden Sie weitere Information hierzu."
#. Tag: para
+#: basic_mapping.xml:437
#, fuzzy, no-c-format
msgid ""
"<literal>check</literal> (optional): an SQL expression used to generate a "
@@ -779,6 +1289,7 @@
"automatische Schemagenerierung zu erstellen. "
#. Tag: para
+#: basic_mapping.xml:443
#, fuzzy, no-c-format
msgid ""
"<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. "
@@ -795,6 +1306,7 @@
"den realen Standort eines gespeicherten Tupel."
#. Tag: para
+#: basic_mapping.xml:452
#, fuzzy, no-c-format
msgid ""
"<literal>subselect</literal> (optional): maps an immutable and read-only "
@@ -807,6 +1319,7 @@
"Ansicht wünschen, aber nicht haben. Weitere Informationen finden Sie unten."
#. Tag: para
+#: basic_mapping.xml:459
#, fuzzy, no-c-format
msgid ""
"<literal>abstract</literal> (optional): is used to mark abstract "
@@ -817,6 +1330,7 @@
"kennzeichnen."
#. Tag: para
+#: basic_mapping.xml:466
#, fuzzy, no-c-format
msgid ""
"It is acceptable for the named persistent class to be an interface. You can "
@@ -834,318 +1348,1271 @@
"spezifiziert werden."
#. Tag: para
+#: basic_mapping.xml:472
+#, no-c-format
+msgid "Here is how to do a virtual view (subselect) in XML:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:474
#, fuzzy, no-c-format
msgid ""
-"Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated "
-"or deleted by the application. This allows Hibernate to make some minor "
-"performance optimizations."
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"Unveränderliche Klassen, <literal>mutable=\"false\"</literal>, können durch "
-"die Anwendung nicht aktualisiert oder gelöscht werden. Dies ermöglicht "
-"Hibernate kleinere Optimierungen hinsichtlich der Performance."
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
#. Tag: para
+#: basic_mapping.xml:476
+#, no-c-format
+msgid ""
+"The <literal><subselect></literal> is available both as an attribute "
+"and a nested mapping element."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:481
#, fuzzy, no-c-format
+msgid "Identifiers"
+msgstr "Zugeordnete Bezeichner"
+
+#. Tag: para
+#: basic_mapping.xml:483
+#, fuzzy, no-c-format
msgid ""
-"The optional <literal>proxy</literal> attribute enables lazy initialization "
-"of persistent instances of the class. Hibernate will initially return CGLIB "
-"proxies that implement the named interface. The persistent object will load "
-"when a method of the proxy is invoked. See \"Initializing collections and "
-"proxies\" below."
+"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
+"the database table. Most classes will also have a JavaBeans-style property "
+"holding the unique identifier of an instance."
msgstr ""
-"Das optionale <literal>proxy</literal>-Attribut aktiviert die \"lazy "
-"Initialization\" persistenter Instanzen der Klasse. Hibernate wird anfangs "
-"mit CGLIB-Proxies reagieren, die das benannte Interface implementieren. Das "
-"eigentliche persistente Objekt wird geladen, wenn eine Methode des Proxy "
-"aufgerufen wird. Sehen Sie dazu \"Proxies für die Lazy Initialization\" "
-"unten."
+"Gemappte Klassen <emphasis>müssen</emphasis> die Spalte des Primärschlüssels "
+"der Datenbanktabelle deklarieren. Die meisten Klassen werden außerdem eine "
+"Property nach Art von JavaBeans besitzen, die den eindeutigen Bezeichner "
+"einer Instanz enthält. Das <literal><id></literal>-Element definiert "
+"das Mapping von der Property zur Spalte des Primärschlüssels."
#. Tag: para
+#: basic_mapping.xml:488
+#, no-c-format
+msgid "Mark the identifier property with <classname>@Id</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Id Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:493
#, fuzzy, no-c-format
msgid ""
-"<emphasis>Implicit</emphasis> polymorphism means that instances of the class "
-"will be returned by a query that names any superclass or implemented "
-"interface or class, and that instances of any subclass of the class will be "
-"returned by a query that names the class itself. <emphasis>Explicit</"
-"emphasis> polymorphism means that class instances will be returned only by "
-"queries that explicitly name that class. Queries that name the class will "
-"return only instances of subclasses mapped inside this <literal><class>"
-"</literal> declaration as a <literal><subclass></literal> or "
-"<literal><joined-subclass></literal>. For most purposes, the default "
-"<literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit "
-"polymorphism is useful when two different classes are mapped to the same "
-"table This allows a \"lightweight\" class that contains a subset of the "
-"table columns."
+"In hbm.xml, use the <literal><id></literal> element which defines the "
+"mapping from that property to the primary key column."
msgstr ""
-"<emphasis>Implicit</emphasis>-Polymorphie bedeutet, dass die Instanzen der "
-"Klasse von einer Anfrage beantwortet werden, die eine Superklasse, ein "
-"implementiertes Interface oder die Klasse zurücksendet und die Instanzen "
-"einer beliebigen Subklasse der betreffenden Klasse von einer die Klasse "
-"selbst nennenden Anfrage zurückgeschickt werden. <emphasis>Explizite</"
-"emphasis> Polymorphie bedeutet, dass die Instanzen der Klasse nur von "
-"Anfragen zurückgeschickt werden, die die Klasse explizit nennen und nur auf "
-"Instanzen, die innerhalb dieser <literal><class></literal> Deklaration "
-"als <literal><subclass></literal> oder <literal><joined-subclass>"
-"</literal> gemappt sind, reagiert wird. In den meisten Fällen ist die "
-"Standardeinstellung <literal>polymorphism=\"implicit\"</literal> angemessen. "
-"Explizite Polymorphie ist insbesondere dann von Nutzen, wenn zwei "
-"verschiedene Klassen ein Mapping zu derselben Tabelle besitzen (es bietet "
-"sich dadurch die Möglichkeit der Erstellung einer \"abgespeckten\" und alle "
-"Tabellenspalten als Teilsatz enthaltenden Klasse)."
+"Beachten Sie die Verwendung von <literal><column></literal>-Tags beim "
+"Mappen einer Property zu mehreren Spalten."
+#. Tag: programlisting
+#: basic_mapping.xml:509
+#, fuzzy, no-c-format
+msgid ""
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
+msgstr ""
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:513
#, fuzzy, no-c-format
msgid ""
-"The <literal>persister</literal> attribute lets you customize the "
-"persistence strategy used for the class. You can, for example, specify your "
-"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
-"or you can even provide a completely new implementation of the interface "
-"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
-"for example, persistence via stored procedure calls, serialization to flat "
-"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
-"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+"<literal>name</literal> (optional): the name of the identifier property."
+msgstr "<literal>name</literal> (optional): Name der Bezeichner-Property."
+
+#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
+#, no-c-format
+msgid ""
+"<literal>type</literal> (optional): a name that indicates the Hibernate type."
msgstr ""
-"Das <literal>persister</literal>-Attribut erlaubt die Anpassung der für die "
-"Klasse zu verwendenden Persistenzstrategie. Sie können zum Beispiel Ihre "
-"eigene Subklasse von <literal>org.hibernate.persister.EntityPersister</"
-"literal> bestimmen oder sogar eine vollständig neue Implementierung des "
-"Interface <literal>org.hibernate.persister.ClassPersister</literal> "
-"bereitsstellen, das z.B. mittels gespeicherter Prozeduraufrufe, "
-"Serialisierung verknüpfungsloser (zweidimensionaler Dateien (sog. \"flat "
-"Files\") oder LDAP Persistenz implementiert. Siehe <literal>org.hibernate."
-"test.CustomPersister</literal> für ein einfaches Beispiel (von \"Persistenz"
-"\" zu einer <literal>Hashtable</literal>)."
+"<literal>type</literal> (optional): Ein Name, der den Hibernate-Typ anzeigt."
#. Tag: para
+#: basic_mapping.xml:523
#, fuzzy, no-c-format
msgid ""
-"The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> "
-"settings are not inherited by subclasses, so they can also be specified on "
-"the <literal><subclass></literal> or <literal><joined-subclass></"
-"literal> elements. Although these settings can increase performance in some "
-"cases, they can actually decrease performance in others."
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the primary key column."
msgstr ""
-"Bitte beachten Sie, dass die <literal>dynamic-update</literal> und "
-"<literal>dynamic-insert</literal> Einstellungen nicht an die Subklassen "
-"vererbt werden und daher auch in den <literal><subclass></literal> "
-"oder <literal><joined-subclass></literal>-Elementen spezifiziert "
-"werden können. Diese Einstellungen können die Performance in einigen Fällen "
-"verbessern, in anderen Fällen jedoch auch verschlechtern. Verwenden Sie sie "
-"daher umsichtig."
+"<literal>column</literal> (optional - Standardeinstellung ist der Property-"
+"Name): Der Name der Primärschlüsselspalte."
#. Tag: para
+#: basic_mapping.xml:528
#, fuzzy, no-c-format
msgid ""
-"Use of <literal>select-before-update</literal> will usually decrease "
-"performance. It is useful to prevent a database update trigger being called "
-"unnecessarily if you reattach a graph of detached instances to a "
-"<literal>Session</literal>."
+"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
+"value): an identifier property value that indicates an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session."
msgstr ""
-"Die Verwendung von <literal>select-before-update</literal> wird die "
-"Performance in der Regel verschlechtern. Es ist sehr hilfreich, um den "
-"Aufruf eines Datenbankaktualisierungs-Triggers abzufangen, wenn Sie einen "
-"Graph abgesetzter Instanzen wieder an eine <literal>Session</literal> binden "
-"möchten."
+"<literal>unsaved-value</literal> (optional - Standardeinstellung ist ein "
+"\"sinnvoller\" Wert): Ein Wert der Bezeichner-Property, der anzeigt, dass "
+"eine Instanz neu instanziiert (ungespeichert) ist und der sie von "
+"abgesetzten Instanzen einer vorangegangenen Session unterscheidet, die "
+"gespeichert oder geladen wurden."
#. Tag: para
+#: basic_mapping.xml:536
+#, fuzzy, no-c-format
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing the property "
+"value."
+msgstr ""
+"<literal>access</literal> (optional - Standardeinstellung ist "
+"<literal>property</literal>): Die Strategie, die Hibernate für den Zugriff "
+"auf den Property-Wert verwenden soll."
+
+#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
msgid ""
-"If you enable <literal>dynamic-update</literal>, you will have a choice of "
-"optimistic locking strategies:"
+"If the <literal>name</literal> attribute is missing, it is assumed that the "
+"class has no identifier property."
msgstr ""
-"Wenn Sie <literal>dynamic-update</literal> aktivieren, haben Sie die Wahl "
-"zwischen verschiedenen Strategien für das optimistische Sperren:"
+"Falls das <literal>name</literal>-Attribut fehlt, wird davon ausgegangen, "
+"dass die Klasse keine Bezeichner-Property besitzt."
#. Tag: para
+#: basic_mapping.xml:546
#, fuzzy, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
-msgstr "<literal>version</literal> Prüfung der Version-/Zeitstempel-Spalten"
+msgid ""
+"The <literal>unsaved-value</literal> attribute is almost never needed in "
+"Hibernate3 and indeed has no corresponding element in annotations."
+msgstr ""
+"Das <literal>unsaved-value</literal>-Attribut wird in Hibernate3 fast nie "
+"benötigt."
#. Tag: para
+#: basic_mapping.xml:550
#, fuzzy, no-c-format
-msgid "<literal>all</literal>: check all columns"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+msgid ""
+"You can also declare the identifier as a composite identifier. This allows "
+"access to legacy data with composite keys. Its use is strongly discouraged "
+"for anything else."
+msgstr ""
+"Es existiert eine alternative <literal><composite-id></literal>-"
+"Deklaration, die Zugriff auf Stammdaten mit zusammengesetzten Schlüsseln "
+"(sog. \"composite keys\") erlaubt. Wir empfehlen dringend, diese "
+"ausschließlich hierfür zur verwenden."
+#. Tag: title
+#: basic_mapping.xml:555
+#, fuzzy, no-c-format
+msgid "Composite identifier"
+msgstr "Zugeordnete Bezeichner"
+
#. Tag: para
+#: basic_mapping.xml:557
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:562
+#, no-c-format
+msgid ""
+"use a component type to represent the identifier and map it as a property in "
+"the entity: you then annotated the property as <classname>@EmbeddedId</"
+"classname>. The component type has to be <classname>Serializable</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:569
+#, no-c-format
+msgid ""
+"map multiple properties as <classname>@Id</classname> properties: the "
+"identifier type is then the entity class itself and needs to be "
+"<classname>Serializable</classname>. This approach is unfortunately not "
+"standard and only supported by Hibernate."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:577
+#, no-c-format
+msgid ""
+"map multiple properties as <classname>@Id</classname> properties and declare "
+"an external class to be the identifier type. This class, which needs to be "
+"<classname>Serializable</classname>, is declared on the entity via the "
+"<classname>@IdClass</classname> annotation. The identifier type must contain "
+"the same properties as the identifier properties of the entity: each "
+"property name must be the same, its type must be the same as well if the "
+"entity property is of a basic type, its type must be the type of the primary "
+"key of the associated entity if the entity property is an association "
+"(either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</"
+"classname>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:592
+#, no-c-format
+msgid ""
+"As you can see the last case is far from obvious. It has been inherited from "
+"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
+"to use it (for simplicity sake)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:596
+#, no-c-format
+msgid "Let's explore all three cases using examples."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:599
+#, no-c-format
+msgid "id as a property using a component type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:601
+#, no-c-format
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class User {\n"
+" @EmbeddedId\n"
+" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
+"\")\n"
+" UserId id;\n"
+"\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:606
+#, no-c-format
+msgid ""
+"You can notice that the <classname>UserId</classname> class is serializable. "
+"To override the column mapping, use <classname>@AttributeOverride</"
+"classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:610
+#, no-c-format
+msgid ""
+"An embedded id can itself contains the primary key of an associated entity."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"\n"
+" @MapsId(\"userId\")\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" @OneToOne User user;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" UserId userId;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:615
+#, no-c-format
+msgid ""
+"In the embedded id object, the association is represented as the identifier "
+"of the associated entity. But you can link its value to a regular "
+"association in the entity via the <classname>@MapsId</classname> annotation. "
+"The <classname>@MapsId</classname> value correspond to the property name of "
+"the embedded id object containing the associated entity's identifier. In the "
+"database, it means that the <literal>Customer.user</literal> and the "
+"<literal>CustomerId.userId</literal> properties share the same underlying "
+"column (<literal>user_fk</literal> in this case)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:627
+#, no-c-format
+msgid ""
+"The component type used as identifier must implement <methodname>equals()</"
+"methodname> and <methodname>hashCode()</methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:632
+#, no-c-format
+msgid ""
+"In practice, your code only sets the <literal>Customer.user</literal> "
+"property and the user id value is copied by Hibernate into the "
+"<literal>CustomerId.userId</literal> property."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:638
+#, no-c-format
+msgid ""
+"The id value can be copied as late as flush time, don't rely on it until "
+"after flush time."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:642
+#, no-c-format
+msgid ""
+"While not supported in JPA, Hibernate lets you place your association "
+"directly in the embedded id component (instead of having to use the "
+"<classname>@MapsId</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:648
+#, no-c-format
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:651
#, fuzzy, no-c-format
msgid ""
-"<literal>dirty</literal>: check the changed columns, allowing some "
-"concurrent updates"
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" node=\"element-name|.\">\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
msgstr ""
-"<literal>dirty</literal> Prüfung der veränderten Spalten, Möglichkeit "
-"einiger simultaner Aktualisierungen"
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|.\"\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
#. Tag: para
+#: basic_mapping.xml:653
+#, no-c-format
+msgid "First a simple example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
+msgid ""
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:657
+#, no-c-format
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"\n"
+" <many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" </many-to-one>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:662
+#, no-c-format
+msgid "Notice a few things in the previous example:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:666
+#, no-c-format
+msgid ""
+"the order of the properties (and column) matters. It must be the same "
+"between the association and the primary key of the associated entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:672
+#, no-c-format
+msgid ""
+"the many to one uses the same columns as the primary key and thus must be "
+"marked as read only (<literal>insertable</literal> and <literal>updatable</"
+"literal> to false)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:679
+#, no-c-format
+msgid ""
+"unlike with <classname>@MapsId</classname>, the id value of the associated "
+"entity is not transparently copied, check the <literal>foreign</literal> id "
+"generator for more information."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:686
+#, no-c-format
+msgid ""
+"The last example shows how to map association directly in the embedded id "
+"component."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:691
+#, no-c-format
+msgid ""
+"This is the recommended approach to map composite identifier. The following "
+"options should not be considered unless some constraint are present."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:697
+#, no-c-format
+msgid "Multiple id properties without identifier type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:699
+#, no-c-format
+msgid ""
+"Another, arguably more natural, approach is to place <classname>@Id</"
+"classname> on multiple properties of your entity. This approach is only "
+"supported by Hibernate (not JPA compliant) but does not require an extra "
+"embeddable component."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:706
+#, no-c-format
+msgid ""
+"In this case <classname>Customer</classname> is its own identifier "
+"representation: it must implement <classname>Serializable</classname> and "
+"must implement <methodname>equals()</methodname> and <methodname>hashCode()</"
+"methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:712
+#, no-c-format
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id>\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:718
+#, no-c-format
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:721
+#, no-c-format
+msgid ""
+"<classname>@IdClass</classname> on an entity points to the class (component) "
+"representing the identifier of the class. The properties marked "
+"<classname>@Id</classname> on the entity must have their corresponding "
+"property on the <classname>@IdClass</classname>. The return type of search "
+"twin property must be either identical for basic properties or must "
+"correspond to the identifier class of the associated entity for an "
+"association."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:730
+#, no-c-format
+msgid ""
+"This approach is inherited from the EJB 2 days and we recommend against its "
+"use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" UserId user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:737
+#, no-c-format
+msgid ""
+"<classname>Customer</classname> and <classname>CustomerId</classname> do "
+"have the same properties <literal>customerNumber</literal> as well as "
+"<literal>user</literal>. <classname>CustomerId</classname> must be "
+"<classname>Serializable</classname> and implement <classname>equals()</"
+"classname> and <classname>hashCode()</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:745
+#, no-c-format
+msgid ""
+"While not JPA standard, Hibernate let's you declare the vanilla associated "
+"property in the <classname>@IdClass</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:751
+#, no-c-format
+msgid ""
+"This feature is of limited interest though as you are likely to have chosen "
+"the <classname>@IdClass</classname> approach to stay JPA compliant or you "
+"have a quite twisted mind."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:762
#, fuzzy, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
-msgstr "<literal>none</literal> verwendet kein optimistisches Sperren"
+msgid "Identifier generator"
+msgstr "Die \"Getter\"-Methode des Bezeichners"
#. Tag: para
+#: basic_mapping.xml:764
+#, no-c-format
+msgid ""
+"Hibernate can generate and populate identifier values for you automatically. "
+"This is the recommended approach over \"business\" or \"natural\" id "
+"(especially composite ids)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:768
+#, no-c-format
+msgid ""
+"Hibernate offers various generation strategies, let's explore the most "
+"common ones first that happens to be standardized by JPA:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:774
#, fuzzy, no-c-format
msgid ""
-"It is <emphasis>strongly</emphasis> recommended that you use version/"
-"timestamp columns for optimistic locking with Hibernate. This strategy "
-"optimizes performance and correctly handles modifications made to detached "
-"instances (i.e. when <literal>Session.merge()</literal> is used)."
+"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
msgstr ""
-"Wir empfehlen <emphasis>sehr</emphasis> dringend die Verwendung von Version-/"
-"Zeitstempel-Spalten für das optimistische Sperren mit Hibernate. Im Hinblick "
-"auf die Performance handelt es sich dabei um die beste Strategie, und es ist "
-"auch die einzige Strategie, die Veränderungen an abgesetzten Instanzen "
-"korrekt bearbeitet (d.h. wenn <literal>Session.merge()</literal> verwendet "
-"wird)."
+"unterstützt die Identitätsspalten in DB2, MySQL, MS SQL Server, Sybase und "
+"HypersonicSQL. Der zurückgesendete Bezeichner ist vom Typ <literal>long</"
+"literal>, <literal>short</literal> oder <literal>int</literal>."
#. Tag: para
+#: basic_mapping.xml:781
#, fuzzy, no-c-format
msgid ""
-"There is no difference between a view and a base table for a Hibernate "
-"mapping. This is transparent at the database level, although some DBMS do "
-"not support views properly, especially with updates. Sometimes you want to "
-"use a view, but you cannot create one in the database (i.e. with a legacy "
-"schema). In this case, you can map an immutable and read-only entity to a "
-"given SQL subselect expression:"
+"SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo "
+"algorithm to efficiently generate identifiers of type <literal>long</"
+"literal>, <literal>short</literal> or <literal>int</literal>, given a named "
+"database sequence."
msgstr ""
-"Es gibt keinen Unterschied zwischen einer Ansicht und einer Basistabelle für "
-"ein Hibernate Mapping, und wie erwartet ist dies auf Datenbankebene "
-"transparent (bitte beachten Sie, dass einige DBMS Ansichten nicht korrekt "
-"unterstützen, insbesondere im Hinblick auf Aktualisierungen). Manchmal "
-"möchten Sie zwar eine Ansicht verwenden, jedoch wird diese in der Datenbank "
-"nicht erstellt (d.h. mit einem \"Legacy Schema\"). In diesem Fall können Sie "
-"eine unveränderbare und schreibgeschützte Entity zu einem gegebenen SQL "
-"Subselect-Ausdruck mappen:"
+"verwendet einen hi/lo-Algorithmus um effizient Bezeichner des Typs "
+"<literal>long</literal>, <literal>short</literal> oder <literal>int</"
+"literal> zu generieren, bei einer vorgegebenen und benannten "
+"Datenbanksequenz."
#. Tag: para
+#: basic_mapping.xml:788
#, fuzzy, no-c-format
msgid ""
-"Declare the tables to synchronize this entity with, ensuring that auto-flush "
-"happens correctly and that queries against the derived entity do not return "
-"stale data. The <literal><subselect></literal> is available both as an "
-"attribute and a nested mapping element."
+"TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in "
+"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
+"type <literal>long</literal>, <literal>short</literal> or <literal>int</"
+"literal>, given a table and column as a source of hi values. The hi/lo "
+"algorithm generates identifiers that are unique only for a particular "
+"database."
msgstr ""
-"Deklarieren Sie die Tabellen mit denen diese Entity synchronisiert werden "
-"soll und stellen Sie sicher, dass \"Auto-Flush\" ordnungsgemäß abläuft und "
-"Anfragen an die abgeleitete Entity keine alten Daten wiedergeben. "
-"<literal><subselect></literal> ist sowohl als Attribut als auch als "
-"verschachteltes Mapping-Element verfügbar."
+"verwendet einen hi/lo Algorithmus um effizient Bezeichner des Typs "
+"<literal>long</literal>, <literal>short</literal> oder <literal>int</"
+"literal> zu generieren, bei gegebener Tabelle und Spalte "
+"(Standardeinstellung lautet <literal>hibernate_unique_key</literal> bzw. "
+"<literal>next_hi</literal>) als Quelle der hi-Werte. Der hi/lo-Algorithmus "
+"generiert Bezeichner, die für eine bestimmte Datenbank eindeutig sind."
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:798
#, fuzzy, no-c-format
-msgid "id"
-msgstr "uuid"
+msgid ""
+"AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or "
+"<literal>TABLE</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"wählt <literal>identity</literal>, <literal>sequence</literal> oder "
+"<literal>hilo</literal> je nach Leistungsfähigkeit der zu Grunde liegenden "
+"Datenbank."
#. Tag: para
+#: basic_mapping.xml:805
#, no-c-format
msgid ""
-"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
-"the database table. Most classes will also have a JavaBeans-style property "
-"holding the unique identifier of an instance. The <literal><id></"
-"literal> element defines the mapping from that property to the primary key "
-"column."
+"We recommend all new projects to use the new enhanced identifier generators. "
+"They are deactivated by default for entities using annotations but can be "
+"activated using <code>hibernate.id.new_generator_mappings=true</code>. These "
+"new generators are more efficient and closer to the JPA 2 specification "
+"semantic."
msgstr ""
-"Gemappte Klassen <emphasis>müssen</emphasis> die Spalte des Primärschlüssels "
-"der Datenbanktabelle deklarieren. Die meisten Klassen werden außerdem eine "
-"Property nach Art von JavaBeans besitzen, die den eindeutigen Bezeichner "
-"einer Instanz enthält. Das <literal><id></literal>-Element definiert "
-"das Mapping von der Property zur Spalte des Primärschlüssels."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:812
+#, no-c-format
msgid ""
-"<literal>name</literal> (optional): the name of the identifier property."
-msgstr "<literal>name</literal> (optional): Name der Bezeichner-Property."
+"However they are not backward compatible with existing Hibernate based "
+"application (if a sequence or a table is used for id generation). See "
+"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
+"to activate them."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:818
#, no-c-format
msgid ""
-"<literal>type</literal> (optional): a name that indicates the Hibernate type."
+"To mark an id property as generated, use the <classname>@GeneratedValue</"
+"classname> annotation. You can specify the strategy used (default to "
+"<literal>AUTO</literal>) by setting <literal>strategy</literal>."
msgstr ""
-"<literal>type</literal> (optional): Ein Name, der den Hibernate-Typ anzeigt."
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue\n"
+" Integer getId() { ... };\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Invoice {\n"
+" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+" Integer getId() { ... };\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid ""
+"<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional "
+"configurations that you can set using <classname>@SequenceGenerator</"
+"classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
#, fuzzy, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr "<literal>name</literal>: Der Name der Property."
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, fuzzy, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to the property name): the "
-"name of the primary key column."
+"<literal>table</literal> / <literal>sequenceName</literal>: name of the "
+"table or the sequence (defaulting respectively to "
+"<literal>hibernate_sequences</literal> and <literal>hibernate_sequence</"
+"literal>)"
msgstr ""
-"<literal>column</literal> (optional - Standardeinstellung ist der Property-"
-"Name): Der Name der Primärschlüsselspalte."
+"<literal>column</literal> (optional - Standardeinstellung lautet "
+"<literal>class</literal>) der Name der Diskriminatorspalte."
#. Tag: para
+#: basic_mapping.xml:843
#, fuzzy, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr "<literal>all</literal> Prüfung aller Spalten"
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, fuzzy, no-c-format
msgid ""
-"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
-"value): an identifier property value that indicates an instance is newly "
-"instantiated (unsaved), distinguishing it from detached instances that were "
-"saved or loaded in a previous session."
+"<literal>initialValue</literal>: the value from which the id is to start "
+"generating"
+msgstr "<literal>table</literal>: Der Name der verbundenen Tabelle."
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid ""
+"<literal>allocationSize</literal>: the amount to increment by when "
+"allocating id numbers from the generator"
msgstr ""
-"<literal>unsaved-value</literal> (optional - Standardeinstellung ist ein "
-"\"sinnvoller\" Wert): Ein Wert der Bezeichner-Property, der anzeigt, dass "
-"eine Instanz neu instanziiert (ungespeichert) ist und der sie von "
-"abgesetzten Instanzen einer vorangegangenen Session unterscheidet, die "
-"gespeichert oder geladen wurden."
#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid ""
+"In addition, the <classname>TABLE</classname> strategy also let you "
+"customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
#, fuzzy, no-c-format
msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing the property "
-"value."
+"<literal>pkColumnName</literal>: the column name containing the entity "
+"identifier"
+msgstr "<literal>name</literal>: Der Name der Property."
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, fuzzy, no-c-format
+msgid ""
+"<literal>valueColumnName</literal>: the column name containing the "
+"identifier value"
+msgstr "<literal>name</literal> (optional): Name der Bezeichner-Property."
+
+#. Tag: para
+#: basic_mapping.xml:873
+#, fuzzy, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr "<literal>id-type</literal>: Der Bezeichnertyp."
+
+#. Tag: para
+#: basic_mapping.xml:878
+#, no-c-format
+msgid ""
+"<literal>uniqueConstraints</literal>: any potential column constraint on the "
+"table containing the ids"
msgstr ""
-"<literal>access</literal> (optional - Standardeinstellung ist "
-"<literal>property</literal>): Die Strategie, die Hibernate für den Zugriff "
-"auf den Property-Wert verwenden soll."
#. Tag: para
+#: basic_mapping.xml:883
#, no-c-format
msgid ""
-"If the <literal>name</literal> attribute is missing, it is assumed that the "
-"class has no identifier property."
+"To link a table or sequence generator definition with an actual generated "
+"property, use the same name in both the definition <literal>name</literal> "
+"and the generator value <literal>generator</literal> as shown below."
msgstr ""
-"Falls das <literal>name</literal>-Attribut fehlt, wird davon ausgegangen, "
-"dass die Klasse keine Bezeichner-Property besitzt."
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+"@Id \n"
+"@GeneratedValue(\n"
+" strategy=GenerationType.SEQUENCE, \n"
+" generator=\"SEQ_GEN\")\n"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:890
#, no-c-format
msgid ""
-"The <literal>unsaved-value</literal> attribute is almost never needed in "
-"Hibernate3."
+"The scope of a generator definition 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 in "
+"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
+"\"/>):"
msgstr ""
-"Das <literal>unsaved-value</literal>-Attribut wird in Hibernate3 fast nie "
-"benötigt."
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+"@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"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:898
+#, no-c-format
msgid ""
-"There is an alternative <literal><composite-id></literal> declaration "
-"that allows access to legacy data with composite keys. Its use is strongly "
-"discouraged for anything else."
+"If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used "
+"to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</"
+"literal> are application level generators."
msgstr ""
-"Es existiert eine alternative <literal><composite-id></literal>-"
-"Deklaration, die Zugriff auf Stammdaten mit zusammengesetzten Schlüsseln "
-"(sog. \"composite keys\") erlaubt. Wir empfehlen dringend, diese "
-"ausschließlich hierfür zur verwenden."
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:904
#, no-c-format
-msgid "Generator"
-msgstr "Programmgenerator"
+msgid ""
+"Package level definition is not supported by the JPA specification. However, "
+"you can use the <literal>@GenericGenerator</literal> at the package level "
+"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:910
#, no-c-format
msgid ""
-"The optional <literal><generator></literal> child element names a Java "
-"class used to generate unique identifiers for instances of the persistent "
-"class. If any parameters are required to configure or initialize the "
-"generator instance, they are passed using the <literal><param></"
-"literal> element."
+"These are the four standard JPA generators. Hibernate goes beyond that and "
+"provide additional generators or additional options as we will see below. "
+"You can also write your own custom identifier generator by implementing "
+"<classname>org.hibernate.id.IdentifierGenerator</classname>."
msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:916
+#, no-c-format
+msgid ""
+"To define a custom generator, use the <classname>@GenericGenerator</"
+"classname> annotation (and its plural counter part "
+"<classname>@GenericGenerators</classname>) that describes the class of the "
+"identifier generator or its short cut name (as described below) and a list "
+"of key/value parameters. When using <classname>@GenericGenerator</classname> "
+"and assigning it via <classname>@GeneratedValue.generator</classname>, the "
+"<classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+"@GenericGenerator(\n"
+" name=\"trigger-generated\", \n"
+" strategy = \"select\",\n"
+" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+")\n"
+"public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, fuzzy, no-c-format
+msgid ""
+"The hbm.xml approach uses the optional <literal><generator></literal> "
+"child element inside <literal><id></literal>. If any parameters are "
+"required to configure or initialize the generator instance, they are passed "
+"using the <literal><param></literal> element."
+msgstr ""
"Das optionale <literal><generator></literal>-Unterelement benennt eine "
"Java-Klasse, die zur Generierung eindeutiger Bezeichner für Instanzen der "
"persistenten Klasse verwendet werden. Falls Parameter zur Konfiguration oder "
"Initialisierung der Generatorinstanz benötigt werden, werden Sie unter "
"Verwendung des <literal><param></literal>-Elements weitergeleitet."
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+
+#. Tag: title
+#: basic_mapping.xml:937
+#, no-c-format
+msgid "Various additional generators"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:939
#, fuzzy, no-c-format
msgid ""
"All generators implement the interface <literal>org.hibernate.id."
@@ -1160,12 +2627,14 @@
"bereit. Hiberante bietet jedoch eine Reihe eingebauter Implementierungen. "
"Für die eingebauten Generatoren existieren abgekürzte Namen:"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>increment</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:946
+#, no-c-format
+msgid "increment"
+msgstr "increment"
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
msgid ""
"generates identifiers of type <literal>long</literal>, <literal>short</"
@@ -1178,12 +2647,14 @@
"anderer Vorgang Daten derselben Tabelle hinzufügt. <emphasis>Nicht in einem "
"Cluster zu verwenden.</emphasis>"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>identity</literal>"
-msgstr "<literal>id-type</literal>: Der Bezeichnertyp."
+#. Tag: literal
+#: basic_mapping.xml:958
+#, no-c-format
+msgid "identity"
+msgstr "identity"
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
msgid ""
"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
@@ -1194,12 +2665,14 @@
"HypersonicSQL. Der zurückgesendete Bezeichner ist vom Typ <literal>long</"
"literal>, <literal>short</literal> oder <literal>int</literal>."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>sequence</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:969
+#, no-c-format
+msgid "sequence"
+msgstr "sequence"
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
msgid ""
"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
@@ -1210,12 +2683,14 @@
"Generator in Interbase. Der zurückgeschickte Bezeichner ist vom Typ "
"<literal>long</literal>, <literal>short</literal> oder <literal>int</literal>"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>hilo</literal>"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+#. Tag: literal
+#: basic_mapping.xml:980
+#, no-c-format
+msgid "hilo"
+msgstr "hilo"
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -1232,12 +2707,14 @@
"<literal>next_hi</literal>) als Quelle der hi-Werte. Der hi/lo-Algorithmus "
"generiert Bezeichner, die für eine bestimmte Datenbank eindeutig sind."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>seqhilo</literal>"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+#. Tag: literal
+#: basic_mapping.xml:996
+#, no-c-format
+msgid "seqhilo"
+msgstr "seqhilo"
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -1249,42 +2726,123 @@
"literal> zu generieren, bei einer vorgegebenen und benannten "
"Datenbanksequenz."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
#, fuzzy, no-c-format
-msgid "<literal>uuid</literal>"
-msgstr "<literal>id</literal>"
+msgid "uuid"
+msgstr "guid"
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1010
+#, no-c-format
msgid ""
-"uses a 128-bit UUID algorithm to generate identifiers of type string that "
-"are unique within a network (the IP address is used). The UUID is encoded as "
-"a string of 32 hexadecimal digits in length."
+"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
+"represented as a string of 32 hexidecimal digits. Users can also configure "
+"it to use a separator (config parameter \"separator\") which separates the "
+"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
+"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
+"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
+"discussed below."
msgstr ""
-"verwendet einen 128-bit UUID-Algorithmus, um Bezeichner des String-Typs "
-"(Zeichenkettentyp) zu generieren, die innerhalb eines Netzwerks eindeutig "
-"sind (die IP-Adresse wird verwendet). Der UUID (Universally Unique "
-"Identifier) ist als Zeichenkette hexadezimaler Ziffern von 32 Zeichen Länge "
-"verschlüsselt."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1023
#, fuzzy, no-c-format
-msgid "<literal>guid</literal>"
-msgstr "<literal>id</literal>"
+msgid "uuid2"
+msgstr "guid"
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
+msgid ""
+"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
+"\"version\" (the RFC term) generated depends on the pluggable \"generation "
+"strategy\" used (see below). Capable of generating values as <classname>java."
+"util.UUID</classname>, <classname>java.lang.String</classname> or as a byte "
+"array of length 16 (<literal>byte[16]</literal>). The \"generation strategy"
+"\" is defined by the interface <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
+"configuration parameters for defining which generation strategy to use:"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1038
+#, no-c-format
+msgid "uuid_gen_strategy_class"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1041
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1047
+#, no-c-format
+msgid "uuid_gen_strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1050
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the "
+"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
+"<methodname>randomUUID</methodname> method of <classname>java.util.UUID</"
+"classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - "
+"generates \"version 1\" UUID values, using IP address since mac address not "
+"available. If you need mac address to be used, consider leveraging one of "
+"the existing third party UUID generators which sniff out mac address and "
+"integrating it via the <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
+"time of this writing include <ulink url=\"http://johannburkard.de/software/"
+"uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url="
+"\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/"
+"sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, no-c-format
+msgid "guid"
+msgstr "guid"
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
msgstr ""
"verwendet einen von der Datenbank generierten GUID-String auf dem MS SQL "
"Server und MySQL."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>native</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:1094
+#, no-c-format
+msgid "native"
+msgstr "native"
#. Tag: para
+#: basic_mapping.xml:1097
#, fuzzy, no-c-format
msgid ""
"selects <literal>identity</literal>, <literal>sequence</literal> or "
@@ -1295,12 +2853,14 @@
"<literal>hilo</literal> je nach Leistungsfähigkeit der zu Grunde liegenden "
"Datenbank."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>assigned</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:1105
+#, no-c-format
+msgid "assigned"
+msgstr "assigned"
#. Tag: para
+#: basic_mapping.xml:1108
#, fuzzy, no-c-format
msgid ""
"lets the application assign an identifier to the object before <literal>save"
@@ -1311,12 +2871,14 @@
"</literal> aufgerufen wird. Falls kein <literal><generator></literal>-"
"Element festgelegt ist, so ist dies die Standardstrategie."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>select</literal>"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+#. Tag: literal
+#: basic_mapping.xml:1117
+#, no-c-format
+msgid "select"
+msgstr "select"
#. Tag: para
+#: basic_mapping.xml:1120
#, fuzzy, no-c-format
msgid ""
"retrieves a primary key, assigned by a database trigger, by selecting the "
@@ -1326,12 +2888,14 @@
"Reihe durch einen eindeutigen Schlüssel ausgewählt und der Wert des "
"Primärschlüssels abgefragt wird."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>foreign</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:1127
+#, no-c-format
+msgid "foreign"
+msgstr "foreign"
#. Tag: para
+#: basic_mapping.xml:1130
#, fuzzy, no-c-format
msgid ""
"uses the identifier of another associated object. It is usually used in "
@@ -1342,12 +2906,14 @@
"Verbindung mit einer <literal><one-to-one></literal>-Assoziation des "
"Primärschlüssels verwendet."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1138
#, fuzzy, no-c-format
-msgid "<literal>sequence-identity</literal>"
+msgid "sequence-identity"
msgstr "sequence-identity"
#. Tag: para
+#: basic_mapping.xml:1141
#, fuzzy, no-c-format
msgid ""
"a specialized sequence generation strategy that utilizes a database sequence "
@@ -1366,11 +2932,13 @@
"eines Bugs innerhalb der Oracle Treiber deaktiviert sind."
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "Hi/lo-Algorithmus"
#. Tag: para
+#: basic_mapping.xml:1157
#, fuzzy, no-c-format
msgid ""
"The <literal>hilo</literal> and <literal>seqhilo</literal> generators "
@@ -1386,7 +2954,46 @@
"nächstverfügbaren \"hi\"-Wert enthält. Die zweite verwendet eine Sequenz "
"nach Oracle-Art (falls unterstützt)."
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:1167
#, fuzzy, no-c-format
msgid ""
"Unfortunately, you cannot use <literal>hilo</literal> when supplying your "
@@ -1402,11 +3009,13 @@
"transaction.manager_lookup_class</literal> korrekt konfigurieren."
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "UUID-Algorithmus"
#. Tag: para
+#: basic_mapping.xml:1177
#, fuzzy, no-c-format
msgid ""
"The UUID contains: IP address, startup time of the JVM that is accurate to a "
@@ -1421,11 +3030,13 @@
"Option ohne Verwendung von JNI handelt."
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "Identitätsspalten und Sequenzen"
#. Tag: para
+#: basic_mapping.xml:1187
#, fuzzy, no-c-format
msgid ""
"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
@@ -1441,7 +3052,40 @@
"<literal>sequence</literal>-Art verwenden. Bei beiden Strategien muss ein "
"neues Objekt durch zwei SQL-Anfragen eingefügt werden."
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:1199
#, fuzzy, no-c-format
msgid ""
"For cross-platform development, the <literal>native</literal> strategy will, "
@@ -1455,11 +3099,13 @@
"der zu Grunde liegenden Datenbank die entsprechende aus."
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "Zugeordnete Bezeichner"
#. Tag: para
+#: basic_mapping.xml:1209
#, fuzzy, no-c-format
msgid ""
"If you want the application to assign identifiers, as opposed to having "
@@ -1467,8 +3113,8 @@
"generator. This special generator uses the identifier value already assigned "
"to the object's identifier property. The generator is used when the primary "
"key is a natural key instead of a surrogate key. This is the default "
-"behavior if you do not specify a <literal><generator></literal> "
-"element."
+"behavior if you do not specify <classname>@GeneratedValue</classname> nor "
+"<literal><generator></literal> elements."
msgstr ""
"Falls die Anwendung Bezeichner zuordnen soll (statt deren Generierung durch "
"Hibernate), so können Sie den <literal>assigned</literal>-Generator "
@@ -1479,6 +3125,7 @@
"wenn Sie kein <literal><generator></literal>-Element festlegen."
#. Tag: para
+#: basic_mapping.xml:1218
#, fuzzy, no-c-format
msgid ""
"The <literal>assigned</literal> generator makes Hibernate use "
@@ -1494,17 +3141,38 @@
"<literal>Interceptor.isUnsaved()</literal> definieren."
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "Durch Trigger zugeordnete Primärschlüssel"
#. Tag: para
+#: basic_mapping.xml:1228
#, fuzzy, no-c-format
msgid ""
"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
msgstr "Nur für Legacy-Schemas (Hibernate generiert DDL nicht mit Triggern)."
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:1233
#, fuzzy, no-c-format
msgid ""
"In the above example, there is a unique valued property named "
@@ -1518,11 +3186,102 @@
"<literal>person_id</literal>, dessen Wert durch einen Trigger generiert wird."
#. Tag: title
+#: basic_mapping.xml:1241
+#, no-c-format
+msgid "Identity copy (foreign generator)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1243
+#, no-c-format
+msgid ""
+"Finally, you can ask Hibernate to copy the identifier from another "
+"associated entity. In the Hibernate jargon, it is known as a foreign "
+"generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumn(name = \"person_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1250
#, fuzzy, no-c-format
+msgid "Or alternatively"
+msgstr "Metadata-Alternativen"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id Integer id;\n"
+"\n"
+" @MapsId @OneToOne\n"
+" @JoinColumn(name = \"patient_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Person {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1254
+#, no-c-format
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"MedicalHistory\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">patient</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
+">\n"
+"</class>"
+msgstr ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, fuzzy, no-c-format
msgid "Enhanced identifier generators"
msgstr "Die \"Getter\"-Methode des Bezeichners"
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
msgid ""
"Starting with release 3.2.3, there are 2 new generators which represent a re-"
@@ -1535,6 +3294,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
msgid ""
"The first of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1556,6 +3316,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1291
#, fuzzy, no-c-format
msgid ""
"<literal>sequence_name</literal> (optional, defaults to "
@@ -1566,6 +3327,7 @@
"<literal>class</literal>) der Name der Diskriminatorspalte."
#. Tag: para
+#: basic_mapping.xml:1297
#, fuzzy, no-c-format
msgid ""
"<literal>initial_value</literal> (optional, defaults to <literal>1</"
@@ -1578,6 +3340,7 @@
"korrespondiert."
#. Tag: para
+#: basic_mapping.xml:1304
#, fuzzy, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1590,6 +3353,7 @@
"korrespondiert."
#. Tag: para
+#: basic_mapping.xml:1312
#, fuzzy, no-c-format
msgid ""
"<literal>force_table_use</literal> (optional - defaults to <literal>false</"
@@ -1601,6 +3365,7 @@
"einer biderektionalen Assoziation"
#. Tag: para
+#: basic_mapping.xml:1319
#, fuzzy, no-c-format
msgid ""
"<literal>value_column</literal> (optional - defaults to <literal>next_val</"
@@ -1611,16 +3376,17 @@
"<literal>class</literal>) der Name der Diskriminatorspalte."
#. Tag: para
+#: basic_mapping.xml:1326
#, fuzzy, no-c-format
msgid ""
"<literal>optimizer</literal> (optional - defaults to <literal>none</"
-"literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" /"
-">"
+"literal>): See"
msgstr ""
"<literal>cascade</literal> (optional- die Standardeinstellung lautet "
"<literal>none</literal>): der \"Cascade-Style\" (Weitergabestil)."
#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
msgid ""
"The second of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1636,6 +3402,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1345
#, fuzzy, no-c-format
msgid ""
"<literal>table_name</literal> (optional - defaults to "
@@ -1645,6 +3412,7 @@
"<literal>integer</literal>): Der Versionsnummerntyp."
#. Tag: para
+#: basic_mapping.xml:1351
#, fuzzy, no-c-format
msgid ""
"<literal>value_column_name</literal> (optional - defaults to "
@@ -1655,6 +3423,7 @@
"<literal>class</literal>) der Name der Diskriminatorspalte."
#. Tag: para
+#: basic_mapping.xml:1357
#, fuzzy, no-c-format
msgid ""
"<literal>segment_column_name</literal> (optional - defaults to "
@@ -1667,6 +3436,7 @@
"korrespondiert."
#. Tag: para
+#: basic_mapping.xml:1365
#, fuzzy, no-c-format
msgid ""
"<literal>segment_value</literal> (optional - defaults to <literal>default</"
@@ -1678,6 +3448,7 @@
"korrespondiert."
#. Tag: para
+#: basic_mapping.xml:1372
#, fuzzy, no-c-format
msgid ""
"<literal>segment_value_length</literal> (optional - defaults to "
@@ -1688,6 +3459,7 @@
"<literal>class</literal>) der Name der Diskriminatorspalte."
#. Tag: para
+#: basic_mapping.xml:1378
#, fuzzy, no-c-format
msgid ""
"<literal>initial_value</literal> (optional - defaults to <literal>1</"
@@ -1697,6 +3469,7 @@
"<literal>integer</literal>): Der Versionsnummerntyp."
#. Tag: para
+#: basic_mapping.xml:1384
#, fuzzy, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1706,20 +3479,23 @@
"<literal>integer</literal>): Der Versionsnummerntyp."
#. Tag: para
+#: basic_mapping.xml:1390
#, fuzzy, no-c-format
msgid ""
-"<literal>optimizer</literal> (optional - defaults to <literal></literal>): "
-"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+"<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): "
+"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
"<literal>cascade</literal> (optional- die Standardeinstellung lautet "
"<literal>none</literal>): der \"Cascade-Style\" (Weitergabestil)."
#. Tag: title
+#: basic_mapping.xml:1397
#, fuzzy, no-c-format
msgid "Identifier generator optimization"
msgstr "Die \"Getter\"-Methode des Bezeichners"
#. Tag: para
+#: basic_mapping.xml:1399
#, no-c-format
msgid ""
"For identifier generators that store values in the database, it is "
@@ -1727,11 +3503,12 @@
"a new identifier value. Instead, you can group a bunch of them in memory and "
"only hit the database when you have exhausted your in-memory value group. "
"This is the role of the pluggable optimizers. Currently only the two "
-"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> "
+"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
"support this operation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
msgid ""
"<literal>none</literal> (generally this is the default if no optimizer was "
@@ -1740,6 +3517,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
msgid ""
"<literal>hilo</literal>: applies a hi/lo algorithm around the database "
@@ -1751,6 +3529,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
msgid ""
"<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this "
@@ -1762,310 +3541,212 @@
msgstr ""
#. Tag: title
-#, no-c-format
-msgid "composite-id"
-msgstr "composite-id"
-
-#. Tag: para
+#: basic_mapping.xml:1441
#, fuzzy, no-c-format
-msgid ""
-"A table with a composite key can be mapped with multiple properties of the "
-"class as identifier properties. The <literal><composite-id></literal> "
-"element accepts <literal><key-property></literal> property mappings "
-"and <literal><key-many-to-one></literal> mappings as child elements."
-msgstr ""
-"Für eine Tabelle mit einem zusammengesetzten Schlüssel, können Sie mehrere "
-"Properties der Klasse als Bezeichner-Properties mappen. Das <literal><"
-"composite-id></literal>-Element akzeptiert <literal><key-property></"
-"literal>-Property-Mappings und <literal><key-many-to-one></literal>-"
-"Mappings als untergeordnete Elemente."
+msgid "Partial identifier generation"
+msgstr "Die \"Getter\"-Methode des Bezeichners"
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1443
+#, no-c-format
msgid ""
-"The persistent class <emphasis>must</emphasis> override <literal>equals()</"
-"literal> and <literal>hashCode()</literal> to implement composite identifier "
-"equality. It must also implement <literal>Serializable</literal>."
+"Hibernate supports the automatic generation of some of the identifier "
+"properties. Simply use the <classname>@GeneratedValue</classname> annotation "
+"on one or several id properties."
msgstr ""
-"Ihre persistente Klasse <emphasis>muss</emphasis> sowohl <literal>equals()</"
-"literal> als auch <literal>hashCode()</literal> außer Kraft setzen, um die "
-"Gleichwertigkeit zusammengesetzter Bezeichner zu implementieren. Sie muss "
-"außerdem <literal>Serializable</literal> implementieren."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1449
+#, no-c-format
msgid ""
-"Unfortunately, this approach means that a persistent object is its own "
-"identifier. There is no convenient \"handle\" other than the object itself. "
-"You must instantiate an instance of the persistent class itself and populate "
-"its identifier properties before you can <literal>load()</literal> the "
-"persistent state associated with a composite key. We call this approach an "
-"<emphasis>embedded</emphasis> composite identifier, and discourage it for "
-"serious applications."
+"The Hibernate team has always felt such a construct as fundamentally wrong. "
+"Try hard to fix your data model before using this feature."
msgstr ""
-"Leider bedeutet diese Vorgehensweise bei zusammengesetzten Bezeichnern, dass "
-"ein persistentes Objekt sein eigener Bezeichner ist. Es existiert keine "
-"praktische \"Handhabung\" außer dem Objekt selbst. Sie müssen eine Instanz "
-"der persistenten Klasse selbst instanziieren und deren Bezeichner-Properties "
-"auffüllen, ehe Sie mit <literal>load()</literal> den persistenten Status "
-"eines zugehörigen zusammengesetzten Schlüssels laden können. Diese "
-"Vorgehensweise gilt als <emphasis>eingebetteter</emphasis> (\"embedded\") "
-"zusammengesetzter Bezeichner und wird nicht für ernsthafte Anwendungen "
-"empfohlen."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1454
#, no-c-format
msgid ""
-"A second approach is what we call a <emphasis>mapped</emphasis> composite "
-"identifier, where the identifier properties named inside the <literal><"
-"composite-id></literal> element are duplicated on both the persistent "
-"class and a separate identifier class."
+"@Entity\n"
+"public class CustomerInventory implements Serializable {\n"
+" @Id\n"
+" @TableGenerator(name = \"inventory\",\n"
+" table = \"U_SEQUENCES\",\n"
+" pkColumnName = \"S_ID\",\n"
+" valueColumnName = \"S_NEXTNUM\",\n"
+" pkColumnValue = \"inventory\",\n"
+" allocationSize = 1000)\n"
+" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
+"\")\n"
+" Integer id;\n"
+"\n"
+"\n"
+" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+" Customer customer;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @Id\n"
+" private int id;\n"
+"}"
msgstr ""
-"Eine zweite Vorgehensweise trägt den Namen <emphasis>gemappter</emphasis> "
-"zusammengesetzter Bezeichner (sog. \"mapped composite identifier\"), wobei "
-"die innerhalb des <literal><composite-id></literal>-Elements genannten "
-"Bezeichner-Properties sowohl an der persistenten Klasse als auch einer "
-"separaten Bezeichnerklasse dupliziert werden."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1456
+#, no-c-format
msgid ""
-"In this example, both the composite identifier class, <literal>MedicareId</"
-"literal>, and the entity class itself have properties named "
-"<literal>medicareNumber</literal> and <literal>dependent</literal>. The "
-"identifier class must override <literal>equals()</literal> and "
-"<literal>hashCode()</literal> and implement <literal>Serializable</literal>. "
-"The main disadvantage of this approach is code duplication."
+"You can also generate properties inside an <classname>@EmbeddedId</"
+"classname> class."
msgstr ""
-"In diesem Beispiel besitzen sowohl die Klasse des zusammengesetzten "
-"Bezeichners <literal>MedicareId</literal> als auch die Entity-Klasse selbst "
-"Properties mit dem Namen <literal>medicareNumber</literal> und "
-"<literal>dependent</literal>. Die Bezeichnerklasse muss <literal>equals()</"
-"literal> und <literal>hashCode()</literal> außer Kraft setzen und "
-"<literal>Serializable</literal> implementieren. Der Nachteil dieser "
-"Vorgehensweise ist offensichtlich— Code-Duplizierung."
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:1462
#, no-c-format
-msgid ""
-"The following attributes are used to specify a mapped composite identifier:"
+msgid "Optimistic locking properties (optional)"
msgstr ""
-"Die folgenden Attribute werden verwendet, um einen gemappten "
-"zusammengesetzten Bezeichner zu bestimmen:"
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1464
+#, no-c-format
msgid ""
-"<literal>mapped</literal> (optional - defaults to <literal>false</literal>): "
-"indicates that a mapped composite identifier is used, and that the contained "
-"property mappings refer to both the entity class and the composite "
-"identifier class."
+"When using long transactions or conversations that span several database "
+"transactions, it is useful to store versioning data to ensure that if the "
+"same entity is updated by two conversations, the last to commit changes will "
+"be informed and not override the other conversation's work. It guarantees "
+"some isolation while still allowing for good scalability and works "
+"particularly well in read-often write-sometimes situations."
msgstr ""
-"<literal>mapped</literal> (optional, Standardeinstellung <literal>false</"
-"literal>): zeigt an, dass ein gemappter zusammengesetzter Bezeichner "
-"verwendet wird und die enthaltenen Property-Mappings auf die Entity-Klasse "
-"und die zusammengesetzte Bezeichnerklasse verweisen."
#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"<literal>class</literal> (optional - but required for a mapped composite "
-"identifier): the class used as a composite identifier."
+#: basic_mapping.xml:1472
+#, no-c-format
+msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
-"<literal>class</literal> (optional, für einen gemappten Bezeichner jedoch "
-"erforderlich): Die als zusammengesetzter Bezeichner verwendete Klasse."
#. Tag: para
+#: basic_mapping.xml:1475
#, fuzzy, no-c-format
msgid ""
-"We will describe a third, even more convenient approach, where the composite "
-"identifier is implemented as a component class in <xref linkend=\"components-"
-"compositeid\" />. The attributes described below apply only to this "
-"alternative approach:"
+"A version or timestamp property should never be null for a detached "
+"instance. Hibernate will detect any instance with a null version or "
+"timestamp as transient, irrespective of what other <literal>unsaved-value</"
+"literal> strategies are specified. <emphasis>Declaring a nullable version or "
+"timestamp property is an easy way to avoid problems with transitive "
+"reattachment in Hibernate. It is especially useful for people using assigned "
+"identifiers or composite keys</emphasis>."
msgstr ""
-"Abschließend erläutern wir einen dritte, noch praktischere Vorgehensweise, "
-"bei der der zusammengesetzte Bezeichner als Komponentenklasse in <xref "
-"linkend=\"components-compositeid\"/> implementiert wird. Die unten "
-"beschriebenen Attribute gelten nur für diese Vorgehensweise:"
+"Eine Versions- oder Zeitstempel-Property sollte für abgesetzte Instanzen "
+"niemals Null sein, damit Hibernate Instanzen mit Null-Version oder -"
+"Zeitstempel als transient entdeckt, ganz unabhängig davon, welche anderen "
+"<literal>unsaved-value</literal>-Strategien festgelegt sind. <emphasis>Die "
+"Deklaration einer nullbaren Version oder Zeitstempel-Property ist eine "
+"einfache Art, Probleme mit transitiver Wiederanbindung in Hibernate zu "
+"vermeiden; besonders nützlich ist dies für Personen, die zugeteilte "
+"Bezeichner oder zusammengesetzte Schlüssel verwenden!</emphasis>"
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"<literal>name</literal> (optional - required for this approach): a property "
-"of component type that holds the composite identifier. Please see chapter 9 "
-"for more information."
-msgstr ""
-"<literal>name</literal> (optional, bei dieser Vorgehensweise erforderlich): "
-"Eine Property nach Komponententyp, die den zusammengesetzten Bezeichner "
-"enthält (siehe Kapitel 9)."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate uses for accessing the property value."
-msgstr ""
-"<literal>access</literal> (optional - Standardeinstellung ist "
-"<literal>property</literal>): Die Strategie, die Hibernate für den Zugriff "
-"auf den Property-Wert verwenden soll."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the component class used as a composite "
-"identifier. Please see the next section for more information."
-msgstr ""
-"<literal>class</literal> (optional - Standardeinstellung ist der durch die "
-"Reflexion bestimmte Property-Typ): Die als ein zusammengesetzter "
-"Bezeichnerverwendete Komponentenklasse (siehe nächster Abschnitt)."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The third approach, an <emphasis>identifier component</emphasis>, is "
-"recommended for almost all applications."
-msgstr ""
-"Bei dieser dritten Vorhegensweise empfehlen wir eine "
-"<emphasis>Bezeichnerkomponente</emphasis> für fast alle Anwendungen."
-
#. Tag: title
-#, fuzzy, no-c-format
-msgid "Discriminator"
-msgstr "discriminator"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The <literal><discriminator></literal> element is required for "
-"polymorphic persistence using the table-per-class-hierarchy mapping "
-"strategy. It declares a discriminator column of the table. The discriminator "
-"column contains marker values that tell the persistence layer what subclass "
-"to instantiate for a particular row. A restricted set of types can be used: "
-"<literal>string</literal>, <literal>character</literal>, <literal>integer</"
-"literal>, <literal>byte</literal>, <literal>short</literal>, "
-"<literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</"
-"literal>."
+#: basic_mapping.xml:1485
+#, no-c-format
+msgid "Version number"
msgstr ""
-"Das <literal><discriminator></literal>-Element wird für die polymorphe "
-"Persistenz unter Verwendung der Tabelle-pro-Klasse-Hierarchie (sog. \"table-"
-"per-class-hierarchy\") Mapping-Strategie benötigt und deklariert eine "
-"Diskriminatorspalte der Tabelle. Diese Diskriminatorspalte enthält "
-"Markierungswerte, die der Persistenzschicht mitteilen, welche Subklasse für "
-"eine bestimmte Reihe instanziiert werden soll. Ein beschränkter Typensatz "
-"kann hierfür verwendet werden: <literal>string</literal>, "
-"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
-"literal>, <literal>short</literal>, <literal>boolean</literal>, "
-"<literal>yes_no</literal>, <literal>true_false</literal>."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1487
+#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
-"the name of the discriminator column."
+"You can add optimistic locking capability to an entity using the "
+"<literal>@Version</literal> annotation:"
msgstr ""
-"<literal>column</literal> (optional - Standardeinstellung lautet "
-"<literal>class</literal>) der Name der Diskriminatorspalte."
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:1490
+#, no-c-format
msgid ""
-"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
-"a name that indicates the Hibernate type"
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
msgstr ""
-"<literal>type</literal> (optional - die Standardeinstellung lautet "
-"<literal>string</literal>) ein Name, der den Hibernate-Typ angibt."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1492
+#, no-c-format
msgid ""
-"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
-"\"forces\" Hibernate to specify the allowed discriminator values, even when "
-"retrieving all instances of the root class."
+"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 ""
-"<literal>force</literal> (optional - die Standardeinstellung lautet "
-"<literal>false</literal>) \"zwingt\" Hibernate dazu, die erlaubten "
-"Diskriminatorwerte beim Abruf aller Instanzen der Stammklasse zu "
-"spezifizieren."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1497
+#, no-c-format
msgid ""
-"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
-"set this to <literal>false</literal> if your discriminator column is also "
-"part of a mapped composite identifier. It tells Hibernate not to include the "
-"column in SQL <literal>INSERTs</literal>."
+"The version column may be a numeric. Hibernate supports any kind of type "
+"provided that you define and implement the appropriate "
+"<classname>UserVersionType</classname>."
msgstr ""
-"<literal>insert</literal> (optional - die Standardeinstellung lautet "
-"<literal>true</literal>) wählen Sie hier die Einstellung <literal>false</"
-"literal>, falls Ihre Diskriminatortspalte auch Teil des zusammengesetzten "
-"Bezeichners ist. (Hibernate wird mitgeteilt, die Spalte nicht in SQL "
-"<literal>INSERT</literal>s mit einzuschließen)."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1501
+#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
-"executed when a type has to be evaluated. It allows content-based "
-"discrimination."
+"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>LockModeType."
+"OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType."
+"PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
-"<literal>formula</literal> (optional) ein beliebiger SQL-Ausdruck, der "
-"ausgeführt wird, wenn ein Typ evaluiert werden muss. Erlaubt inhaltsbasierte "
-"Unterscheidung (sog. \"discrimination\")."
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
msgid ""
-"Actual values of the discriminator column are specified by the "
-"<literal>discriminator-value</literal> attribute of the <literal><"
-"class></literal> and <literal><subclass></literal> elements."
+"If the version number is generated by the database (via a trigger for "
+"example), make sure to use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"Die tatsächlichen Werte der Diskriminatorspalte werden durch das "
-"<literal>discriminator-value</literal>-Attribut der <literal><class></"
-"literal> und <literal><subclass></literal>-Elemente spezifiziert."
#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The <literal>force</literal> attribute is only useful if the table contains "
-"rows with \"extra\" discriminator values that are not mapped to a persistent "
-"class. This will not usually be the case."
+#: basic_mapping.xml:1511
+#, no-c-format
+msgid "To declare a version property in hbm.xml, use:"
msgstr ""
-"Das <literal>force</literal>-Attribut ist (nur) von Nutzen, wenn die Tabelle "
-"eine Reihe mit \"zusätzlichen\" Diskriminatorwerten enthält, die nicht zu "
-"einer persistenten Klasse gemappt sind. Dies ist in der Regel jedoch nicht "
-"der Fall."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1530
#, fuzzy, no-c-format
msgid ""
-"The <literal>formula</literal> attribute allows you to declare an arbitrary "
-"SQL expression that will be used to evaluate the type of a row. For example:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
msgstr ""
-"Mit dem <literal>formula</literal>-Attribut können Sie einen beliebigen SQL-"
-"Ausdruck deklarieren, der dann zur Evaluierung des Reihentyps verwendet wird:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
-#. Tag: title
-#, fuzzy, no-c-format
-msgid "Version (optional)"
-msgstr "version (optional)"
-
#. Tag: para
+#: basic_mapping.xml:1534
#, fuzzy, no-c-format
msgid ""
-"The <literal><version></literal> element is optional and indicates "
-"that the table contains versioned data. This is particularly useful if you "
-"plan to use <emphasis>long transactions</emphasis>. See below for more "
-"information:"
-msgstr ""
-"Das <literal><version></literal>-Element ist optional und zeigt an, "
-"dass die Tabelle versionierte Daten enthält. Das ist insbesondere dann "
-"nützlich, wenn Sie vorhaben, <emphasis>lange Transaktionen</emphasis> zu "
-"verwenden (siehe unten)."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of the column holding the version number."
msgstr ""
@@ -2073,6 +3754,7 @@
"Name): Der Name der Spalte, die die Versionsnummer enthält."
#. Tag: para
+#: basic_mapping.xml:1540
#, fuzzy, no-c-format
msgid ""
"<literal>name</literal>: the name of a property of the persistent class."
@@ -2080,6 +3762,7 @@
"<literal>name</literal>: Der Name einer Property der persistenten Klasse."
#. Tag: para
+#: basic_mapping.xml:1545
#, fuzzy, no-c-format
msgid ""
"<literal>type</literal> (optional - defaults to <literal>integer</literal>): "
@@ -2089,6 +3772,7 @@
"<literal>integer</literal>): Der Versionsnummerntyp."
#. Tag: para
+#: basic_mapping.xml:1551
#, fuzzy, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -2099,6 +3783,7 @@
"auf den Property-Wert verwenden soll."
#. Tag: para
+#: basic_mapping.xml:1557
#, fuzzy, no-c-format
msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</"
@@ -2116,6 +3801,7 @@
"sollte)."
#. Tag: para
+#: basic_mapping.xml:1567
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2129,6 +3815,7 @@
"linkend=\"mapping-generated\"/>."
#. Tag: para
+#: basic_mapping.xml:1575
#, fuzzy, no-c-format
msgid ""
"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
@@ -2142,57 +3829,88 @@
"<literal>false</literal> lauten, wenn (und nur in diesem Fall) die "
"Datenbankspalte mit dem Standardwert <literal>0</literal> definiert ist."
+#. Tag: title
+#: basic_mapping.xml:1586
+#, fuzzy, no-c-format
+msgid "Timestamp"
+msgstr "Zeitstempel (optional)"
+
#. Tag: para
+#: basic_mapping.xml:1588
#, fuzzy, no-c-format
msgid ""
-"Version numbers can be of Hibernate type <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> or <literal>calendar</literal>."
+"Alternatively, you can use a timestamp. Timestamps are a less safe "
+"implementation of optimistic locking. However, sometimes the application "
+"might use the timestamps in other ways."
msgstr ""
-"Die Versionsnummern können vom Hibernate-Typ <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> oder <literal>calendar</literal> sein."
+"Das optionale <literal><timestamp></literal>-Element zeigt an, dass "
+"die Tabelle Daten mit Zeitstempel enthält. Dies ist als Alternative zur "
+"Versionierung gedacht. Zeitstempel sind generell eine weniger sichere "
+"Implementierung des optimistischen Sperrens. Jedoch wird die Anwendung die "
+"Zeitstempel manchmal auf andere Weise benutzen."
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1592
+#, no-c-format
msgid ""
-"A version or timestamp property should never be null for a detached "
-"instance. Hibernate will detect any instance with a null version or "
-"timestamp as transient, irrespective of what other <literal>unsaved-value</"
-"literal> strategies are specified. <emphasis>Declaring a nullable version or "
-"timestamp property is an easy way to avoid problems with transitive "
-"reattachment in Hibernate. It is especially useful for people using assigned "
-"identifiers or composite keys</emphasis>."
+"Simply mark a property of type <classname>Date</classname> or "
+"<classname>Calendar</classname> as <classname>@Version</classname>."
msgstr ""
-"Eine Versions- oder Zeitstempel-Property sollte für abgesetzte Instanzen "
-"niemals Null sein, damit Hibernate Instanzen mit Null-Version oder -"
-"Zeitstempel als transient entdeckt, ganz unabhängig davon, welche anderen "
-"<literal>unsaved-value</literal>-Strategien festgelegt sind. <emphasis>Die "
-"Deklaration einer nullbaren Version oder Zeitstempel-Property ist eine "
-"einfache Art, Probleme mit transitiver Wiederanbindung in Hibernate zu "
-"vermeiden; besonders nützlich ist dies für Personen, die zugeteilte "
-"Bezeichner oder zusammengesetzte Schlüssel verwenden!</emphasis>"
-#. Tag: title
-#, fuzzy, no-c-format
-msgid "Timestamp (optional)"
-msgstr "Zeitstempel (optional)"
+#. Tag: programlisting
+#: basic_mapping.xml:1596
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" public Date getLastUpdate() { ... }\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1598
+#, no-c-format
+msgid ""
+"Like version numbers, the timestamp can be generated by the database instead "
+"of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1602
#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr ""
+"Nehmen wir etwa das folgende <literal><properties></literal>-Mapping:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
+#, fuzzy, no-c-format
msgid ""
-"The optional <literal><timestamp></literal> element indicates that the "
-"table contains timestamped data. This provides an alternative to versioning. "
-"Timestamps are a less safe implementation of optimistic locking. However, "
-"sometimes the application might use the timestamps in other ways."
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
msgstr ""
-"Das optionale <literal><timestamp></literal>-Element zeigt an, dass "
-"die Tabelle Daten mit Zeitstempel enthält. Dies ist als Alternative zur "
-"Versionierung gedacht. Zeitstempel sind generell eine weniger sichere "
-"Implementierung des optimistischen Sperrens. Jedoch wird die Anwendung die "
-"Zeitstempel manchmal auf andere Weise benutzen."
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
#. Tag: para
+#: basic_mapping.xml:1624
#, fuzzy, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -2202,6 +3920,7 @@
"Property-Name): Der Name einer Spalte, die den Zeitstempel enthält."
#. Tag: para
+#: basic_mapping.xml:1630
#, fuzzy, no-c-format
msgid ""
"<literal>name</literal>: the name of a JavaBeans style property of Java type "
@@ -2213,8 +3932,21 @@
"persistenten Klasse."
#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380
+#: basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
#, fuzzy, no-c-format
msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the property value."
+msgstr ""
+"<literal>access</literal> (optional - Standardeinstellung ist "
+"<literal>property</literal>): Die Strategie, die Hibernate für den Zugriff "
+"auf den Property-Wert verwenden soll."
+
+#. Tag: para
+#: basic_mapping.xml:1642
+#, fuzzy, no-c-format
+msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>null</"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
@@ -2229,6 +3961,7 @@
"dass der Property-Wert des Identifiers verwendet werden soll.)"
#. Tag: para
+#: basic_mapping.xml:1652
#, fuzzy, no-c-format
msgid ""
"<literal>source</literal> (optional - defaults to <literal>vm</literal>): "
@@ -2252,6 +3985,7 @@
"8)."
#. Tag: para
+#: basic_mapping.xml:1665
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2265,11 +3999,13 @@
"die Erläuterungen unter <xref linkend=\"mapping-generated\"/>."
#. Tag: title
+#: basic_mapping.xml:1675
#, no-c-format
msgid "Note"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1677
#, fuzzy, no-c-format
msgid ""
"<literal><Timestamp></literal> is equivalent to <literal><version "
@@ -2283,20 +4019,849 @@
"type=\"dbtimestamp\"></literal> ist"
#. Tag: title
+#: basic_mapping.xml:1686
#, fuzzy, no-c-format
msgid "Property"
msgstr "property"
#. Tag: para
+#: basic_mapping.xml:1688
+#, no-c-format
+msgid ""
+"You need to decide which property needs to be made persistent in a given "
+"entity. This differs slightly between the annotation driven metadata and the "
+"hbm.xml files."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1693
+#, no-c-format
+msgid "Property mapping with annotations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1695
+#, no-c-format
+msgid ""
+"In the annotations world, every non static non transient property (field or "
+"method depending on the access type) of an entity 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."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1702
+#, no-c-format
+msgid ""
+"The <literal>@Basic</literal> annotation allows you to declare the fetching "
+"strategy for a property. If set to <literal>LAZY</literal>, specifies that "
+"this property should be fetched lazily when the instance variable is first "
+"accessed. It requires build-time bytecode instrumentation, if your classes "
+"are not instrumented, property level lazy loading is silently ignored. The "
+"default is <literal>EAGER</literal>. You can also mark a property as not "
+"optional thanks to the <classname>@Basic.optional</classname> attribute. "
+"This will ensure that the underlying column are not nullable (if possible). "
+"Note that a better approach is to use the <classname>@NotNull</classname> "
+"annotation of the Bean Validation specification."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1715
+#, no-c-format
+msgid "Let's look at a few examples:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+"@Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property \n"
+"\n"
+"@Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1719
+#, 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 Hibernate. <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). The recommended alternative is to "
+"use the projection capability of JP-QL (Java Persistence Query Language) or "
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1732
+#, no-c-format
+msgid ""
+"JPA support property mapping of all basic types supported by Hibernate (all "
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> "
+"annotation as shown in the <literal>note</literal> property example."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1742
+#, no-c-format
+msgid ""
+"In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
+#, 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 <classname>Serializable</classname> type "
+"will be persisted in a Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
+#, 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
+#: basic_mapping.xml:1768
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1770
+#, no-c-format
+msgid ""
+"You can also manually specify a type using the <literal>@org.hibernate."
+"annotations.Type</literal> and some parameters if needed. <classname>@Type."
+"type</classname> could be:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
#, fuzzy, no-c-format
msgid ""
+"The name of a Hibernate basic type: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgstr ""
+"Der Name eines Hibernate Grundtyps (z.B. <literal>integer, string, "
+"character, date, timestamp, float, binary, serializable, object, blob</"
+"literal>)."
+
+#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
+#, fuzzy, no-c-format
+msgid ""
+"The name of a Java class with a default basic type: <literal>int, float, "
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal> etc."
+msgstr ""
+"Der Name einer Java-Klasse mit einem Grundtyp als Standard (z.B. "
+"<literal>int, float, char, java.lang.String, java.util.Date, java.lang."
+"Integer, java.sql.Clob</literal>)."
+
+#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
+#, no-c-format
+msgid "The name of a serializable Java class."
+msgstr "Der Name einer serialisierbaren Java-Klasse."
+
+#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
+#, fuzzy, no-c-format
+msgid ""
+"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
+"literal> etc."
+msgstr ""
+"Der Klassenname eines anwenderdefinierten Typs (z.B. <literal>com.illflow."
+"type.MyCustomType</literal>)."
+
+#. Tag: para
+#: basic_mapping.xml:1798
+#, fuzzy, no-c-format
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4."
+msgstr ""
+"Falls Sie keinen Typ festlegen, so wird Hibernate mittels Reflexion an der "
+"genannten Property versuchen, den korrekten Typ zu ermitteln. Hibernate wird "
+"dabei versuchen, den Namen der Rückgabeklasse des Property-\"Getters\" unter "
+"Verwendung der Regeln 2, 3, 4 (in dieser Reihenfolge) zu ermitteln. Das "
+"reicht jedoch nicht immer. In bestimmten Fällen wird nach wie vor das "
+"<literal>type</literal>-Attribut benötigt. (Um zum Beispiel zwischen "
+"<literal>Hibernate.DATE</literal> und <literal>Hibernate.TIMESTAMP</literal> "
+"zu unterscheiden oder einen anwenderdefinierten Typ zu bestimmen)."
+
+#. Tag: para
+#: basic_mapping.xml:1803
+#, no-c-format
+msgid ""
+"<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when "
+"defined at the class level). If the type is used on a single entity, you can "
+"place the definition on the entity itself. Otherwise, it is recommended to "
+"place the definition at the package level. In the example below, when "
+"Hibernate encounters a property of class <literal>PhoneNumer</literal>, it "
+"delegates the persistence strategy to the custom mapping type "
+"<literal>PhoneNumberType</literal>. However, properties belonging to other "
+"classes, too, can delegate their persistence strategy to "
+"<literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</"
+"literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1819
+#, 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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+"@TypeDef(\n"
+" name = \"phoneNumber\",\n"
+" defaultForType = PhoneNumber.class,\n"
+" typeClass = PhoneNumberType.class\n"
+")\n"
+"\n"
+"@Entity\n"
+"public class ContactDetails {\n"
+" [...]\n"
+" private PhoneNumber localPhoneNumber;\n"
+" @Type(type=\"phoneNumber\")\n"
+" private OverseasPhoneNumber overseasPhoneNumber;\n"
+" [...]\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1826
+#, no-c-format
+msgid ""
+"The following example shows the usage of the <literal>parameters</literal> "
+"attribute to customize the TypeDef."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
+#, 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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+"@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
+#: basic_mapping.xml:1840
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1842
+#, no-c-format
+msgid ""
+"By default the access type of a class hierarchy is defined by the position "
+"of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> "
+"annotations. If these annotations are on a field, then only fields are "
+"considered for persistence and the state is accessed via the field. If there "
+"annotations are on a getter, then only the getters are considered for "
+"persistence and the state is accessed via the getter/setter. That works well "
+"in practice and is the recommended approach."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1850
+#, no-c-format
+msgid ""
+"The placement of annotations within a class hierarchy has to be consistent "
+"(either field or on property) to be able to determine the default access "
+"type. It is recommended to stick to one single annotation placement strategy "
+"throughout your whole application."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1857
+#, no-c-format
+msgid "However in some situations, you need to:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1861
+#, no-c-format
+msgid "force the access type of the entity hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1865
+#, no-c-format
+msgid "override the access type of a specific entity in the class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1870
+#, no-c-format
+msgid "override the access type of an embeddable type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid ""
+"The best use case is an embeddable class used by several entities that might "
+"not use the same access type. In this case it is better to force the access "
+"type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid ""
+"To force the access type on a given class, use the <classname>@Access</"
+"classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" @Embedded private Address address;\n"
+" public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class User {\n"
+" private Long id;\n"
+" @Id public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" private Address address;\n"
+" @Embedded public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"@Access(AcessType.PROPERTY)\n"
+"public class Address {\n"
+" private String street1;\n"
+" public String getStreet1() { return street1; }\n"
+" public void setStreet1() { this.street1 = street1; }\n"
+"\n"
+" private hashCode; //not persistent\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid ""
+"You can also override the access type of a single property while keeping the "
+"other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+" @Transient private String userId;\n"
+" @Transient private String orderId;\n"
+"\n"
+" @Access(AccessType.PROPERTY)\n"
+" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid ""
+"In this example, the default access type is <classname>FIELD</classname> "
+"except for the <literal>orderNumber</literal> property. Note that the "
+"corresponding field, if any must be marked as <classname>@Transient</"
+"classname> or <code>transient</code>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1896
+#, no-c-format
+msgid "@org.hibernate.annotations.AccessType"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1898
+#, no-c-format
+msgid ""
+"The annotation <classname>@org.hibernate.annotations.AccessType</classname> "
+"should be considered deprecated for FIELD and PROPERTY access. It is still "
+"useful however if you need to use a custom access type."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1907
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1909
+#, 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
+#: basic_mapping.xml:1914
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "<literal>name</literal>: Der Property-Name."
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "<literal>name</literal>: Der Property-Name."
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "<literal>all</literal> Prüfung aller Spalten"
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "<literal>all</literal> Prüfung aller Spalten"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, fuzzy, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the property "
+"name)"
+msgstr "<literal>name</literal> (optional): Name der Bezeichner-Property."
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal> (optional): Aktiviert die DDL-Generierung einer "
+"eindeutigen Bedingung für die Spalten. Dies kann auch das Ziel (sog. \"target"
+"\") einer <literal>property-ref</literal> sein."
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, fuzzy, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable (default "
+"true)."
+msgstr "<literal>name</literal> (optional): Name der Bezeichner-Property."
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column will be "
+"part of the insert statement (default true)"
+msgstr "<literal>name</literal> (optional): Name der Bezeichner-Property."
+
+#. Tag: para
+#: basic_mapping.xml:2008
+#, fuzzy, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will be "
+"part of the update statement (default true)"
+msgstr ""
+"<literal>catalog</literal> (optional): Der Name eines Datenbankkatalogs."
+
+#. Tag: para
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL "
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default "
+"primary table)"
+msgstr ""
+"<literal>catalog</literal> (optional): Der Name eines Datenbankkatalogs."
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional): column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional): column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional): column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>Serializable</"
+"classname>, it is mapped as <classname>@Basic</classname> in a column "
+"holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>java.sql.Clob</"
+"classname> or <classname>java.sql.Blob</classname>, it is mapped as "
+"<classname>@Lob</classname> with the appropriate <classname>LobType</"
+"classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, fuzzy, no-c-format
+msgid ""
"The <literal><property></literal> element declares a persistent "
"JavaBean style property of the class."
msgstr ""
"Das <literal><property></literal>-Element deklariert eine persistente "
"Property der Klasse nach Art von JavaBean."
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, fuzzy, no-c-format
+msgid ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+msgstr ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:2129
#, no-c-format
msgid ""
"<literal>name</literal>: the name of the property, with an initial lowercase "
@@ -2306,6 +4871,7 @@
"Anfangsbuchstaben."
#. Tag: para
+#: basic_mapping.xml:2134
#, fuzzy, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -2318,6 +4884,7 @@
"spezifiziert werden."
#. Tag: para
+#: basic_mapping.xml:2146
#, fuzzy, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2336,6 +4903,7 @@
"einen Trigger in einer anderen Anwendung, initialisiert wird."
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2347,6 +4915,7 @@
"Properties besitzen kein eigenes Spalten-Mapping."
#. Tag: para
+#: basic_mapping.xml:2169
#, fuzzy, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
@@ -2360,6 +4929,7 @@
"Build-time Bytecode Instrumentierung)."
#. Tag: para
+#: basic_mapping.xml:2176
#, fuzzy, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2371,6 +4941,7 @@
"\") einer <literal>property-ref</literal> sein."
#. Tag: para
+#: basic_mapping.xml:2183
#, fuzzy, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2380,6 +4951,7 @@
"\"Nullability\"-Bedingung für die Spalten."
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, fuzzy, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2395,6 +4967,7 @@
"sagt sie sein dann \"dirty\")."
#. Tag: para
+#: basic_mapping.xml:2196
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2408,48 +4981,15 @@
"<xref linkend=\"mapping-generated\"/>."
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr "<emphasis>typename</emphasis> könnte sein:"
#. Tag: para
+#: basic_mapping.xml:2230
#, fuzzy, no-c-format
msgid ""
-"The name of a Hibernate basic type: <literal>integer, string, character, "
-"date, timestamp, float, binary, serializable, object, blob</literal> etc."
-msgstr ""
-"Der Name eines Hibernate Grundtyps (z.B. <literal>integer, string, "
-"character, date, timestamp, float, binary, serializable, object, blob</"
-"literal>)."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The name of a Java class with a default basic type: <literal>int, float, "
-"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
-"literal> etc."
-msgstr ""
-"Der Name einer Java-Klasse mit einem Grundtyp als Standard (z.B. "
-"<literal>int, float, char, java.lang.String, java.util.Date, java.lang."
-"Integer, java.sql.Clob</literal>)."
-
-#. Tag: para
-#, no-c-format
-msgid "The name of a serializable Java class."
-msgstr "Der Name einer serialisierbaren Java-Klasse."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
-"literal> etc."
-msgstr ""
-"Der Klassenname eines anwenderdefinierten Typs (z.B. <literal>com.illflow."
-"type.MyCustomType</literal>)."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
@@ -2468,6 +5008,7 @@
"zu unterscheiden oder einen anwenderdefinierten Typ zu bestimmen)."
#. Tag: para
+#: basic_mapping.xml:2239
#, fuzzy, no-c-format
msgid ""
"The <literal>access</literal> attribute allows you to control how Hibernate "
@@ -2488,6 +5029,7 @@
"hibernate.property.PropertyAccessor</literal> implementiert."
#. Tag: para
+#: basic_mapping.xml:2248
#, fuzzy, no-c-format
msgid ""
"A powerful feature is derived properties. These properties are by definition "
@@ -2501,7 +5043,26 @@
"Ausdruck, was in eine <literal>SELECT</literal>-Klausel Unteranfrage in der "
"eine Instanz ladenden SQL-Anfrage übersetzt wird:"
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+
#. Tag: para
+#: basic_mapping.xml:2256
#, fuzzy, no-c-format
msgid ""
"You can reference the entity table by not declaring an alias on a particular "
@@ -2516,32 +5077,1985 @@
"Mapping-Element statt des Attributs verwenden können."
#. Tag: title
+#: basic_mapping.xml:2265
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2267
#, fuzzy, no-c-format
-msgid "Many-to-one"
-msgstr "many-to-one"
+msgid ""
+"Embeddable objects (or components) are objects whose properties are mapped "
+"to the same table as the owning entity's table. Components can, in turn, "
+"declare their own properties, components or collections"
+msgstr ""
+"Das <literal><component></literal>-Element mappt die Properties eines "
+"untergeordneten Objekts zu den Spalten der Tabelle der übergeordneten "
+"Klasse. Komponenten wiederum können ihre eigenen Properties, Komponenten "
+"oder \"Collections\" deklarieren. Siehe \"Komponenten\" unten."
#. Tag: para
+#: basic_mapping.xml:2272
+#, 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
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
+#, no-c-format
+msgid ""
+"An embeddable object inherits the access type of its owning entity (note "
+"that you can override that using the <literal>@Access</literal> annotation)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2290
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded "
+"objects of embedded objects is through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2305
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column = @Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
+"(name=\"nat_Iso2\") ),\n"
+" @AttributeOverride(name=\"nationality.name\", column = @Column"
+"(name=\"nat_CountryName\") )\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2307
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports something that is not explicitly supported by "
+"the JPA 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
+#: basic_mapping.xml:2313
+#, no-c-format
+msgid ""
+"You can also use association annotations in an embeddable object (ie "
+"<literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, "
+"<classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To "
+"override the association columns you can use <literal>@AssociationOverride</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2319
+#, 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 as several embedded objects "
+"would share the same set of columns. In plain JPA, you need to override at "
+"least one set of columns. Hibernate, however, allows you to enhance the "
+"default naming mechanism through the <classname>NamingStrategy</classname> "
+"interface. You can write a strategy that prevent name clashing in such a "
+"situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an "
+"example of this."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2329
+#, no-c-format
+msgid ""
+"If a property of the embedded object points back to the owning entity, "
+"annotate it with the <classname>@Parent</classname> annotation. Hibernate "
+"will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
#, fuzzy, no-c-format
msgid ""
-"An ordinary association to another persistent class is declared using a "
-"<literal>many-to-one</literal> element. The relational model is a many-to-"
-"one association; a foreign key in one table is referencing the primary key "
-"column(s) of the target table."
+"<component\n"
+" name=\"propertyName\"\n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
msgstr ""
-"Eine reguläre Assoziation zu einer anderen persistenten Klasse wird unter "
-"Verwendung eines <literal>many-to-one</literal>-Elements deklariert. Das "
-"relationale Modell ist eine \"Many-to-One\"-Assoziation: Der Fremdschlüssel "
-"in einer Tabelle verweist auf die Spalte(n) des Primärschlüssels der "
-"Zieltabelle."
+"<component \n"
+" name=\"propertyName\" \n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+" \n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
#, fuzzy, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr "<literal>name</literal>: Der Name der Property."
#. Tag: para
+#: basic_mapping.xml:2364
#, fuzzy, no-c-format
msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the component (child) class."
+msgstr ""
+"<literal>class</literal> (optional - Standardeinstellung ist der durch "
+"Reflexion bestimmte Property-Typ): Der Name der (untergeordneten) "
+"Komponentenklasse."
+
+#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insert</literal>: do the mapped columns appear in SQL "
+"<literal>INSERTs</literal>?"
+msgstr ""
+"<literal>insert</literal>: Erscheinen die gemappten Spalten in SQL "
+"<literal>INSERT</literal>s?"
+
+#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
+#, fuzzy, no-c-format
+msgid ""
+"<literal>update</literal>: do the mapped columns appear in SQL "
+"<literal>UPDATEs</literal>?"
+msgstr ""
+"<literal>update</literal>: Erscheinen die gemappten Spalten in SQL "
+"<literal>UPDATE</literal>s?"
+
+#. Tag: para
+#: basic_mapping.xml:2386
+#, fuzzy, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this component should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>): Legt fest, dass für diese Komponente \"lazy "
+"Fetching\" gilt, wenn erstmals auf die Instanzvariable zugegriffen wird "
+"(erfordert Build-time Bytecode Instrumentierung)."
+
+#. Tag: para
+#: basic_mapping.xml:2393
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this component either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal> (optional - die Standardeinstellung "
+"lautet <literal>true</literal>): Legt fest, ob Aktualisierungen dieser "
+"Komponente die Erfassung einer optimistischen Sperre benötigen oder nicht. "
+"Mit anderen Worten, es wird bestimmt, ob eine Erhöhung der Version "
+"stattfinden soll, wenn die Inhalte dieser Property sich verändert haben (man "
+"sagt sie sein dann \"dirty\")."
+
+#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that a unique constraint exists upon all mapped columns of the "
+"component."
+msgstr ""
+"<literal>unique</literal> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>): Bestimmt, dass eine eindeutige Bedingung an allen "
+"gemappten Spalten der Komponente existiert."
+
+#. Tag: para
+#: basic_mapping.xml:2408
+#, no-c-format
+msgid ""
+"The child <literal><property></literal> tags map properties of the "
+"child class to table columns."
+msgstr ""
+"Die untergeordneten <literal><property></literal>-Tags mappen "
+"Properties der untergeordneten Klasse zu den Spalten der Tabelle."
+
+#. Tag: para
+#: basic_mapping.xml:2411
+#, no-c-format
+msgid ""
+"The <literal><component></literal> element allows a <literal><"
+"parent></literal> subelement that maps a property of the component class "
+"as a reference back to the containing entity."
+msgstr ""
+"Das <literal><component></literal>-Element ermöglicht ein <literal><"
+"parent></literal>-Subelement, das eine Property der Komponentenklasse als "
+"Rückreferenz zur enthaltenden Entity mappt."
+
+#. Tag: para
+#: basic_mapping.xml:2415
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><dynamic-component></literal> element allows a "
+"<literal>Map</literal> to be mapped as a component, where the property names "
+"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
+"more information. This feature is not supported in annotations."
+msgstr ""
+"Das <literal><dynamic-component></literal>-Element erlaubt es einer "
+"<literal>Map</literal> als Komponente gemappt zu werden, wenn die Namen der "
+"Properties auf Schlüssel der Map verweisen, siehe <xref linkend=\"components-"
+"dynamic\"/>."
+
+#. Tag: title
+#: basic_mapping.xml:2423
+#, no-c-format
+msgid "Inheritance strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2425
+#, no-c-format
+msgid ""
+"Java is a language supporting polymorphism: a class can inherit from "
+"another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2431
+#, no-c-format
+msgid ""
+"Single table per class hierarchy strategy: a single table hosts all the "
+"instances of a class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2436
+#, no-c-format
+msgid ""
+"Joined subclass strategy: one table per class and subclass is present and "
+"each table persist the properties specific to a given subclass. The state of "
+"the entity is then stored in its corresponding class table and all its "
+"superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2443
+#, no-c-format
+msgid ""
+"Table per class strategy: one table per concrete class and subclass is "
+"present and each table persist the properties of the class and its "
+"superclasses. The state of the entity is then stored entirely in the "
+"dedicated table for its class."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2453
+#, no-c-format
+msgid ""
+"With this approach the properties of all the subclasses in a given mapped "
+"class hierarchy are stored in a single table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2456
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass declares its own persistent properties and subclasses. Version "
+"and id properties are assumed to be inherited from the root class. Each "
+"subclass in a hierarchy must define a unique discriminator value. If this is "
+"not specified, the fully qualified Java class name is used."
+msgstr ""
+"Jede Subklasse sollte ihre eigenen persistenten Properties und Subklassen "
+"deklarieren. Die <literal><version></literal> und <literal><id></"
+"literal>-Properties werden als von der Stammklasse vererbt vorausgesetzt. "
+"Jede Subklasse einer Hierarchie muss einen eindeutigen "
+"<literal>discriminator-value</literal> definieren. Ist keiner festgelegt, so "
+"wird der vollständige Java Klassenname verwendet."
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: basic_mapping.xml:2464
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
+"<literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+"Schließlich erfordert die polymorphe Persistenz die Deklaration jeder "
+"Subklasse der persistenten Stammklasse. Für die Tabelle-pro-Klasse-"
+"Hierarchie (sog. \"table-per-class-hierarchy\") Mapping-Strategie wird die "
+"<literal><subclass></literal>-Deklaration verwendet."
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, fuzzy, no-c-format
+msgid ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+msgstr ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
+#, fuzzy, no-c-format
+msgid ""
+"<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr "<literal>name</literal>: Der vollständige Klassenname der Subklasse."
+
+#. Tag: para
+#: basic_mapping.xml:2488
+#, fuzzy, no-c-format
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses."
+msgstr ""
+"<literal>discriminator-value</literal> (optional - die Standardeinstellung "
+"ist der Klassenname): Ein Wert, der einzelne Subklassen unterscheidet."
+
+#. Tag: para
+#: basic_mapping.xml:2494
+#, fuzzy, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface used for "
+"lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (optional): Bestimmt eine Klasse oder ein "
+"Interface, die/das für die Initialisierung von Proxies bei Bedarf (sog. "
+"\"lazy initializing proxies\") verwendet werden soll."
+
+#. Tag: para
+#: basic_mapping.xml:2499
+#, fuzzy, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (optional, die Standardeinstellung lautet "
+"<literal>true</literal>): Die Einstellung <literal>lazy=\"false\"</literal> "
+"deaktiviert die Verwendung von \"Lazy Fetching\"."
+
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, fuzzy, no-c-format
+msgid ""
+"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
+">."
+msgstr ""
+"Informationen zu Vererbungsmappings (\"sog. \"inheritance mappings\") finden "
+"Sie unter <xref linkend=\"inheritance\"/>."
+
+#. Tag: title
+#: basic_mapping.xml:2511
+#, fuzzy, no-c-format
+msgid "Discriminator"
+msgstr "discriminator"
+
+#. Tag: para
+#: basic_mapping.xml:2513
+#, fuzzy, no-c-format
+msgid ""
+"Discriminators are required for polymorphic persistence using the table-per-"
+"class-hierarchy mapping strategy. It declares a discriminator column of the "
+"table. The discriminator column contains marker values that tell the "
+"persistence layer what subclass to instantiate for a particular row. A "
+"restricted set of types can be used: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+"Das <literal><discriminator></literal>-Element wird für die polymorphe "
+"Persistenz unter Verwendung der Tabelle-pro-Klasse-Hierarchie (sog. \"table-"
+"per-class-hierarchy\") Mapping-Strategie benötigt und deklariert eine "
+"Diskriminatorspalte der Tabelle. Diese Diskriminatorspalte enthält "
+"Markierungswerte, die der Persistenzschicht mitteilen, welche Subklasse für "
+"eine bestimmte Reihe instanziiert werden soll. Ein beschränkter Typensatz "
+"kann hierfür verwendet werden: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2523
+#, no-c-format
+msgid ""
+"Use the <classname>@DiscriminatorColumn</classname> to define the "
+"discriminator column as well as the discriminator type. Alternatively, you "
+"can also use <classname>@DiscriminatorFormula</classname> to express in SQL "
+"what would be in a virtual discriminator column. This is particularly handy "
+"when the discriminator value can be extracted from one or more columns of "
+"the table. Both <classname>@DiscriminatorColumn</classname> and "
+"<classname>@DiscriminatorFormula</classname> are to be set on the root "
+"entity (once per persisted hierarchy)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2534
+#, no-c-format
+msgid ""
+"Finally, use <classname>@DiscriminatorValue</classname> on each class of the "
+"hierarchy to specify the value stored in the discriminator column for a "
+"given entity. If you do not set <classname>@DiscriminatorValue</classname> "
+"on a class, the fully qualified class name is used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2542
+#, no-c-format
+msgid ""
+"In hbm.xml, the <literal><discriminator></literal> element is used to "
+"define the discriminator column or formula:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, fuzzy, no-c-format
+msgid ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+msgstr ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:2563
+#, fuzzy, no-c-format
+msgid ""
+"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
+"the name of the discriminator column."
+msgstr ""
+"<literal>column</literal> (optional - Standardeinstellung lautet "
+"<literal>class</literal>) der Name der Diskriminatorspalte."
+
+#. Tag: para
+#: basic_mapping.xml:2569
+#, fuzzy, no-c-format
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
+"a name that indicates the Hibernate type"
+msgstr ""
+"<literal>type</literal> (optional - die Standardeinstellung lautet "
+"<literal>string</literal>) ein Name, der den Hibernate-Typ angibt."
+
+#. Tag: para
+#: basic_mapping.xml:2575
+#, fuzzy, no-c-format
+msgid ""
+"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
+"\"forces\" Hibernate to specify the allowed discriminator values, even when "
+"retrieving all instances of the root class."
+msgstr ""
+"<literal>force</literal> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>) \"zwingt\" Hibernate dazu, die erlaubten "
+"Diskriminatorwerte beim Abruf aller Instanzen der Stammklasse zu "
+"spezifizieren."
+
+#. Tag: para
+#: basic_mapping.xml:2582
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"set this to <literal>false</literal> if your discriminator column is also "
+"part of a mapped composite identifier. It tells Hibernate not to include the "
+"column in SQL <literal>INSERTs</literal>."
+msgstr ""
+"<literal>insert</literal> (optional - die Standardeinstellung lautet "
+"<literal>true</literal>) wählen Sie hier die Einstellung <literal>false</"
+"literal>, falls Ihre Diskriminatortspalte auch Teil des zusammengesetzten "
+"Bezeichners ist. (Hibernate wird mitgeteilt, die Spalte nicht in SQL "
+"<literal>INSERT</literal>s mit einzuschließen)."
+
+#. Tag: para
+#: basic_mapping.xml:2590
+#, fuzzy, no-c-format
+msgid ""
+"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
+"executed when a type has to be evaluated. It allows content-based "
+"discrimination."
+msgstr ""
+"<literal>formula</literal> (optional) ein beliebiger SQL-Ausdruck, der "
+"ausgeführt wird, wenn ein Typ evaluiert werden muss. Erlaubt inhaltsbasierte "
+"Unterscheidung (sog. \"discrimination\")."
+
+#. Tag: para
+#: basic_mapping.xml:2597
+#, no-c-format
+msgid ""
+"Actual values of the discriminator column are specified by the "
+"<literal>discriminator-value</literal> attribute of the <literal><"
+"class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+"Die tatsächlichen Werte der Diskriminatorspalte werden durch das "
+"<literal>discriminator-value</literal>-Attribut der <literal><class></"
+"literal> und <literal><subclass></literal>-Elemente spezifiziert."
+
+#. Tag: para
+#: basic_mapping.xml:2602
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>force</literal> attribute is only useful if the table contains "
+"rows with \"extra\" discriminator values that are not mapped to a persistent "
+"class. This will not usually be the case."
+msgstr ""
+"Das <literal>force</literal>-Attribut ist (nur) von Nutzen, wenn die Tabelle "
+"eine Reihe mit \"zusätzlichen\" Diskriminatorwerten enthält, die nicht zu "
+"einer persistenten Klasse gemappt sind. Dies ist in der Regel jedoch nicht "
+"der Fall."
+
+#. Tag: para
+#: basic_mapping.xml:2607
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>formula</literal> attribute allows you to declare an arbitrary "
+"SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+"Mit dem <literal>formula</literal>-Attribut können Sie einen beliebigen SQL-"
+"Ausdruck deklarieren, der dann zur Evaluierung des Reihentyps verwendet wird:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, fuzzy, no-c-format
+msgid ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+msgstr ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, fuzzy, no-c-format
+msgid "Joined subclass strategy"
+msgstr "joined-subclass"
+
+#. Tag: para
+#: basic_mapping.xml:2618
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass can also be mapped to its own table. This is called the table-"
+"per-subclass mapping strategy. An inherited state is retrieved by joining "
+"with the table of the superclass. A discriminator column is not required for "
+"this mapping strategy. Each subclass must, however, declare a table column "
+"holding the object identifier. The primary key of this table is also a "
+"foreign key to the superclass table and described by the "
+"<classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></"
+"literal> element."
+msgstr ""
+"Alternativ kann jede Subklasse zu ihrer eigenen Tabelle gemappt werden (sog. "
+"\"Table-per-Subclass\" Mapping-Strategie). Der vererbte Status wird durch "
+"Verbindung mit der Tabelle der Superklasse abgerufen. Es wird das "
+"<literal><joined-subclass></literal>-Element verwendet."
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
+#, no-c-format
+msgid ""
+"@Entity @Table(name=\"CATS\")\n"
+"@Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Cat implements Serializable { \n"
+" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+" String getId() { return id; }\n"
+"\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+"public class DomesticCat extends Cat { \n"
+" public String getName() { return name; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2631
+#, no-c-format
+msgid ""
+"The table name still defaults to the non qualified class name. Also if "
+"<classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / "
+"foreign key columns are assumed to have the same names as the primary key "
+"columns of the primary table of the superclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2638
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><joined-subclass></literal> element. For "
+"example:"
+msgstr ""
+"Sie können unter Verwendung des <literal>class</literal>-Elements eine "
+"persistente Klasse deklarieren:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, fuzzy, no-c-format
+msgid ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+msgstr ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
+#, fuzzy, no-c-format
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr "<literal>table</literal>: Der Name der Subklassentabelle."
+
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
+#, fuzzy, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface to use "
+"for lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (optional): Bestimmt eine Klasse oder ein "
+"Interface, die/das für die Initialisierung von Proxies bei Bedarf (sog. "
+"\"lazy initializing proxies\") verwendet werden soll."
+
+#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
+#, fuzzy, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (optional, die Standardeinstellung lautet "
+"<literal>true</literal>): Die Einstellung <literal>lazy=\"false\"</literal> "
+"deaktiviert die Verwendung von \"Lazy Fetching\"."
+
+#. Tag: para
+#: basic_mapping.xml:2679
+#, no-c-format
+msgid ""
+"Use the <literal><key></literal> element to declare the primary key / "
+"foreign key column. The mapping at the start of the chapter would then be re-"
+"written as:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2692
+#, fuzzy, no-c-format
+msgid ""
+"A third option is to map only the concrete classes of an inheritance "
+"hierarchy to tables. This is called the table-per-concrete-class strategy. "
+"Each table defines all persistent states of the class, including the "
+"inherited state. In Hibernate, it is not necessary to explicitly map such "
+"inheritance hierarchies. You can map each class as a separate entity root. "
+"However, if you wish use polymorphic associations (e.g. an association to "
+"the superclass of your hierarchy), you need to use the union subclass "
+"mapping."
+msgstr ""
+"Eine dritte Möglichkeit besteht darin, nur die konkreten Klassen einer "
+"Vererbungshierarchie zu Tabellen zu mappen (sog. \"table-per-concrete-class"
+"\"-Strategie), bei der jede Tabelle jeden persistenten Status "
+"(einschließlich vererbter) definiert. In Hibernate ist es absolut nicht "
+"notwendig solche Vererbungshierarchien explizit zu mappen. Sie können "
+"einfach jede Klasse mit einer separaten <literal><class></literal>-"
+"Deklaration mappen. Falls Sie jedoch polymorphe Assoziationen verwenden "
+"wollen (z.B. eine Assoziation zur Superklasse Ihrer Hierarchie), so müssen "
+"Sie das <literal><union-subclass></literal>-Mapping verwenden."
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2703
+#, no-c-format
+msgid "Or in hbm.xml:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, fuzzy, no-c-format
+msgid ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+msgstr ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid ""
+"No discriminator column or key column is required for this mapping strategy."
+msgstr ""
+"Für diese Mapping-Strategie ist keine Diskriminatorspalte oder "
+"Schlüsselspalte erforderlich."
+
+#. Tag: title
+#: basic_mapping.xml:2751
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2753
+#, 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>@MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
+#, 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
+#: basic_mapping.xml:2768
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as <literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2773
+#, no-c-format
+msgid ""
+"The default access type (field or methods) is used, unless you use the "
+"<literal>@Access</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2778
+#, 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
+#: basic_mapping.xml:2786
+#, 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
+#: basic_mapping.xml:2792
+#, 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
+#: basic_mapping.xml:2797
+#, 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
+#: basic_mapping.xml:2801
+#, 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( \n"
+" name=\"propulsion\", \n"
+" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+")\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2803
+#, 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
+#: basic_mapping.xml:2809
+#, 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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid ""
+"In hbm.xml, simply map the properties of the superclass in the <literal><"
+"class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2821
+#, no-c-format
+msgid "Mapping one entity to several tables"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2823
+#, no-c-format
+msgid ""
+"While not recommended for a fresh schema, some legacy databases force your "
+"to map a single entity on several tables."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2826
+#, no-c-format
+msgid ""
+"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>@JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2834
+#, 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
+#: basic_mapping.xml:2844
+#, no-c-format
+msgid ""
+"There is also additional tuning accessible via the <classname>@org.hibernate."
+"annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, fuzzy, 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 <classname>SELECT</classname> 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> (optional - die Standardeinstellung lautet "
+"<literal>join</literal>): Falls im Standard auf <literal>join</literal> "
+"eingestellt, so verwendet Hibernate einen inneren Verbund (sog. \"inner join"
+"\"), um einen durch eine Klasse oder deren Superklasse definierten "
+"<literal><join></literal> und einen äußeren Verbund (sog. \"outer join"
+"\") für einen durch eine Subklasse definierten <literal><join></"
+"literal> abzurufen. Bei der Einstellung <literal>select</literal> verwendet "
+"Hibernate eine sequentielle Auswahl für einen an einer Subklasse definierten "
+"<literal><join></literal>, welcher nur herausgegeben wird, wenn "
+"festgestellt wird, dass eine Reihe eine Instanz der Subklasse repräsentiert. "
+"Innere Verbünde werden nach wie vor verwendet, um einen durch eine Klasse "
+"oder deren Superklasse definierten <literal><join></literal> abzurufen."
+
+#. Tag: para
+#: basic_mapping.xml:2862
+#, fuzzy, 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> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>): Falls aktiviert, wird Hibernate nicht versuchen, "
+"die durch diese Verknüpfung definierten Properties einzufügen oder zu "
+"aktualisieren."
+
+#. Tag: para
+#: basic_mapping.xml:2868
+#, fuzzy, 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> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>): Falls aktiviert, wird Hibernate nur dann eine "
+"Reihe einfügen, wenn die durch diese Verknüpfung definierten Properties "
+"ungleich Null sind. Es wird außerdem stets einen äußeren Verbund beim Abruf "
+"der Properties verwenden."
+
+#. Tag: para
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid ""
+"Make sure to use the secondary table name in the <methodname>appliesto</"
+"methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTable(name=\"Cat1\")\n"
+"@org.hibernate.annotations.Table(\n"
+" appliesTo=\"Cat1\",\n"
+" fetch=FetchMode.SELECT,\n"
+" optional=true)\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
+msgstr ""
+"Nehmen wir etwa das folgende <literal><properties></literal>-Mapping:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, fuzzy, no-c-format
+msgid ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+"\n"
+" <key ... />\n"
+"\n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+msgstr ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+" \n"
+" <key ... />\n"
+" \n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+
+#. Tag: para
+#: basic_mapping.xml:2907
+#, fuzzy, no-c-format
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr "<literal>table</literal>: Der Name der verbundenen Tabelle."
+
+#. Tag: para
+#: basic_mapping.xml:2924
+#, fuzzy, no-c-format
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
+"if set to <literal>join</literal>, the default, Hibernate will use an inner "
+"join to retrieve a <literal><join></literal> defined by a class or its "
+"superclasses. It will use an outer join for a <literal><join></"
+"literal> defined by a subclass. If set to <literal>select</literal> then "
+"Hibernate will use a sequential select for a <literal><join></literal> "
+"defined on a subclass. This will be issued only if a row represents an "
+"instance of the subclass. Inner joins will still be used to retrieve a "
+"<literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+"<literal>fetch</literal> (optional - die Standardeinstellung lautet "
+"<literal>join</literal>): Falls im Standard auf <literal>join</literal> "
+"eingestellt, so verwendet Hibernate einen inneren Verbund (sog. \"inner join"
+"\"), um einen durch eine Klasse oder deren Superklasse definierten "
+"<literal><join></literal> und einen äußeren Verbund (sog. \"outer join"
+"\") für einen durch eine Subklasse definierten <literal><join></"
+"literal> abzurufen. Bei der Einstellung <literal>select</literal> verwendet "
+"Hibernate eine sequentielle Auswahl für einen an einer Subklasse definierten "
+"<literal><join></literal>, welcher nur herausgegeben wird, wenn "
+"festgestellt wird, dass eine Reihe eine Instanz der Subklasse repräsentiert. "
+"Innere Verbünde werden nach wie vor verwendet, um einen durch eine Klasse "
+"oder deren Superklasse definierten <literal><join></literal> abzurufen."
+
+#. Tag: para
+#: basic_mapping.xml:2939
+#, fuzzy, no-c-format
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will not insert or update the properties "
+"defined by this join."
+msgstr ""
+"<literal>inverse</literal> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>): Falls aktiviert, wird Hibernate nicht versuchen, "
+"die durch diese Verknüpfung definierten Properties einzufügen oder zu "
+"aktualisieren."
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optional</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will insert a row only if the properties "
+"defined by this join are non-null. It will always use an outer join to "
+"retrieve the properties."
+msgstr ""
+"<literal>optional</literal> (optional - die Standardeinstellung lautet "
+"<literal>false</literal>): Falls aktiviert, wird Hibernate nur dann eine "
+"Reihe einfügen, wenn die durch diese Verknüpfung definierten Properties "
+"ungleich Null sind. Es wird außerdem stets einen äußeren Verbund beim Abruf "
+"der Properties verwenden."
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, fuzzy, no-c-format
+msgid ""
+"For example, address information for a person can be mapped to a separate "
+"table while preserving value type semantics for all properties:"
+msgstr ""
+"Die Adressinformationen einer Person können zum Beispiel zu einer separaten "
+"Tabelle gemappt werden (unter Berücksichtigung der Semantik der Wertetypen "
+"aller Properties):"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+msgstr ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, fuzzy, no-c-format
+msgid ""
+"This feature is often only useful for legacy data models. We recommend fewer "
+"tables than classes and a fine-grained domain model. However, it is useful "
+"for switching between inheritance mapping strategies in a single hierarchy, "
+"as explained later."
+msgstr ""
+"Dieses Feature ist bei Stammdatenmodellen oft sehr nützlich, wir empfehlen "
+"weniger Tabellen als Klassen sowie ein feinstufiges Domainmodell. Es ist "
+"jedoch von Nutzen, wenn zwischen Mapping-Strategien der Vererbung in einer "
+"einzelnen Hierarchie gewechselt wird. Wir gehen später noch näher darauf ein."
+
+#. Tag: title
+#: basic_mapping.xml:2967
+#, no-c-format
+msgid "Mapping one to one and one to many associations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2969
+#, no-c-format
+msgid ""
+"To link one entity to an other, you need to map the association property as "
+"a to one association. In the relational model, you can either use a foreign "
+"key or an association table, or (a bit less common) share the same primary "
+"key value between the two entities."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2974
+#, no-c-format
+msgid ""
+"To mark an association, use either <classname>@ManyToOne</classname> or "
+"<classname>@OnetoOne</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2978
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
+#, no-c-format
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than nothing will propagate certain operations to the "
+"associated object. The meaningful values are divided into three categories."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2992
+#, no-c-format
+msgid ""
+"basic operations, which include: <literal>persist, merge, delete, save-"
+"update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2998
+#, fuzzy, no-c-format
+msgid ""
+"special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+"Beachten Sie, wie Assoziationen nun unter Verwendung von <literal>entity-"
+"name</literal> statt <literal>class</literal> spezifiziert werden."
+
+#. Tag: para
+#: basic_mapping.xml:3003
+#, no-c-format
+msgid ""
+"comma-separated combinations of operation names: <literal>cascade=\"persist,"
+"merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. "
+"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
+"that single valued many-to-one associations do not support orphan delete."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3012
+#, no-c-format
+msgid ""
+"By default, single point associations are eagerly fetched in JPA 2. You can "
+"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
+"LAZY) </classname>in which case Hibernate will proxy the association and "
+"load it when the state of the associated entity is reached. You can force "
+"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</"
+"classname>. In this case, the property is fetched lazily when the instance "
+"variable is first accessed. This requires build-time bytecode "
+"instrumentation. lazy=\"false\" specifies that the association will always "
+"be eagerly fetched."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid ""
+"With the default JPA options, single-ended associations are loaded with a "
+"subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used "
+"for <literal>EAGER</literal> associations. You can however adjust the "
+"fetching strategy, ie how data is fetched by using <literal>@Fetch</"
+"literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a "
+"select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, fuzzy, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr "Assoziationen eines eindeutigen Fremdschlüssels"
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, fuzzy, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+"Eine \"One-to-One\"-Assoziation mit einer anderen persistenten Klasse wird "
+"unter Verwendung eines <literal>one-to-one</literal>-Elements deklariert."
+
+#. Tag: para
+#: basic_mapping.xml:3041
+#, no-c-format
+msgid ""
+"<classname>@ManyToOne</classname> if several entities can point to the the "
+"target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3046
+#, no-c-format
+msgid ""
+"<classname>@OneToOne</classname> if only a single entity can point to the "
+"the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3051
+#, no-c-format
+msgid ""
+"and a foreign key in one table is referencing the primary key column(s) of "
+"the target table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3056
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default value"
+"(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"targetEntity=CompanyImpl.class )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3066
+#, no-c-format
+msgid ""
+"You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing "
+"the target entity table (through <literal>@JoinTable.inverseJoinColumns</"
+"literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3077
+#, no-c-format
+msgid ""
+"You can use a SQL fragment to simulate a physical join column using the "
+"<classname>@JoinColumnOrFormula</classname> / "
+"<classname>@JoinColumnOrformulas</classname> annotations (just like you can "
+"use a SQL fragment to simulate a property column via the "
+"<classname>@Formula</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" @ManyToOne\n"
+" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+" public Person getOwner() {\n"
+" return person;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid ""
+"You can mark an association as mandatory by using the "
+"<literal>optional=false</literal> attribute. We recommend to use Bean "
+"Validation's <classname>@NotNull</classname> annotation as a better "
+"alternative however. As a consequence, the foreign key column(s) will be "
+"marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid ""
+"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. 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."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3100
+#, no-c-format
+msgid "@NotFound annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when "
+"a given entity is deleted. In this case Hibernate generates a cascade delete "
+"constraint at the database level."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name using "
+"<literal>@ForeignKey</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3120
+#, fuzzy, no-c-format
+msgid "@ForeignKey annotation"
+msgstr "Assoziationen eines eindeutigen Fremdschlüssels"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @ForeignKey(name=\"FK_PARENT\")\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3125
+#, no-c-format
+msgid ""
+"Sometimes, you want to link one entity to an other not by the target entity "
+"primary key but by a different unique key. You can achieve that by "
+"referencing the unique key column(s) in <methodname>@JoinColumn."
+"referenceColumnName</methodname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Person {\n"
+" @Id Integer personNumber;\n"
+" String firstName;\n"
+" @Column(name=\"I\")\n"
+" String initial;\n"
+" String lastName;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Home {\n"
+" @ManyToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+" })\n"
+" Person owner\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3132
+#, no-c-format
+msgid ""
+"This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3135
+#, no-c-format
+msgid ""
+"In hbm.xml, mapping an association is similar. The main difference is that a "
+"<classname>@OneToOne</classname> is mapped as <literal><many-to-one "
+"unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
+#, fuzzy, no-c-format
+msgid ""
"<literal>column</literal> (optional): the name of the foreign key column. "
"This can also be specified by nested <literal><column></literal> "
"element(s)."
@@ -2551,6 +7065,7 @@
"spezifiziert werden."
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, fuzzy, no-c-format
msgid ""
"<literal>class</literal> (optional - defaults to the property type "
@@ -2560,6 +7075,7 @@
"bestimmte Property-Typ): Der Name der assoziierten Klasse."
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, fuzzy, no-c-format
msgid ""
"<literal>cascade</literal> (optional): specifies which operations should be "
@@ -2569,6 +7085,7 @@
"übergeordneten Objekt an das assoziierte Objekt weitergegeben werden sollen."
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, fuzzy, no-c-format
msgid ""
"<literal>fetch</literal> (optional - defaults to <literal>select</literal>): "
@@ -2579,6 +7096,7 @@
"sequentiellem \"Select-Fetching\"."
#. Tag: para
+#: basic_mapping.xml:3209
#, fuzzy, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2598,6 +7116,7 @@
"initialisiert wird, möglich."
#. Tag: para
+#: basic_mapping.xml:3219
#, fuzzy, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2609,6 +7128,7 @@
"festgelegt, so wird der Primärschlüssel der assoziierten Klasse verwendet."
#. Tag: para
+#: basic_mapping.xml:3232
#, fuzzy, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2622,6 +7142,7 @@
"Assoziationsmultiplizität \"one-to-one\" effektiv."
#. Tag: para
+#: basic_mapping.xml:3240
#, fuzzy, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2631,6 +7152,7 @@
"\"Nullability\"-Bedingung für die Fremdschlüsselspalten."
#. Tag: para
+#: basic_mapping.xml:3254
#, fuzzy, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2651,6 +7173,7 @@
"assoziierten Objekten mit Verbundoperationen)."
#. Tag: para
+#: basic_mapping.xml:3264
#, fuzzy, no-c-format
msgid ""
"<literal>not-found</literal> (optional - defaults to <literal>exception</"
@@ -2664,6 +7187,7 @@
"Null-Assoziation angesehen."
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, fuzzy, no-c-format
msgid ""
"<literal>entity-name</literal> (optional): the entity name of the associated "
@@ -2673,6 +7197,7 @@
"Klasse."
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2682,6 +7207,7 @@
"einen <emphasis>errechneten</emphasis> Fremdschlüssel definiert."
#. Tag: para
+#: basic_mapping.xml:3284
#, fuzzy, no-c-format
msgid ""
"Setting a value of the <literal>cascade</literal> attribute to any "
@@ -2692,7 +7218,7 @@
"second, special values: <literal>delete-orphan</literal>; and third,"
"<literal>all</literal> comma-separated combinations of operation names: "
"<literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,"
-"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> "
+"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> "
"for a full explanation. Note that single valued, many-to-one and one-to-one, "
"associations do not support orphan delete."
msgstr ""
@@ -2710,6 +7236,7 @@
"\"Orphan Delete\" nicht unterstützen."
#. Tag: para
+#: basic_mapping.xml:3298
#, fuzzy, no-c-format
msgid ""
"Here is an example of a typical <literal>many-to-one</literal> declaration:"
@@ -2717,7 +7244,16 @@
"Eine typische <literal>many-to-one</literal>-Deklaration sieht so "
"unkompliziert wie die Folgende aus:"
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3303
#, fuzzy, no-c-format
msgid ""
"The <literal>property-ref</literal> attribute should only be used for "
@@ -2737,18 +7273,41 @@
"nicht der Primärschlüssel ist. (Das <literal>unique</literal>-Attribut "
"steuert Hibernates DDL-Generierung mittels dem SchemaExport-Tool)."
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+msgstr ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3313
#, no-c-format
msgid "Then the mapping for <literal>OrderItem</literal> might use:"
msgstr ""
"Dann könnte das Mapping für <literal>OrderItem</literal> folgendes verwenden:"
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3318
#, fuzzy, no-c-format
msgid "This is not encouraged, however."
msgstr "Allerdings wird dies nicht empfohlen."
#. Tag: para
+#: basic_mapping.xml:3320
#, no-c-format
msgid ""
"If the referenced unique key comprises multiple properties of the associated "
@@ -2761,6 +7320,7 @@
"gemappt werden."
#. Tag: para
+#: basic_mapping.xml:3324
#, fuzzy, no-c-format
msgid ""
"If the referenced unique key is the property of a component, you can specify "
@@ -2769,23 +7329,117 @@
"Falls der eindeutige Schlüssel, auf den verwiesen wird, die Property einer "
"Komponente ist, so können Sie einen Property-Pfad festlegen:"
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+msgstr ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+
#. Tag: title
+#: basic_mapping.xml:3331
+#, no-c-format
+msgid "Sharing the primary key with the associated entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3333
+#, no-c-format
+msgid ""
+"The second approach is to ensure an entity and its associated entity share "
+"the same primary key. In this case the primary key column is also a foreign "
+"key and there is no extra column. These associations are always one to one."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3339
#, fuzzy, no-c-format
-msgid "One-to-one"
-msgstr "one-to-one"
+msgid "One to One association"
+msgstr "Assoziationen eines eindeutigen Fremdschlüssels"
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @MapsId\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"} \n"
+"\n"
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
msgid ""
-"A one-to-one association to another persistent class is declared using a "
-"<literal>one-to-one</literal> element."
+"Many people got confused by these primary key based one to one associations. "
+"They can only be lazily loaded if Hibernate knows that the other side of the "
+"association is always present. To indicate to Hibernate that it is the case, "
+"use <classname>@OneToOne(optional=false)</classname>."
msgstr ""
-"Eine \"One-to-One\"-Assoziation mit einer anderen persistenten Klasse wird "
-"unter Verwendung eines <literal>one-to-one</literal>-Elements deklariert."
#. Tag: para
+#: basic_mapping.xml:3352
+#, no-c-format
+msgid "In hbm.xml, use the following mapping."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3377
#, fuzzy, no-c-format
msgid ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3397
+#, fuzzy, no-c-format
+msgid ""
"<literal>constrained</literal> (optional): specifies that a foreign key "
"constraint on the primary key of the mapped table and references the table "
"of the associated class. This option affects the order in which <literal>save"
@@ -2801,6 +7455,7 @@
"werden kann (wird auch vom Schema-Export-Tool verwendet)."
#. Tag: para
+#: basic_mapping.xml:3413
#, fuzzy, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2813,6 +7468,7 @@
"assoziierten Klasse verwendet."
#. Tag: para
+#: basic_mapping.xml:3426
#, fuzzy, no-c-format
msgid ""
"<literal>formula</literal> (optional): almost all one-to-one associations "
@@ -2829,6 +7485,7 @@
"literal>)."
#. Tag: para
+#: basic_mapping.xml:3435
#, fuzzy, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2854,22 +7511,8 @@
"anwendet!</emphasis>"
#. Tag: para
+#: basic_mapping.xml:3454
#, fuzzy, no-c-format
-msgid "There are two varieties of one-to-one associations:"
-msgstr "Es existieren zwei Arten von \"One-to-One\"-Assoziation:"
-
-#. Tag: para
-#, no-c-format
-msgid "primary key associations"
-msgstr "Assoziationen des Primärschlüssels"
-
-#. Tag: para
-#, no-c-format
-msgid "unique foreign key associations"
-msgstr "Assoziationen eines eindeutigen Fremdschlüssels"
-
-#. Tag: para
-#, fuzzy, no-c-format
msgid ""
"Primary key associations do not need an extra table column. If two rows are "
"related by the association, then the two table rows share the same primary "
@@ -2884,6 +7527,7 @@
"Bezeichnerwert zugeschrieben wird!"
#. Tag: para
+#: basic_mapping.xml:3460
#, fuzzy, no-c-format
msgid ""
"For a primary key association, add the following mappings to "
@@ -2893,7 +7537,22 @@
"zu <literal>Employee</literal> beziehungsweise <literal>Person</literal> "
"hinzu."
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3468
#, fuzzy, no-c-format
msgid ""
"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
@@ -2905,7 +7564,36 @@
"Strategie namens <literal>foreign</literal> für die Generierung des "
"Bezeichners durch Hibernate zum Einsatz:"
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:3474
#, fuzzy, no-c-format
msgid ""
"A newly saved instance of <literal>Person</literal> is assigned the same "
@@ -2917,41 +7605,23 @@
"literal>-Instanz, die mit der <literal>employee</literal>-Property dieser "
"<literal>Person</literal> referenziert ist."
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Alternatively, a foreign key with a unique constraint, from "
-"<literal>Employee</literal> to <literal>Person</literal>, can be expressed "
-"as:"
-msgstr ""
-"Alternativ kann ein Fremdschlüssel mit eindeutiger Bedingung von "
-"<literal>Employee</literal> zu <literal>Person</literal> wie folgt "
-"ausgedrückt werden:"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"This association can be made bidirectional by adding the following to the "
-"<literal>Person</literal> mapping:"
-msgstr ""
-"Und diese Assoziation kann durch Hinzufügen des Folgenden zum "
-"<literal>Person</literal>-Mapping bidirektional gemacht werden:"
-
#. Tag: title
+#: basic_mapping.xml:3482
#, fuzzy, no-c-format
msgid "Natural-id"
msgstr "natural-id"
#. Tag: para
+#: basic_mapping.xml:3484
#, fuzzy, no-c-format
msgid ""
"Although we recommend the use of surrogate keys as primary keys, you should "
"try to identify natural keys for all entities. A natural key is a property "
"or combination of properties that is unique and non-null. It is also "
-"immutable. Map the properties of the natural key inside the <literal><"
-"natural-id></literal> element. Hibernate will generate the necessary "
-"unique key and nullability constraints and, as a result, your mapping will "
-"be more self-documenting."
+"immutable. Map the properties of the natural key as <classname>@NaturalId</"
+"classname> or map them inside the <literal><natural-id></literal> "
+"element. Hibernate will generate the necessary unique key and nullability "
+"constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
"Obwohl wir die Verwendung von Surrogatschlüsseln als Primärschlüssel "
"empfehlen, sollten Sie nach wie vor versuchen natürliche Schlüssel für alle "
@@ -2962,9 +7632,62 @@
"Elements. Hibernate generiert den nötigen eindeutigen Schlüssel sowie "
"\"Nullability\"-Bedingungen, und Ihr Mapping wird selbst-dokumentierender."
+#. Tag: programlisting
+#: basic_mapping.xml:3493
+#, 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
+#: basic_mapping.xml:3495
+#, no-c-format
+msgid "Or in XML,"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3497
#, fuzzy, no-c-format
msgid ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+msgstr ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+
+#. Tag: para
+#: basic_mapping.xml:3499
+#, fuzzy, no-c-format
+msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
"<literal>hashCode()</literal> to compare the natural key properties of the "
"entity."
@@ -2974,6 +7697,7 @@
"Schlüssels der Entity zu vergleichen."
#. Tag: para
+#: basic_mapping.xml:3503
#, fuzzy, no-c-format
msgid ""
"This mapping is not intended for use with entities that have natural primary "
@@ -2983,6 +7707,7 @@
"Primärschlüsseln vorgesehen."
#. Tag: para
+#: basic_mapping.xml:3508
#, fuzzy, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>false</"
@@ -2995,128 +7720,228 @@
"(konstant) sind."
#. Tag: title
+#: basic_mapping.xml:3516
#, fuzzy, no-c-format
-msgid "Component and dynamic-component"
-msgstr "component, dynamic-component"
+msgid "<title>Any</title>"
+msgstr "<title>any</title>"
#. Tag: para
+#: basic_mapping.xml:3518
#, fuzzy, no-c-format
msgid ""
-"The <literal><component></literal> element maps properties of a child "
-"object to columns of the table of a parent class. Components can, in turn, "
-"declare their own properties, components or collections. See the \"Component"
-"\" examples below:"
+"There is one more type of property mapping. The <classname>@Any</classname> "
+"mapping defines a polymorphic association to classes from multiple tables. "
+"This type of mapping requires more than one column. The first column "
+"contains the type of the associated entity. The remaining columns contain "
+"the identifier. It is impossible to specify a foreign key constraint for "
+"this kind of association. This is not the usual way of mapping polymorphic "
+"associations and you should use this only in special cases. For example, for "
+"audit logs, user session data, etc."
msgstr ""
-"Das <literal><component></literal>-Element mappt die Properties eines "
-"untergeordneten Objekts zu den Spalten der Tabelle der übergeordneten "
-"Klasse. Komponenten wiederum können ihre eigenen Properties, Komponenten "
-"oder \"Collections\" deklarieren. Siehe \"Komponenten\" unten."
+"Es gibt noch einen weiteren Typ von Property-Mapping. Das <literal><"
+"any></literal> Mapping-Element definiert eine polymorphe Assoziation zu "
+"Klassen mehrerer Tabellen. Diese Art von Mapping erfordert immer mehr als "
+"eine Spalte. Die erste Spalte enthält den Typ der zugehörigen Entity. Die "
+"übrigen Spalten enthalten den Bezeichner. Es ist unmöglich, eine Bedingung "
+"für den Fremdschlüssel für diese Art von Assoziation festzulegen, daher ist "
+"dies nicht als reguläre Art des Mappings (polymorpher) Assoziationen "
+"gedacht. Sie sollten diesen Typ von Mapping nur in ganz besonderen Fällen "
+"anwenden (z.B. für Überprüfungsprotokolle, Daten der Benutzersession usw.)."
#. Tag: para
+#: basic_mapping.xml:3528
#, fuzzy, no-c-format
msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the name of the component (child) class."
+"The <classname>@Any</classname> 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. The <literal>metaType</"
+"literal> attribute allows the application to specify a custom type that maps "
+"database column values to persistent classes that have identifier properties "
+"of the type specified by <literal>idType</literal>. You must specify the "
+"mapping from values of the <literal>metaType</literal> to class names."
msgstr ""
-"<literal>class</literal> (optional - Standardeinstellung ist der durch "
-"Reflexion bestimmte Property-Typ): Der Name der (untergeordneten) "
-"Komponentenklasse."
+"Das <literal>meta-type</literal>-Attribut ermöglicht es der Anwendung einen "
+"anwenderdefinierten Typ festzulegen, der die Werte der Datenbankspalte zu "
+"persistenten Klassen mit durch <literal>id-type</literal> bestimmte "
+"Bezeichner-Properties mappt. Das Mapping muss aus Werten des Meta-Typs zu "
+"Klassennamen bestimmt werden."
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:3538
+#, no-c-format
msgid ""
-"<literal>insert</literal>: do the mapped columns appear in SQL "
-"<literal>INSERTs</literal>?"
+"@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 ""
-"<literal>insert</literal>: Erscheinen die gemappten Spalten in SQL "
-"<literal>INSERT</literal>s?"
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:3540
+#, no-c-format
msgid ""
-"<literal>update</literal>: do the mapped columns appear in SQL "
-"<literal>UPDATEs</literal>?"
+"Note that <classname>@AnyDef</classname> can be mutualized and reused. It is "
+"recommended to place it as a package metadata in this case."
msgstr ""
-"<literal>update</literal>: Erscheinen die gemappten Spalten in SQL "
-"<literal>UPDATE</literal>s?"
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:3544
+#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that this component should be fetched lazily when the instance "
-"variable is first accessed. It requires build-time bytecode instrumentation."
+"//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 ""
-"<literal>lazy</literal> (optional - die Standardeinstellung lautet "
-"<literal>false</literal>): Legt fest, dass für diese Komponente \"lazy "
-"Fetching\" gilt, wenn erstmals auf die Instanzvariable zugegriffen wird "
-"(erfordert Build-time Bytecode Instrumentierung)."
#. Tag: para
+#: basic_mapping.xml:3546
+#, no-c-format
+msgid "The hbm.xml equivalent is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3548
#, fuzzy, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this component either do or do not "
-"require acquisition of the optimistic lock. It determines if a version "
-"increment should occur when this property is dirty."
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
msgstr ""
-"<literal>optimistic-lock</literal> (optional - die Standardeinstellung "
-"lautet <literal>true</literal>): Legt fest, ob Aktualisierungen dieser "
-"Komponente die Erfassung einer optimistischen Sperre benötigen oder nicht. "
-"Mit anderen Worten, es wird bestimmt, ob eine Erhöhung der Version "
-"stattfinden soll, wenn die Inhalte dieser Property sich verändert haben (man "
-"sagt sie sein dann \"dirty\")."
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
#. Tag: para
+#: basic_mapping.xml:3551
+#, no-c-format
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3570
#, fuzzy, no-c-format
msgid ""
-"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that a unique constraint exists upon all mapped columns of the "
-"component."
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
msgstr ""
-"<literal>unique</literal> (optional - die Standardeinstellung lautet "
-"<literal>false</literal>): Bestimmt, dass eine eindeutige Bedingung an allen "
-"gemappten Spalten der Komponente existiert."
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
#. Tag: para
+#: basic_mapping.xml:3574
#, no-c-format
+msgid "<literal>name</literal>: the property name."
+msgstr "<literal>name</literal>: Der Property-Name."
+
+#. Tag: para
+#: basic_mapping.xml:3578
+#, no-c-format
+msgid "<literal>id-type</literal>: the identifier type."
+msgstr "<literal>id-type</literal>: Der Bezeichnertyp."
+
+#. Tag: para
+#: basic_mapping.xml:3582
+#, fuzzy, no-c-format
msgid ""
-"The child <literal><property></literal> tags map properties of the "
-"child class to table columns."
+"<literal>meta-type</literal> (optional - defaults to <literal>string</"
+"literal>): any type that is allowed for a discriminator mapping."
msgstr ""
-"Die untergeordneten <literal><property></literal>-Tags mappen "
-"Properties der untergeordneten Klasse zu den Spalten der Tabelle."
+"<literal>meta-type</literal> (optional - die Standardeinstellung lautet "
+"<literal>string</literal>): Jeder Typ, der für ein Diskriminator-Mapping "
+"gestattet ist."
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
msgid ""
-"The <literal><component></literal> element allows a <literal><"
-"parent></literal> subelement that maps a property of the component class "
-"as a reference back to the containing entity."
+"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
+"the cascade style."
msgstr ""
-"Das <literal><component></literal>-Element ermöglicht ein <literal><"
-"parent></literal>-Subelement, das eine Property der Komponentenklasse als "
-"Rückreferenz zur enthaltenden Entity mappt."
+"<literal>cascade</literal> (optional- die Standardeinstellung lautet "
+"<literal>none</literal>): der \"Cascade-Style\" (Weitergabestil)."
#. Tag: para
+#: basic_mapping.xml:3599
#, fuzzy, no-c-format
msgid ""
-"The <literal><dynamic-component></literal> element allows a "
-"<literal>Map</literal> to be mapped as a component, where the property names "
-"refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for "
-"more information."
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property either do or do not "
+"require acquisition of the optimistic lock. It defines whether a version "
+"increment should occur if this property is dirty."
msgstr ""
-"Das <literal><dynamic-component></literal>-Element erlaubt es einer "
-"<literal>Map</literal> als Komponente gemappt zu werden, wenn die Namen der "
-"Properties auf Schlüssel der Map verweisen, siehe <xref linkend=\"components-"
-"dynamic\"/>."
+"<literal>optimistic-lock</literal> (optional - die Standardeinstellung "
+"lautet <literal>true</literal>): Legt fest, ob Aktualisierungen dieser "
+"Property die Erfassung einer optimistischen Sperre benötigen oder nicht. Mit "
+"anderen Worten, es wird bestimmt ob eine Erhöhung der Version stattfinden "
+"soll, wenn die Inhalte dieser Property sich verändert haben."
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
msgid "Properties"
msgstr "Properties"
#. Tag: para
+#: basic_mapping.xml:3612
#, fuzzy, no-c-format
msgid ""
"The <literal><properties></literal> element allows the definition of a "
@@ -3132,7 +7957,38 @@
"bietet außerdem eine gute Möglichkeit, eine eindeutige Mehrspalten-Bedingung "
"zu definieren."
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, fuzzy, no-c-format
+msgid ""
+"<properties\n"
+" name=\"logicalName\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+msgstr ""
+"<properties \n"
+" name=\"logicalName\" \n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+" \n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+
#. Tag: para
+#: basic_mapping.xml:3636
#, fuzzy, no-c-format
msgid ""
"<literal>name</literal>: the logical name of the grouping. It is "
@@ -3142,6 +7998,7 @@
"emphasis> tatsächlicher Property-Name."
#. Tag: para
+#: basic_mapping.xml:3651
#, fuzzy, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -3157,6 +8014,7 @@
"(man sagt sie seien dann \"dirty\")."
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
msgid ""
"For example, if we have the following <literal><properties></literal> "
@@ -3164,7 +8022,35 @@
msgstr ""
"Nehmen wir etwa das folgende <literal><properties></literal>-Mapping:"
+#. Tag: programlisting
+#: basic_mapping.xml:3669
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+"\n"
+" ...\n"
+" <properties name=\"name\"\n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+" ...\n"
+" <properties name=\"name\" \n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:3671
#, fuzzy, no-c-format
msgid ""
"You might have some legacy data association that refers to this unique key "
@@ -3174,7 +8060,35 @@
"Schlüssel der <literal>Person</literal>-Tabelle verweist, statt auf den "
"Primärschlüssel:"
+#. Tag: programlisting
+#: basic_mapping.xml:3675
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"owner\"\n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+msgstr ""
+"<many-to-one name=\"person\" \n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+
#. Tag: para
+#: basic_mapping.xml:3678
+#, no-c-format
+msgid ""
+"When using annotations as a mapping strategy, such construct is not "
+"necessary as the binding between a column and its related column on the "
+"associated table is done directly"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3685
#, fuzzy, no-c-format
msgid ""
"The use of this outside the context of mapping legacy data is not "
@@ -3184,279 +8098,299 @@
"jedoch nicht empfohlen."
#. Tag: title
-#, fuzzy, no-c-format
-msgid "Subclass"
-msgstr "subclass"
+#: basic_mapping.xml:3690
+#, no-c-format
+msgid "Some hbm.xml specificities"
+msgstr ""
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:3692
+#, no-c-format
msgid ""
-"Polymorphic persistence requires the declaration of each subclass of the "
-"root persistent class. For the table-per-class-hierarchy mapping strategy, "
-"the <literal><subclass></literal> declaration is used. For example:"
+"The hbm.xml structure has some specificities naturally not present when "
+"using annotations, let's describe them briefly."
msgstr ""
-"Schließlich erfordert die polymorphe Persistenz die Deklaration jeder "
-"Subklasse der persistenten Stammklasse. Für die Tabelle-pro-Klasse-"
-"Hierarchie (sog. \"table-per-class-hierarchy\") Mapping-Strategie wird die "
-"<literal><subclass></literal>-Deklaration verwendet."
+#. Tag: title
+#: basic_mapping.xml:3696
+#, no-c-format
+msgid "Doctype"
+msgstr "Doctype"
+
#. Tag: para
+#: basic_mapping.xml:3698
#, fuzzy, no-c-format
msgid ""
-"<literal>name</literal>: the fully qualified class name of the subclass."
-msgstr "<literal>name</literal>: Der vollständige Klassenname der Subklasse."
+"All XML mappings should declare the doctype shown. The actual DTD can be "
+"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
+"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
+"will always look for the DTD in its classpath first. If you experience "
+"lookups of the DTD using an Internet connection, check the DTD declaration "
+"against the contents of your classpath."
+msgstr ""
+"Alle XML-Mappings sollten den gezeigten doctype deklarieren. Die "
+"tatsächliche Dokumenttyp-Definition (\"DTD\") kann in der URL oben, im "
+"Verzeichnis <literal>hibernate-x.x.x/src/org/hibernate </literal> oder in "
+"<literal>hibernate3.jar</literal> gefunden werden. Hibernate wird stets "
+"zuerst in seinem Klassenpfad nach der DTD suchen. Falls es bei Ihnen zu "
+"Suchläufen der DTD mittels einer Internetverbindung kommt, überprüfen Sie "
+"Ihre DTD-Deklaration hinsichtlich der Inhalte Ihres Klassenpfads."
+#. Tag: title
+#: basic_mapping.xml:3707
+#, no-c-format
+msgid "EntityResolver"
+msgstr "EntityResolver"
+
#. Tag: para
+#: basic_mapping.xml:3709
#, fuzzy, no-c-format
msgid ""
-"<literal>discriminator-value</literal> (optional - defaults to the class "
-"name): a value that distinguishes individual subclasses."
+"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
+"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
+"implementation with the SAXReader it uses to read in the xml files. This "
+"custom <literal>EntityResolver</literal> recognizes two different systemId "
+"namespaces:"
msgstr ""
-"<literal>discriminator-value</literal> (optional - die Standardeinstellung "
-"ist der Klassenname): Ein Wert, der einzelne Subklassen unterscheidet."
+"Wie bereits erwähnt, wird Hibernate zuerst versuchen, DTDs in seinem "
+"Klassenpfad aufzulösen. Dies geschieht, indem eine anwenderdefinierte "
+"<literal>org.xml.sax.EntityResolver</literal>-Implementierung mit dem "
+"SAXReader, der zum Lesen der xml-Dateien verwendet wird, registriert wird. "
+"Dieser anwenderorientierte <literal>EntityResolver</literal> erkennt zwei "
+"verschiedene \"systemId\"-Namensräume."
#. Tag: para
+#: basic_mapping.xml:3718
#, fuzzy, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface used for "
-"lazy initializing proxies."
+"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
+"encounters a systemId starting with <literal>http://hibernate.sourceforge."
+"net/</literal>. The resolver attempts to resolve these entities via the "
+"classloader which loaded the Hibernate classes."
msgstr ""
-"<literal>proxy</literal> (optional): Bestimmt eine Klasse oder ein "
-"Interface, die/das für die Initialisierung von Proxies bei Bedarf (sog. "
-"\"lazy initializing proxies\") verwendet werden soll."
+"ein <literal>hibernate namespace</literal> wird erkannt, sobald der "
+"\"Resolver\" (Auflöser) einer mit <literal>http://hibernate.sourceforge.net/"
+"</literal> beginnenden systemId begegnet. Der Resolver versucht diese "
+"Entities über den Klassenlader (sog. \"Classloader\"), der die Hibernate-"
+"Klassen geladen hat, aufzulösen."
#. Tag: para
+#: basic_mapping.xml:3726
#, fuzzy, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"a <literal>user namespace</literal> is recognized whenever the resolver "
+"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
+"The resolver will attempt to resolve these entities via (1) the current "
+"thread context classloader and (2) the classloader which loaded the "
+"Hibernate classes."
msgstr ""
-"<literal>lazy</literal> (optional, die Standardeinstellung lautet "
-"<literal>true</literal>): Die Einstellung <literal>lazy=\"false\"</literal> "
-"deaktiviert die Verwendung von \"Lazy Fetching\"."
+"ein <literal>user namespace</literal> wird erkannt, sobald der Resolver "
+"einem <literal>classpath://</literal> URL-Protokoll verwendenden systemId "
+"begegnet. Der Resolver wird versuchen, diese Entities über (1) den aktuellen "
+"Thread-Kontext-Klassenlader und (2) den Klassenlader, der die Hibernate-"
+"Klassen geladen hat, aufzulösen."
#. Tag: para
+#: basic_mapping.xml:3735
#, fuzzy, no-c-format
+msgid "The following is an example of utilizing user namespacing:"
+msgstr "Ein Beispiel der Verwendung des Benutzer-Namespacing:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3738
+#, no-c-format
msgid ""
-"Each subclass declares its own persistent properties and subclasses. "
-"<literal><version></literal> and <literal><id></literal> "
-"properties are assumed to be inherited from the root class. Each subclass in "
-"a hierarchy must define a unique <literal>discriminator-value</literal>. If "
-"this is not specified, the fully qualified Java class name is used."
+"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
msgstr ""
-"Jede Subklasse sollte ihre eigenen persistenten Properties und Subklassen "
-"deklarieren. Die <literal><version></literal> und <literal><id></"
-"literal>-Properties werden als von der Stammklasse vererbt vorausgesetzt. "
-"Jede Subklasse einer Hierarchie muss einen eindeutigen "
-"<literal>discriminator-value</literal> definieren. Ist keiner festgelegt, so "
-"wird der vollständige Java Klassenname verwendet."
#. Tag: para
+#: basic_mapping.xml:3740
#, fuzzy, no-c-format
msgid ""
-"For information about inheritance mappings see <xref linkend=\"inheritance"
-"\" />."
+"Where <literal>types.xml</literal> is a resource in the <literal>your."
+"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
+"custom\">typedef</link>."
msgstr ""
-"Informationen zu Vererbungsmappings (\"sog. \"inheritance mappings\") finden "
-"Sie unter <xref linkend=\"inheritance\"/>."
+"Wo <literal>types.xml</literal> eine Ressource in im <literal>your.domain</"
+"literal> Paket ist und eine anwenderdefinierte <xref linkend=\"mapping-types-"
+"custom\"/>-Typedef enthält."
#. Tag: title
+#: basic_mapping.xml:3747
#, fuzzy, no-c-format
-msgid "Joined-subclass"
-msgstr "joined-subclass"
+msgid "Hibernate-mapping"
+msgstr "hibernate-mapping"
#. Tag: para
+#: basic_mapping.xml:3749
#, fuzzy, no-c-format
msgid ""
-"Each subclass can also be mapped to its own table. This is called the table-"
-"per-subclass mapping strategy. An inherited state is retrieved by joining "
-"with the table of the superclass. To do this you use the <literal><joined-"
-"subclass></literal> element. For example:"
+"This element has several optional attributes. The <literal>schema</literal> "
+"and <literal>catalog</literal> attributes specify that tables referred to in "
+"this mapping belong to the named schema and/or catalog. If they are "
+"specified, tablenames will be qualified by the given schema and catalog "
+"names. If they are missing, tablenames will be unqualified. The "
+"<literal>default-cascade</literal> attribute specifies what cascade style "
+"should be assumed for properties and collections that do not specify a "
+"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
+"literal> attribute allows you to use unqualified class names in the query "
+"language."
msgstr ""
-"Alternativ kann jede Subklasse zu ihrer eigenen Tabelle gemappt werden (sog. "
-"\"Table-per-Subclass\" Mapping-Strategie). Der vererbte Status wird durch "
-"Verbindung mit der Tabelle der Superklasse abgerufen. Es wird das "
-"<literal><joined-subclass></literal>-Element verwendet."
+"Dieses Element besitzt mehrere optionale Attribute. Die <literal>schema</"
+"literal> und <literal>catalog</literal>-Attribute spezifizieren, dass die in "
+"diesem Mapping aufgeführten Tabellen zum genannten Schema und/oder Katalog "
+"gehören. Falls bestimmt, werden Tabellennamen durch die gegebenen Schema- "
+"und Katalognamen definiert. Falls nicht vorhanden, so bleiben die "
+"Tabellennamen undefiniert. Das <literal>default-cascade</literal>-Attribut "
+"bestimmt, welcher Weitergabestil (sog. \"Cascade-Style\" für Properties und "
+"Collections angenommen werden sollte, die kein <literal>cascade</literal>-"
+"Attribut spezifizieren. Das <literal>auto-import</literal>-Attribut erlaubt "
+"die Verwendung undefinierter Klassennamen in der Abfragensprache in der "
+"Standardeinstellung."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3778
#, fuzzy, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
-msgstr "<literal>table</literal>: Der Name der Subklassentabelle."
-
-#. Tag: para
-#, fuzzy, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface to use "
-"for lazy initializing proxies."
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
msgstr ""
-"<literal>proxy</literal> (optional): Bestimmt eine Klasse oder ein "
-"Interface, die/das für die Initialisierung von Proxies bei Bedarf (sog. "
-"\"lazy initializing proxies\") verwendet werden soll."
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
#. Tag: para
+#: basic_mapping.xml:3782
#, fuzzy, no-c-format
-msgid ""
-"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
-msgstr ""
-"<literal>lazy</literal> (optional, die Standardeinstellung lautet "
-"<literal>true</literal>): Die Einstellung <literal>lazy=\"false\"</literal> "
-"deaktiviert die Verwendung von \"Lazy Fetching\"."
+msgid "<literal>schema</literal> (optional): the name of a database schema."
+msgstr "<literal>schema</literal> (optional): Der Name eines Datenbankschemas."
#. Tag: para
+#: basic_mapping.xml:3787
#, fuzzy, no-c-format
-msgid ""
-"A discriminator column is not required for this mapping strategy. Each "
-"subclass must, however, declare a table column holding the object identifier "
-"using the <literal><key></literal> element. The mapping at the start "
-"of the chapter would then be re-written as:"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
msgstr ""
-"Bei dieser Mapping-Strategie ist keine Diskriminatortabelle erforderlich. "
-"Jede Subklasse muss jedoch unter Verwendung des <literal><key></"
-"literal>-Elements eine Tabellenspalte deklarieren, die den Objektbezeichner "
-"enthält. Das Mapping vom Kapitelbeginn würde dann wie folgt umgeschrieben:"
+"<literal>catalog</literal> (optional): Der Name eines Datenbankkatalogs."
-#. Tag: title
-#, fuzzy, no-c-format
-msgid "Union-subclass"
-msgstr "union-subclass"
-
#. Tag: para
+#: basic_mapping.xml:3792
#, fuzzy, no-c-format
msgid ""
-"A third option is to map only the concrete classes of an inheritance "
-"hierarchy to tables. This is called the table-per-concrete-class strategy. "
-"Each table defines all persistent states of the class, including the "
-"inherited state. In Hibernate, it is not necessary to explicitly map such "
-"inheritance hierarchies. You can map each class with a separate <literal><"
-"class></literal> declaration. However, if you wish use polymorphic "
-"associations (e.g. an association to the superclass of your hierarchy), you "
-"need to use the <literal><union-subclass></literal> mapping. For "
-"example:"
+"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
+"literal>): a default cascade style."
msgstr ""
-"Eine dritte Möglichkeit besteht darin, nur die konkreten Klassen einer "
-"Vererbungshierarchie zu Tabellen zu mappen (sog. \"table-per-concrete-class"
-"\"-Strategie), bei der jede Tabelle jeden persistenten Status "
-"(einschließlich vererbter) definiert. In Hibernate ist es absolut nicht "
-"notwendig solche Vererbungshierarchien explizit zu mappen. Sie können "
-"einfach jede Klasse mit einer separaten <literal><class></literal>-"
-"Deklaration mappen. Falls Sie jedoch polymorphe Assoziationen verwenden "
-"wollen (z.B. eine Assoziation zur Superklasse Ihrer Hierarchie), so müssen "
-"Sie das <literal><union-subclass></literal>-Mapping verwenden."
+"<literal>default-cascade</literal> (optional - die Standardeinstellung "
+"lautet <literal>none</literal>): Ein standardmäßiger Weitergabestil "
+"(\"Cascade-Style\")."
#. Tag: para
-#, no-c-format
-msgid ""
-"No discriminator column or key column is required for this mapping strategy."
-msgstr ""
-"Für diese Mapping-Strategie ist keine Diskriminatorspalte oder "
-"Schlüsselspalte erforderlich."
-
-#. Tag: title
+#: basic_mapping.xml:3797
#, fuzzy, no-c-format
-msgid "Join"
-msgstr "join"
-
-#. Tag: para
-#, fuzzy, no-c-format
msgid ""
-"Using the <literal><join></literal> element, it is possible to map "
-"properties of one class to several tables that have a one-to-one "
-"relationship. For example:"
+"<literal>default-access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing all properties. "
+"It can be a custom implementation of <literal>PropertyAccessor</literal>."
msgstr ""
-"Mittels des <literal><join></literal>-Elements können Properties einer "
-"Klasse zu mehreren Tabellen gemappt werden, wenn eine 1-zu-1 Beziehung "
-"zwischen den Tabellen besteht."
+"<literal>default-access</literal> (optional - der Standard ist "
+"<literal>property</literal>): Die Strategie, die Hibernate für den Zugriff "
+"auf alle Properties benutzen sollte. Kann eine anwenderdefinierte "
+"Implementierung von <literal>PropertyAccessor</literal> sein."
#. Tag: para
+#: basic_mapping.xml:3804
#, fuzzy, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
-msgstr "<literal>table</literal>: Der Name der verbundenen Tabelle."
-
-#. Tag: para
-#, fuzzy, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"if set to <literal>join</literal>, the default, Hibernate will use an inner "
-"join to retrieve a <literal><join></literal> defined by a class or its "
-"superclasses. It will use an outer join for a <literal><join></"
-"literal> defined by a subclass. If set to <literal>select</literal> then "
-"Hibernate will use a sequential select for a <literal><join></literal> "
-"defined on a subclass. This will be issued only if a row represents an "
-"instance of the subclass. Inner joins will still be used to retrieve a "
-"<literal><join></literal> defined by the class and its superclasses."
+"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
+"literal>): the default value for unspecified <literal>lazy</literal> "
+"attributes of class and collection mappings."
msgstr ""
-"<literal>fetch</literal> (optional - die Standardeinstellung lautet "
-"<literal>join</literal>): Falls im Standard auf <literal>join</literal> "
-"eingestellt, so verwendet Hibernate einen inneren Verbund (sog. \"inner join"
-"\"), um einen durch eine Klasse oder deren Superklasse definierten "
-"<literal><join></literal> und einen äußeren Verbund (sog. \"outer join"
-"\") für einen durch eine Subklasse definierten <literal><join></"
-"literal> abzurufen. Bei der Einstellung <literal>select</literal> verwendet "
-"Hibernate eine sequentielle Auswahl für einen an einer Subklasse definierten "
-"<literal><join></literal>, welcher nur herausgegeben wird, wenn "
-"festgestellt wird, dass eine Reihe eine Instanz der Subklasse repräsentiert. "
-"Innere Verbünde werden nach wie vor verwendet, um einen durch eine Klasse "
-"oder deren Superklasse definierten <literal><join></literal> abzurufen."
+"<literal>default-lazy</literal> (optional - die Standardeinstellung lautet "
+"<literal>true</literal>): Der Standardwert für nicht spezifizierte "
+"<literal>lazy</literal> Attribute von Klassen- und Collection-Mappings."
#. Tag: para
+#: basic_mapping.xml:3811
#, fuzzy, no-c-format
msgid ""
-"<literal>inverse</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will not insert or update the properties "
-"defined by this join."
+"<literal>auto-import</literal> (optional - defaults to <literal>true</"
+"literal>): specifies whether we can use unqualified class names of classes "
+"in this mapping in the query language."
msgstr ""
-"<literal>inverse</literal> (optional - die Standardeinstellung lautet "
-"<literal>false</literal>): Falls aktiviert, wird Hibernate nicht versuchen, "
-"die durch diese Verknüpfung definierten Properties einzufügen oder zu "
-"aktualisieren."
+"<literal>auto-import</literal> (optional - die Standardeinstellung lautet "
+"<literal>true</literal>): Legt fest, ob in der Abfragensprache ein "
+"undefinierter Klassenname verwendet werden kann (von Klassen in diesem "
+"Mapping)."
#. Tag: para
+#: basic_mapping.xml:3818
#, fuzzy, no-c-format
msgid ""
-"<literal>optional</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will insert a row only if the properties "
-"defined by this join are non-null. It will always use an outer join to "
-"retrieve the properties."
+"<literal>package</literal> (optional): specifies a package prefix to use for "
+"unqualified class names in the mapping document."
msgstr ""
-"<literal>optional</literal> (optional - die Standardeinstellung lautet "
-"<literal>false</literal>): Falls aktiviert, wird Hibernate nur dann eine "
-"Reihe einfügen, wenn die durch diese Verknüpfung definierten Properties "
-"ungleich Null sind. Es wird außerdem stets einen äußeren Verbund beim Abruf "
-"der Properties verwenden."
+"<literal>package</literal> (optional): Spezifiziert einen Paket-Präfix, der "
+"für undefinierte Klassennamen im Mapping-Dokument angenommen werden soll."
#. Tag: para
+#: basic_mapping.xml:3825
#, fuzzy, no-c-format
msgid ""
-"For example, address information for a person can be mapped to a separate "
-"table while preserving value type semantics for all properties:"
+"If you have two persistent classes with the same unqualified name, you "
+"should set <literal>auto-import=\"false\"</literal>. An exception will "
+"result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
-"Die Adressinformationen einer Person können zum Beispiel zu einer separaten "
-"Tabelle gemappt werden (unter Berücksichtigung der Semantik der Wertetypen "
-"aller Properties):"
+"Falls Sie zwei persistente Klassen mit demselben (undefinierten) Namen "
+"besitzen, sollten Sie die Einstellung <literal>auto-import=\"false\"</"
+"literal> vornehmen. Hibernate wird eine Ausnahme melden, wenn Sie versuchen, "
+"zwei Klassen demselben \"importierten\" Namen zuzuordnen."
#. Tag: para
+#: basic_mapping.xml:3830
#, fuzzy, no-c-format
msgid ""
-"This feature is often only useful for legacy data models. We recommend fewer "
-"tables than classes and a fine-grained domain model. However, it is useful "
-"for switching between inheritance mapping strategies in a single hierarchy, "
-"as explained later."
+"The <literal>hibernate-mapping</literal> element allows you to nest several "
+"persistent <literal><class></literal> mappings, as shown above. It is, "
+"however, good practice (and expected by some tools) to map only a single "
+"persistent class, or a single class hierarchy, in one mapping file and name "
+"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
+"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
+"<literal>Animal.hbm.xml</literal>."
msgstr ""
-"Dieses Feature ist bei Stammdatenmodellen oft sehr nützlich, wir empfehlen "
-"weniger Tabellen als Klassen sowie ein feinstufiges Domainmodell. Es ist "
-"jedoch von Nutzen, wenn zwischen Mapping-Strategien der Vererbung in einer "
-"einzelnen Hierarchie gewechselt wird. Wir gehen später noch näher darauf ein."
+"Bitte beachten Sie, dass das <literal>hibernate-mapping</literal>-Element es "
+"Ihnen ermöglicht, mehrere persistente <literal><class></literal>-"
+"Mappings (wie oben dargestellt) zu verschachteln. Es ist jedoch eine gute "
+"Angewohnheit (und wird von einigen Tools vorausgesetzt) nur eine einzelne "
+"persistente Klasse (oder eine Einzelklassenhierarchie) in einer Mapping-"
+"Datei zu mappen und diese nach der persistenten Superklasse zu benennen, z."
+"B. <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal> oder - "
+"falls Sie \"Inheritance\" (d.h. Vererbung) verwenden - <literal>Animal.hbm."
+"xml</literal>."
#. Tag: title
-#, no-c-format
-msgid "Key"
-msgstr ""
+#: basic_mapping.xml:3841
+#, fuzzy, no-c-format
+msgid "<title>Key</title>"
+msgstr "<title>key</title>"
#. Tag: para
+#: basic_mapping.xml:3843
#, fuzzy, no-c-format
msgid ""
-"The <literal><key></literal> element has featured a few times within "
+"The <literal><key></literal> element is featured a few times within "
"this guide. It appears anywhere the parent mapping element defines a join to "
"a new table that references the primary key of the original table. It also "
"defines the foreign key in the joined table:"
@@ -3467,7 +8401,30 @@
"Fremdschlüssel in der verknüpften Tabelle, der auf den Primärschlüssel der "
"Originaltabelle verweist."
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, fuzzy, no-c-format
+msgid ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+msgstr ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:3874
#, fuzzy, no-c-format
msgid ""
"<literal>on-delete</literal> (optional - defaults to <literal>noaction</"
@@ -3479,6 +8436,7 @@
"Fremdschlüssel auf Datenbankebene \"cascade delete\" aktiviert."
#. Tag: para
+#: basic_mapping.xml:3880
#, fuzzy, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): specifies that the foreign key "
@@ -3490,6 +8448,7 @@
"Originaltabelle sind (für existierende Daten, sog. \"Legacy Data\")."
#. Tag: para
+#: basic_mapping.xml:3886
#, fuzzy, no-c-format
msgid ""
"<literal>not-null</literal> (optional): specifies that the foreign key "
@@ -3501,6 +8460,7 @@
"vorausgesetzt, wenn der Fremdschlüssel auch Teil des Primärschlüssels ist)."
#. Tag: para
+#: basic_mapping.xml:3892
#, fuzzy, no-c-format
msgid ""
"<literal>update</literal> (optional): specifies that the foreign key should "
@@ -3512,6 +8472,7 @@
"Fremdschlüssel auch Teil des Primärschlüssels ist)."
#. Tag: para
+#: basic_mapping.xml:3898
#, fuzzy, no-c-format
msgid ""
"<literal>unique</literal> (optional): specifies that the foreign key should "
@@ -3523,6 +8484,7 @@
"der Fremdschlüssel auch der Primärschlüssel ist)."
#. Tag: para
+#: basic_mapping.xml:3905
#, fuzzy, no-c-format
msgid ""
"For systems where delete performance is important, we recommend that all "
@@ -3540,6 +8502,7 @@
"Strategie für optimistisches Sperren für versionierte Daten umgeht."
#. Tag: para
+#: basic_mapping.xml:3913
#, fuzzy, no-c-format
msgid ""
"The <literal>not-null</literal> and <literal>update</literal> attributes are "
@@ -3556,52 +8519,13 @@
"\"></literal> deklarieren."
#. Tag: title
+#: basic_mapping.xml:3922
#, fuzzy, no-c-format
-msgid "Column and formula elements"
-msgstr "Spalten- und Formel-Elemente"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Mapping elements which accept a <literal>column</literal> attribute will "
-"alternatively accept a <literal><column></literal> subelement. "
-"Likewise, <literal><formula></literal> is an alternative to the "
-"<literal>formula</literal> attribute. For example:"
-msgstr ""
-"Jedes Mapping-Element das ein <literal>column</literal>-Attribut akzeptiert, "
-"akzeptiert alternativ auch ein <literal><column></literal>-Subelement. "
-"Ebenso ist <literal><formula></literal> eine Alternative zum "
-"<literal>formula</literal>-Attribut."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Most of the attributes on <literal>column</literal> provide a means of "
-"tailoring the DDL during automatic schema generation. The <literal>read</"
-"literal> and <literal>write</literal> attributes allow you to specify custom "
-"SQL that Hibernate will use to access the column's value. For more on this, "
-"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
-"read and write expressions</link>."
-msgstr ""
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The <literal>column</literal> and <literal>formula</literal> elements can "
-"even be combined within the same property or association mapping to express, "
-"for example, exotic join conditions."
-msgstr ""
-"Die <literal>column</literal> und <literal>formula</literal>-Attribute "
-"können sogar innerhalb desselben auszudrückenden Property- oder "
-"Assoziationsmappings kombiniert werden, zum Beispiel ausgefallene "
-"Verbundbedingungen."
-
-#. Tag: title
-#, fuzzy, no-c-format
msgid "Import"
msgstr "import"
#. Tag: para
+#: basic_mapping.xml:3924
#, fuzzy, no-c-format
msgid ""
"If your application has two persistent classes with the same name, and you "
@@ -3616,7 +8540,28 @@
"auf <literal>auto-import=\"true\"</literal> angewiesen zu sein. Sie können "
"sogar Klassen und Interfaces importieren, die nicht explizit gemappt sind."
+#. Tag: programlisting
+#: basic_mapping.xml:3930
+#, fuzzy, no-c-format
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3939
+#, fuzzy, no-c-format
+msgid ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+msgstr ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:3943
#, fuzzy, no-c-format
msgid ""
"<literal>class</literal>: the fully qualified class name of any Java class."
@@ -3624,6 +8569,7 @@
"<literal>class</literal>: Der vollständige Klassenname einer Java-Klasse."
#. Tag: para
+#: basic_mapping.xml:3948
#, fuzzy, no-c-format
msgid ""
"<literal>rename</literal> (optional - defaults to the unqualified class "
@@ -3633,102 +8579,125 @@
"definierte Klassenname): Ein Name, der in der Anfragensprache verwendet "
"werden kann."
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3956
#, no-c-format
-msgid "Any"
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:3962
+#, fuzzy, no-c-format
+msgid "Column and formula elements"
+msgstr "Spalten- und Formel-Elemente"
+
#. Tag: para
+#: basic_mapping.xml:3964
#, fuzzy, no-c-format
msgid ""
-"There is one more type of property mapping. The <literal><any></"
-"literal> mapping element defines a polymorphic association to classes from "
-"multiple tables. This type of mapping requires more than one column. The "
-"first column contains the type of the associated entity. The remaining "
-"columns contain the identifier. It is impossible to specify a foreign key "
-"constraint for this kind of association. This is not the usual way of "
-"mapping polymorphic associations and you should use this only in special "
-"cases. For example, for audit logs, user session data, etc."
+"Mapping elements which accept a <literal>column</literal> attribute will "
+"alternatively accept a <literal><column></literal> subelement. "
+"Likewise, <literal><formula></literal> is an alternative to the "
+"<literal>formula</literal> attribute. For example:"
msgstr ""
-"Es gibt noch einen weiteren Typ von Property-Mapping. Das <literal><"
-"any></literal> Mapping-Element definiert eine polymorphe Assoziation zu "
-"Klassen mehrerer Tabellen. Diese Art von Mapping erfordert immer mehr als "
-"eine Spalte. Die erste Spalte enthält den Typ der zugehörigen Entity. Die "
-"übrigen Spalten enthalten den Bezeichner. Es ist unmöglich, eine Bedingung "
-"für den Fremdschlüssel für diese Art von Assoziation festzulegen, daher ist "
-"dies nicht als reguläre Art des Mappings (polymorpher) Assoziationen "
-"gedacht. Sie sollten diesen Typ von Mapping nur in ganz besonderen Fällen "
-"anwenden (z.B. für Überprüfungsprotokolle, Daten der Benutzersession usw.)."
+"Jedes Mapping-Element das ein <literal>column</literal>-Attribut akzeptiert, "
+"akzeptiert alternativ auch ein <literal><column></literal>-Subelement. "
+"Ebenso ist <literal><formula></literal> eine Alternative zum "
+"<literal>formula</literal>-Attribut."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3970
#, fuzzy, no-c-format
msgid ""
-"The <literal>meta-type</literal> attribute allows the application to specify "
-"a custom type that maps database column values to persistent classes that "
-"have identifier properties of the type specified by <literal>id-type</"
-"literal>. You must specify the mapping from values of the meta-type to class "
-"names."
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"\n"
+" read=\"SQL expression\"\n"
+" write=\"SQL expression\"/>"
msgstr ""
-"Das <literal>meta-type</literal>-Attribut ermöglicht es der Anwendung einen "
-"anwenderdefinierten Typ festzulegen, der die Werte der Datenbankspalte zu "
-"persistenten Klassen mit durch <literal>id-type</literal> bestimmte "
-"Bezeichner-Properties mappt. Das Mapping muss aus Werten des Meta-Typs zu "
-"Klassennamen bestimmt werden."
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"/>"
-#. Tag: para
-#, no-c-format
-msgid "<literal>name</literal>: the property name."
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: programlisting
+#: basic_mapping.xml:3972
+#, fuzzy, no-c-format
+msgid "<formula>SQL expression</formula>"
+msgstr "<formula>SQL expression</formula>"
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "<literal>id-type</literal>: the identifier type."
-msgstr "<literal>id-type</literal>: Der Bezeichnertyp."
-
-#. Tag: para
-#, fuzzy, no-c-format
msgid ""
-"<literal>meta-type</literal> (optional - defaults to <literal>string</"
-"literal>): any type that is allowed for a discriminator mapping."
+"Most of the attributes on <literal>column</literal> provide a means of "
+"tailoring the DDL during automatic schema generation. The <literal>read</"
+"literal> and <literal>write</literal> attributes allow you to specify custom "
+"SQL that Hibernate will use to access the column's value. For more on this, "
+"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
+"read and write expressions</link>."
msgstr ""
-"<literal>meta-type</literal> (optional - die Standardeinstellung lautet "
-"<literal>string</literal>): Jeder Typ, der für ein Diskriminator-Mapping "
-"gestattet ist."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3982
+#, fuzzy, no-c-format
msgid ""
-"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
-"the cascade style."
+"The <literal>column</literal> and <literal>formula</literal> elements can "
+"even be combined within the same property or association mapping to express, "
+"for example, exotic join conditions."
msgstr ""
-"<literal>cascade</literal> (optional- die Standardeinstellung lautet "
-"<literal>none</literal>): der \"Cascade-Style\" (Weitergabestil)."
+"Die <literal>column</literal> und <literal>formula</literal>-Attribute "
+"können sogar innerhalb desselben auszudrückenden Property- oder "
+"Assoziationsmappings kombiniert werden, zum Beispiel ausgefallene "
+"Verbundbedingungen."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3986
#, fuzzy, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this property either do or do not "
-"require acquisition of the optimistic lock. It defines whether a version "
-"increment should occur if this property is dirty."
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
msgstr ""
-"<literal>optimistic-lock</literal> (optional - die Standardeinstellung "
-"lautet <literal>true</literal>): Legt fest, ob Aktualisierungen dieser "
-"Property die Erfassung einer optimistischen Sperre benötigen oder nicht. Mit "
-"anderen Worten, es wird bestimmt ob eine Erhöhung der Version stattfinden "
-"soll, wenn die Inhalte dieser Property sich verändert haben."
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
#. Tag: title
+#: basic_mapping.xml:3992
#, fuzzy, no-c-format
msgid "Hibernate types"
msgstr "Hibernate-Typen"
#. Tag: title
+#: basic_mapping.xml:3995
#, no-c-format
msgid "Entities and values"
msgstr "Entities und Werte"
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
msgid ""
"In relation to the persistence service, Java language-level objects are "
@@ -3736,6 +8705,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4000
#, fuzzy, no-c-format
msgid ""
"An <emphasis>entity</emphasis> exists independently of any other objects "
@@ -3760,6 +8730,7 @@
"zirkulare und geteilte Verweise. Sie können auch versioniert werden."
#. Tag: para
+#: basic_mapping.xml:4010
#, fuzzy, no-c-format
msgid ""
"An entity's persistent state consists of references to other entities and "
@@ -3784,6 +8755,7 @@
"Entities oder Collections geteilt werden."
#. Tag: para
+#: basic_mapping.xml:4020
#, fuzzy, no-c-format
msgid ""
"Until now, we have been using the term \"persistent class\" to refer to "
@@ -3813,6 +8785,7 @@
"Komposition oder Aggregation in der Regel für einen Wertetyp geeignet sind. "
#. Tag: para
+#: basic_mapping.xml:4033
#, fuzzy, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
msgstr ""
@@ -3820,6 +8793,7 @@
"aufgegriffen."
#. Tag: para
+#: basic_mapping.xml:4036
#, fuzzy, no-c-format
msgid ""
"The challenge is to map the Java type system, and the developers' definition "
@@ -3847,6 +8821,7 @@
"Darauf gehen wir später noch ein."
#. Tag: para
+#: basic_mapping.xml:4049
#, fuzzy, no-c-format
msgid ""
"With the exception of collections, all built-in Hibernate types support null "
@@ -3856,11 +8831,13 @@
"Semantik (sog. \"null semantics\"."
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
msgid "Basic value types"
msgstr "Grundlegende Wertetypen"
#. Tag: para
+#: basic_mapping.xml:4056
#, fuzzy, no-c-format
msgid ""
"The built-in <emphasis>basic mapping types</emphasis> can be roughly "
@@ -3869,16 +8846,18 @@
"Die eingebauten, <emphasis>grundlegenden Mapping-Typen</emphasis> können im "
"Wesentlichen wie folgt kategorisiert werden"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4059
#, fuzzy, no-c-format
msgid ""
-"<literal>integer, long, short, float, double, character, byte, boolean, "
-"yes_no, true_false</literal>"
+"integer, long, short, float, double, character, byte, boolean, yes_no, "
+"true_false"
msgstr ""
"integer, long, short, float, double, character, byte, boolean, yes_no, "
"true_false"
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
msgid ""
"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
@@ -3892,12 +8871,14 @@
"einen Java <literal>boolean</literal> oder <literal>java.lang.Boolean</"
"literal>."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>string</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:4073
+#, no-c-format
+msgid "string"
+msgstr "string"
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</"
@@ -3906,12 +8887,14 @@
"Ein \"Type-Mapping\" von <literal>java.lang.String</literal> zu "
"<literal>VARCHAR</literal> (oder Oracle <literal>VARCHAR2</literal>)."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4083
#, fuzzy, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
+msgid "date, time, timestamp"
msgstr "date, time, timestamp"
#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Date</literal> and its subclasses to "
@@ -3922,12 +8905,14 @@
"SQL-Typen <literal>DATE</literal>, <literal>TIME</literal> und "
"<literal>TIMESTAMP</literal> (oder äquivalent)."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4094
#, fuzzy, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
+msgid "calendar, calendar_date"
msgstr "calendar, calendar_date"
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Calendar</literal> to SQL types "
@@ -3936,12 +8921,14 @@
"Type-Mappings von <literal>java.util.Calendar</literal> zu SQL-Typen "
"<literal>TIMESTAMP</literal> und <literal>DATE</literal> (oder äquivalent)."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4104
#, fuzzy, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
+msgid "big_decimal, big_integer"
msgstr "big_decimal, big_integer"
#. Tag: para
+#: basic_mapping.xml:4107
#, no-c-format
msgid ""
"Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java."
@@ -3952,12 +8939,14 @@
"math.BigInteger</literal> zu <literal>NUMERIC</literal> (oder Oracle "
"<literal>NUMBER</literal>)."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4115
#, fuzzy, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
+msgid "locale, timezone, currency"
msgstr "locale, timezone, currency"
#. Tag: para
+#: basic_mapping.xml:4118
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Locale</literal>, <literal>java.util."
@@ -3974,12 +8963,14 @@
"werden zu ihren ISO-Codes gemappt. Instanzen von <literal>TimeZone</literal> "
"werden zu ihrer <literal>ID</literal> gemappt."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4131
#, fuzzy, no-c-format
-msgid "<literal>class</literal>"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+msgid "class"
+msgstr "subclass"
#. Tag: para
+#: basic_mapping.xml:4134
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</"
@@ -3990,22 +8981,26 @@
"literal> (oder Oracle <literal>VARCHAR2</literal>). Eine <literal>Class</"
"literal> wird zu ihrem vollständigen Namen gemappt."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>binary</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:4142
+#, no-c-format
+msgid "binary"
+msgstr "binary"
#. Tag: para
+#: basic_mapping.xml:4145
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr "Mappt Byte-Arrays zum zugehörigen SQL-Binärtyp."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>text</literal>"
-msgstr "<literal>name</literal>: Der Property-Name."
+#. Tag: literal
+#: basic_mapping.xml:4150
+#, no-c-format
+msgid "text"
+msgstr "text"
#. Tag: para
+#: basic_mapping.xml:4153
#, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</"
@@ -4014,12 +9009,14 @@
"Mappt lange Java-Strings zum SQL <literal>CLOB</literal> oder <literal>TEXT</"
"literal>-Typ."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>serializable</literal>"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+#. Tag: literal
+#: basic_mapping.xml:4159
+#, no-c-format
+msgid "serializable"
+msgstr "serializable"
#. Tag: para
+#: basic_mapping.xml:4162
#, fuzzy, no-c-format
msgid ""
"Maps serializable Java types to an appropriate SQL binary type. You can also "
@@ -4031,12 +9028,14 @@
"einer serialisierbaren Java-Klasse oder einem Interface (das in der "
"Standardeinstellung kein Grundtyp ist) anzeigen."
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>clob, blob</literal>"
-msgstr "<literal>all</literal> Prüfung aller Spalten"
+#. Tag: literal
+#: basic_mapping.xml:4171
+#, no-c-format
+msgid "clob, blob"
+msgstr "clob, blob"
#. Tag: para
+#: basic_mapping.xml:4174
#, fuzzy, no-c-format
msgid ""
"Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and "
@@ -4050,16 +9049,18 @@
"nicht außerhalb einer Transaktion wiederverwendet werden darf. (Auch der "
"Treiber-Support ist lückenhaft und uneinheitlich)."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4184
#, fuzzy, no-c-format
msgid ""
-"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
-"imm_serializable, imm_binary</literal>"
+"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary"
msgstr ""
"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary"
#. Tag: para
+#: basic_mapping.xml:4188
#, fuzzy, no-c-format
msgid ""
"Type mappings for what are considered mutable Java types. This is where "
@@ -4080,6 +9081,7 @@
"zuordnen."
#. Tag: para
+#: basic_mapping.xml:4200
#, fuzzy, no-c-format
msgid ""
"Unique identifiers of entities and collections can be of any basic type "
@@ -4093,6 +9095,7 @@
"siehe unten)."
#. Tag: para
+#: basic_mapping.xml:4205
#, no-c-format
msgid ""
"The basic value types have corresponding <literal>Type</literal> constants "
@@ -4106,11 +9109,13 @@
"<literal>string</literal>-Typ."
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
msgid "Custom value types"
msgstr "Angepasste Wertetypen"
#. Tag: para
+#: basic_mapping.xml:4214
#, fuzzy, no-c-format
msgid ""
"It is relatively easy for developers to create their own value types. For "
@@ -4135,6 +9140,7 @@
"literal>, <literal>SURNAME</literal> persistiert ist."
#. Tag: para
+#: basic_mapping.xml:4225
#, fuzzy, no-c-format
msgid ""
"To implement a custom type, implement either <literal>org.hibernate."
@@ -4150,7 +9156,24 @@
"DoubleStringType</literal> finden Sie die unterschiedlichen Möglichkeiten, "
"die es dabei gibt."
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+msgstr ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+
#. Tag: para
+#: basic_mapping.xml:4234
#, no-c-format
msgid ""
"Notice the use of <literal><column></literal> tags to map a property "
@@ -4160,6 +9183,7 @@
"Mappen einer Property zu mehreren Spalten."
#. Tag: para
+#: basic_mapping.xml:4237
#, no-c-format
msgid ""
"The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</"
@@ -4173,6 +9197,7 @@
"Einsatzmöglichkeiten."
#. Tag: para
+#: basic_mapping.xml:4243
#, fuzzy, no-c-format
msgid ""
"You can even supply parameters to a <literal>UserType</literal> in the "
@@ -4188,7 +9213,24 @@
"können Sie das <literal><type></literal>-Element in Ihren "
"Mappingdateien verwenden."
+#. Tag: programlisting
+#: basic_mapping.xml:4250
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+msgstr ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+
#. Tag: para
+#: basic_mapping.xml:4252
#, no-c-format
msgid ""
"The <literal>UserType</literal> can now retrieve the value for the parameter "
@@ -4200,6 +9242,7 @@
"<literal>Properties</literal>-Objekt abrufen."
#. Tag: para
+#: basic_mapping.xml:4256
#, fuzzy, no-c-format
msgid ""
"If you regularly use a certain <literal>UserType</literal>, it is useful to "
@@ -4215,7 +9258,28 @@
"eine Liste standardmäßiger Parameterwerte enthalten, wenn der Typ "
"parametriert wird."
+#. Tag: programlisting
+#: basic_mapping.xml:4262
+#, fuzzy, no-c-format
+msgid ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+msgstr ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:4264
+#, fuzzy, no-c-format
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
+msgstr "<property name=\"priority\" type=\"default_zero\"/>"
+
#. Tag: para
+#: basic_mapping.xml:4266
#, no-c-format
msgid ""
"It is also possible to override the parameters supplied in a typedef on a "
@@ -4226,6 +9290,7 @@
"Kraft zu setzen."
#. Tag: para
+#: basic_mapping.xml:4270
#, fuzzy, no-c-format
msgid ""
"Even though Hibernate's rich range of built-in types and support for "
@@ -4249,11 +9314,13 @@
"Geldwerte repräsentiert werden, gesichert."
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
msgid "Mapping a class more than once"
msgstr "Das mehrfache Mappen einer Klasse"
#. Tag: para
+#: basic_mapping.xml:4285
#, fuzzy, no-c-format
msgid ""
"It is possible to provide more than one mapping for a particular persistent "
@@ -4271,7 +9338,48 @@
"festlegen, wenn Sie mit persistenten Objekten arbeiten, wenn Sie Anfragen "
"schreiben oder Assoziationen zu der genannten Entity mappen."
+#. Tag: programlisting
+#: basic_mapping.xml:4293
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Contract\" table=\"Contracts\"\n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\"\n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\"\n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\"\n"
+" column=\"currentContractId\"\n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Contract\" table=\"Contracts\" \n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\" \n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\" \n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\" \n"
+" column=\"currentContractId\" \n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:4295
#, fuzzy, no-c-format
msgid ""
"Associations are now specified using <literal>entity-name</literal> instead "
@@ -4280,12 +9388,20 @@
"Beachten Sie, wie Assoziationen nun unter Verwendung von <literal>entity-"
"name</literal> statt <literal>class</literal> spezifiziert werden."
+#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
+#, no-c-format
+msgid "This feature is not supported in Annotations"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
msgid "SQL quoted identifiers"
msgstr "SQL angeführte Bezeichner"
#. Tag: para
+#: basic_mapping.xml:4306
#, fuzzy, no-c-format
msgid ""
"You can force Hibernate to quote an identifier in the generated SQL by "
@@ -4301,103 +9417,38 @@
"Regel doppelte Anführungszeichen, aber Klammern für SQL-Server und Backticks "
"für MySQL)."
-#. Tag: title
-#, no-c-format
-msgid "Metadata alternatives"
-msgstr "Metadata-Alternativen"
-
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:4312
#, fuzzy, no-c-format
msgid ""
-"XML does not suit all users so there are some alternative ways to define O/R "
-"mapping metadata in Hibernate."
+"@Entity @Table(name=\"`Line Item`\")\n"
+"class LineItem {\n"
+" @id @Column(name=\"`Item Id`\") Integer id;\n"
+" @Column(name=\"`Item #`\") int itemNumber\n"
+"}\n"
+"\n"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"XML ist nicht jedermanns Sache, daher gibt es auch alternative Möglichkeiten "
-"O/R Mapping Metadaten in Hibernate zu definieren."
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
#. Tag: title
-#, no-c-format
-msgid "Using XDoclet markup"
-msgstr "Die Verwendung von XDoclet-Markup"
-
-#. Tag: para
+#: basic_mapping.xml:4316
#, fuzzy, no-c-format
-msgid ""
-"Many Hibernate users prefer to embed mapping information directly in "
-"sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover "
-"this approach in this reference guide since it is considered part of "
-"XDoclet. However, we include the following example of the <literal>Cat</"
-"literal> class with XDoclet mappings:"
-msgstr ""
-"Viele Benutzer von Hibernate ziehen es vor, Mapping-Informationen unter "
-"Verwendung von XDoclet <literal>@hibernate.tags</literal> direkt im "
-"Quellcode einzubetten. Diese Vorgehensweise wird hier nicht behandelt, da es "
-"sich ausschließlich um einen Teil von XDoclet handelt. Allerdings zeigen wir "
-"das nachfolgende Beispiel der <literal>Cat</literal>-Klasse mit XDoclet-"
-"Mappings."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr ""
-"Weitere Beispiele zu XDoclet und Hibernate finden Sie auf der Hibernate "
-"Website."
-
-#. Tag: title
-#, no-c-format
-msgid "Using JDK 5.0 Annotations"
-msgstr "Die Verwendung von JDK 5.0 Annotationen"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"JDK 5.0 introduced XDoclet-style annotations at the language level that are "
-"type-safe and checked at compile time. This mechanism is more powerful than "
-"XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, "
-"for example, supports auto-completion and syntax highlighting of JDK 5.0 "
-"annotations. The new revision of the EJB specification (JSR-220) uses JDK "
-"5.0 annotations as the primary metadata mechanism for entity beans. "
-"Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the "
-"persistence API). Support for mapping metadata is available via the "
-"<emphasis>Hibernate Annotations</emphasis> package as a separate download. "
-"Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
-msgstr ""
-"JDK 5.0 hat Annotationen im XDoclet-Stil auf der Sprachebene vorgestellt, "
-"die typensicher und zum Zeitpunkt der Kompilierung geprüft sind. Dieser "
-"Mechanismus ist leistungsstärker als XDoclet-Annotationen und bietet "
-"besseren Support durch Tools und IDEs . IntelliJ IDEA zum Beispiel "
-"unterstützt Auto-Vervollständigung und Syntax-Hervorhebungen von JDK 5.0 "
-"Annotationen. Die neue Revision der EJB-Spezifikation (JSR-220) verwendet "
-"JDK 5.0 Annotationen als primären Metadata-Mechanismus für Entity-Beans. "
-"Hibernate3 implementiert den <literal>EntityManager</literal> von JSR-220 "
-"(das Persistenz-API), Support für Mapping-Metadata ist mittels des "
-"<emphasis>Hibernate Annotations</emphasis>-Pakets als separater Download "
-"verfügbar. Sowohl EJB3 (JSR-220) und Hibernate3 Metadata werden unterstützt."
-
-#. Tag: para
-#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
-msgstr ""
-"Nachfolgend sehen Sie ein Beispiel für eine als EJB Entity-Bean annotierte "
-"POJO-Klasse:"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Support for JDK 5.0 Annotations (and JSR-220) is currently under "
-"development. Please refer to the Hibernate Annotations module for more "
-"details."
-msgstr ""
-"Bitte beachten Sie, dass am Support für JDK 5.0 Annotationen (und JSR-220) "
-"noch gearbeitet wird und dieser noch nicht vollständig verfügbar ist. "
-"Weitere Einzelheiten entnehmen Sie bitte dem Hibernate Annotationsmodul."
-
-#. Tag: title
-#, fuzzy, no-c-format
msgid "Generated properties"
msgstr "Generierte Properties"
#. Tag: para
+#: basic_mapping.xml:4318
#, fuzzy, no-c-format
msgid ""
"Generated properties are properties that have their values generated by the "
@@ -4419,6 +9470,7 @@
"abzufragen."
#. Tag: para
+#: basic_mapping.xml:4327
#, fuzzy, no-c-format
msgid ""
"Properties marked as generated must additionally be non-insertable and non-"
@@ -4435,6 +9487,7 @@
"als generiert gekennzeichnet sein."
#. Tag: para
+#: basic_mapping.xml:4334
#, fuzzy, no-c-format
msgid ""
"<literal>never</literal> (the default): the given property value is not "
@@ -4444,6 +9497,7 @@
"Property-Wert nicht innerhalb der Datenbank generiert wird."
#. Tag: para
+#: basic_mapping.xml:4337
#, fuzzy, no-c-format
msgid ""
"<literal>insert</literal>: the given property value is generated on insert, "
@@ -4462,6 +9516,7 @@
"diese Option dort jedoch nicht existiert."
#. Tag: para
+#: basic_mapping.xml:4344
#, fuzzy, no-c-format
msgid ""
"<literal>always</literal>: the property value is generated both on insert "
@@ -4470,24 +9525,43 @@
"<literal>always</literal> - besagt, dass der Property-Wert sowohl bei der "
"Einfügung als auch bei der Aktualisierung generiert wird."
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4354
#, no-c-format
msgid ""
"Hibernate allows you to customize the SQL it uses to read and write the "
"values of columns mapped to <link linkend=\"mapping-declaration-property"
"\">simple properties</link>. For example, if your database provides a set of "
"data encryption functions, you can invoke them for individual columns like "
-"this: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"this:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4359
+#, no-c-format
+msgid ""
+"<property name=\"creditCardNumber\">\n"
+" <column \n"
+" name=\"credit_card_num\"\n"
+" read=\"decrypt(credit_card_num)\"\n"
+" write=\"encrypt(?)\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
msgid ""
"Hibernate applies the custom expressions automatically whenever the property "
@@ -4496,6 +9570,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
msgid ""
"The property is backed by one or more columns that are exported as part of "
@@ -4503,11 +9578,13 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
msgid ""
"The <literal>write</literal> expression, if specified, must contain exactly "
@@ -4515,11 +9592,13 @@
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4384
#, fuzzy, no-c-format
msgid "Auxiliary database objects"
msgstr "Datenbankhilfsobjekte"
#. Tag: para
+#: basic_mapping.xml:4386
#, fuzzy, no-c-format
msgid ""
"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
@@ -4541,6 +9620,7 @@
"gibt im Wesentlichen zwei Modi der Definition von Datenbankhilfsobjekten..."
#. Tag: para
+#: basic_mapping.xml:4396
#, fuzzy, no-c-format
msgid ""
"The first mode is to explicitly list the CREATE and DROP commands in the "
@@ -4549,7 +9629,28 @@
"Die erste Methode ist die explizite Auflistung der CREATE- und DROP-Befehle "
"in der Mapping-Datei:"
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:4401
#, fuzzy, no-c-format
msgid ""
"The second mode is to supply a custom class that constructs the CREATE and "
@@ -4561,7 +9662,26 @@
"muss das <literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal>-"
"Interface implementieren."
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:4408
#, fuzzy, no-c-format
msgid ""
"Additionally, these database objects can be optionally scoped so that they "
@@ -4570,1401 +9690,532 @@
"Zusätzlich können diese Datenbankobjekte wahlweise so abgegrenzt werden, "
"dass Sie nur in Kraft treten, wenn bestimmte Dialekte verwendet werden."
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\"\n"
-#~ " table=\"cats\"\n"
-#~ " discriminator-value=\"C\">\n"
-#~ "\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <discriminator column=\"subclass\"\n"
-#~ " type=\"character\"/>\n"
-#~ "\n"
-#~ " <property name=\"weight\"/>\n"
-#~ "\n"
-#~ " <property name=\"birthdate\"\n"
-#~ " type=\"date\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"color\"\n"
-#~ " type=\"eg.types.ColorUserType\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"sex\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"litterId\"\n"
-#~ " column=\"litterId\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"mother\"\n"
-#~ " column=\"mother_id\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <set name=\"kittens\"\n"
-#~ " inverse=\"true\"\n"
-#~ " order-by=\"litter_id\">\n"
-#~ " <key column=\"mother_id\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ " <subclass name=\"DomesticCat\"\n"
-#~ " discriminator-value=\"D\">\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " </subclass>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" \n"
-#~ " table=\"cats\"\n"
-#~ " discriminator-value=\"C\">\n"
-#~ " \n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <discriminator column=\"subclass\" \n"
-#~ " type=\"character\"/>\n"
-#~ "\n"
-#~ " <property name=\"weight\"/>\n"
-#~ "\n"
-#~ " <property name=\"birthdate\"\n"
-#~ " type=\"date\" \n"
-#~ " not-null=\"true\" \n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"color\"\n"
-#~ " type=\"eg.types.ColorUserType\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"sex\"\n"
-#~ " not-null=\"true\" \n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"litterId\"\n"
-#~ " column=\"litterId\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"mother\"\n"
-#~ " column=\"mother_id\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <set name=\"kittens\"\n"
-#~ " inverse=\"true\"\n"
-#~ " order-by=\"litter_id\">\n"
-#~ " <key column=\"mother_id\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ " <subclass name=\"DomesticCat\"\n"
-#~ " discriminator-value=\"D\">\n"
-#~ "\n"
-#~ " <property name=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " </subclass>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
+">\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
-#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
-#~ "]>\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"your.domain\">\n"
-#~ " <class name=\"MyEntity\">\n"
-#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
-#~ " ...\n"
-#~ " </id>\n"
-#~ " <class>\n"
-#~ " &types;\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping>\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>"
+#~ msgid "Class"
+#~ msgstr "subclass"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping\n"
-#~ " schema=\"schemaName\"\n"
-#~ " catalog=\"catalogName\"\n"
-#~ " default-cascade=\"cascade_style\"\n"
-#~ " default-access=\"field|property|ClassName\"\n"
-#~ " default-lazy=\"true|false\"\n"
-#~ " auto-import=\"true|false\"\n"
-#~ " package=\"package.name\"\n"
-#~ " />]]>"
+#~ "Use of <literal>select-before-update</literal> will usually decrease "
+#~ "performance. It is useful to prevent a database update trigger being "
+#~ "called unnecessarily if you reattach a graph of detached instances to a "
+#~ "<literal>Session</literal>."
#~ msgstr ""
-#~ "<hibernate-mapping\n"
-#~ " schema=\"schemaName\"\n"
-#~ " catalog=\"catalogName\"\n"
-#~ " default-cascade=\"cascade_style\"\n"
-#~ " default-access=\"field|property|ClassName\"\n"
-#~ " default-lazy=\"true|false\"\n"
-#~ " auto-import=\"true|false\"\n"
-#~ " package=\"package.name\"\n"
-#~ " />"
+#~ "Die Verwendung von <literal>select-before-update</literal> wird die "
+#~ "Performance in der Regel verschlechtern. Es ist sehr hilfreich, um den "
+#~ "Aufruf eines Datenbankaktualisierungs-Triggers abzufangen, wenn Sie einen "
+#~ "Graph abgesetzter Instanzen wieder an eine <literal>Session</literal> "
+#~ "binden möchten."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tableName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " select-before-update=\"true|false\"\n"
-#~ " polymorphism=\"implicit|explicit\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " persister=\"PersisterClass\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " optimistic-lock=\"none|version|dirty|all\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " check=\"arbitrary sql check condition\"\n"
-#~ " rowid=\"rowid\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " node=\"element-name\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<class\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tableName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " select-before-update=\"true|false\"\n"
-#~ " polymorphism=\"implicit|explicit\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " persister=\"PersisterClass\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " optimistic-lock=\"none|version|dirty|all\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " check=\"arbitrary sql check condition\"\n"
-#~ " rowid=\"rowid\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " node=\"element-name\"\n"
-#~ "/>"
+#~ msgid "id"
+#~ msgstr "uuid"
+#~ msgid "Generator"
+#~ msgstr "Programmgenerator"
+
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Summary\">\n"
-#~ " <subselect>\n"
-#~ " select item.name, max(bid.amount), count(*)\n"
-#~ " from item\n"
-#~ " join bid on bid.item_id = item.id\n"
-#~ " group by item.name\n"
-#~ " </subselect>\n"
-#~ " <synchronize table=\"item\"/>\n"
-#~ " <synchronize table=\"bid\"/>\n"
-#~ " <id name=\"name\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Summary\">\n"
-#~ " <subselect>\n"
-#~ " select item.name, max(bid.amount), count(*)\n"
-#~ " from item\n"
-#~ " join bid on bid.item_id = item.id\n"
-#~ " group by item.name\n"
-#~ " </subselect>\n"
-#~ " <synchronize table=\"item\"/>\n"
-#~ " <synchronize table=\"bid\"/>\n"
-#~ " <id name=\"name\"/>\n"
-#~ " ...\n"
-#~ "</class>"
+#~ msgid "<literal>increment</literal>"
+#~ msgstr "<literal>name</literal>: Der Property-Name."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " column=\"column_name\"\n"
-#~ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "\n"
-#~ " <generator class=\"generatorClass\"/>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " column=\"column_name\"\n"
-#~ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "\n"
-#~ " <generator class=\"generatorClass\"/>\n"
-#~ "</id>"
+#~ msgid "<literal>identity</literal>"
+#~ msgstr "<literal>id-type</literal>: Der Bezeichnertyp."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
-#~ " <param name=\"table\">uid_table</param>\n"
-#~ " <param name=\"column\">next_hi_value_column</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
-#~ " <param name=\"table\">uid_table</param>\n"
-#~ " <param name=\"column\">next_hi_value_column</"
-#~ "param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>sequence</literal>"
+#~ msgstr "<literal>name</literal>: Der Property-Name."
-#~ msgid "increment"
-#~ msgstr "increment"
-
-#~ msgid "identity"
-#~ msgstr "identity"
-
-#~ msgid "sequence"
-#~ msgstr "sequence"
-
-#~ msgid "hilo"
-#~ msgstr "hilo"
-
-#~ msgid "seqhilo"
-#~ msgstr "seqhilo"
-
-#~ msgid "guid"
-#~ msgstr "guid"
-
-#~ msgid "native"
-#~ msgstr "native"
-
-#~ msgid "assigned"
-#~ msgstr "assigned"
-
-#~ msgid "select"
-#~ msgstr "select"
-
-#~ msgid "foreign"
-#~ msgstr "foreign"
-
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"hilo\">\n"
-#~ " <param name=\"table\">hi_value</param>\n"
-#~ " <param name=\"column\">next_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"hilo\">\n"
-#~ " <param name=\"table\">hi_value</param>\n"
-#~ " <param name=\"column\">next_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>seqhilo</literal>"
+#~ msgstr "<literal>all</literal> Prüfung aller Spalten"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"seqhilo\">\n"
-#~ " <param name=\"sequence\">hi_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"seqhilo\">\n"
-#~ " <param name=\"sequence\">hi_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>uuid</literal>"
+#~ msgstr "<literal>id</literal>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"sequence\">\n"
-#~ " <param name=\"sequence\">person_id_sequence</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
+#~ "are unique within a network (the IP address is used). The UUID is encoded "
+#~ "as a string of 32 hexadecimal digits in length."
#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"sequence\">\n"
-#~ " <param name=\"sequence\">person_id_sequence</"
-#~ "param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ "verwendet einen 128-bit UUID-Algorithmus, um Bezeichner des String-Typs "
+#~ "(Zeichenkettentyp) zu generieren, die innerhalb eines Netzwerks eindeutig "
+#~ "sind (die IP-Adresse wird verwendet). Der UUID (Universally Unique "
+#~ "Identifier) ist als Zeichenkette hexadezimaler Ziffern von 32 Zeichen "
+#~ "Länge verschlüsselt."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value="
-#~ "\"0\">\n"
-#~ " <generator class=\"identity\"/>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
-#~ "\">\n"
-#~ " <generator class=\"identity\"/>\n"
-#~ "</id>"
+#~ msgid "<literal>guid</literal>"
+#~ msgstr "<literal>id</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"select\">\n"
-#~ " <param name=\"key\">socialSecurityNumber</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"select\">\n"
-#~ " <param name=\"key\">socialSecurityNumber</"
-#~ "param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>native</literal>"
+#~ msgstr "<literal>name</literal>: Der Property-Name."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<composite-id\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " mapped=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|.\"\n"
-#~ "\n"
-#~ " <key-property name=\"propertyName\" type=\"typename\" column="
-#~ "\"column_name\"/>\n"
-#~ " <key-many-to-one name=\"propertyName class=\"ClassName\" column="
-#~ "\"column_name\"/>\n"
-#~ " ......\n"
-#~ "</composite-id>]]>"
-#~ msgstr ""
-#~ "<composite-id\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " mapped=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|.\"\n"
-#~ "\n"
-#~ " <key-property name=\"propertyName\" type=\"typename\" column="
-#~ "\"column_name\"/>\n"
-#~ " <key-many-to-one name=\"propertyName class=\"ClassName\" "
-#~ "column=\"column_name\"/>\n"
-#~ " ......\n"
-#~ "</composite-id>"
+#~ msgid "<literal>select</literal>"
+#~ msgstr "<literal>all</literal> Prüfung aller Spalten"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<composite-id>\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
-#~ msgstr ""
-#~ "<composite-id>\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>"
+#~ msgid "<literal>foreign</literal>"
+#~ msgstr "<literal>name</literal>: Der Property-Name."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
+#~ "<literal>optimizer</literal> (optional - defaults to <literal>none</"
+#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
#~ msgstr ""
-#~ "<composite-id class=\"MedicareId\" mapped=\"true\">\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>"
+#~ "<literal>cascade</literal> (optional- die Standardeinstellung lautet "
+#~ "<literal>none</literal>): der \"Cascade-Style\" (Weitergabestil)."
+#~ msgid "composite-id"
+#~ msgstr "composite-id"
+
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<discriminator\n"
-#~ " column=\"discriminator_column\"\n"
-#~ " type=\"discriminator_type\"\n"
-#~ " force=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary sql expression\"\n"
-#~ "/>]]>"
+#~ "A table with a composite key can be mapped with multiple properties of "
+#~ "the class as identifier properties. The <literal><composite-id></"
+#~ "literal> element accepts <literal><key-property></literal> property "
+#~ "mappings and <literal><key-many-to-one></literal> mappings as child "
+#~ "elements."
#~ msgstr ""
-#~ "<discriminator\n"
-#~ " column=\"discriminator_column\"\n"
-#~ " type=\"discriminator_type\"\n"
-#~ " force=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary sql expression\"\n"
-#~ "/>"
+#~ "Für eine Tabelle mit einem zusammengesetzten Schlüssel, können Sie "
+#~ "mehrere Properties der Klasse als Bezeichner-Properties mappen. Das "
+#~ "<literal><composite-id></literal>-Element akzeptiert <literal><"
+#~ "key-property></literal>-Property-Mappings und <literal><key-many-to-"
+#~ "one></literal>-Mappings als untergeordnete Elemente."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<discriminator\n"
-#~ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end"
-#~ "\"\n"
-#~ " type=\"integer\"/>]]>"
+#~ "The persistent class <emphasis>must</emphasis> override <literal>equals()"
+#~ "</literal> and <literal>hashCode()</literal> to implement composite "
+#~ "identifier equality. It must also implement <literal>Serializable</"
+#~ "literal>."
#~ msgstr ""
-#~ "<discriminator\n"
-#~ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end"
-#~ "\"\n"
-#~ " type=\"integer\"/>"
+#~ "Ihre persistente Klasse <emphasis>muss</emphasis> sowohl <literal>equals()"
+#~ "</literal> als auch <literal>hashCode()</literal> außer Kraft setzen, um "
+#~ "die Gleichwertigkeit zusammengesetzter Bezeichner zu implementieren. Sie "
+#~ "muss außerdem <literal>Serializable</literal> implementieren."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<version\n"
-#~ " column=\"version_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|negative|undefined\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "Unfortunately, this approach means that a persistent object is its own "
+#~ "identifier. There is no convenient \"handle\" other than the object "
+#~ "itself. You must instantiate an instance of the persistent class itself "
+#~ "and populate its identifier properties before you can <literal>load()</"
+#~ "literal> the persistent state associated with a composite key. We call "
+#~ "this approach an <emphasis>embedded</emphasis> composite identifier, and "
+#~ "discourage it for serious applications."
#~ msgstr ""
-#~ "<version\n"
-#~ " column=\"version_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|negative|undefined\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>"
+#~ "Leider bedeutet diese Vorgehensweise bei zusammengesetzten Bezeichnern, "
+#~ "dass ein persistentes Objekt sein eigener Bezeichner ist. Es existiert "
+#~ "keine praktische \"Handhabung\" außer dem Objekt selbst. Sie müssen eine "
+#~ "Instanz der persistenten Klasse selbst instanziieren und deren Bezeichner-"
+#~ "Properties auffüllen, ehe Sie mit <literal>load()</literal> den "
+#~ "persistenten Status eines zugehörigen zusammengesetzten Schlüssels laden "
+#~ "können. Diese Vorgehensweise gilt als <emphasis>eingebetteter</emphasis> "
+#~ "(\"embedded\") zusammengesetzter Bezeichner und wird nicht für ernsthafte "
+#~ "Anwendungen empfohlen."
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<timestamp\n"
-#~ " column=\"timestamp_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|undefined\"\n"
-#~ " source=\"vm|db\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "A second approach is what we call a <emphasis>mapped</emphasis> composite "
+#~ "identifier, where the identifier properties named inside the <literal><"
+#~ "composite-id></literal> element are duplicated on both the persistent "
+#~ "class and a separate identifier class."
#~ msgstr ""
-#~ "<timestamp\n"
-#~ " column=\"timestamp_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|undefined\"\n"
-#~ " source=\"vm|db\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>"
+#~ "Eine zweite Vorgehensweise trägt den Namen <emphasis>gemappter</emphasis> "
+#~ "zusammengesetzter Bezeichner (sog. \"mapped composite identifier\"), "
+#~ "wobei die innerhalb des <literal><composite-id></literal>-Elements "
+#~ "genannten Bezeichner-Properties sowohl an der persistenten Klasse als "
+#~ "auch einer separaten Bezeichnerklasse dupliziert werden."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " type=\"typename\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " generated=\"never|insert|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " length=\"L\"\n"
-#~ " precision=\"P\"\n"
-#~ " scale=\"S\"\n"
-#~ "/>]]>"
+#~ "In this example, both the composite identifier class, "
+#~ "<literal>MedicareId</literal>, and the entity class itself have "
+#~ "properties named <literal>medicareNumber</literal> and "
+#~ "<literal>dependent</literal>. The identifier class must override "
+#~ "<literal>equals()</literal> and <literal>hashCode()</literal> and "
+#~ "implement <literal>Serializable</literal>. The main disadvantage of this "
+#~ "approach is code duplication."
#~ msgstr ""
-#~ "<property\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " type=\"typename\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " generated=\"never|insert|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " length=\"L\"\n"
-#~ " precision=\"P\"\n"
-#~ " scale=\"S\"\n"
-#~ "/>"
+#~ "In diesem Beispiel besitzen sowohl die Klasse des zusammengesetzten "
+#~ "Bezeichners <literal>MedicareId</literal> als auch die Entity-Klasse "
+#~ "selbst Properties mit dem Namen <literal>medicareNumber</literal> und "
+#~ "<literal>dependent</literal>. Die Bezeichnerklasse muss <literal>equals()"
+#~ "</literal> und <literal>hashCode()</literal> außer Kraft setzen und "
+#~ "<literal>Serializable</literal> implementieren. Der Nachteil dieser "
+#~ "Vorgehensweise ist offensichtlich— Code-Duplizierung."
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "<property name=\"totalPrice\"\n"
-#~ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, "
-#~ "Product p\n"
-#~ " WHERE li.productId = p.productId\n"
-#~ " AND li.customerId = customerId\n"
-#~ " AND li.orderNumber = orderNumber )\"/>]]>"
+#~ "The following attributes are used to specify a mapped composite "
+#~ "identifier:"
#~ msgstr ""
-#~ "<property name=\"totalPrice\"\n"
-#~ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, "
-#~ "Product p\n"
-#~ " WHERE li.productId = p.productId\n"
-#~ " AND li.customerId = customerId\n"
-#~ " AND li.orderNumber = orderNumber )\"/>"
+#~ "Die folgenden Attribute werden verwendet, um einen gemappten "
+#~ "zusammengesetzten Bezeichner zu bestimmen:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>]]>"
+#~ "<literal>mapped</literal> (optional - defaults to <literal>false</"
+#~ "literal>): indicates that a mapped composite identifier is used, and that "
+#~ "the contained property mappings refer to both the entity class and the "
+#~ "composite identifier class."
#~ msgstr ""
-#~ "<many-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>"
+#~ "<literal>mapped</literal> (optional, Standardeinstellung <literal>false</"
+#~ "literal>): zeigt an, dass ein gemappter zusammengesetzter Bezeichner "
+#~ "verwendet wird und die enthaltenen Property-Mappings auf die Entity-"
+#~ "Klasse und die zusammengesetzte Bezeichnerklasse verweisen."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"product\" class=\"Product\" column="
-#~ "\"PRODUCT_ID\"/>]]>"
+#~ "<literal>class</literal> (optional - but required for a mapped composite "
+#~ "identifier): the class used as a composite identifier."
#~ msgstr ""
-#~ "<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/"
-#~ ">"
+#~ "<literal>class</literal> (optional, für einen gemappten Bezeichner jedoch "
+#~ "erforderlich): Die als zusammengesetzter Bezeichner verwendete Klasse."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"serialNumber\" unique=\"true\" type=\"string\" "
-#~ "column=\"SERIAL_NUMBER\"/>]]>"
+#~ "We will describe a third, even more convenient approach, where the "
+#~ "composite identifier is implemented as a component class in <xref linkend="
+#~ "\"components-compositeid\" />. The attributes described below apply only "
+#~ "to this alternative approach:"
#~ msgstr ""
-#~ "<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
-#~ "\"SERIAL_NUMBER\"/>"
+#~ "Abschließend erläutern wir einen dritte, noch praktischere "
+#~ "Vorgehensweise, bei der der zusammengesetzte Bezeichner als "
+#~ "Komponentenklasse in <xref linkend=\"components-compositeid\"/> "
+#~ "implementiert wird. Die unten beschriebenen Attribute gelten nur für "
+#~ "diese Vorgehensweise:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"product\" property-ref=\"serialNumber\" "
-#~ "column=\"PRODUCT_SERIAL_NUMBER\"/>]]>"
+#~ "<literal>name</literal> (optional - required for this approach): a "
+#~ "property of component type that holds the composite identifier. Please "
+#~ "see chapter 9 for more information."
#~ msgstr ""
-#~ "<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
-#~ "\"PRODUCT_SERIAL_NUMBER\"/>"
+#~ "<literal>name</literal> (optional, bei dieser Vorgehensweise "
+#~ "erforderlich): Eine Property nach Komponententyp, die den "
+#~ "zusammengesetzten Bezeichner enthält (siehe Kapitel 9)."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
-#~ "\"OWNER_SSN\"/>]]>"
+#~ "<literal>class</literal> (optional - defaults to the property type "
+#~ "determined by reflection): the component class used as a composite "
+#~ "identifier. Please see the next section for more information."
#~ msgstr ""
-#~ "<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
-#~ "\"OWNER_SSN\"/>"
+#~ "<literal>class</literal> (optional - Standardeinstellung ist der durch "
+#~ "die Reflexion bestimmte Property-Typ): Die als ein zusammengesetzter "
+#~ "Bezeichnerverwendete Komponentenklasse (siehe nächster Abschnitt)."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " constrained=\"true|false\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " formula=\"any SQL expression\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>]]>"
+#~ "The third approach, an <emphasis>identifier component</emphasis>, is "
+#~ "recommended for almost all applications."
#~ msgstr ""
-#~ "<one-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " constrained=\"true|false\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " formula=\"any SQL expression\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>"
+#~ "Bei dieser dritten Vorhegensweise empfehlen wir eine "
+#~ "<emphasis>Bezeichnerkomponente</emphasis> für fast alle Anwendungen."
#, fuzzy
-#~ msgid "<![CDATA[<one-to-one name=\"person\" class=\"Person\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
+#~ msgid "Version (optional)"
+#~ msgstr "version (optional)"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" constrained="
-#~ "\"true\"/>]]>"
+#~ "The <literal><version></literal> element is optional and indicates "
+#~ "that the table contains versioned data. This is particularly useful if "
+#~ "you plan to use <emphasis>long transactions</emphasis>. See below for "
+#~ "more information:"
#~ msgstr ""
-#~ "<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/"
-#~ ">"
+#~ "Das <literal><version></literal>-Element ist optional und zeigt an, "
+#~ "dass die Tabelle versionierte Daten enthält. Das ist insbesondere dann "
+#~ "nützlich, wenn Sie vorhaben, <emphasis>lange Transaktionen</emphasis> zu "
+#~ "verwenden (siehe unten)."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"foreign\">\n"
-#~ " <param name=\"property\">employee</param>\n"
-#~ " </generator>\n"
-#~ " </id>\n"
-#~ " ...\n"
-#~ " <one-to-one name=\"employee\"\n"
-#~ " class=\"Employee\"\n"
-#~ " constrained=\"true\"/>\n"
-#~ "</class>]]>"
+#~ "Version numbers can be of Hibernate type <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> or <literal>calendar</literal>."
#~ msgstr ""
-#~ "<class name=\"person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"foreign\">\n"
-#~ " <param name=\"property\">employee</param>\n"
-#~ " </generator>\n"
-#~ " </id>\n"
-#~ " ...\n"
-#~ " <one-to-one name=\"employee\"\n"
-#~ " class=\"Employee\"\n"
-#~ " constrained=\"true\"/>\n"
-#~ "</class>"
+#~ "Die Versionsnummern können vom Hibernate-Typ <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> oder <literal>calendar</literal> sein."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID"
-#~ "\" unique=\"true\"/>]]>"
-#~ msgstr ""
-#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
-#~ "unique=\"true\"/>"
+#~ msgid "Many-to-one"
+#~ msgstr "many-to-one"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" property-ref="
-#~ "\"person\"/>]]>"
+#~ "An ordinary association to another persistent class is declared using a "
+#~ "<literal>many-to-one</literal> element. The relational model is a many-to-"
+#~ "one association; a foreign key in one table is referencing the primary "
+#~ "key column(s) of the target table."
#~ msgstr ""
-#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
-#~ "\"/>"
+#~ "Eine reguläre Assoziation zu einer anderen persistenten Klasse wird unter "
+#~ "Verwendung eines <literal>many-to-one</literal>-Elements deklariert. Das "
+#~ "relationale Modell ist eine \"Many-to-One\"-Assoziation: Der "
+#~ "Fremdschlüssel in einer Tabelle verweist auf die Spalte(n) des "
+#~ "Primärschlüssels der Zieltabelle."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<natural-id mutable=\"true|false\"/>\n"
-#~ " <property ... />\n"
-#~ " <many-to-one ... />\n"
-#~ " ......\n"
-#~ "</natural-id>]]>"
-#~ msgstr ""
-#~ "<natural-id mutable=\"true|false\"/>\n"
-#~ " <property ... />\n"
-#~ " <many-to-one ... />\n"
-#~ " ......\n"
-#~ "</natural-id>"
+#~ msgid "One-to-one"
+#~ msgstr "one-to-one"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<component\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"className\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</component>]]>"
-#~ msgstr ""
-#~ "<component \n"
-#~ " name=\"propertyName\" \n"
-#~ " class=\"className\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ ">\n"
-#~ " \n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</component>"
+#~ msgid "There are two varieties of one-to-one associations:"
+#~ msgstr "Es existieren zwei Arten von \"One-to-One\"-Assoziation:"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<properties\n"
-#~ " name=\"logicalName\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</properties>]]>"
-#~ msgstr ""
-#~ "<properties \n"
-#~ " name=\"logicalName\" \n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ ">\n"
-#~ " \n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</properties>"
+#~ msgid "primary key associations"
+#~ msgstr "Assoziationen des Primärschlüssels"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"personNumber\"/>\n"
-#~ "\n"
-#~ " ...\n"
-#~ " <properties name=\"name\"\n"
-#~ " unique=\"true\" update=\"false\">\n"
-#~ " <property name=\"firstName\"/>\n"
-#~ " <property name=\"initial\"/>\n"
-#~ " <property name=\"lastName\"/>\n"
-#~ " </properties>\n"
-#~ "</class>]]>"
+#~ "Alternatively, a foreign key with a unique constraint, from "
+#~ "<literal>Employee</literal> to <literal>Person</literal>, can be "
+#~ "expressed as:"
#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"personNumber\"/>\n"
-#~ " ...\n"
-#~ " <properties name=\"name\" \n"
-#~ " unique=\"true\" update=\"false\">\n"
-#~ " <property name=\"firstName\"/>\n"
-#~ " <property name=\"initial\"/>\n"
-#~ " <property name=\"lastName\"/>\n"
-#~ " </properties>\n"
-#~ "</class>"
+#~ "Alternativ kann ein Fremdschlüssel mit eindeutiger Bedingung von "
+#~ "<literal>Employee</literal> zu <literal>Person</literal> wie folgt "
+#~ "ausgedrückt werden:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"person\"\n"
-#~ " class=\"Person\" property-ref=\"name\">\n"
-#~ " <column name=\"firstName\"/>\n"
-#~ " <column name=\"initial\"/>\n"
-#~ " <column name=\"lastName\"/>\n"
-#~ "</many-to-one>]]>"
+#~ "This association can be made bidirectional by adding the following to the "
+#~ "<literal>Person</literal> mapping:"
#~ msgstr ""
-#~ "<many-to-one name=\"person\" \n"
-#~ " class=\"Person\" property-ref=\"name\">\n"
-#~ " <column name=\"firstName\"/>\n"
-#~ " <column name=\"initial\"/>\n"
-#~ " <column name=\"lastName\"/>\n"
-#~ "</many-to-one>"
+#~ "Und diese Assoziation kann durch Hinzufügen des Folgenden zum "
+#~ "<literal>Person</literal>-Mapping bidirektional gemacht werden:"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " extends=\"SuperclassName\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</subclass>]]>"
-#~ msgstr ""
-#~ "<subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " extends=\"SuperclassName\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</subclass>"
+#~ msgid "Component and dynamic-component"
+#~ msgstr "component, dynamic-component"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<joined-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <key .... >\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</joined-subclass>]]>"
-#~ msgstr ""
-#~ "<joined-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <key .... >\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</joined-subclass>"
+#~ msgid "Subclass"
+#~ msgstr "subclass"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" table=\"CATS\">\n"
-#~ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
-#~ " <generator class=\"hilo\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"birthdate\" type=\"date\"/>\n"
-#~ " <property name=\"color\" not-null=\"true\"/>\n"
-#~ " <property name=\"sex\" not-null=\"true\"/>\n"
-#~ " <property name=\"weight\"/>\n"
-#~ " <many-to-one name=\"mate\"/>\n"
-#~ " <set name=\"kittens\">\n"
-#~ " <key column=\"MOTHER\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ " <joined-subclass name=\"DomesticCat\" table="
-#~ "\"DOMESTIC_CATS\">\n"
-#~ " <key column=\"CAT\"/>\n"
-#~ " <property name=\"name\" type=\"string\"/>\n"
-#~ " </joined-subclass>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"eg.Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
+#~ "A discriminator column is not required for this mapping strategy. Each "
+#~ "subclass must, however, declare a table column holding the object "
+#~ "identifier using the <literal><key></literal> element. The mapping "
+#~ "at the start of the chapter would then be re-written as:"
#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" table=\"CATS\">\n"
-#~ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
-#~ " <generator class=\"hilo\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"birthdate\" type=\"date\"/>\n"
-#~ " <property name=\"color\" not-null=\"true\"/>\n"
-#~ " <property name=\"sex\" not-null=\"true\"/>\n"
-#~ " <property name=\"weight\"/>\n"
-#~ " <many-to-one name=\"mate\"/>\n"
-#~ " <set name=\"kittens\">\n"
-#~ " <key column=\"MOTHER\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ " <joined-subclass name=\"DomesticCat\" table="
-#~ "\"DOMESTIC_CATS\">\n"
-#~ " <key column=\"CAT\"/>\n"
-#~ " <property name=\"name\" type=\"string\"/>\n"
-#~ " </joined-subclass>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"eg.Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
+#~ "Bei dieser Mapping-Strategie ist keine Diskriminatortabelle erforderlich. "
+#~ "Jede Subklasse muss jedoch unter Verwendung des <literal><key></"
+#~ "literal>-Elements eine Tabellenspalte deklarieren, die den "
+#~ "Objektbezeichner enthält. Das Mapping vom Kapitelbeginn würde dann wie "
+#~ "folgt umgeschrieben:"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<union-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</union-subclass>]]>"
-#~ msgstr ""
-#~ "<union-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</union-subclass>"
+#~ msgid "Union-subclass"
+#~ msgstr "union-subclass"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<join\n"
-#~ " table=\"tablename\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " optional=\"true|false\">\n"
-#~ "\n"
-#~ " <key ... />\n"
-#~ "\n"
-#~ " <property ... />\n"
-#~ " ...\n"
-#~ "</join>]]>"
-#~ msgstr ""
-#~ "<join\n"
-#~ " table=\"tablename\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " optional=\"true|false\">\n"
-#~ " \n"
-#~ " <key ... />\n"
-#~ " \n"
-#~ " <property ... />\n"
-#~ " ...\n"
-#~ "</join>"
+#~ msgid "Join"
+#~ msgstr "join"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\"\n"
-#~ " table=\"PERSON\">\n"
-#~ "\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
-#~ "\n"
-#~ " <join table=\"ADDRESS\">\n"
-#~ " <key column=\"ADDRESS_ID\"/>\n"
-#~ " <property name=\"address\"/>\n"
-#~ " <property name=\"zip\"/>\n"
-#~ " <property name=\"country\"/>\n"
-#~ " </join>\n"
-#~ " ...]]>"
+#~ "Using the <literal><join></literal> element, it is possible to map "
+#~ "properties of one class to several tables that have a one-to-one "
+#~ "relationship. For example:"
#~ msgstr ""
-#~ "<class name=\"Person\"\n"
-#~ " table=\"PERSON\">\n"
-#~ "\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
-#~ "\n"
-#~ " <join table=\"ADDRESS\">\n"
-#~ " <key column=\"ADDRESS_ID\"/>\n"
-#~ " <property name=\"address\"/>\n"
-#~ " <property name=\"zip\"/>\n"
-#~ " <property name=\"country\"/>\n"
-#~ " </join>\n"
-#~ " ..."
+#~ "Mittels des <literal><join></literal>-Elements können Properties "
+#~ "einer Klasse zu mehreren Tabellen gemappt werden, wenn eine 1-zu-1 "
+#~ "Beziehung zwischen den Tabellen besteht."
#, fuzzy
-#~ msgid "<title>Key</title>"
-#~ msgstr "<title>key</title>"
+#~ msgid "<literal>class</literal>"
+#~ msgstr "<literal>all</literal> Prüfung aller Spalten"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<key\n"
-#~ " column=\"columnname\"\n"
-#~ " on-delete=\"noaction|cascade\"\n"
-#~ " property-ref=\"propertyName\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<key\n"
-#~ " column=\"columnname\"\n"
-#~ " on-delete=\"noaction|cascade\"\n"
-#~ " property-ref=\"propertyName\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ "/>"
+#~ msgid "<literal>binary</literal>"
+#~ msgstr "<literal>name</literal>: Der Property-Name."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<column\n"
-#~ " name=\"column_name\"\n"
-#~ " length=\"N\"\n"
-#~ " precision=\"N\"\n"
-#~ " scale=\"N\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " unique-key=\"multicolumn_unique_key_name\"\n"
-#~ " index=\"index_name\"\n"
-#~ " sql-type=\"sql_type_name\"\n"
-#~ " check=\"SQL expression\"\n"
-#~ " default=\"SQL expression\"/>]]>"
-#~ msgstr ""
-#~ "<column\n"
-#~ " name=\"column_name\"\n"
-#~ " length=\"N\"\n"
-#~ " precision=\"N\"\n"
-#~ " scale=\"N\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " unique-key=\"multicolumn_unique_key_name\"\n"
-#~ " index=\"index_name\"\n"
-#~ " sql-type=\"sql_type_name\"\n"
-#~ " check=\"SQL expression\"\n"
-#~ " default=\"SQL expression\"/>"
+#~ msgid "<literal>text</literal>"
+#~ msgstr "<literal>name</literal>: Der Property-Name."
#, fuzzy
-#~ msgid "<![CDATA[<formula>SQL expression</formula>]]>"
-#~ msgstr "<formula>SQL expression</formula>"
+#~ msgid "<literal>clob, blob</literal>"
+#~ msgstr "<literal>all</literal> Prüfung aller Spalten"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"homeAddress\" class=\"Address\"\n"
-#~ " insert=\"false\" update=\"false\">\n"
-#~ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
-#~ " <formula>'MAILING'</formula>\n"
-#~ "</many-to-one>]]>"
+#~ "XML does not suit all users so there are some alternative ways to define "
+#~ "O/R mapping metadata in Hibernate."
#~ msgstr ""
-#~ "<many-to-one name=\"homeAddress\" class=\"Address\"\n"
-#~ " insert=\"false\" update=\"false\">\n"
-#~ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
-#~ " <formula>'MAILING'</formula>\n"
-#~ "</many-to-one>"
+#~ "XML ist nicht jedermanns Sache, daher gibt es auch alternative "
+#~ "Möglichkeiten O/R Mapping Metadaten in Hibernate zu definieren."
-#, fuzzy
-#~ msgid "<![CDATA[<import class=\"java.lang.Object\" rename=\"Universe\"/>]]>"
-#~ msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+#~ msgid "Using XDoclet markup"
+#~ msgstr "Die Verwendung von XDoclet-Markup"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<import\n"
-#~ " class=\"ClassName\"\n"
-#~ " rename=\"ShortName\"\n"
-#~ "/>]]>"
+#~ "Many Hibernate users prefer to embed mapping information directly in "
+#~ "sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not "
+#~ "cover this approach in this reference guide since it is considered part "
+#~ "of XDoclet. However, we include the following example of the "
+#~ "<literal>Cat</literal> class with XDoclet mappings:"
#~ msgstr ""
-#~ "<import\n"
-#~ " class=\"ClassName\"\n"
-#~ " rename=\"ShortName\"\n"
-#~ "/>"
+#~ "Viele Benutzer von Hibernate ziehen es vor, Mapping-Informationen unter "
+#~ "Verwendung von XDoclet <literal>@hibernate.tags</literal> direkt im "
+#~ "Quellcode einzubetten. Diese Vorgehensweise wird hier nicht behandelt, da "
+#~ "es sich ausschließlich um einen Teil von XDoclet handelt. Allerdings "
+#~ "zeigen wir das nachfolgende Beispiel der <literal>Cat</literal>-Klasse "
+#~ "mit XDoclet-Mappings."
#, fuzzy
-#~ msgid "<title>Any</title>"
-#~ msgstr "<title>any</title>"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
-#~ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
-#~ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
-#~ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
-#~ " <column name=\"table_name\"/>\n"
-#~ " <column name=\"id\"/>\n"
-#~ "</any>]]>"
+#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
#~ msgstr ""
-#~ "<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
-#~ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
-#~ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
-#~ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
-#~ " <column name=\"table_name\"/>\n"
-#~ " <column name=\"id\"/>\n"
-#~ "</any>"
+#~ "Weitere Beispiele zu XDoclet und Hibernate finden Sie auf der Hibernate "
+#~ "Website."
+#~ msgid "Using JDK 5.0 Annotations"
+#~ msgstr "Die Verwendung von JDK 5.0 Annotationen"
+
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<any\n"
-#~ " name=\"propertyName\"\n"
-#~ " id-type=\"idtypename\"\n"
-#~ " meta-type=\"metatypename\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ ">\n"
-#~ " <meta-value ... />\n"
-#~ " <meta-value ... />\n"
-#~ " .....\n"
-#~ " <column .... />\n"
-#~ " <column .... />\n"
-#~ " .....\n"
-#~ "</any>]]>"
+#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
+#~ "are type-safe and checked at compile time. This mechanism is more "
+#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
+#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
+#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
+#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
+#~ "mechanism for entity beans. Hibernate3 implements the "
+#~ "<literal>EntityManager</literal> of JSR-220 (the persistence API). "
+#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
+#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
+#~ "220) and Hibernate3 metadata is supported."
#~ msgstr ""
-#~ "<any\n"
-#~ " name=\"propertyName\"\n"
-#~ " id-type=\"idtypename\"\n"
-#~ " meta-type=\"metatypename\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ ">\n"
-#~ " <meta-value ... />\n"
-#~ " <meta-value ... />\n"
-#~ " .....\n"
-#~ " <column .... />\n"
-#~ " <column .... />\n"
-#~ " .....\n"
-#~ "</any>"
+#~ "JDK 5.0 hat Annotationen im XDoclet-Stil auf der Sprachebene vorgestellt, "
+#~ "die typensicher und zum Zeitpunkt der Kompilierung geprüft sind. Dieser "
+#~ "Mechanismus ist leistungsstärker als XDoclet-Annotationen und bietet "
+#~ "besseren Support durch Tools und IDEs . IntelliJ IDEA zum Beispiel "
+#~ "unterstützt Auto-Vervollständigung und Syntax-Hervorhebungen von JDK 5.0 "
+#~ "Annotationen. Die neue Revision der EJB-Spezifikation (JSR-220) verwendet "
+#~ "JDK 5.0 Annotationen als primären Metadata-Mechanismus für Entity-Beans. "
+#~ "Hibernate3 implementiert den <literal>EntityManager</literal> von JSR-220 "
+#~ "(das Persistenz-API), Support für Mapping-Metadata ist mittels des "
+#~ "<emphasis>Hibernate Annotations</emphasis>-Pakets als separater Download "
+#~ "verfügbar. Sowohl EJB3 (JSR-220) und Hibernate3 Metadata werden "
+#~ "unterstützt."
-#~ msgid "string"
-#~ msgstr "string"
+#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+#~ msgstr ""
+#~ "Nachfolgend sehen Sie ein Beispiel für eine als EJB Entity-Bean "
+#~ "annotierte POJO-Klasse:"
#, fuzzy
-#~ msgid "class"
-#~ msgstr "subclass"
-
-#~ msgid "binary"
-#~ msgstr "binary"
-
-#~ msgid "text"
-#~ msgstr "text"
-
-#~ msgid "serializable"
-#~ msgstr "serializable"
-
-#~ msgid "clob, blob"
-#~ msgstr "clob, blob"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"twoStrings\" type=\"org.hibernate.test."
-#~ "DoubleStringType\">\n"
-#~ " <column name=\"first_string\"/>\n"
-#~ " <column name=\"second_string\"/>\n"
-#~ "</property>]]>"
+#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
+#~ "development. Please refer to the Hibernate Annotations module for more "
+#~ "details."
#~ msgstr ""
-#~ "<property name=\"twoStrings\" type=\"org.hibernate.test."
-#~ "DoubleStringType\">\n"
-#~ " <column name=\"first_string\"/>\n"
-#~ " <column name=\"second_string\"/>\n"
-#~ "</property>"
+#~ "Bitte beachten Sie, dass am Support für JDK 5.0 Annotationen (und JSR-"
+#~ "220) noch gearbeitet wird und dieser noch nicht vollständig verfügbar "
+#~ "ist. Weitere Einzelheiten entnehmen Sie bitte dem Hibernate "
+#~ "Annotationsmodul."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"priority\">\n"
-#~ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ " </type>\n"
-#~ "</property>]]>"
+#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
+#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
+#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
+#~ "]>\n"
+#~ "\n"
+#~ "<hibernate-mapping package=\"your.domain\">\n"
+#~ " <class name=\"MyEntity\">\n"
+#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
+#~ " ...\n"
+#~ " </id>\n"
+#~ " <class>\n"
+#~ " &types;\n"
+#~ "</hibernate-mapping>]]>"
#~ msgstr ""
-#~ "<property name=\"priority\">\n"
-#~ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType"
+#~ "<?xml version=\"1.0\"?>\n"
+#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
#~ "\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ " </type>\n"
-#~ "</property>"
+#~ "\n"
+#~ "<hibernate-mapping>\n"
+#~ "[...]\n"
+#~ "</hibernate-mapping>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType"
-#~ "\" name=\"default_zero\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ "</typedef>]]>"
+#~ "<![CDATA[<composite-id>\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
#~ msgstr ""
-#~ "<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" "
-#~ "name=\"default_zero\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ "</typedef>"
+#~ "<composite-id>\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>"
#, fuzzy
-#~ msgid "<![CDATA[<property name=\"priority\" type=\"default_zero\"/>]]>"
-#~ msgstr "<property name=\"priority\" type=\"default_zero\"/>"
+#~ msgid ""
+#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
+#~ msgstr ""
+#~ "<composite-id class=\"MedicareId\" mapped=\"true\">\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Contract\" table=\"Contracts\"\n"
-#~ " entity-name=\"CurrentContract\">\n"
-#~ " ...\n"
-#~ " <set name=\"history\" inverse=\"true\"\n"
-#~ " order-by=\"effectiveEndDate desc\">\n"
-#~ " <key column=\"currentContractId\"/>\n"
-#~ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Contract\" table=\"ContractHistory\"\n"
-#~ " entity-name=\"HistoricalContract\">\n"
-#~ " ...\n"
-#~ " <many-to-one name=\"currentContract\"\n"
-#~ " column=\"currentContractId\"\n"
-#~ " entity-name=\"CurrentContract\"/>\n"
-#~ "</class>]]>"
+#~ "<![CDATA[<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID"
+#~ "\" unique=\"true\"/>]]>"
#~ msgstr ""
-#~ "<class name=\"Contract\" table=\"Contracts\" \n"
-#~ " entity-name=\"CurrentContract\">\n"
-#~ " ...\n"
-#~ " <set name=\"history\" inverse=\"true\" \n"
-#~ " order-by=\"effectiveEndDate desc\">\n"
-#~ " <key column=\"currentContractId\"/>\n"
-#~ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Contract\" table=\"ContractHistory\" \n"
-#~ " entity-name=\"HistoricalContract\">\n"
-#~ " ...\n"
-#~ " <many-to-one name=\"currentContract\" \n"
-#~ " column=\"currentContractId\" \n"
-#~ " entity-name=\"CurrentContract\"/>\n"
-#~ "</class>"
+#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
+#~ "unique=\"true\"/>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"LineItem\" table=\"`Line Item`\">\n"
-#~ " <id name=\"id\" column=\"`Item Id`\"/><generator class=\"assigned\"/"
-#~ "></id>\n"
-#~ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
+#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" property-ref="
+#~ "\"person\"/>]]>"
#~ msgstr ""
-#~ "<class name=\"LineItem\" table=\"`Line Item`\">\n"
-#~ " <id name=\"id\" column=\"`Item Id`\"/><generator class="
-#~ "\"assigned\"/></id>\n"
-#~ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
-#~ " ...\n"
-#~ "</class>"
+#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
+#~ "\"/>"
#, fuzzy
#~ msgid ""
@@ -6225,59 +10476,3 @@
#~ "\n"
#~ " // Getter/setter and business methods\n"
#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <create>CREATE TRIGGER my_trigger ...</create>\n"
-#~ " <drop>DROP TRIGGER my_trigger</drop>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <create>CREATE TRIGGER my_trigger ...</create>\n"
-#~ " <drop>DROP TRIGGER my_trigger</drop>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
-#~ ">\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/"
-#~ ">\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/collection_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/collection_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/collection_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,33 +285,52 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: collection_mapping.xml:31
#, fuzzy, no-c-format
msgid "Collection mapping"
msgstr "Collection-Mappings"
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr "Persistente Collections"
#. Tag: para
+#: collection_mapping.xml:36
#, fuzzy, no-c-format
msgid ""
-"Hibernate requires that persistent collection-valued fields be declared as "
-"an interface type. For example:"
+"Naturally Hibernate also allows to persist collections. These persistent "
+"collections can contain almost any other Hibernate type, including: basic "
+"types, custom types, components and references to other entities. The "
+"distinction between value and reference semantics is in this context very "
+"important. An object in a collection might be handled with \"value\" "
+"semantics (its life cycle fully depends on the collection owner), or it "
+"might be a reference to another entity with its own life cycle. In the "
+"latter case, only the \"link\" between the two objects is considered to be a "
+"state held by the collection."
msgstr ""
-"In Hibernate müssen persistente Collection-wertige Felder als Interface-Typ "
-"deklariert werden, zum Beispiel:"
+"Collections können fast jeden beliebigen anderen Hibernate-Typ enthalten, "
+"einschließlich sämtlicher Grundtypen, angepasster Typen, Komponenten und "
+"natürlich Referenzen zu anderen Entities. Das ist ein wichtiger Unterschied: "
+"Ein Objekt einer Collection könnte mit \"Wert\"semantik bearbeitet werden "
+"(sein Lebenszyklus hängt vollständig vom Besitzer der Collection ab) oder es "
+"könnte ein Verweis auf eine andere Entity mit ihrem eigenen Lebenszyklus "
+"sein. Im letzteren Fall wird nur die \"Verbindung\" zwischen den beiden "
+"Objekten als von der Collection gehaltener Status angesehen."
#. Tag: para
+#: collection_mapping.xml:46
#, fuzzy, no-c-format
msgid ""
-"The actual interface might be <literal>java.util.Set</literal>, "
+"As a requirement persistent collection-valued fields must be declared as an "
+"interface type (see <xref linkend=\"example.collection.mapping.annotations\"/"
+">). The actual interface might be <literal>java.util.Set</literal>, "
"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
"<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, "
"<literal>java.util.SortedMap</literal> or anything you like (\"anything you "
"like\" means you will have to write an implementation of <literal>org."
-"hibernate.usertype.UserCollectionType</literal>.)"
+"hibernate.usertype.UserCollectionType</literal>)."
msgstr ""
"Das tatsächliche Interface könnte <literal>java.util.Set</literal>, "
"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
@@ -322,15 +341,17 @@
"schreiben müssen)."
#. Tag: para
+#: collection_mapping.xml:57
#, fuzzy, no-c-format
msgid ""
-"Notice how the instance variable was initialized with an instance of "
-"<literal>HashSet</literal>. This is the best way to initialize collection "
+"Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the "
+"instance variable <literal>parts</literal> was initialized with an instance "
+"of <literal>HashSet</literal>. This is the best way to initialize collection "
"valued properties of newly instantiated (non-persistent) instances. When you "
-"make the instance persistent, by calling <literal>persist()</literal> for "
-"example, Hibernate will actually replace the <literal>HashSet</literal> with "
-"an instance of Hibernate's own implementation of <literal>Set</literal>. Be "
-"aware of the following errors:"
+"make the instance persistent, by calling <literal>persist()</literal>, "
+"Hibernate will actually replace the <literal>HashSet</literal> with an "
+"instance of Hibernate's own implementation of <literal>Set</literal>. Be "
+"aware of the following error:"
msgstr ""
"Beachten Sie, wie wir die Instanzvariable mit einer Instanz von "
"<literal>HashSet</literal> initialisiert haben. Dieses ist die beste Art, "
@@ -340,7 +361,39 @@
"literal> durch eine Instanz seiner eigenen Implementierung von <literal>Set</"
"literal> ersetzen. Achten Sie auf mögliche Fehler wie den folgenden:"
+#. Tag: title
+#: collection_mapping.xml:68
+#, no-c-format
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+
#. Tag: para
+#: collection_mapping.xml:73
#, fuzzy, no-c-format
msgid ""
"The persistent collections injected by Hibernate behave like "
@@ -354,6 +407,7 @@
"<literal>ArrayList</literal>."
#. Tag: para
+#: collection_mapping.xml:78
#, fuzzy, no-c-format
msgid ""
"Collections instances have the usual behavior of value types. They are "
@@ -377,11 +431,12 @@
"Collection-Verweis und einer leeren Collection."
#. Tag: para
+#: collection_mapping.xml:89
#, fuzzy, no-c-format
msgid ""
"Use persistent collections the same way you use ordinary Java collections. "
-"However, please ensure you understand the semantics of bidirectional "
-"associations (these are discussed later)."
+"However, ensure you understand the semantics of bidirectional associations "
+"(see <xref linkend=\"collections-bidirectional\"/>)."
msgstr ""
"Sie werden mit all dem jedoch meist wenig zu tun haben. Verwenden Sie "
"persistente Collections genau so, wie sie reguläre Java-Collections "
@@ -390,57 +445,384 @@
"ein)."
#. Tag: title
+#: collection_mapping.xml:97
+#, fuzzy, no-c-format
+msgid "How to map collections"
+msgstr "Sortierte Collections"
+
+#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "Collection mappings"
-msgstr "Collection-Mappings"
+msgid ""
+"Using annotations you can map <classname>Collection</classname>s, "
+"<classname>List</classname>s, <classname>Map</classname>s and "
+"<classname>Set</classname>s of associated entities using @OneToMany and "
+"@ManyToMany. For collections of a basic or embeddable type use "
+"@ElementCollection. In the simplest case a collection mapping looks like "
+"this:"
+msgstr ""
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
#, fuzzy, no-c-format
msgid ""
-"There are quite a range of mappings that can be generated for collections "
-"that cover many common relational models. We suggest you experiment with the "
-"schema generation tool so that you understand how various mapping "
-"declarations translate to database tables."
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinColumn(name=\"PART_ID\")\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
msgstr ""
-"Es gibt eine ganze Reihe von Mappings, die für Collections generiert werden "
-"können und die zahlreiche gängige relationale Modelle abdecken. Es ist "
-"wahrscheinlich sinnvoll, wenn Sie mit dem Tool zur Schemagenerierung "
-"experimentieren, um zu sehen, wie die verschiedenen Mapping-Deklarationen "
-"bei Datenbanktabellen umgesetzt werden."
+"public class Product {\n"
+" private String serialNumber;\n"
+" private Set parts = new HashSet();\n"
+" \n"
+" public Set getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+"}"
#. Tag: para
+#: collection_mapping.xml:112
+#, no-c-format
+msgid ""
+"Product describes a unidirectional relationship with Part using the join "
+"column PART_ID. In this unidirectional one to many scenario you can also use "
+"a join table as seen in <xref linkend=\"example-one-to-many-with-join-table"
+"\"/>."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"PRODUCT_PARTS\",\n"
+" joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+" )\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:124
+#, no-c-format
+msgid ""
+"Without describing any physical mapping (no <classname>@JoinColumn</"
+"classname> or <classname>@JoinTable</classname>), a unidirectional one to "
+"many with join table is used. The table name is the concatenation of the "
+"owner table name, _, and the other side table name. The foreign key name(s) "
+"referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:135
#, fuzzy, no-c-format
msgid ""
-"The Hibernate mapping element used for mapping a collection depends upon the "
-"type of interface. For example, a <literal><set></literal> element is "
-"used for mapping properties of type <literal>Set</literal>."
+"Lets have a look now how collections are mapped using Hibernate mapping "
+"files. In this case the first step is to chose the right mapping element. It "
+"depends on the type of interface. For example, a <literal><set></"
+"literal> element is used for mapping properties of type <literal>Set</"
+"literal>."
msgstr ""
"Das Hibernate Mapping-Element, das für das Mapping einer Collection "
"verwendet wird, hängt vom Typ des Interface ab. Zum Beispiel wird ein "
"<literal><set></literal>-Element für Mapping-Properties des Typs "
"<literal>Set</literal> verwendet."
+#. Tag: title
+#: collection_mapping.xml:142
+#, no-c-format
+msgid "Mapping a Set using <set>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:147
+#, fuzzy, no-c-format
+msgid ""
+"In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many "
+"association</emphasis> links the <literal>Product</literal> and "
+"<literal>Part</literal> entities. This association requires the existence of "
+"a foreign key column and possibly an index column to the <literal>Part</"
+"literal> table. This mapping loses certain semantics of normal Java "
+"collections:"
+msgstr ""
+"Eine Assoziation von <literal>Product</literal> zu <literal>Part</literal> "
+"macht die Existenz einer Spalte mit Fremdschlüssel und möglicherweise einer "
+"Indexspalte zur <literal>Part</literal>-Tabelle erforderlich. Ein "
+"<literal><one-to-many></literal>-Tag zeigt an, dass dies eine \"One-to-"
+"Many\"-Assoziation ist."
+
+#. Tag: para
+#: collection_mapping.xml:156
+#, fuzzy, no-c-format
+msgid ""
+"An instance of the contained entity class cannot belong to more than one "
+"instance of the collection."
+msgstr ""
+"Eine Instanz der enthaltenen Entity-Klasse kann nicht zu mehr als einer "
+"Instanz der Collection gehören"
+
+#. Tag: para
+#: collection_mapping.xml:161
+#, fuzzy, no-c-format
+msgid ""
+"An instance of the contained entity class cannot appear at more than one "
+"value of the collection index."
+msgstr ""
+"Eine Instanz der enthaltenen Entity-Klasse kann nicht an mehr als einem Wert "
+"des Collection-Index erscheinen"
+
+#. Tag: para
+#: collection_mapping.xml:166
#, no-c-format
msgid ""
-"Apart from <literal><set></literal>, there is also <literal><"
-"list></literal>, <literal><map></literal>, <literal><bag></"
-"literal>, <literal><array></literal> and <literal><primitive-"
-"array></literal> mapping elements. The <literal><map></literal> "
-"element is representative:"
+"Looking closer at the used <literal><one-to-many></literal> tag we see "
+"that it has the following options."
msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-many\n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+msgstr ""
+"<one-to-many \n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+
+#. Tag: para
+#: collection_mapping.xml:185
+#, fuzzy, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr ""
+"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, fuzzy, no-c-format
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how cached identifiers that reference missing rows will "
+"be handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal> (optional - standardmäßig <literal>exception</"
+"literal>): Bestimmt, wie gespeicherte Bezeichner (sog. \"Identifier\"), die "
+"auf fehlende Reihen verweisen, behandelt werden. Mit <literal>ignore</"
+"literal> wird eine fehlende Reihe als Null-Assoziation angesehen."
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, fuzzy, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class, as an alternative to <literal>class</literal>."
+msgstr ""
+"<literal>entity-name</literal> (optional): Der Entity-Name der zugehörigen "
+"Klasse als Alternative zu <literal>class</literal>."
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><one-to-many></literal> element does not need to declare "
+"any columns. Nor is it necessary to specify the <literal>table</literal> "
+"name anywhere."
+msgstr ""
+"Beachten Sie, dass das <literal><one-to-many></literal>-Element keine "
+"Spalten deklarieren muss. Es ist außerdem nicht nötig, den <literal>table</"
+"literal>-Namen irgendwo zu bestimmen."
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, fuzzy, no-c-format
+msgid ""
+"If the foreign key column of a <literal><one-to-many></literal> "
+"association is declared <literal>NOT NULL</literal>, you must declare the "
+"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
+"or <emphasis>use a bidirectional association</emphasis> with the collection "
+"mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend="
+"\"collections-bidirectional\"/>."
+msgstr ""
+"<emphasis>Sehr wichtig:</emphasis> Falls die Fremdschlüsselspalte einer "
+"<literal><one-to-many></literal>-Assoziation als <literal>NOT NULL</"
+"literal> deklariert ist, müssen Sie beim <literal><key></literal>-"
+"Mapping <literal>not-null=\"true\"</literal> deklarieren oder <emphasis>eine "
+"bidirektionale Assoziation</emphasis> mit als <literal>inverse=\"true\"</"
+"literal> gekennzeichnetem Collection-Mapping verwenden. Wir gehen später in "
+"diesem Kapitel noch näher auf bidirektionale Assoziationen ein."
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, fuzzy, no-c-format
+msgid ""
+"Apart from the <literal><set> </literal>tag as shown in <xref linkend="
+"\"example.collections.set\"/>, there is also <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> and <literal><primitive-array></"
+"literal> mapping elements. The <literal><map></literal> element is "
+"representative:"
+msgstr ""
"Neben <literal><set></literal> gibt es auch <literal><list></"
"literal>, <literal><map></literal>, <literal><bag></literal>, "
"<literal><array></literal> und <literal><primitive-array></"
"literal> Mapping-Elemente. Das <literal><map></literal>-Element ist "
"charakteristisch:"
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, fuzzy, no-c-format
+msgid ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+msgstr ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+
#. Tag: para
+#: collection_mapping.xml:266
#, fuzzy, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr "<literal>name</literal> der Property-Name der Collection"
#. Tag: para
+#: collection_mapping.xml:270
#, fuzzy, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to property name): the name of "
@@ -451,6 +833,7 @@
"verwendet)"
#. Tag: para
+#: collection_mapping.xml:276
#, fuzzy, no-c-format
msgid ""
"<literal>schema</literal> (optional): the name of a table schema to override "
@@ -460,6 +843,7 @@
"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:281
#, fuzzy, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
@@ -478,6 +862,7 @@
"(passend für sehr große Collections)"
#. Tag: para
+#: collection_mapping.xml:290
#, fuzzy, no-c-format
msgid ""
"<literal>inverse</literal> (optional - defaults to <literal>false</"
@@ -489,6 +874,7 @@
"einer biderektionalen Assoziation"
#. Tag: para
+#: collection_mapping.xml:296
#, fuzzy, no-c-format
msgid ""
"<literal>cascade</literal> (optional - defaults to <literal>none</literal>): "
@@ -499,6 +885,7 @@
"\"child entities\")"
#. Tag: para
+#: collection_mapping.xml:302
#, fuzzy, no-c-format
msgid ""
"<literal>sort</literal> (optional): specifies a sorted collection with "
@@ -509,12 +896,13 @@
"Vergleichsprogramm"
#. Tag: para
+#: collection_mapping.xml:308
#, fuzzy, no-c-format
msgid ""
-"<literal>order-by</literal> (optional, JDK1.4 only): specifies a table "
-"column or columns that define the iteration order of the <literal>Map</"
-"literal>, <literal>Set</literal> or bag, together with an optional "
-"<literal>asc</literal> or <literal>desc</literal>."
+"<literal>order-by</literal> (optional): specifies a table column or columns "
+"that define the iteration order of the <literal>Map</literal>, <literal>Set</"
+"literal> or bag, together with an optional <literal>asc</literal> or "
+"<literal>desc</literal>."
msgstr ""
"<literal>order-by</literal> (optional, nur JDK1.4) bestimmt eine (oder "
"mehrere) Tabellenspalte(n), die die Iterationsreihenfolge von <literal>Map</"
@@ -523,6 +911,7 @@
"definieren"
#. Tag: para
+#: collection_mapping.xml:316
#, fuzzy, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -536,6 +925,7 @@
"Collection nur einen Untersatz der verfügbaren Daten enthalten soll)"
#. Tag: para
+#: collection_mapping.xml:324
#, fuzzy, no-c-format
msgid ""
"<literal>fetch</literal> (optional, defaults to <literal>select</literal>): "
@@ -547,6 +937,7 @@
"sequentieller Auswahl und Fetching nach sequentieller Unterauswahl."
#. Tag: para
+#: collection_mapping.xml:331
#, fuzzy, no-c-format
msgid ""
"<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): "
@@ -557,6 +948,7 @@
"Collection."
#. Tag: para
+#: collection_mapping.xml:337
#, fuzzy, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -568,6 +960,7 @@
"den Property-Wert der Collection."
#. Tag: para
+#: collection_mapping.xml:343
#, fuzzy, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -581,6 +974,7 @@
"ist es oftmals sinnvoll, diese Einstellung zu deaktivieren)."
#. Tag: para
+#: collection_mapping.xml:351
#, fuzzy, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -593,19 +987,31 @@
"der Collection sich niemals ändern (in manchen Fällen eine leichte "
"Optimierung der Performance)."
+#. Tag: para
+#: collection_mapping.xml:360
+#, no-c-format
+msgid ""
+"After exploring the basic mapping of collections in the preceding paragraphs "
+"we will now focus details like physical mapping considerations, indexed "
+"collections and collections of value types."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr "Collection-Fremdschlüssel"
#. Tag: para
+#: collection_mapping.xml:367
#, fuzzy, no-c-format
msgid ""
-"Collection instances are distinguished in the database by the foreign key of "
-"the entity that owns the collection. This foreign key is referred to as the "
-"<emphasis>collection key column</emphasis>, or columns, of the collection "
-"table. The collection key column is mapped by the <literal><key></"
-"literal> element."
+"On the database level collection instances are distinguished by the foreign "
+"key of the entity that owns the collection. This foreign key is referred to "
+"as the <emphasis>collection key column</emphasis>, or columns, of the "
+"collection table. The collection key column is mapped by the "
+"<literal>@JoinColumn</literal> annotation respectively the <literal><"
+"key></literal> XML element."
msgstr ""
"Die Instanzen der Collection werden in der Datenbank durch den "
"Fremdschlüssel der Entity, zu der die Collection gehört, unterschieden. "
@@ -615,12 +1021,12 @@
"Element gemappt."
#. Tag: para
+#: collection_mapping.xml:374
#, fuzzy, no-c-format
msgid ""
"There can be a nullability constraint on the foreign key column. For most "
"collections, this is implied. For unidirectional one-to-many associations, "
-"the foreign key column is nullable by default, so you may need to specify "
-"<literal>not-null=\"true\"</literal>."
+"the foreign key column is nullable by default, so you may need to specify"
msgstr ""
"Es ist möglich, dass eine \"Nullability\"-Bedingung an der Spalte des "
"Fremdschlüssels existiert. Für die meisten Collections wird dies "
@@ -628,101 +1034,268 @@
"Spalte des Fremdschlüssels standardmäßig \"nullbar\", weswegen es möglich "
"ist, dass Sie <literal>not-null=\"true\"</literal> festlegen müssen."
+#. Tag: programlisting
+#: collection_mapping.xml:379
+#, no-c-format
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:381
+#, no-c-format
+msgid "<para>or</para>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:383
#, fuzzy, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+
+#. Tag: para
+#: collection_mapping.xml:385
+#, fuzzy, no-c-format
msgid ""
-"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
+"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In "
+"XML this can be expressed via:"
msgstr ""
"Die Bedingung für den Fremdschlüssel kann <literal>ON DELETE CASCADE</"
"literal> verwenden."
+#. Tag: programlisting
+#: collection_mapping.xml:388
+#, fuzzy, no-c-format
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+msgstr "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+
#. Tag: para
+#: collection_mapping.xml:390
#, no-c-format
msgid ""
-"See the previous chapter for a full definition of the <literal><key></"
-"literal> element."
+"In annotations the Hibernate specific annotation @OnDelete has to be used."
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:393
+#, no-c-format
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:395
+#, fuzzy, no-c-format
+msgid ""
+"See <xref lang=\"\" linkend=\"section.key\"/> for more information about the "
+"<literal><key></literal> element."
+msgstr ""
"Die vollständige Definition des <literal><key></literal>-Elements "
"finden Sie im vorangegangenen Kapitel."
#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
-msgid "Collection elements"
-msgstr "Collection-Elemente"
+msgid "Indexed collections"
+msgstr "Indizierte Collections"
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:402
+#, no-c-format
msgid ""
-"Collections can contain almost any other Hibernate type, including: basic "
-"types, custom types, components and references to other entities. This is an "
-"important distinction. An object in a collection might be handled with "
-"\"value\" semantics (its life cycle fully depends on the collection owner), "
-"or it might be a reference to another entity with its own life cycle. In the "
-"latter case, only the \"link\" between the two objects is considered to be a "
-"state held by the collection."
+"In the following paragraphs we have a closer at the indexed collections "
+"<classname>List</classname> and <classname>Map</classname> how the their "
+"index can be mapped in Hibernate."
msgstr ""
-"Collections können fast jeden beliebigen anderen Hibernate-Typ enthalten, "
-"einschließlich sämtlicher Grundtypen, angepasster Typen, Komponenten und "
-"natürlich Referenzen zu anderen Entities. Das ist ein wichtiger Unterschied: "
-"Ein Objekt einer Collection könnte mit \"Wert\"semantik bearbeitet werden "
-"(sein Lebenszyklus hängt vollständig vom Besitzer der Collection ab) oder es "
-"könnte ein Verweis auf eine andere Entity mit ihrem eigenen Lebenszyklus "
-"sein. Im letzteren Fall wird nur die \"Verbindung\" zwischen den beiden "
-"Objekten als von der Collection gehaltener Status angesehen."
+#. Tag: title
+#: collection_mapping.xml:407
+#, no-c-format
+msgid "Lists"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
+msgid "Lists can be mapped in two different ways:"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:413
+#, no-c-format
+msgid "as ordered lists, where the order is not materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:418
+#, no-c-format
+msgid "as indexed lists, where the order is materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:423
+#, no-c-format
msgid ""
-"The contained type is referred to as the <emphasis>collection element type</"
-"emphasis>. Collection elements are mapped by <literal><element></"
-"literal> or <literal><composite-element></literal>, or in the case of "
-"entity references, with <literal><one-to-many></literal> or "
-"<literal><many-to-many></literal>. The first two map elements with "
-"value semantics, the next two are used to map entity associations."
+"To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> "
+"to your property. This annotation takes as parameter a list of comma "
+"separated properties (of the target entity) and orders the collection "
+"accordingly (eg <code>firstname asc, age desc</code>), if the string is "
+"empty, the collection will be ordered by the primary key of the target "
+"entity."
msgstr ""
-"Der enthaltene Typ wird als <emphasis>Typ von Collection-Element</emphasis> "
-"bezeichnet. Collection-Elemente werden durch <literal><element></"
-"literal> oder <literal><composite-element></literal> - oder im Fall "
-"von Entity-Verweisen - durch <literal><one-to-many></literal> oder "
-"<literal><many-to-many></literal> gemappt. Die ersten beiden Elemente "
-"mappen mit Wertsemantik, die beiden folgenden werden für das Mappen von "
-"Entity-Assoziationen verwendet."
#. Tag: title
+#: collection_mapping.xml:432
#, no-c-format
-msgid "Indexed collections"
-msgstr "Indizierte Collections"
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:434
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderBy(\"number\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:437
+#, no-c-format
msgid ""
-"All collection mappings, except those with set and bag semantics, need an "
-"<emphasis>index column</emphasis> in the collection table. An index column "
-"is a column that maps to an array index, or <literal>List</literal> index, "
-"or <literal>Map</literal> key. The index of a <literal>Map</literal> may be "
-"of any basic type, mapped with <literal><map-key></literal>. It can be "
-"an entity reference mapped with <literal><map-key-many-to-many></"
-"literal>, or it can be a composite type mapped with <literal><composite-"
-"map-key></literal>. The index of an array or list is always of type "
-"<literal>integer</literal> and is mapped using the <literal><list-"
-"index></literal> element. The mapped column contains sequential integers "
-"that are numbered from zero by default."
+"To store the index value in a dedicated column, use the <classname>@javax."
+"persistence.OrderColumn</classname> annotation on your property. This "
+"annotations describes the column name and attributes of the column keeping "
+"the index value. This column is hosted on the table containing the "
+"association foreign key. If the column name is not specified, the default is "
+"the name of the referencing property, followed by underscore, followed by "
+"<literal>ORDER</literal> (in the following example, it would be "
+"<literal>orders_ORDER</literal>)."
msgstr ""
-"Alle Collection-Mappings - außer denen mit \"Set\"- und \"Bag\"-Semantik - "
-"benötigen eine <emphasis>Indexspalte</emphasis> in der Collection-Tabelle. "
-"Es handelt sich dabei um eine Spalte, die zu einem Verzeichnis von "
-"Datenelementen, <literal>List</literal>-Verzeichnis oder <literal>Map</"
-"literal>-Schlüssel mappt. Der Index einer <literal>Map</literal> kann jeden "
-"Grundtyp besitzen, der mit <literal><map-key></literal> gemappt ist. "
-"Es kann ein mit <literal><map-key-many-to-many></literal> gemappter "
-"Entity-Verweis oder ein mit <literal><composite-map-key></literal> "
-"gemappter zusammengesetzter Typ sein. Der Index eines Datenelements oder "
-"einer Liste ist immer vom Typ her <literal>integer</literal> und wird "
-"mittels <literal><list-index></literal>-Element gemappt. Die gemappte "
-"Spalte enthält sequenzielle ganze Zahlen (im Standard ab Null "
-"durchnummeriert)."
+#. Tag: title
+#: collection_mapping.xml:448
+#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderColumn(name=\"orders_index\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|--------------| |----------|\n"
+"| Order | | Customer |\n"
+"|--------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"| orders_order |\n"
+"|--------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:455
+#, no-c-format
+msgid ""
+"We recommend you to convert <classname>the legacy @org.hibernate.annotations."
+"IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless "
+"you are making use of the base property. The <literal>base</literal> "
+"property lets you define the index value of the first element (aka as base "
+"index). The usual value is <literal>0</literal> or <literal>1</literal>. The "
+"default is 0 like in Java."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:464
+#, no-c-format
+msgid ""
+"Looking again at the Hibernate mapping file equivalent, the index of an "
+"array or list is always of type <literal>integer</literal> and is mapped "
+"using the <literal><list-index></literal> element. The mapped column "
+"contains sequential integers that are numbered from zero by default."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:471
+#, no-c-format
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:481
+#, no-c-format
+msgid ""
+"<list-index\n"
+" column=\"column_name\"\n"
+" base=\"0|1|...\"/>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:485
#, fuzzy, no-c-format
msgid ""
"<literal>column_name</literal> (required): the name of the column holding "
@@ -731,6 +1304,7 @@
"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
#. Tag: para
+#: collection_mapping.xml:490
#, fuzzy, no-c-format
msgid ""
"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
@@ -742,364 +1316,618 @@
"\"child entities\")"
#. Tag: para
+#: collection_mapping.xml:498
#, fuzzy, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection index values."
+"If your table does not have an index column, and you still wish to use "
+"<literal>List</literal> as the property type, you can map the property as a "
+"Hibernate <emphasis><bag></emphasis>. A bag does not retain its order "
+"when it is retrieved from the database, but it can be optionally sorted or "
+"ordered."
msgstr ""
-"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
-"im Stammelement deklarierte Schema außer Kraft setzt"
+"Falls Ihre Tabelle keine Indexspalte besitzt und Sie nach wie vor "
+"<literal>List</literal> als Property-Typ verwenden wollen, so sollten Sie "
+"die Property als eine <emphasis><Bag></emphasis> mappen. Eine \"Bag\" "
+"bewahrt ihre Reihenfolge beim Abruf aus der Datenbank nicht, kann aber "
+"optional sortiert oder geordnet werden."
+#. Tag: title
+#: collection_mapping.xml:506
+#, no-c-format
+msgid "Maps"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:508
+#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
-"key of the map."
+"The question with <classname>Map</classname>s is where the key value is "
+"stored. There are everal options. Maps can borrow their keys from one of the "
+"associated entity properties or have dedicated columns to store an explicit "
+"key."
msgstr ""
-"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
-"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
+#: collection_mapping.xml:513
+#, no-c-format
+msgid ""
+"To use one of the target entity property as a key of the map, use "
+"<literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</"
+"literal> is a property name in the target entity. When using "
+"<literal>@MapKey</literal> without the name attribuate, 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, "
+"because the map key 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."
msgstr ""
-"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
+#. Tag: title
+#: collection_mapping.xml:525
+#, no-c-format
+msgid ""
+"Use of target entity property as map key via <classname>@MapKey</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:528
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @MapKey(name=\"number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> order) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:531
+#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the foreign key column for "
-"the collection index values."
+"Alternatively the map key is mapped to a dedicated column or columns. In "
+"order to customize the mapping use one of the following annotations:"
msgstr ""
-"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
-"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:537
+#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
-"foreign key of the map key."
+"@<classname>MapKeyColumn</classname> if the map key is a basic type. If you "
+"don't specify the column name, the name of the property followed by "
+"underscore followed by <literal>KEY</literal> is used (for example "
+"<literal>orders_KEY</literal>)."
msgstr ""
-"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
-"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:544
+#, no-c-format
msgid ""
-"<literal>class</literal> (required): the entity class used as the map key."
+"<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</"
+"classname> if the map key type is respectively an enum or a <classname>Date</"
+"classname>."
msgstr ""
-"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:550
+#, no-c-format
msgid ""
-"If your table does not have an index column, and you still wish to use "
-"<literal>List</literal> as the property type, you can map the property as a "
-"Hibernate <emphasis><bag></emphasis>. A bag does not retain its order "
-"when it is retrieved from the database, but it can be optionally sorted or "
-"ordered."
+"<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</"
+"classname> if the map key type is another entity."
msgstr ""
-"Falls Ihre Tabelle keine Indexspalte besitzt und Sie nach wie vor "
-"<literal>List</literal> als Property-Typ verwenden wollen, so sollten Sie "
-"die Property als eine <emphasis><Bag></emphasis> mappen. Eine \"Bag\" "
-"bewahrt ihre Reihenfolge beim Abruf aus der Datenbank nicht, kann aber "
-"optional sortiert oder geordnet werden."
+#. Tag: para
+#: collection_mapping.xml:555
+#, no-c-format
+msgid ""
+"<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</"
+"classname> when the map key is a embeddable object. Use <literal>key.</"
+"literal> as a prefix for your embeddable object property names."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:562
+#, no-c-format
+msgid ""
+"You can also use <classname>@MapKeyClass</classname> to define the type of "
+"the key if you don't use generics."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:566
#, no-c-format
-msgid "Collections of values and many-to-many associations"
-msgstr "Collections von Werten und \"Many-to-Many\"-Assoziationen"
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+" @MapKeyColumn(name=\"orders_number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> orders) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------| |---------------|\n"
+"| Order | | Customer | | Cust_Order |\n"
+"|-------------| |----------| |---------------|\n"
+"| id | | id | | customer_id |\n"
+"| number | |----------| | order_id |\n"
+"| customer_id | | orders_number |\n"
+"|-------------| |---------------|"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:573
+#, no-c-format
msgid ""
-"Any collection of values or many-to-many associations requires a dedicated "
-"<emphasis>collection table</emphasis> with a foreign key column or columns, "
-"<emphasis>collection element column</emphasis> or columns, and possibly an "
-"index column or columns."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</"
+"classname> to the new standard approach described above"
msgstr ""
-"Jede Collection von Werten oder \"Many-to-Many\"-Assoziation erfordert eine "
-"zugeordnete <emphasis>Collection-Tabelle</emphasis> mit einer oder mehreren "
-"Fremdschlüsselspalten, <emphasis>Collection-Element-Spalte(n)</emphasis> "
-"oder möglicherweise einer oder mehreren Indexspalte(n)."
#. Tag: para
+#: collection_mapping.xml:579
#, fuzzy, no-c-format
msgid ""
-"For a collection of values use the <literal><element></literal> tag. "
-"For example:"
+"Using Hibernate mapping files there exists equivalent concepts to the "
+"descibed annotations. You have to use <literal><map-key></literal>, "
+"<literal><map-key-many-to-many></literal> and <literal><composite-"
+"map-key></literal>. <literal><map-key></literal> is used for any "
+"basic type, <literal><map-key-many-to-many></literal> for an entity "
+"reference and <literal><composite-map-key></literal> for a composite "
+"type."
msgstr ""
-"Für eine Collection von Werten wird das <literal><element></literal>-"
-"Tag verwendet."
+"Neben <literal><set></literal> gibt es auch <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> und <literal><primitive-array></"
+"literal> Mapping-Elemente. Das <literal><map></literal>-Element ist "
+"charakteristisch:"
+#. Tag: title
+#: collection_mapping.xml:590
+#, no-c-format
+msgid "map-key xml mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
+msgid ""
+"<map-key\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"type_name\"\n"
+" node=\"@attribute-name\"\n"
+" length=\"N\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:605
#, fuzzy, no-c-format
msgid ""
"<literal>column</literal> (optional): the name of the column holding the "
-"collection element values."
+"collection index values."
msgstr ""
"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:610
#, fuzzy, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element."
+"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
+"key of the map."
msgstr ""
"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:615
#, fuzzy, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
+msgid "<literal>type</literal> (required): the type of the map keys."
msgstr ""
"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:623
+#, fuzzy, no-c-format
+msgid "map-key-many-to-many"
+msgstr "\"Many-to-Many\""
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
#, no-c-format
msgid ""
-"A <emphasis>many-to-many association</emphasis> is specified using the "
-"<literal><many-to-many></literal> element."
+"<map-key-many-to-many\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" class=\"ClassName\"\n"
+"/>"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:638
#, fuzzy, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the element foreign key "
-"column."
+"<literal>column</literal> (optional): the name of the foreign key column for "
+"the collection index values."
msgstr ""
-"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
+"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
+"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:643
#, fuzzy, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element foreign key value."
+"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
+"foreign key of the map key."
msgstr ""
"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:648
#, fuzzy, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
+msgid ""
+"<literal>class</literal> (required): the entity class used as the map key."
msgstr ""
"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
+#. Tag: title
+#: collection_mapping.xml:658
+#, fuzzy, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr "Collections von Werten und \"Many-to-Many\"-Assoziationen"
+
#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"enables outer-join or sequential select fetching for this association. This "
-"is a special case; for full eager fetching in a single <literal>SELECT</"
-"literal> of an entity and its many-to-many relationships to other entities, "
-"you would enable <literal>join</literal> fetching,not only of the collection "
-"itself, but also with this attribute on the <literal><many-to-many></"
-"literal> nested element."
+"In some situations you don't need to associate two entities but simply "
+"create a collection of basic types or embeddable objects. Use the "
+"<classname>@ElementCollection</classname> for this case."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:665
#, no-c-format
msgid ""
-"<literal>unique</literal> (optional): enables the DDL generation of a unique "
-"constraint for the foreign-key column. This makes the association "
-"multiplicity effectively one-to-many."
+"Collection of basic types mapped via <classname>@ElementCollection</"
+"classname>"
msgstr ""
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how foreign keys that reference missing rows will be "
-"handled: <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @Column(name=\"nickname\")\n"
+" public Set<String> getNicknames() { ... } \n"
+"}"
msgstr ""
-"<literal>not-found</literal> (optional - standardmäßig <literal>exception</"
-"literal>): Bestimmt, wie gespeicherte Bezeichner (sog. \"Identifier\"), die "
-"auf fehlende Reihen verweisen, behandelt werden. Mit <literal>ignore</"
-"literal> wird eine fehlende Reihe als Null-Assoziation angesehen."
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:671
+#, no-c-format
msgid ""
-"<literal>entity-name</literal> (optional): the entity name of the associated "
-"class, as an alternative to <literal>class</literal>."
+"The collection table holding the collection data is set using the "
+"<classname>@CollectionTable</classname> annotation. If omitted the "
+"collection table name defaults to the concatenation of the name of the "
+"containing entity and the name of the collection attribute, separated by an "
+"underscore. In our example, it would be <literal>User_nicknames</literal>."
msgstr ""
-"<literal>entity-name</literal> (optional): Der Entity-Name der zugehörigen "
-"Klasse als Alternative zu <literal>class</literal>."
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
msgid ""
-"<literal>property-ref</literal> (optional): the name of a property of the "
-"associated class that is joined to this foreign key. If not specified, the "
-"primary key of the associated class is used."
+"The column holding the basic type is set using the <classname>@Column</"
+"classname> annotation. If omitted, the column name defaults to the property "
+"name: in our example, it would be <literal>nicknames</literal>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
-msgid "Here are some examples."
+msgid ""
+"But you are not limited to basic types, the collection type can be any "
+"embeddable object. To override the columns of the embeddable object in the "
+"collection table, use the <classname>@AttributeOverride</classname> "
+"annotation."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:689
#, no-c-format
-msgid "A set of strings:"
+msgid "@ElementCollection for embeddable objects"
msgstr ""
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: programlisting
+#: collection_mapping.xml:691
+#, no-c-format
msgid ""
-"A bag containing integers with an iteration order determined by the "
-"<literal>order-by</literal> attribute:"
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street"
+"\"))\n"
+" })\n"
+" public Set<Address> getAddresses() { ... } \n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" public String getStreet1() {...}\n"
+" [...]\n"
+"}"
msgstr ""
-"Eine ganze Zahlen enthaltende \"Bag\" (mit einer durch das <literal>order-"
-"by</literal>-Attribut bestimmten Reihenfolge):"
#. Tag: para
-#, fuzzy, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
+#: collection_mapping.xml:694
+#, no-c-format
+msgid "Such an embeddable object cannot contains a collection itself."
msgstr ""
-"Ein Datenelement von Entities - in diesem Fall eine \"Many-to-Many\"-"
-"Assoziation:"
#. Tag: para
+#: collection_mapping.xml:698
#, no-c-format
-msgid "A map from string indices to dates:"
-msgstr "Eine Map von String-Indexen zu Daten:"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
+msgid ""
+"in <classname>@AttributeOverride</classname>, you must use the "
+"<literal>value.</literal> prefix to override properties of the embeddable "
+"object used in the map value and the <literal>key.</literal> prefix to "
+"override properties of the embeddable object used in the map key."
msgstr ""
-"Eine List von Komponenten (wird im nachfolgenden Kapitel näher erläutert):"
-#. Tag: title
+#. Tag: programlisting
+#: collection_mapping.xml:704
#, no-c-format
-msgid "One-to-many associations"
-msgstr "\"One-to-Many\"-Assoziationen"
-
-#. Tag: para
-#, fuzzy, no-c-format
msgid ""
-"A <emphasis>one-to-many association</emphasis> links the tables of two "
-"classes via a foreign key with no intervening collection table. This mapping "
-"loses certain semantics of normal Java collections:"
+"@Entity\n"
+"public class User {\n"
+" @ElementCollection\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"key.street1\", column=@Column(name="
+"\"fld_street\")),\n"
+" @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note"
+"\"))\n"
+" })\n"
+" public Map<Address,Rating> getFavHomes() { ... }"
msgstr ""
-"Eine <emphasis>\"One-to-Many\"-Assoziation</emphasis> verbindet die Tabellen "
-"zweier Klassen mittels des Fremdschlüssels ohne eine intervenierende "
-"Collection-Tabelle. Dieses Mapping verliert bestimmte Teile der Semantik "
-"regulärer Java-Collections:"
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:708
+#, no-c-format
msgid ""
-"An instance of the contained entity class cannot belong to more than one "
-"instance of the collection."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"CollectionOfElements</classname> to the new <classname>@ElementCollection</"
+"classname> annotation."
msgstr ""
-"Eine Instanz der enthaltenen Entity-Klasse kann nicht zu mehr als einer "
-"Instanz der Collection gehören"
#. Tag: para
+#: collection_mapping.xml:714
#, fuzzy, no-c-format
msgid ""
-"An instance of the contained entity class cannot appear at more than one "
-"value of the collection index."
+"Using the mapping file approach a collection of values is mapped using the "
+"<literal><element></literal> tag. For example:"
msgstr ""
-"Eine Instanz der enthaltenen Entity-Klasse kann nicht an mehr als einem Wert "
-"des Collection-Index erscheinen"
+"Für eine Collection von Werten wird das <literal><element></literal>-"
+"Tag verwendet."
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"An association from <literal>Product</literal> to <literal>Part</literal> "
-"requires the existence of a foreign key column and possibly an index column "
-"to the <literal>Part</literal> table. A <literal><one-to-many></"
-"literal> tag indicates that this is a one-to-many association."
+#. Tag: title
+#: collection_mapping.xml:718
+#, no-c-format
+msgid "<element> tag for collection values using mapping files"
msgstr ""
-"Eine Assoziation von <literal>Product</literal> zu <literal>Part</literal> "
-"macht die Existenz einer Spalte mit Fremdschlüssel und möglicherweise einer "
-"Indexspalte zur <literal>Part</literal>-Tabelle erforderlich. Ein "
-"<literal><one-to-many></literal>-Tag zeigt an, dass dies eine \"One-to-"
-"Many\"-Assoziation ist."
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how cached identifiers that reference missing rows will "
-"be handled. <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"<element\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"typename\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
msgstr ""
-"<literal>not-found</literal> (optional - standardmäßig <literal>exception</"
-"literal>): Bestimmt, wie gespeicherte Bezeichner (sog. \"Identifier\"), die "
-"auf fehlende Reihen verweisen, behandelt werden. Mit <literal>ignore</"
-"literal> wird eine fehlende Reihe als Null-Assoziation angesehen."
#. Tag: para
+#: collection_mapping.xml:734
#, fuzzy, no-c-format
msgid ""
-"The <literal><one-to-many></literal> element does not need to declare "
-"any columns. Nor is it necessary to specify the <literal>table</literal> "
-"name anywhere."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection element values."
msgstr ""
-"Beachten Sie, dass das <literal><one-to-many></literal>-Element keine "
-"Spalten deklarieren muss. Es ist außerdem nicht nötig, den <literal>table</"
-"literal>-Namen irgendwo zu bestimmen."
+"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
+"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:739
#, fuzzy, no-c-format
msgid ""
-"If the foreign key column of a <literal><one-to-many></literal> "
-"association is declared <literal>NOT NULL</literal>, you must declare the "
-"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
-"or <emphasis>use a bidirectional association</emphasis> with the collection "
-"mapping marked <literal>inverse=\"true\"</literal>. See the discussion of "
-"bidirectional associations later in this chapter for more information."
+"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
+"element."
msgstr ""
-"<emphasis>Sehr wichtig:</emphasis> Falls die Fremdschlüsselspalte einer "
-"<literal><one-to-many></literal>-Assoziation als <literal>NOT NULL</"
-"literal> deklariert ist, müssen Sie beim <literal><key></literal>-"
-"Mapping <literal>not-null=\"true\"</literal> deklarieren oder <emphasis>eine "
-"bidirektionale Assoziation</emphasis> mit als <literal>inverse=\"true\"</"
-"literal> gekennzeichnetem Collection-Mapping verwenden. Wir gehen später in "
-"diesem Kapitel noch näher auf bidirektionale Assoziationen ein."
+"<literal>schema</literal> (optional) der Name eines Tabellenschemas, der das "
+"im Stammelement deklarierte Schema außer Kraft setzt"
#. Tag: para
+#: collection_mapping.xml:744
#, fuzzy, no-c-format
-msgid ""
-"The following example shows a map of <literal>Part</literal> entities by "
-"name, where <literal>partName</literal> is a persistent property of "
-"<literal>Part</literal>. Notice the use of a formula-based index:"
+msgid "<literal>type</literal> (required): the type of the collection element."
msgstr ""
-"Dieses Beispiel zeigt die Map von <literal>Part</literal>-Entities nach Name "
-"(wobei <literal>partName</literal> eine persistente Property von "
-"<literal>Part</literal>) ist. Beachten Sie die Verwendung eines "
-"formelbasierten Index."
+"<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr "Fortgeschrittene Collection-Mappings"
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr "Sortierte Collections"
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
msgid ""
"Hibernate supports collections implementing <literal>java.util.SortedMap</"
-"literal> and <literal>java.util.SortedSet</literal>. You must specify a "
-"comparator in the mapping file:"
+"literal> and <literal>java.util.SortedSet</literal>. With annotations you "
+"declare a sort comparator using <literal>@Sort</literal>. You chose between "
+"the comparator types unsorted, natural or custom. If you want to use your "
+"own comparator implementation, you'll also have to specify 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 ""
-"Hibernate unterstützt <literal>java.util.SortedMap</literal> und "
-"<literal>java.util.SortedSet</literal> implementierende Collections. Sie "
-"müssen ein Vergleichsprogramm in der Mapping-Datei bestimmen:"
+#. Tag: title
+#: collection_mapping.xml:770
+#, fuzzy, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr "Sortierte Collections"
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+"@JoinColumn(name=\"CUST_ID\")\n"
+"@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+"public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
msgid ""
+"Using Hibernate mapping files you specify a comparator in the mapping file "
+"with <literal><sort></literal>:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:779
+#, fuzzy, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr "Sortierte Collections"
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"aliases\"\n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+msgstr ""
+"<set name=\"aliases\" \n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+
+#. Tag: para
+#: collection_mapping.xml:784
+#, no-c-format
+msgid ""
"Allowed values of the <literal>sort</literal> attribute are "
"<literal>unsorted</literal>, <literal>natural</literal> and the name of a "
"class implementing <literal>java.util.Comparator</literal>."
@@ -1109,6 +1937,7 @@
"Klassenimplementierung <literal>java.util.Comparator</literal>."
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
msgid ""
"Sorted collections actually behave like <literal>java.util.TreeSet</literal> "
@@ -1118,14 +1947,15 @@
"TreeSet</literal> oder <literal>java.util.TreeMap</literal>."
#. Tag: para
+#: collection_mapping.xml:794
#, fuzzy, no-c-format
msgid ""
"If you want the database itself to order the collection elements, use the "
"<literal>order-by</literal> attribute of <literal>set</literal>, "
"<literal>bag</literal> or <literal>map</literal> mappings. This solution is "
-"only available under JDK 1.4 or higher and is implemented using "
-"<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This "
-"performs the ordering in the SQL query and not in the memory."
+"implemented using <literal>LinkedHashSet</literal> or "
+"<literal>LinkedHashMap</literal> and performs the ordering in the SQL query "
+"and not in the memory."
msgstr ""
"Falls Sie wollen, dass die Datenbank selbst die Elemente der Collection "
"ordnet, verwenden Sie das <literal>order-by</literal>-Attribut von "
@@ -1136,11 +1966,47 @@
"in der SQL-Anfrage - nicht im Speicher - durchgeführt."
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+msgstr ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:810
#, fuzzy, no-c-format
msgid ""
"The value of the <literal>order-by</literal> attribute is an SQL ordering, "
@@ -1150,6 +2016,7 @@
"SQL-Anordnung, keine HQL-Anordnung ist!"
#. Tag: para
+#: collection_mapping.xml:814
#, fuzzy, no-c-format
msgid ""
"Associations can even be sorted by arbitrary criteria at runtime using a "
@@ -1159,11 +2026,29 @@
"literal> sogar nach beliebigen Kriterien sortiert werden."
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, fuzzy, no-c-format
+msgid ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+msgstr ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr "Bidirektionale Assoziationen"
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
msgid ""
"A <emphasis>bidirectional association</emphasis> allows navigation from both "
@@ -1175,33 +2060,366 @@
"Assoziationen unterstützt:"
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr "\"One-to-Many\""
#. Tag: para
+#: collection_mapping.xml:834
#, fuzzy, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr ""
"an einem Ende von \"Set\"- oder \"Bag\"-wertig, am anderen Ende einwertig"
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr "\"Many-to-Many\""
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr "an beiden Enden \"Set\"- oder \"Bag\"-wertig"
#. Tag: para
+#: collection_mapping.xml:848
+#, no-c-format
+msgid ""
+"Often there exists a many to one association which is the owner side of a "
+"bidirectional relationship. The corresponding one to many association is in "
+"this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:854
+#, no-c-format
+msgid "Bidirectional one to many with many to one side as association owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:860
+#, no-c-format
+msgid ""
+"<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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:865
+#, no-c-format
+msgid ""
+"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 not optimized and will produce additional UPDATE "
+"statements."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:872
#, fuzzy, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr "Bidirektionale Assoziationen mit indizierten Collections"
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
msgid ""
-"You can specify a bidirectional many-to-many association by mapping two many-"
-"to-many associations to the same database table and declaring one end as "
-"<emphasis>inverse</emphasis>. You cannot select an indexed collection."
+"@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"
+"}"
msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:878
+#, fuzzy, no-c-format
+msgid ""
+"How does the mappping of a bidirectional mapping look like in Hibernate "
+"mapping xml? There you define a bidirectional one-to-many association by "
+"mapping a one-to-many association to the same table column(s) as a many-to-"
+"one association and declaring the many-valued end <literal>inverse=\"true\"</"
+"literal>."
+msgstr ""
+"Sie können eine bidirektionale \"One-to-Many\"-Assoziation definieren, indem "
+"Sie eine \"One-to-Many\"-Assoziation zu derselben (oder denselben) "
+"Tabellenspalte(n) wie eine \"Many-to-One\"-Assoziation mappen und für das "
+"mehrwertige Ende <literal>inverse=\"true\"</literal> deklarieren."
+
+#. Tag: title
+#: collection_mapping.xml:885
+#, no-c-format
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+
+#. Tag: para
+#: collection_mapping.xml:890
+#, fuzzy, no-c-format
+msgid ""
+"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
+"does not affect the operation of cascades as these are orthogonal concepts."
+msgstr ""
+"Das Mappen eines der Enden einer Assoziation mit <literal>inverse=\"true\"</"
+"literal> hat keinen Einfluss auf die Weitergabevorgänge (sog. \"Cascades\"), "
+"es handelt sich um orthogonale Konzepte!"
+
+#. Tag: para
+#: collection_mapping.xml:894
+#, no-c-format
+msgid ""
+"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):"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:903
+#, no-c-format
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:910
+#, no-c-format
+msgid ""
+"In this example <classname>@JoinTable</classname> defines a <literal>name</"
+"literal>, an array of join columns, 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\"). 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:919
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:938
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:955
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:961
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:966
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files you can map a bidirectional many-to-many "
+"association by mapping two many-to-many associations to the same database "
+"table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
"Sie können eine bidirektionale \"Many-to-Many\"-Assoziation ganz einfach "
"festlegen, indem Sie zwei \"Many-to-Many\"-Assoziationen zur selben "
"Datenbanktabelle mappen und ein Ende als <emphasis>invertiert</emphasis> "
@@ -1209,17 +2427,76 @@
"indizierte Collection sein)."
#. Tag: para
+#: collection_mapping.xml:970
+#, no-c-format
+msgid "You cannot select an indexed collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:973
#, fuzzy, no-c-format
msgid ""
-"Here is an example of a bidirectional many-to-many association that "
-"illustrates how each category can have many items and each item can be in "
-"many categories:"
+"shows a bidirectional many-to-many association that illustrates how each "
+"category can have many items and each item can be in many categories:"
msgstr ""
"Nachfolgend sehen Sie ein Beispiel für eine bidirektionale \"Many-to-Many\"-"
"Assoziation. Jede Kategorie kann viele Posten besitzen und jeder Posten kann "
"sich in vielen Kategorien befinden:"
+#. Tag: title
+#: collection_mapping.xml:979
+#, no-c-format
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+msgstr ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:984
#, fuzzy, no-c-format
msgid ""
"Changes made only to the inverse end of the association are <emphasis>not</"
@@ -1235,7 +2512,36 @@
"Dies ist leichter zu verstehen, wenn man an das Objektmodell von Java denkt "
"und daran, wie in Java eine \"Many-to-Many\"-Beziehung erstellt wird:"
+#. Tag: title
+#: collection_mapping.xml:992
+#, fuzzy, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr "Collections von Werten und \"Many-to-Many\"-Assoziationen"
+
+#. Tag: programlisting
+#: collection_mapping.xml:995
+#, fuzzy, no-c-format
+msgid ""
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
+msgstr ""
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
+
#. Tag: para
+#: collection_mapping.xml:998
#, no-c-format
msgid ""
"The non-inverse side is used to save the in-memory representation to the "
@@ -1244,41 +2550,22 @@
"Die nicht-invertierte Seite wird dazu benutzt, die gespeicherte Darstellung "
"in der Datenbank zu speichern."
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"You can define a bidirectional one-to-many association by mapping a one-to-"
-"many association to the same table column(s) as a many-to-one association "
-"and declaring the many-valued end <literal>inverse=\"true\"</literal>."
-msgstr ""
-"Sie können eine bidirektionale \"One-to-Many\"-Assoziation definieren, indem "
-"Sie eine \"One-to-Many\"-Assoziation zu derselben (oder denselben) "
-"Tabellenspalte(n) wie eine \"Many-to-One\"-Assoziation mappen und für das "
-"mehrwertige Ende <literal>inverse=\"true\"</literal> deklarieren."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
-"does not affect the operation of cascades as these are orthogonal concepts."
-msgstr ""
-"Das Mappen eines der Enden einer Assoziation mit <literal>inverse=\"true\"</"
-"literal> hat keinen Einfluss auf die Weitergabevorgänge (sog. \"Cascades\"), "
-"es handelt sich um orthogonale Konzepte!"
-
#. Tag: title
+#: collection_mapping.xml:1003
#, no-c-format
msgid "Bidirectional associations with indexed collections"
msgstr "Bidirektionale Assoziationen mit indizierten Collections"
#. Tag: para
+#: collection_mapping.xml:1005
#, fuzzy, no-c-format
msgid ""
-"A bidirectional association where one end is represented as a <literal><"
-"list></literal> or <literal><map></literal>, requires special "
-"consideration. If there is a property of the child class that maps to the "
-"index column you can use <literal>inverse=\"true\"</literal> on the "
-"collection mapping:"
+"There are some additional considerations for bidirectional mappings with "
+"indexed collections (where one end is represented as a <literal><list>"
+"</literal> or <literal><map></literal>) when using Hibernate mapping "
+"files. If there is a property of the child class that maps to the index "
+"column you can use <literal>inverse=\"true\"</literal> on the collection "
+"mapping:"
msgstr ""
"Eine bidirektionale Assoziation, bei der ein Ende als <literal><list></"
"literal> oder <literal><map></literal> dargestellt ist, erfordert "
@@ -1287,7 +2574,62 @@
"Probleme und wir können mit der Verwendung von <literal>inverse=\"true\"</"
"literal> beim Collection-Mapping fortfahren:"
+#. Tag: title
+#: collection_mapping.xml:1013
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr "Bidirektionale Assoziationen mit indizierten Collections"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:1018
#, fuzzy, no-c-format
msgid ""
"If there is no such property on the child class, the association cannot be "
@@ -1303,7 +2645,64 @@
"<literal>inverse=\"true\"</literal> mappen. Statt dessen empfehlen wir "
"folgendes Mapping:"
+#. Tag: title
+#: collection_mapping.xml:1026
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr "Bidirektionale Assoziationen mit indizierten Collections"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:1032
#, fuzzy, no-c-format
msgid ""
"Note that in this mapping, the collection-valued end of the association is "
@@ -1314,11 +2713,13 @@
"Führt dies zu unnötigen Aktualisierungsanweisungen? "
#. Tag: title
+#: collection_mapping.xml:1037
#, no-c-format
msgid "Ternary associations"
msgstr "Dreifache Assoziationen"
#. Tag: para
+#: collection_mapping.xml:1039
#, fuzzy, no-c-format
msgid ""
"There are three possible approaches to mapping a ternary association. One "
@@ -1328,40 +2729,64 @@
"ist die Verwendung von <literal>Map</literal> mit einer Assoziation als "
"deren Index:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1044
#, fuzzy, no-c-format
+msgid "Ternary association mapping"
+msgstr "Dreifache Assoziationen"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1046
+#, no-c-format
msgid ""
-"A second approach is to remodel the association as an entity class. This is "
-"the most common approach."
+"@Entity\n"
+"public class Company {\n"
+" @Id \n"
+" int id;\n"
+" ...\n"
+" @OneToMany // unidirectional\n"
+" @MapKeyJoinColumn(name=\"employee_id\")\n"
+" Map<Employee, Contract> contracts;\n"
+"}\n"
+"\n"
+"// or\n"
+"\n"
+"<map name=\"contracts\">\n"
+" <key column=\"employer_id\" not-null=\"true\"/>\n"
+" <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+" <one-to-many class=\"Contract\"/>\n"
+"</map>"
msgstr ""
-"Ein zweiter Weg ist es, die Assoziation einfach als eine Entity-Klasse zu "
-"gestalten. Das ist die am häufigsten gewählte Herangehensweise."
#. Tag: para
+#: collection_mapping.xml:1049
#, fuzzy, no-c-format
msgid ""
-"A final alternative is to use composite elements, which will be discussed "
-"later."
+"A second approach is to remodel the association as an entity class. This is "
+"the most common approach. A final alternative is to use composite elements, "
+"which will be discussed later."
msgstr ""
-"Die dritte und letzte Variante besteht in der Verwendung zusammengesetzter "
-"Elemente, auf die wir zu einem späteren Zeitpunkt näher eingehen werden."
+"Ein zweiter Weg ist es, die Assoziation einfach als eine Entity-Klasse zu "
+"gestalten. Das ist die am häufigsten gewählte Herangehensweise."
-#. Tag: title
+#. Tag: literal
+#: collection_mapping.xml:1055
#, fuzzy, no-c-format
-msgid "<literal>Using an <idbag></literal>"
+msgid "Using an <idbag>"
msgstr "Die Verwendung einer <idbag>"
#. Tag: para
+#: collection_mapping.xml:1057
#, fuzzy, no-c-format
msgid ""
"The majority of the many-to-many associations and collections of values "
"shown previously all map to tables with composite keys, even though it has "
-"been have suggested that entities should have synthetic identifiers "
-"(surrogate keys). A pure association table does not seem to benefit much "
-"from a surrogate key, although a collection of composite values "
-"<emphasis>might</emphasis>. It is for this reason that Hibernate provides a "
-"feature that allows you to map many-to-many associations and collections of "
-"values to a table with a surrogate key."
+"been suggested that entities should have synthetic identifiers (surrogate "
+"keys). A pure association table does not seem to benefit much from a "
+"surrogate key, although a collection of composite values <emphasis>might</"
+"emphasis>. For this reason Hibernate provides a feature that allows you to "
+"map many-to-many associations and collections of values to a table with a "
+"surrogate key."
msgstr ""
"Falls Sie unsere Ansicht teilen und ebenfalls der Meinung sind, dass "
"zusammengesetzte Schlüssel keine gute Sache sind und Entities synthetische "
@@ -1376,6 +2801,7 @@
"einer Tabelle mit einem Surrogatschlüssel zu mappen."
#. Tag: para
+#: collection_mapping.xml:1066
#, fuzzy, no-c-format
msgid ""
"The <literal><idbag></literal> element lets you map a <literal>List</"
@@ -1384,7 +2810,30 @@
"Das <literal><idbag></literal>-Element lässt Sie eine <literal>List</"
"literal> (oder <literal>Collection</literal>) mit \"Bag\"-Semantik mappen."
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, fuzzy, no-c-format
+msgid ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+msgstr ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+
#. Tag: para
+#: collection_mapping.xml:1072
#, fuzzy, no-c-format
msgid ""
"An <literal><idbag></literal> has a synthetic id generator, just like "
@@ -1399,6 +2848,7 @@
"herauszufinden."
#. Tag: para
+#: collection_mapping.xml:1077
#, fuzzy, no-c-format
msgid ""
"The update performance of an <literal><idbag></literal> supersedes a "
@@ -1413,6 +2863,7 @@
"ganz wie bei einer Liste, einer Map oder einem Set."
#. Tag: para
+#: collection_mapping.xml:1082
#, no-c-format
msgid ""
"In the current implementation, the <literal>native</literal> identifier "
@@ -1424,16 +2875,19 @@
"Collection-Bezeichner unterstützt."
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr "Collection-Beispiele"
#. Tag: para
+#: collection_mapping.xml:1105
#, fuzzy, no-c-format
msgid "This section covers collection examples."
msgstr "Collection-Beispiele"
#. Tag: para
+#: collection_mapping.xml:1107
#, fuzzy, no-c-format
msgid ""
"The following class has a collection of <literal>Child</literal> instances:"
@@ -1441,7 +2895,39 @@
"Der folgende Code würde verwendet, um ein neues <literal>Child</literal> "
"hinzuzufügen"
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid ""
+"Example classes <classname>Parent</classname> and <classname>Child</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" private long id;\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" private long id;\n"
+" private String name\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, fuzzy, no-c-format
msgid ""
"If each child has, at most, one parent, the most natural mapping is a one-to-"
@@ -1451,12 +2937,127 @@
"\"child\" (untergeordnet) höchstens einen \"parent\" (übergeordnet) besitzt, "
"so ist das natürlichste Mapping eine \"One-to-Many\"-Assoziation:"
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr "Das mappt zu den folgenden Tabellendefinitionen:"
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid ""
+"Table definitions for unidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
msgid ""
"If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-"
@@ -1465,177 +3066,571 @@
"Falls der \"parent\" <emphasis>erforderlich</emphasis> ist, verwenden Sie "
"eine bidirektionale \"One-to-Many\"-Assoziation:"
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+" \n"
+" @ManyToOne\n"
+" private Parent parent;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr "Beachten Sie die <literal>NOT NULL</literal>-Bedingung:"
+#. Tag: title
+#: collection_mapping.xml:1164
+#, no-c-format
+msgid ""
+"Table definitions for bidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+
#. Tag: para
+#: collection_mapping.xml:1171
#, fuzzy, no-c-format
msgid ""
-"Alternatively, if this association must be unidirectional you can declare "
-"the <literal>NOT NULL</literal> constraint on the <literal><key></"
-"literal> mapping:"
+"Alternatively, if this association must be unidirectional you can enforce "
+"the <literal>NOT NULL</literal> constraint."
msgstr ""
"Andernfalls - falls Sie absolut darauf bestehen, dass diese Assoziation "
"unidirektional ist - können Sie die <literal>NOT NULL</literal>-Bedingung am "
"<literal><key></literal>-Mapping deklarieren:"
+#. Tag: title
+#: collection_mapping.xml:1175
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(optional=false)\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1188
#, fuzzy, no-c-format
msgid ""
"On the other hand, if a child has multiple parents, a many-to-many "
-"association is appropriate:"
+"association is appropriate."
msgstr ""
"Wenn jedoch ein \"child\" mehrere \"parents\" besitzen kann, ist die \"Many-"
"to-Many\"-Assoziation passender:"
+#. Tag: title
+#: collection_mapping.xml:1192
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using "
+"annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @ManyToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using mapping "
+"files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr "Tabellendefinitionen:"
+#. Tag: title
+#: collection_mapping.xml:1208
+#, no-c-format
+msgid "Table definitions for many to many releationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+
#. Tag: para
+#: collection_mapping.xml:1213
#, fuzzy, no-c-format
msgid ""
"For more examples and a complete explanation of a parent/child relationship "
-"mapping, see <xref linkend=\"example-parentchild\" /> for more information."
+"mapping, see <xref linkend=\"example-parentchild\"/> for more information. "
+"Even more complex association mappings are covered in the next chapter."
msgstr ""
"Weitere Beispiele und eine vollständige Abhandlung des Mappings der \"parent/"
"child\"-Beziehung finden Sie unter <xref linkend=\"example-parentchild\"/>."
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
-msgstr ""
-"Es sind sogar noch weitaus exotischere Assoziations-Mappings möglich, die "
-"wir im nächsten Kapitel ausführen."
+#, fuzzy
+#~ msgid ""
+#~ "Hibernate requires that persistent collection-valued fields be declared "
+#~ "as an interface type. For example:"
+#~ msgstr ""
+#~ "In Hibernate müssen persistente Collection-wertige Felder als Interface-"
+#~ "Typ deklariert werden, zum Beispiel:"
+#~ msgid "Collection mappings"
+#~ msgstr "Collection-Mappings"
+
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[public class Product {\n"
-#~ " private String serialNumber;\n"
-#~ " private Set parts = new HashSet();\n"
-#~ " \n"
-#~ " public Set getParts() { return parts; }\n"
-#~ " void setParts(Set parts) { this.parts = parts; }\n"
-#~ " public String getSerialNumber() { return serialNumber; }\n"
-#~ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
-#~ "}]]>"
+#~ "There are quite a range of mappings that can be generated for collections "
+#~ "that cover many common relational models. We suggest you experiment with "
+#~ "the schema generation tool so that you understand how various mapping "
+#~ "declarations translate to database tables."
#~ msgstr ""
-#~ "public class Product {\n"
-#~ " private String serialNumber;\n"
-#~ " private Set parts = new HashSet();\n"
-#~ " \n"
-#~ " public Set getParts() { return parts; }\n"
-#~ " void setParts(Set parts) { this.parts = parts; }\n"
-#~ " public String getSerialNumber() { return serialNumber; }\n"
-#~ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
-#~ "}"
+#~ "Es gibt eine ganze Reihe von Mappings, die für Collections generiert "
+#~ "werden können und die zahlreiche gängige relationale Modelle abdecken. Es "
+#~ "ist wahrscheinlich sinnvoll, wenn Sie mit dem Tool zur Schemagenerierung "
+#~ "experimentieren, um zu sehen, wie die verschiedenen Mapping-Deklarationen "
+#~ "bei Datenbanktabellen umgesetzt werden."
+#~ msgid "Collection elements"
+#~ msgstr "Collection-Elemente"
+
+#~ msgid ""
+#~ "The contained type is referred to as the <emphasis>collection element "
+#~ "type</emphasis>. Collection elements are mapped by <literal><"
+#~ "element></literal> or <literal><composite-element></literal>, or "
+#~ "in the case of entity references, with <literal><one-to-many></"
+#~ "literal> or <literal><many-to-many></literal>. The first two map "
+#~ "elements with value semantics, the next two are used to map entity "
+#~ "associations."
+#~ msgstr ""
+#~ "Der enthaltene Typ wird als <emphasis>Typ von Collection-Element</"
+#~ "emphasis> bezeichnet. Collection-Elemente werden durch <literal><"
+#~ "element></literal> oder <literal><composite-element></literal> - "
+#~ "oder im Fall von Entity-Verweisen - durch <literal><one-to-many></"
+#~ "literal> oder <literal><many-to-many></literal> gemappt. Die ersten "
+#~ "beiden Elemente mappen mit Wertsemantik, die beiden folgenden werden für "
+#~ "das Mappen von Entity-Assoziationen verwendet."
+
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "Cat kitten = new DomesticCat();\n"
-#~ "....\n"
-#~ "Set kittens = new HashSet();\n"
-#~ "kittens.add(kitten);\n"
-#~ "cat.setKittens(kittens);\n"
-#~ "session.persist(cat);\n"
-#~ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
-#~ "(HashSet) cat.getKittens(); // Error!]]>"
+#~ "All collection mappings, except those with set and bag semantics, need an "
+#~ "<emphasis>index column</emphasis> in the collection table. An index "
+#~ "column is a column that maps to an array index, or <literal>List</"
+#~ "literal> index, or <literal>Map</literal> key. The index of a "
+#~ "<literal>Map</literal> may be of any basic type, mapped with <literal><"
+#~ "map-key></literal>. It can be an entity reference mapped with "
+#~ "<literal><map-key-many-to-many></literal>, or it can be a composite "
+#~ "type mapped with <literal><composite-map-key></literal>. The index "
+#~ "of an array or list is always of type <literal>integer</literal> and is "
+#~ "mapped using the <literal><list-index></literal> element. The "
+#~ "mapped column contains sequential integers that are numbered from zero by "
+#~ "default."
#~ msgstr ""
-#~ "Cat cat = new DomesticCat();\n"
-#~ "Cat kitten = new DomesticCat();\n"
-#~ "....\n"
-#~ "Set kittens = new HashSet();\n"
-#~ "kittens.add(kitten);\n"
-#~ "cat.setKittens(kittens);\n"
-#~ "session.persist(cat);\n"
-#~ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
-#~ "(HashSet) cat.getKittens(); // Error!"
+#~ "Alle Collection-Mappings - außer denen mit \"Set\"- und \"Bag\"-Semantik "
+#~ "- benötigen eine <emphasis>Indexspalte</emphasis> in der Collection-"
+#~ "Tabelle. Es handelt sich dabei um eine Spalte, die zu einem Verzeichnis "
+#~ "von Datenelementen, <literal>List</literal>-Verzeichnis oder "
+#~ "<literal>Map</literal>-Schlüssel mappt. Der Index einer <literal>Map</"
+#~ "literal> kann jeden Grundtyp besitzen, der mit <literal><map-key></"
+#~ "literal> gemappt ist. Es kann ein mit <literal><map-key-many-to-"
+#~ "many></literal> gemappter Entity-Verweis oder ein mit <literal><"
+#~ "composite-map-key></literal> gemappter zusammengesetzter Typ sein. Der "
+#~ "Index eines Datenelements oder einer Liste ist immer vom Typ her "
+#~ "<literal>integer</literal> und wird mittels <literal><list-index></"
+#~ "literal>-Element gemappt. Die gemappte Spalte enthält sequenzielle ganze "
+#~ "Zahlen (im Standard ab Null durchnummeriert)."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Product\">\n"
-#~ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
-#~ " <set name=\"parts\">\n"
-#~ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Part\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
+#~ "Any collection of values or many-to-many associations requires a "
+#~ "dedicated <emphasis>collection table</emphasis> with a foreign key column "
+#~ "or columns, <emphasis>collection element column</emphasis> or columns, "
+#~ "and possibly an index column or columns."
#~ msgstr ""
-#~ "<class name=\"Product\">\n"
-#~ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
-#~ " <set name=\"parts\">\n"
-#~ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Part\"/>\n"
-#~ " </set>\n"
-#~ "</class>"
+#~ "Jede Collection von Werten oder \"Many-to-Many\"-Assoziation erfordert "
+#~ "eine zugeordnete <emphasis>Collection-Tabelle</emphasis> mit einer oder "
+#~ "mehreren Fremdschlüsselspalten, <emphasis>Collection-Element-Spalte(n)</"
+#~ "emphasis> oder möglicherweise einer oder mehreren Indexspalte(n)."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<map\n"
-#~ " name=\"propertyName\"\n"
-#~ " table=\"table_name\"\n"
-#~ " schema=\"schema_name\"\n"
-#~ " lazy=\"true|extra|false\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan"
-#~ "\"\n"
-#~ " sort=\"unsorted|natural|comparatorClass\"\n"
-#~ " order-by=\"column_name asc|desc\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " fetch=\"join|select|subselect\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <key .... />\n"
-#~ " <map-key .... />\n"
-#~ " <element .... />\n"
-#~ "</map>]]>"
+#~ "<literal>column</literal> (optional): the name of the element foreign key "
+#~ "column."
#~ msgstr ""
-#~ "<map\n"
-#~ " name=\"propertyName\"\n"
-#~ " table=\"table_name\"\n"
-#~ " schema=\"schema_name\"\n"
-#~ " lazy=\"true|extra|false\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan"
-#~ "\"\n"
-#~ " sort=\"unsorted|natural|comparatorClass\"\n"
-#~ " order-by=\"column_name asc|desc\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " fetch=\"join|select|subselect\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <key .... />\n"
-#~ " <map-key .... />\n"
-#~ " <element .... />\n"
-#~ "</map>"
+#~ "<literal>class</literal> (erforderlich): Der Name der zugehörigen Klasse."
#, fuzzy
-#~ msgid "<![CDATA[<key column=\"productSerialNumber\" not-null=\"true\"/>]]>"
-#~ msgstr "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+#~ msgid ""
+#~ "<literal>formula</literal> (optional): an SQL formula used to evaluate "
+#~ "the element foreign key value."
+#~ msgstr ""
+#~ "<literal>schema</literal> (optional) der Name eines Tabellenschemas, der "
+#~ "das im Stammelement deklarierte Schema außer Kraft setzt"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<key column=\"productSerialNumber\" on-delete=\"cascade\"/>]]>"
-#~ msgstr "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+#~ "<literal>not-found</literal> (optional - defaults to <literal>exception</"
+#~ "literal>): specifies how foreign keys that reference missing rows will be "
+#~ "handled: <literal>ignore</literal> will treat a missing row as a null "
+#~ "association."
+#~ msgstr ""
+#~ "<literal>not-found</literal> (optional - standardmäßig "
+#~ "<literal>exception</literal>): Bestimmt, wie gespeicherte Bezeichner "
+#~ "(sog. \"Identifier\"), die auf fehlende Reihen verweisen, behandelt "
+#~ "werden. Mit <literal>ignore</literal> wird eine fehlende Reihe als Null-"
+#~ "Assoziation angesehen."
#, fuzzy
#~ msgid ""
+#~ "A bag containing integers with an iteration order determined by the "
+#~ "<literal>order-by</literal> attribute:"
+#~ msgstr ""
+#~ "Eine ganze Zahlen enthaltende \"Bag\" (mit einer durch das <literal>order-"
+#~ "by</literal>-Attribut bestimmten Reihenfolge):"
+
+#, fuzzy
+#~ msgid "An array of entities, in this case, a many-to-many association:"
+#~ msgstr ""
+#~ "Ein Datenelement von Entities - in diesem Fall eine \"Many-to-Many\"-"
+#~ "Assoziation:"
+
+#~ msgid "A map from string indices to dates:"
+#~ msgstr "Eine Map von String-Indexen zu Daten:"
+
+#, fuzzy
+#~ msgid "A list of components (this is discussed in the next chapter):"
+#~ msgstr ""
+#~ "Eine List von Komponenten (wird im nachfolgenden Kapitel näher erläutert):"
+
+#~ msgid "One-to-many associations"
+#~ msgstr "\"One-to-Many\"-Assoziationen"
+
+#, fuzzy
+#~ msgid ""
+#~ "A <emphasis>one-to-many association</emphasis> links the tables of two "
+#~ "classes via a foreign key with no intervening collection table. This "
+#~ "mapping loses certain semantics of normal Java collections:"
+#~ msgstr ""
+#~ "Eine <emphasis>\"One-to-Many\"-Assoziation</emphasis> verbindet die "
+#~ "Tabellen zweier Klassen mittels des Fremdschlüssels ohne eine "
+#~ "intervenierende Collection-Tabelle. Dieses Mapping verliert bestimmte "
+#~ "Teile der Semantik regulärer Java-Collections:"
+
+#, fuzzy
+#~ msgid ""
+#~ "The following example shows a map of <literal>Part</literal> entities by "
+#~ "name, where <literal>partName</literal> is a persistent property of "
+#~ "<literal>Part</literal>. Notice the use of a formula-based index:"
+#~ msgstr ""
+#~ "Dieses Beispiel zeigt die Map von <literal>Part</literal>-Entities nach "
+#~ "Name (wobei <literal>partName</literal> eine persistente Property von "
+#~ "<literal>Part</literal>) ist. Beachten Sie die Verwendung eines "
+#~ "formelbasierten Index."
+
+#~ msgid ""
+#~ "Hibernate supports collections implementing <literal>java.util.SortedMap</"
+#~ "literal> and <literal>java.util.SortedSet</literal>. You must specify a "
+#~ "comparator in the mapping file:"
+#~ msgstr ""
+#~ "Hibernate unterstützt <literal>java.util.SortedMap</literal> und "
+#~ "<literal>java.util.SortedSet</literal> implementierende Collections. Sie "
+#~ "müssen ein Vergleichsprogramm in der Mapping-Datei bestimmen:"
+
+#, fuzzy
+#~ msgid ""
+#~ "A final alternative is to use composite elements, which will be discussed "
+#~ "later."
+#~ msgstr ""
+#~ "Die dritte und letzte Variante besteht in der Verwendung "
+#~ "zusammengesetzter Elemente, auf die wir zu einem späteren Zeitpunkt näher "
+#~ "eingehen werden."
+
+#, fuzzy
+#~ msgid ""
+#~ "Even more complex association mappings are covered in the next chapter."
+#~ msgstr ""
+#~ "Es sind sogar noch weitaus exotischere Assoziations-Mappings möglich, die "
+#~ "wir im nächsten Kapitel ausführen."
+
+#, fuzzy
+#~ msgid ""
#~ "<![CDATA[<set name=\"names\" table=\"person_names\">\n"
#~ " <key column=\"person_id\"/>\n"
#~ " <element column=\"person_name\" type=\"string\"/>\n"
@@ -1726,24 +3721,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-many \n"
-#~ " class=\"ClassName\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " />]]>"
-#~ msgstr ""
-#~ "<one-to-many \n"
-#~ " class=\"ClassName\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " />"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<map name=\"parts\"\n"
#~ " cascade=\"all\">\n"
#~ " <key column=\"productId\" not-null=\"true\"/>\n"
@@ -1760,265 +3737,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<set name=\"aliases\" \n"
-#~ " table=\"person_aliases\" \n"
-#~ " sort=\"natural\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date\" type=\"date\"/>\n"
-#~ "</map>]]>"
-#~ msgstr ""
-#~ "<set name=\"aliases\" \n"
-#~ " table=\"person_aliases\" \n"
-#~ " sort=\"natural\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date\" type=\"date\"/>\n"
-#~ "</map>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower"
-#~ "(name) asc\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date type=\"date\"/>\n"
-#~ "</map>]]>"
-#~ msgstr ""
-#~ "<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) "
-#~ "asc\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date type=\"date\"/>\n"
-#~ "</map>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sortedUsers = s.createFilter( group.getUsers(), \"order by this."
-#~ "name\" ).list();]]>"
-#~ msgstr ""
-#~ "sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" )."
-#~ "list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Category\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
-#~ " <key column=\"CATEGORY_ID\"/>\n"
-#~ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Item\">\n"
-#~ " <id name=\"id\" column=\"ITEM_ID\"/>\n"
-#~ " ...\n"
-#~ "\n"
-#~ " <!-- inverse end -->\n"
-#~ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"
-#~ " <key column=\"ITEM_ID\"/>\n"
-#~ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Category\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
-#~ " <key column=\"CATEGORY_ID\"/>\n"
-#~ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Item\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ "\n"
-#~ " <!-- inverse end -->\n"
-#~ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
-#~ "\">\n"
-#~ " <key column=\"ITEM_ID\"/>\n"
-#~ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "category.getItems().add(item); // The category now \"knows\" "
-#~ "about the relationship\n"
-#~ "item.getCategories().add(category); // The item now \"knows\" about "
-#~ "the relationship\n"
-#~ "\n"
-#~ "session.persist(item); // The relationship won't be "
-#~ "saved!\n"
-#~ "session.persist(category); // The relationship will be "
-#~ "saved]]>"
-#~ msgstr ""
-#~ "category.getItems().add(item); // The category now \"knows\" "
-#~ "about the relationship\n"
-#~ "item.getCategories().add(category); // The item now \"knows\" about "
-#~ "the relationship\n"
-#~ "\n"
-#~ "session.persist(item); // The relationship won't be "
-#~ "saved!\n"
-#~ "session.persist(category); // The relationship will be saved"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <property name=\"name\" \n"
-#~ " not-null=\"true\"/>\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <property name=\"name\" \n"
-#~ " not-null=\"true\"/>\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\">\n"
-#~ " <key column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " insert=\"false\"\n"
-#~ " update=\"false\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\">\n"
-#~ " <key column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " insert=\"false\"\n"
-#~ " update=\"false\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<map name=\"contracts\">\n"
#~ " <key column=\"employer_id\" not-null=\"true\"/>\n"
#~ " <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
@@ -2049,25 +3767,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<idbag name=\"lovers\" table=\"LOVERS\">\n"
-#~ " <collection-id column=\"ID\" type=\"long\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </collection-id>\n"
-#~ " <key column=\"PERSON1\"/>\n"
-#~ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/>\n"
-#~ "</idbag>]]>"
-#~ msgstr ""
-#~ "<idbag name=\"lovers\" table=\"LOVERS\">\n"
-#~ " <collection-id column=\"ID\" type=\"long\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </collection-id>\n"
-#~ " <key column=\"PERSON1\"/>\n"
-#~ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
-#~ ">\n"
-#~ "</idbag>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[package eg;\n"
#~ "import java.util.Set;\n"
#~ "\n"
@@ -2101,233 +3800,3 @@
#~ " ....\n"
#~ " ....\n"
#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255), "
-#~ "parent_id bigint )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-#~ msgstr ""
-#~ "create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255), "
-#~ "parent_id bigint )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
-#~ "\" not-null=\"true\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " <many-to-one name=\"parent\" class=\"Parent\" column="
-#~ "\"parent_id\" not-null=\"true\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null\n"
-#~ " primary key,\n"
-#~ " name varchar(255),\n"
-#~ " parent_id bigint not null )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-#~ msgstr ""
-#~ "create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null\n"
-#~ " primary key,\n"
-#~ " name varchar(255),\n"
-#~ " parent_id bigint not null )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" table=\"childset\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" table=\"childset\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255) )\n"
-#~ "create table childset ( parent_id bigint not null,\n"
-#~ " child_id bigint not null,\n"
-#~ " primary key ( parent_id, child_id ) )\n"
-#~ "alter table childset add constraint childsetfk0 (parent_id) references "
-#~ "parent\n"
-#~ "alter table childset add constraint childsetfk1 (child_id) references "
-#~ "child]]>"
-#~ msgstr ""
-#~ "create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255) )\n"
-#~ "create table childset ( parent_id bigint not null,\n"
-#~ " child_id bigint not null,\n"
-#~ " primary key ( parent_id, child_id ) )\n"
-#~ "alter table childset add constraint childsetfk0 (parent_id) references "
-#~ "parent\n"
-#~ "alter table childset add constraint childsetfk1 (child_id) references "
-#~ "child"
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/configuration.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/configuration.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/configuration.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,11 +285,13 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr "Konfiguration"
#. Tag: para
+#: configuration.xml:33
#, fuzzy, no-c-format
msgid ""
"Hibernate is designed to operate in many different environments and, as "
@@ -308,11 +310,13 @@
"passen Sie sie an."
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr "Programmatische Konfiguration"
#. Tag: para
+#: configuration.xml:43
#, fuzzy, no-c-format
msgid ""
"An instance of <classname>org.hibernate.cfg.Configuration</classname> "
@@ -328,6 +332,7 @@
"bauen. Die Mappings werden aus verschiedenen XML-Mapping-Dateien kompiliert."
#. Tag: para
+#: configuration.xml:51
#, fuzzy, no-c-format
msgid ""
"You can obtain a <classname>org.hibernate.cfg.Configuration</classname> "
@@ -340,7 +345,20 @@
"Mapping-Dateien sich im Klassenpfad befinden, verwenden Sie "
"<literal>addResource()</literal>:"
+#. Tag: programlisting
+#: configuration.xml:57
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+
#. Tag: para
+#: configuration.xml:59
#, fuzzy, no-c-format
msgid ""
"An alternative way is to specify the mapped class and allow Hibernate to "
@@ -349,7 +367,20 @@
"Eine andere (und manchmal bessere) Weise, die gemappte Klasse zu "
"spezifizieren ist es, Hibernate das Mapping-Dokument finden zu lassen:"
+#. Tag: programlisting
+#: configuration.xml:62
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+
#. Tag: para
+#: configuration.xml:64
#, fuzzy, no-c-format
msgid ""
"Hibernate will then search for mapping files named <filename>/org/hibernate/"
@@ -363,6 +394,7 @@
"jegliche festcodierten Dateinamen."
#. Tag: para
+#: configuration.xml:69
#, fuzzy, no-c-format
msgid ""
"A <classname>org.hibernate.cfg.Configuration</classname> also allows you to "
@@ -371,7 +403,30 @@
"Eine <literal>Configuration</literal> erlaubt es Ihnen auch, "
"Konfigurationseigenschaften zu bestimmen:"
+#. Tag: programlisting
+#: configuration.xml:72
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+
#. Tag: para
+#: configuration.xml:74
#, fuzzy, no-c-format
msgid ""
"This is not the only way to pass configuration properties to Hibernate. Some "
@@ -381,6 +436,7 @@
"Hibernate weiterzugeben. Die verschiedenen Optionen beinhalten:"
#. Tag: para
+#: configuration.xml:79
#, fuzzy, no-c-format
msgid ""
"Pass an instance of <classname>java.util.Properties</classname> to "
@@ -390,6 +446,7 @@
"<literal>Configuration.setProperties()</literal>."
#. Tag: para
+#: configuration.xml:84
#, fuzzy, no-c-format
msgid ""
"Place a file named <filename>hibernate.properties</filename> in a root "
@@ -399,6 +456,7 @@
"des Klassenpfads."
#. Tag: para
+#: configuration.xml:89
#, no-c-format
msgid ""
"Set <literal>System</literal> properties using <literal>java -"
@@ -408,6 +466,7 @@
"Dproperty=value</literal> ein."
#. Tag: para
+#: configuration.xml:94
#, fuzzy, no-c-format
msgid ""
"Include <literal><property></literal> elements in <literal>hibernate."
@@ -418,6 +477,7 @@
"erläutert)."
#. Tag: para
+#: configuration.xml:99
#, fuzzy, no-c-format
msgid ""
"If you want to get started quickly<filename>hibernate.properties</filename> "
@@ -427,6 +487,7 @@
"des Klassenpfads."
#. Tag: para
+#: configuration.xml:103
#, fuzzy, no-c-format
msgid ""
"The <classname>org.hibernate.cfg.Configuration</classname> is intended as a "
@@ -438,11 +499,13 @@
"literal> verworfen werden."
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr "Erstellung einer SessionFactory"
#. Tag: para
+#: configuration.xml:111
#, fuzzy, no-c-format
msgid ""
"When all mappings have been parsed by the <classname>org.hibernate.cfg."
@@ -455,7 +518,14 @@
"<literal>Session</literal>-Instanzen erstellen. Diese Factory wird von allen "
"Anwendungsthreads geteilt:"
+#. Tag: programlisting
+#: configuration.xml:117
+#, fuzzy, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr "SessionFactory sessions = cfg.buildSessionFactory();"
+
#. Tag: para
+#: configuration.xml:119
#, fuzzy, no-c-format
msgid ""
"Hibernate does allow your application to instantiate more than one "
@@ -467,11 +537,13 @@
"als eine Datenbank verwenden."
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr "JDBC-Verbindungen"
#. Tag: para
+#: configuration.xml:127
#, fuzzy, no-c-format
msgid ""
"It is advisable to have the <interfacename>org.hibernate.SessionFactory</"
@@ -483,7 +555,14 @@
"für Sie erstellen und zusammenfassen. Wenn Sie diese Vorgehensweise wählen, "
"so ist das Eröffnen einer <literal>Session</literal> ganz einfach:"
+#. Tag: programlisting
+#: configuration.xml:133
+#, fuzzy, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr "Session session = sessions.openSession(); // open a new Session"
+
#. Tag: para
+#: configuration.xml:135
#, fuzzy, no-c-format
msgid ""
"Once you start a task that requires access to the database, a JDBC "
@@ -493,6 +572,7 @@
"wird eine JDBC-Verbindung aus dem Pool bereitgestellt."
#. Tag: para
+#: configuration.xml:138
#, fuzzy, no-c-format
msgid ""
"Before you can do this, you first need to pass some JDBC connection "
@@ -508,6 +588,7 @@
"Konfiguration der JDBC-Verbindungen erläutert."
#. Tag: para
+#: configuration.xml:144
#, fuzzy, no-c-format
msgid ""
"Hibernate will obtain and pool connections using <classname>java.sql."
@@ -518,71 +599,89 @@
"einstellen:"
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr "Hibernate JDBC-Properties"
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327
+#: configuration.xml:495 configuration.xml:657 configuration.xml:753
+#: configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr "Property-Name"
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329
+#: configuration.xml:497 configuration.xml:659 configuration.xml:755
+#: configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr "Zweck"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:166
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+msgid "hibernate.connection.driver_class"
msgstr "hibernate.connection.driver_class"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:168
#, fuzzy, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+msgid "JDBC driver class"
msgstr "jdbc-Treiberklasse"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:172
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+msgid "hibernate.connection.url"
msgstr "hibernate.connection.url"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
-msgstr "jdbc-Treiberklasse"
+#. Tag: emphasis
+#: configuration.xml:174
+#, no-c-format
+msgid "JDBC URL"
+msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.username</property>"
+msgid "hibernate.connection.username"
msgstr "hibernate.connection.username"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<emphasis>database user</emphasis>"
-msgstr "<emphasis>Datenbankbenutzer</emphasis> (optional)"
+#. Tag: emphasis
+#: configuration.xml:180
+#, no-c-format
+msgid "database user"
+msgstr "Datenbankbenutzer"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.password</property>"
+msgid "hibernate.connection.password"
msgstr "hibernate.connection.password"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<emphasis>database user password</emphasis>"
-msgstr "<emphasis>Passwort des Datenbankbenutzers</emphasis> (optional)"
+#. Tag: emphasis
+#: configuration.xml:186
+#, no-c-format
+msgid "database user password"
+msgstr "Datenbankbenutzer-Passwort"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:190
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+msgid "hibernate.connection.pool_size"
msgstr "hibernate.connection.pool_size"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:192
#, fuzzy, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+msgid "maximum number of pooled connections"
msgstr "maximale Anzahl gepoolter Verbindungen"
#. Tag: para
+#: configuration.xml:199
#, fuzzy, no-c-format
msgid ""
"Hibernate's own connection pooling algorithm is, however, quite rudimentary. "
@@ -603,6 +702,7 @@
"interner Pool ausgeschaltet. Sie können zum Beispiel C3P0 verwenden."
#. Tag: para
+#: configuration.xml:208
#, fuzzy, no-c-format
msgid ""
"C3P0 is an open source JDBC connection pool distributed along with Hibernate "
@@ -622,6 +722,7 @@
"auf der Hibernate Website."
#. Tag: para
+#: configuration.xml:216
#, fuzzy, no-c-format
msgid ""
"The following is an example <filename>hibernate.properties</filename> file "
@@ -630,7 +731,32 @@
"Hier sehen Sie das Beispiel einer <literal>hibernate.properties</literal>-"
"Datei für C3P0:"
+#. Tag: programlisting
+#: configuration.xml:219
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+
#. Tag: para
+#: configuration.xml:221
#, fuzzy, no-c-format
msgid ""
"For use inside an application server, you should almost always configure "
@@ -645,36 +771,43 @@
"müssen:"
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr "Properties der Hibernate Datenquelle (\"Datasource\")"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:244
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+msgid "hibernate.connection.datasource"
msgstr "hibernate.connection.datasource"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
-msgstr "<emphasis>Datenbankbenutzer</emphasis> (optional)"
+#. Tag: emphasis
+#: configuration.xml:246
+#, no-c-format
+msgid "datasource JNDI name"
+msgstr "JNDI-Name der Datenquelle"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:250
#, fuzzy, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+msgid "hibernate.jndi.url"
msgstr "hibernate.jndi.url"
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr "<emphasis>URL des JNDI-Providers</emphasis> (optional)"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:257
#, fuzzy, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+msgid "hibernate.jndi.class"
msgstr "hibernate.jndi.class"
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
msgid ""
"<emphasis>class of the JNDI <literal>InitialContextFactory</literal></"
@@ -684,16 +817,19 @@
"emphasis> (optional)"
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr "<emphasis>Datenbankbenutzer</emphasis> (optional)"
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
msgstr "<emphasis>Passwort des Datenbankbenutzers</emphasis> (optional)"
#. Tag: para
+#: configuration.xml:280
#, fuzzy, no-c-format
msgid ""
"Here is an example <filename>hibernate.properties</filename> file for an "
@@ -702,7 +838,26 @@
"Hier sehen Sie das Beispiel einer <literal>hibernate.properties</literal>-"
"Datei für eine vom Applikationsserver bereitgestellte JNDI-Datenquelle:"
+#. Tag: programlisting
+#: configuration.xml:283
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
msgid ""
"JDBC connections obtained from a JNDI datasource will automatically "
@@ -712,6 +867,7 @@
"den vom Container verwalteten Transaktionen des Applikationsservers teil."
#. Tag: para
+#: configuration.xml:289
#, fuzzy, no-c-format
msgid ""
"Arbitrary connection properties can be given by prepending "
@@ -725,6 +881,7 @@
"Verwendung von <literal>hibernate.connection.charSet</literal> bestimmen."
#. Tag: para
+#: configuration.xml:294
#, fuzzy, no-c-format
msgid ""
"You can define your own plugin strategy for obtaining JDBC connections by "
@@ -740,11 +897,13 @@
"Ihre eigene anwenderdefinierte Implementierung wählen."
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr "Optionale Properties der Konfiguration"
#. Tag: para
+#: configuration.xml:304
#, fuzzy, no-c-format
msgid ""
"There are a number of other properties that control the behavior of "
@@ -755,6 +914,7 @@
"Standardwerte."
#. Tag: para
+#: configuration.xml:309
#, fuzzy, no-c-format
msgid ""
"<emphasis>Some of these properties are \"system-level\" only.</emphasis> "
@@ -769,16 +929,19 @@
"der anderen, oben beschriebenen Techniken eingestellt werden."
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr "Konfigurationseigenschaften von Hibernate"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:335
#, fuzzy, no-c-format
-msgid "<property>hibernate.dialect</property>"
+msgid "hibernate.dialect"
msgstr "hibernate.dialect"
#. Tag: entry
+#: configuration.xml:337
#, fuzzy, no-c-format
msgid ""
"The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</"
@@ -790,6 +953,7 @@
"generieren."
#. Tag: para
+#: configuration.xml:340
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of."
@@ -799,6 +963,7 @@
"literal>"
#. Tag: para
+#: configuration.xml:341
#, no-c-format
msgid ""
"In most cases Hibernate will actually be able to choose the correct "
@@ -806,12 +971,14 @@
"the <literal>JDBC metadata</literal> returned by the JDBC driver."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:349
#, fuzzy, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+msgid "hibernate.show_sql"
msgstr "hibernate.show_sql"
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
msgid ""
"Write all SQL statements to console. This is an alternative to setting the "
@@ -823,6 +990,11 @@
"hibernate.SQL</literal> auf <literal>debug</literal>."
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426
+#: configuration.xml:435 configuration.xml:443 configuration.xml:453
+#: configuration.xml:468 configuration.xml:525 configuration.xml:545
+#: configuration.xml:555 configuration.xml:598 configuration.xml:797
+#: configuration.xml:808 configuration.xml:904
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
@@ -831,22 +1003,26 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>true</literal> | "
"<literal>false</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:359
#, fuzzy, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+msgid "hibernate.format_sql"
msgstr "hibernate.format_sql"
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr "SQL in Protokoll und Konsole lesbar ausgeben."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:367
#, fuzzy, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+msgid "hibernate.default_schema"
msgstr "hibernate.default_schema"
#. Tag: entry
+#: configuration.xml:369
#, fuzzy, no-c-format
msgid ""
"Qualify unqualified table names with the given schema/tablespace in "
@@ -856,17 +1032,20 @@
"Tabellenraum in generiertem SQL."
#. Tag: para
+#: configuration.xml:370
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
msgstr "<emphasis role=\"strong\">eg.</emphasis><literal>SCHEMA_NAME</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:376
#, fuzzy, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+msgid "hibernate.default_catalog"
msgstr "hibernate.default_catalog"
#. Tag: entry
+#: configuration.xml:378
#, fuzzy, no-c-format
msgid ""
"Qualifies unqualified table names with the given catalog in generated SQL."
@@ -875,18 +1054,21 @@
"generierten SQL."
#. Tag: para
+#: configuration.xml:379
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
msgstr ""
"<emphasis role=\"strong\">eg.</emphasis><literal>CATALOG_NAME</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:384
#, fuzzy, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+msgid "hibernate.session_factory_name"
msgstr "hibernate.session_factory_name"
#. Tag: entry
+#: configuration.xml:386
#, fuzzy, no-c-format
msgid ""
"The <interfacename>org.hibernate.SessionFactory</interfacename> will be "
@@ -896,6 +1078,7 @@
"JNDI gebunden, nachdem sie erstellt wurde."
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
@@ -904,12 +1087,14 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>jndi/composite/name</"
"literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:394
#, fuzzy, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+msgid "hibernate.max_fetch_depth"
msgstr "hibernate.max_fetch_depth"
#. Tag: entry
+#: configuration.xml:396
#, fuzzy, no-c-format
msgid ""
"Sets a maximum \"depth\" for the outer join fetch tree for single-ended "
@@ -922,6 +1107,7 @@
"Fetching."
#. Tag: para
+#: configuration.xml:398
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -930,12 +1116,14 @@
"<emphasis role=\"strong\">z.B.</emphasis> empfohlene Werte zwischen "
"<literal>0</literal> und <literal>3</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:404
#, fuzzy, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+msgid "hibernate.default_batch_fetch_size"
msgstr "hibernate.default_batch_fetch_size"
#. Tag: entry
+#: configuration.xml:406
#, fuzzy, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr ""
@@ -943,6 +1131,7 @@
"Fetching\") von Assoziationen ein."
#. Tag: para
+#: configuration.xml:407
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</"
@@ -951,12 +1140,14 @@
"<emphasis role=\"strong\">z.B.</emphasis> empfohlene Werte <literal>4</"
"literal>, <literal>8</literal>, <literal>16</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:413
#, fuzzy, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+msgid "hibernate.default_entity_mode"
msgstr "hibernate.default_entity_mode"
#. Tag: entry
+#: configuration.xml:415
#, fuzzy, no-c-format
msgid ""
"Sets a default mode for entity representation for all sessions opened from "
@@ -966,6 +1157,7 @@
"dieser <literal>SessionFactory</literal> geöffneten Sessions."
#. Tag: para
+#: configuration.xml:416
#, no-c-format
msgid ""
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
@@ -974,12 +1166,14 @@
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
"literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:422
#, fuzzy, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+msgid "hibernate.order_updates"
msgstr "hibernate.order_updates"
#. Tag: entry
+#: configuration.xml:424
#, fuzzy, no-c-format
msgid ""
"Forces Hibernate to order SQL updates by the primary key value of the items "
@@ -990,12 +1184,14 @@
"aktualisierten Posten anzufordern. Dies hat eine Verringerung der Anzahl von "
"Transaktionssperren in simultan laufenden Systemen zur Folge."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:432
#, fuzzy, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
-msgstr "hibernate.generate_statistics"
+msgid "hibernate.generate_statistics"
+msgstr "Die Hibernate Statistik"
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
msgid ""
"If enabled, Hibernate will collect statistics useful for performance tuning."
@@ -1003,12 +1199,14 @@
"Falls aktiviert, so sammelt Hibernate Statistiken, die bei der "
"Feinabstimmung der Performance von Nutzen sind. "
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:440
#, fuzzy, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+msgid "hibernate.use_identifier_rollback"
msgstr "hibernate.use_identifer_rollback"
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
msgid ""
"If enabled, generated identifier properties will be reset to default values "
@@ -1017,12 +1215,14 @@
"Falls aktiviert, so werden die generierten Bezeichner-Properties auf die "
"Standardwerte zurückgesetzt, wenn Objekte gelöscht werden."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:449
#, fuzzy, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
+msgid "hibernate.use_sql_comments"
msgstr "hibernate.use_sql_comments"
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
msgid ""
"If turned on, Hibernate will generate comments inside the SQL, for easier "
@@ -1032,17 +1232,51 @@
"eine vereinfachte Fehlersuche. Die Standardeinstellung lautet "
"<literal>false</literal>."
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:460
+#, no-c-format
+msgid ""
+"Setting is relevant when using <classname>@GeneratedValue</classname>. It "
+"indicates whether or not the new <classname>IdentifierGenerator</classname> "
+"implementations are used for <classname>javax.persistence.GenerationType."
+"AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</"
+"classname> and <classname>javax.persistence.GenerationType.SEQUENCE</"
+"classname>. Default to <literal>false</literal> to keep backward "
+"compatibility."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid ""
+"We recommend all new projects which make use of to use "
+"<classname>@GeneratedValue</classname> to also set <code>hibernate.id."
+"new_generator_mappings=true</code> as the new generators are more efficient "
+"and closer to the JPA 2 specification semantic. However they are not "
+"backward compatible with existing databases (if a sequence or a table is "
+"used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr "Hibernate JDBC- und Connection-Properties"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:503
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+msgid "hibernate.jdbc.fetch_size"
msgstr "hibernate.jdbc.fetch_size"
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
msgid ""
"A non-zero value determines the JDBC fetch size (calls <literal>Statement."
@@ -1052,12 +1286,14 @@
"genannten \"Fetch Size\" (ruft <literal>Statement.setFetchSize()</literal> "
"auf)."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:510
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+msgid "hibernate.jdbc.batch_size"
msgstr "hibernate.jdbc.batch_size"
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr ""
@@ -1065,6 +1301,7 @@
"Stapelaktualisierungen (sog. \"Batch Updates\") durch Hibernate."
#. Tag: para
+#: configuration.xml:513
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -1073,16 +1310,18 @@
"<emphasis role=\"strong\">z.B.</emphasis> empfohlene Werte zwischen "
"<literal>5</literal> und <literal>30</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:519
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr "hibernate.jdbc.batch_versioned_data"
#. Tag: entry
+#: configuration.xml:521
#, fuzzy, no-c-format
msgid ""
"Set this property to <literal>true</literal> if your JDBC driver returns "
-"correct row counts from <literal>executeBatch()</literal>. Iit is usually "
+"correct row counts from <literal>executeBatch()</literal>. It is usually "
"safe to turn this option on. Hibernate will then use batched DML for "
"automatically versioned data. Defaults to <literal>false</literal>."
msgstr ""
@@ -1092,12 +1331,14 @@
"Hibernate verwendet dann gestapelte DML für automatisch versionierte Daten. "
"Die Standardeinstellung lautet hier <literal>false</literal>."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:531
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+msgid "hibernate.jdbc.factory_class"
msgstr "hibernate.jdbc.factory_class"
#. Tag: entry
+#: configuration.xml:533
#, fuzzy, no-c-format
msgid ""
"Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. "
@@ -1107,6 +1348,7 @@
"Anwendungen benötigen diese Konfigurationseigenschaft nicht."
#. Tag: para
+#: configuration.xml:535
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1115,12 +1357,14 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>classname.of.Batcher</"
"literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:541
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr "hibernate.jdbc.use_scrollable_resultset"
#. Tag: entry
+#: configuration.xml:543
#, fuzzy, no-c-format
msgid ""
"Enables use of JDBC2 scrollable resultsets by Hibernate. This property is "
@@ -1132,12 +1376,14 @@
"Verwendung von Benutzer-gelieferten JDBC-Verbindungen notwendig, Hibernate "
"verwendet Metadaten der Verbindung(en) anders."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:551
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr "hibernate.jdbc.use_streams_for_binary"
#. Tag: entry
+#: configuration.xml:553
#, fuzzy, no-c-format
msgid ""
"Use streams when writing/reading <literal>binary</literal> or "
@@ -1148,12 +1394,14 @@
"<literal>binary</literal> oder <literal>serializable</literal> Typen in/aus "
"JDBC (Property der Systemebene)."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:561
#, fuzzy, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr "hibernate.jdbc.use_get_generated_keys"
#. Tag: entry
+#: configuration.xml:563
#, fuzzy, no-c-format
msgid ""
"Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> "
@@ -1170,16 +1418,20 @@
"Metadaten die Treiberfähigkeiten zu bestimmen."
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687
+#: configuration.xml:696 configuration.xml:723
#, fuzzy, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
msgstr "<emphasis role=\"strong\">eg.</emphasis><literal>true|false</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:574
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+msgid "hibernate.connection.provider_class"
msgstr "hibernate.connection.provider_class"
#. Tag: entry
+#: configuration.xml:576
#, fuzzy, no-c-format
msgid ""
"The classname of a custom <interfacename>org.hibernate.connection."
@@ -1190,6 +1442,7 @@
"literal> der Hibernate JDBC-Verbindungen bereitstellt."
#. Tag: para
+#: configuration.xml:578
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1198,12 +1451,14 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>classname.of."
"ConnectionProvider</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:584
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+msgid "hibernate.connection.isolation"
msgstr "hibernate.connection.isolation"
#. Tag: entry
+#: configuration.xml:586
#, fuzzy, no-c-format
msgid ""
"Sets the JDBC transaction isolation level. Check <interfacename>java.sql."
@@ -1216,27 +1471,32 @@
"Sie, dass die meisten Datenbanken nicht alle Isolationsebenen unterstützen."
#. Tag: para
+#: configuration.xml:589
#, fuzzy, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
msgstr "<emphasis role=\"strong\">eg.</emphasis><literal>1, 2, 4, 8</literal>"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:595
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+msgid "hibernate.connection.autocommit"
msgstr "hibernate.connection.autocommit"
#. Tag: entry
+#: configuration.xml:597
#, fuzzy, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr ""
"Aktiviert \"autocommit\" für JDBC gepoolte Verbindungen (nicht empfohlen)."
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:603
#, fuzzy, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+msgid "hibernate.connection.release_mode"
msgstr "hibernate.connection.release_mode"
#. Tag: entry
+#: configuration.xml:605
#, fuzzy, no-c-format
msgid ""
"Specifies when Hibernate should release JDBC connections. By default, a JDBC "
@@ -1262,6 +1522,7 @@
"Transaktionsstrategie."
#. Tag: para
+#: configuration.xml:615
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) "
@@ -1273,6 +1534,7 @@
"<literal>after_statement</literal>"
#. Tag: para
+#: configuration.xml:618
#, fuzzy, no-c-format
msgid ""
"This setting only affects <literal>Session</literal>s returned from "
@@ -1280,8 +1542,7 @@
"literal>s obtained through <literal>SessionFactory.getCurrentSession</"
"literal>, the <literal>CurrentSessionContext</literal> implementation "
"configured for use controls the connection release mode for those "
-"<literal>Session</literal>s. See <xref linkend=\"architecture-current-session"
-"\" />"
+"<literal>Session</literal>s. See"
msgstr ""
"Bitte beachten Sie, dass diese Einstellung nur <literal>Session</literal>s "
"betrifft, die von der <literal>SessionFactory.openSession</literal> "
@@ -1292,6 +1553,7 @@
"\"architecture-current-session\"/>."
#. Tag: entry
+#: configuration.xml:630
#, fuzzy, no-c-format
msgid ""
"<property>hibernate.connection.</property><emphasis><propertyName></"
@@ -1299,6 +1561,7 @@
msgstr "hibernate.connection.<propertyName>"
#. Tag: entry
+#: configuration.xml:632
#, fuzzy, no-c-format
msgid ""
"Pass the JDBC property <emphasis><propertyName></emphasis> to "
@@ -1308,6 +1571,7 @@
"<literal>DriverManager.getConnection()</literal>."
#. Tag: entry
+#: configuration.xml:638
#, fuzzy, no-c-format
msgid ""
"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
@@ -1316,6 +1580,7 @@
"emphasis>"
#. Tag: entry
+#: configuration.xml:640
#, fuzzy, no-c-format
msgid ""
"Pass the property <emphasis><propertyName></emphasis> to the JNDI "
@@ -1325,22 +1590,26 @@
"<literal>InitialContextFactory</literal>."
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr "Hibernate Cache-Properties"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:665
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+msgid "hibernate.cache.provider_class"
msgstr "hibernate.cache.provider_class"
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
msgstr ""
"Der Klassenname eines anwenderdefinierten <literal>CacheProvider</literal>."
#. Tag: para
+#: configuration.xml:668
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1349,12 +1618,14 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>classname.of.CacheProvider</"
"literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:673
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+msgid "hibernate.cache.use_minimal_puts"
msgstr "hibernate.cache.use_minimal_puts"
#. Tag: entry
+#: configuration.xml:675
#, fuzzy, no-c-format
msgid ""
"Optimizes second-level cache operation to minimize writes, at the cost of "
@@ -1366,12 +1637,14 @@
"ist vor allem für geclusterte Caches sinnvoll und ist bei Hibernate3 "
"standardmäßig für geclusterte Cache-Implementierungen aktiviert."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:684
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+msgid "hibernate.cache.use_query_cache"
msgstr "hibernate.cache.use_query_cache"
#. Tag: entry
+#: configuration.xml:686
#, fuzzy, no-c-format
msgid ""
"Enables the query cache. Individual queries still have to be set cachable."
@@ -1379,12 +1652,14 @@
"Aktivieren Sie das Anfragen-Cache, Einzelanfragen müssen nach wie vor als "
"speicherbar eingestellt sein."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:692
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+msgid "hibernate.cache.use_second_level_cache"
msgstr "hibernate.cache.use_second_level_cache"
#. Tag: entry
+#: configuration.xml:694
#, fuzzy, no-c-format
msgid ""
"Can be used to completely disable the second level cache, which is enabled "
@@ -1395,12 +1670,14 @@
"deaktivieren, das für Klassen mit einem <literal><cache></literal>-"
"Mapping standardmäßig aktiviert ist."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:702
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+msgid "hibernate.cache.query_cache_factory"
msgstr "hibernate.cache.query_cache_factory"
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
msgid ""
"The classname of a custom <literal>QueryCache</literal> interface, defaults "
@@ -1410,6 +1687,7 @@
"Interface, Standard ist das eingebaute <literal>StandardQueryCache</literal>."
#. Tag: para
+#: configuration.xml:706
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
@@ -1418,27 +1696,32 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>classname.of.QueryCache</"
"literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:712
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+msgid "hibernate.cache.region_prefix"
msgstr "hibernate.cache.region_prefix"
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr "Ein für Cache-Bereiche der zweiten Ebene zu verwendender Präfix."
#. Tag: para
+#: configuration.xml:714
#, fuzzy, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
msgstr "<emphasis role=\"strong\">eg.</emphasis><literal>prefix</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:720
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+msgid "hibernate.cache.use_structured_entries"
msgstr "hibernate.cache.use_structured_entries"
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
msgid ""
"Forces Hibernate to store data in the second-level cache in a more human-"
@@ -1447,17 +1730,36 @@
"Bringt Hibernate dazu, Daten im Cachespeicher der zweiten Ebene in einer für "
"den Benutzer freundlicheren Art zu speichern."
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid ""
+"Setting used to give the name of the default <classname>org.hibernate."
+"annotations.CacheConcurrencyStrategy</classname> to use when either "
+"<classname>@Cacheable</classname> or <classname>@Cache</classname> is used. "
+"<code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr "Hibernate Transaktions-Properties"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:761
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+msgid "hibernate.transaction.factory_class"
msgstr "hibernate.transaction.factory_class"
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
msgid ""
"The classname of a <literal>TransactionFactory</literal> to use with "
@@ -1470,6 +1772,7 @@
"<literal>JDBCTransactionFactory</literal>)."
#. Tag: para
+#: configuration.xml:765
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1478,12 +1781,14 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>classname.of."
"TransactionFactory</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:771
#, fuzzy, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+msgid "jta.UserTransaction"
msgstr "jta.UserTransaction"
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
msgid ""
"A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the "
@@ -1493,12 +1798,14 @@
"<literal>UserTransaction</literal> vom Applikationsserver verwendeter JNDI-"
"Name."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:781
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+msgid "hibernate.transaction.manager_lookup_class"
msgstr "hibernate.transaction.manager_lookup_class"
#. Tag: entry
+#: configuration.xml:783
#, fuzzy, no-c-format
msgid ""
"The classname of a <literal>TransactionManagerLookup</literal>. It is "
@@ -1510,6 +1817,7 @@
"einer JTA-Umgebung ein Hilo-Generator verwendet wird."
#. Tag: para
+#: configuration.xml:786
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1518,17 +1826,19 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>classname.of."
"TransactionManagerLookup</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:792
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+msgid "hibernate.transaction.flush_before_completion"
msgstr "hibernate.transaction.flush_before_completion"
#. Tag: entry
+#: configuration.xml:794
#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically flushed during the before "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Falls aktiviert, wird die Session automatisch während der Vorabschlussphase "
@@ -1536,17 +1846,19 @@
"Kontextmanagement wird bevorzugt, siehe <xref linkend=\"architecture-current-"
"session\"/>."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:803
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+msgid "hibernate.transaction.auto_close_session"
msgstr "hibernate.transaction.auto_close_session"
#. Tag: entry
+#: configuration.xml:805
#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically closed during the after "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Falls aktiviert, wird die Session während der Nachabschlussphase automatisch "
@@ -1554,21 +1866,24 @@
"bevorzugt, siehe <xref linkend=\"architecture-current-session\"/>."
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr "Verschiedene Properties"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:834
#, fuzzy, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+msgid "hibernate.current_session_context_class"
msgstr "hibernate.current_session_context_class"
#. Tag: entry
+#: configuration.xml:836
#, fuzzy, no-c-format
msgid ""
"Supply a custom strategy for the scoping of the \"current\" "
"<literal>Session</literal>. See <xref linkend=\"architecture-current-session"
-"\" /> for more information about the built-in strategies."
+"\"/> for more information about the built-in strategies."
msgstr ""
"Geben Sie eine (anwenderdefinierte) Strategie für den Gültigkeitsbereich der "
"\"aktuellen\" <literal>Session</literal> ein. Weitere Informationen zu "
@@ -1576,6 +1891,7 @@
"session\"/>."
#. Tag: para
+#: configuration.xml:839
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | "
@@ -1586,17 +1902,20 @@
"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
"Class</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:846
#, fuzzy, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+msgid "hibernate.query.factory_class"
msgstr "hibernate.query.factory_class"
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr "Wählt die Implemetierung des HQL-Parsers (Analysealgorithmus)."
#. Tag: para
+#: configuration.xml:848
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast."
@@ -1607,12 +1926,14 @@
"ASTQueryTranslatorFactory</literal> or <literal>org.hibernate.hql.classic."
"ClassicQueryTranslatorFactory</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:857
#, fuzzy, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
-msgstr "hibernate.query.substitutions"
+msgid "hibernate.query.substitutions"
+msgstr "hibernate.query.substitutions true=1, false=0"
#. Tag: entry
+#: configuration.xml:859
#, fuzzy, no-c-format
msgid ""
"Is used to map from tokens in Hibernate queries to SQL tokens (tokens might "
@@ -1622,6 +1943,7 @@
"B. Funktions- oder Literalnamen sein)."
#. Tag: para
+#: configuration.xml:861
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
@@ -1630,12 +1952,14 @@
"<emphasis role=\"strong\">eg.</emphasis><literal>hqlLiteral=SQL_LITERAL, "
"hqlFunction=SQLFUNC</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:867
#, fuzzy, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+msgid "hibernate.hbm2ddl.auto"
msgstr "hibernate.hbm2ddl.auto"
#. Tag: entry
+#: configuration.xml:869
#, fuzzy, no-c-format
msgid ""
"Automatically validates or exports schema DDL to the database when the "
@@ -1649,6 +1973,7 @@
"<literal>SessionFactory</literal> explizit geschlossen wird."
#. Tag: para
+#: configuration.xml:873
#, fuzzy, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | "
@@ -1659,12 +1984,48 @@
"<literal>update</literal> | <literal>create</literal> | <literal>create-"
"drop</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:880
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+msgid "hibernate.hbm2ddl.import_file"
+msgstr "hibernate.hbm2ddl.auto"
+
+#. Tag: para
+#: configuration.xml:882
+#, no-c-format
+msgid ""
+"Comma-separated names of the optional files containing SQL DML statements "
+"executed during the <classname>SessionFactory</classname> creation. This is "
+"useful for testing or demoing: by adding INSERT statements for example you "
+"can populate your database with a minimal set of data when it is deployed."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:887
+#, no-c-format
+msgid ""
+"File order matters, the statements of a give file are executed before the "
+"statements of the following files. These statements are only executed if the "
+"schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to "
+"<literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:892
+#, fuzzy, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</"
+"literal>"
+msgstr "<emphasis role=\"strong\">eg.</emphasis><literal>true|false</literal>"
+
+#. Tag: literal
+#: configuration.xml:898
+#, fuzzy, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
msgstr "hibernate.cglib.use_reflection_optimizer"
#. Tag: entry
+#: configuration.xml:900
#, fuzzy, no-c-format
msgid ""
"Enables the use of CGLIB instead of runtime reflection (System-level "
@@ -1679,11 +2040,13 @@
"<literal>hibernate.cfg.xml</literal> eingestellt werden."
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr "SQL-Dialekte"
#. Tag: para
+#: configuration.xml:915
#, fuzzy, no-c-format
msgid ""
"Always set the <literal>hibernate.dialect</literal> property to the correct "
@@ -1700,256 +2063,307 @@
"bleibt."
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr "Hibernate SQL-Dialekte (<literal>hibernate.dialect</literal>)"
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr "RDBMS"
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr "Dialekt"
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
-msgstr ""
+msgid "<entry>DB2</entry>"
+msgstr "<entry>DB2</entry>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:943
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr "org.hibernate.dialect.DB2Dialect"
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr "DB2 AS/400"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:949
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr "org.hibernate.dialect.DB2400Dialect"
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr "DB2 OS390"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:955
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr "org.hibernate.dialect.DB2390Dialect"
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr "PostgreSQL"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:961
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr "org.hibernate.dialect.PostgreSQLDialect"
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr "MySQL"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:967
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr "org.hibernate.dialect.MySQLDialect"
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr "MySQL mit InnoDB"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:973
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr "org.hibernate.dialect.MySQLInnoDBDialect"
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr "MySQL mit MyISAM"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:979
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr "org.hibernate.dialect.MySQLMyISAMDialect"
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr "Oracle (alle Versionen)"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:985
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+msgid "org.hibernate.dialect.OracleDialect"
msgstr "org.hibernate.dialect.OracleDialect"
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:991
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr "org.hibernate.dialect.OracleDialect"
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:997
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr "org.hibernate.dialect.OracleDialect"
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr "Sybase"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1003
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr "org.hibernate.dialect.SybaseDialect"
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr "Sybase Anywhere"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1009
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr "org.hibernate.dialect.SybaseAnywhereDialect"
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr "Microsoft SQL-Server"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1015
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr "org.hibernate.dialect.SQLServerDialect"
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr "SAP DB"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1021
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr "org.hibernate.dialect.SAPDBDialect"
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr "Informix"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1027
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+msgid "org.hibernate.dialect.InformixDialect"
msgstr "org.hibernate.dialect.InformixDialect"
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr "HypersonicSQL"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1033
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr "org.hibernate.dialect.HSQLDialect"
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr "Ingres"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1039
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+msgid "org.hibernate.dialect.IngresDialect"
msgstr "org.hibernate.dialect.IngresDialect"
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr "Progress"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1045
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr "org.hibernate.dialect.ProgressDialect"
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr "Mckoi SQL"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1051
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr "org.hibernate.dialect.MckoiDialect"
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr "Interbase"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1057
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr "org.hibernate.dialect.InterbaseDialect"
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr "Pointbase"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1063
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr "org.hibernate.dialect.PointbaseDialect"
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr "FrontBase"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1069
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr "org.hibernate.dialect.FrontbaseDialect"
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr "Firebird"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1075
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr "org.hibernate.dialect.FirebirdDialect"
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr "\"Outer-Join-Fetching\""
#. Tag: para
+#: configuration.xml:1085
#, fuzzy, no-c-format
msgid ""
"If your database supports ANSI, Oracle or Sybase style outer joins, "
@@ -1971,6 +2385,7 @@
"aufzurufen."
#. Tag: para
+#: configuration.xml:1094
#, fuzzy, no-c-format
msgid ""
"Outer join fetching can be disabled <emphasis>globally</emphasis> by setting "
@@ -1987,18 +2402,21 @@
"\"-Assoziationen."
#. Tag: para
+#: configuration.xml:1100
#, fuzzy, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr ""
"Weitere Informationen finden Sie unter <xref linkend=\"performance-fetching"
"\"/>."
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr "Binäre Datenströme "
#. Tag: para
+#: configuration.xml:1107
#, fuzzy, no-c-format
msgid ""
"Oracle limits the size of <literal>byte</literal> arrays that can be passed "
@@ -2015,16 +2433,18 @@
"gilt ausschließlich für die Systemebene.</emphasis>"
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr "Zweite Ebene und Anfragen-Cache"
#. Tag: para
+#: configuration.xml:1118
#, fuzzy, no-c-format
msgid ""
"The properties prefixed by <literal>hibernate.cache</literal> allow you to "
"use a process or cluster scoped second-level cache system with Hibernate. "
-"See the <xref linkend=\"performance-cache\" /> for more information."
+"See the <xref linkend=\"performance-cache\"/> for more information."
msgstr ""
"Die Properties mit dem Präfix <literal>hibernate.cache</literal> erlauben "
"die Verwendung eines prozess- oder clusterbegrenzten Cache-Systems der "
@@ -2032,11 +2452,13 @@
"\"performance-cache\"/>."
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr "\"Query Language Substitution\""
#. Tag: para
+#: configuration.xml:1127
#, fuzzy, no-c-format
msgid ""
"You can define new Hibernate query tokens using <literal>hibernate.query."
@@ -2045,7 +2467,14 @@
"Sie können neue Hibernate Anfrage-\"Tokens\" mittels <literal>hibernate."
"query.substitutions</literal> definieren. Zum Beispiel:"
+#. Tag: programlisting
+#: configuration.xml:1130
+#, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr "hibernate.query.substitutions true=1, false=0"
+
#. Tag: para
+#: configuration.xml:1132
#, fuzzy, no-c-format
msgid ""
"This would cause the tokens <literal>true</literal> and <literal>false</"
@@ -2055,7 +2484,14 @@
"<literal>false</literal> in ganzzahlige Literale in der generierten SQL mit "
"sich bringen."
+#. Tag: programlisting
+#: configuration.xml:1136
+#, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr "hibernate.query.substitutions toLowercase=LOWER"
+
#. Tag: para
+#: configuration.xml:1138
#, fuzzy, no-c-format
msgid ""
"This would allow you to rename the SQL <literal>LOWER</literal> function."
@@ -2063,11 +2499,13 @@
"ermöglicht Ihnen die Umbenennung der SQL <literal>LOWER</literal>-Funktion."
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr "Die Hibernate Statistik"
#. Tag: para
+#: configuration.xml:1145
#, fuzzy, no-c-format
msgid ""
"If you enable <literal>hibernate.generate_statistics</literal>, Hibernate "
@@ -2084,11 +2522,13 @@
"der Interfaces <literal>org.hibernate.stats</literal>."
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr "Protokollierung"
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
msgid ""
"Hibernate utilizes <ulink url=\"http://www.slf4j.org/\">Simple Logging "
@@ -2106,6 +2546,7 @@
msgstr ""
#. Tag: para
+#: configuration.xml:1171
#, fuzzy, no-c-format
msgid ""
"It is recommended that you familiarize yourself with Hibernate's log "
@@ -2121,56 +2562,67 @@
"Fehlerbehebung. Die wichtigsten Protokollkategorien lauten:"
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr "Die Protokollkategorien von Hibernate"
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr "Kategorie"
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr "Funktion"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1195
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
-msgstr "org.hibernate.SQL"
+msgid "org.hibernate.SQL"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr "Protokollierung aller SQL DML-Anweisungen bei deren Ausführung"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1201
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
-msgstr "org.hibernate.type"
+msgid "org.hibernate.type"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr "Protokollierung aller JDBC-Parameter"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1207
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+msgid "org.hibernate.tool.hbm2ddl"
msgstr "org.hibernate.tool.hbm2ddl"
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr "Protokollierung aller SQL DDL-Anweisungen bei deren Ausführung"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1213
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
-msgstr "org.hibernate.pretty"
+msgid "org.hibernate.pretty"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
msgid ""
"Log the state of all entities (max 20 entities) associated with the session "
@@ -2179,62 +2631,74 @@
"Protokollierung des Status aller Entities (max. 20 Entities) die zum "
"Räumungzeitpunkt mit der Session assoziiert werden."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1220
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
-msgstr "org.hibernate.cache"
+msgid "org.hibernate.cache"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr "Protokollierung aller Cache-Vorgänge der zweiten Ebene"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1226
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+msgid "org.hibernate.transaction"
msgstr "org.hibernate.transaction"
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr "Protokollierung von transaktionsbezogenen Vorgänge"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1232
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
-msgstr "org.hibernate.jdbc"
+msgid "org.hibernate.jdbc"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr "Protokollierung sämtlicher JDBC-Ressourcen-Erfassungen"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1238
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+msgid "org.hibernate.hql.ast.AST"
msgstr "org.hibernate.hql.ast.AST"
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr "Protokollierung von HQL und SQL ASTs während Abfragen-Parsing"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1244
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
-msgstr "org.hibernate.secure"
+msgid "org.hibernate.secure"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr "Protokollierung aller JAAS-Authentifizierungsanfragen"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<literal>org.hibernate</literal>"
-msgstr "JNDI-gebundene SessionFactory"
+#. Tag: literal
+#: configuration.xml:1250
+#, no-c-format
+msgid "org.hibernate"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1252
#, fuzzy, no-c-format
msgid ""
"Log everything. This is a lot of information but it is useful for "
@@ -2244,6 +2708,7 @@
"bei der Fehlerbehebung)"
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
msgid ""
"When developing applications with Hibernate, you should almost always work "
@@ -2257,11 +2722,13 @@
"mit der aktivierten Property <literal>hibernate.show_sql</literal>."
#. Tag: title
+#: configuration.xml:1266
#, fuzzy, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr "wählen Sie eine <literal>NamingStrategy</literal>"
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
msgid ""
"The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you "
@@ -2272,6 +2739,7 @@
"Datenbankobjekte und Schema-Elemente zu bestimmen."
#. Tag: para
+#: configuration.xml:1272
#, fuzzy, no-c-format
msgid ""
"You can provide rules for automatically generating database identifiers from "
@@ -2290,6 +2758,7 @@
"Die von Hibernate verwendete Standardstrategie ist recht minimal."
#. Tag: para
+#: configuration.xml:1279
#, fuzzy, no-c-format
msgid ""
"You can specify a different strategy by calling <literal>Configuration."
@@ -2298,7 +2767,24 @@
"Mit dem Aufruf <literal>Configuration.setNamingStrategy()</literal> können "
"Sie eine andere Strategie festlegen, ehe Sie Mappings hinzufügen:"
+#. Tag: programlisting
+#: configuration.xml:1283
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
msgid ""
"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in "
@@ -2309,11 +2795,13 @@
"von Nutzen sein kann."
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr "XML-Konfigurationsdatei"
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
msgid ""
"An alternative approach to configuration is to specify a full configuration "
@@ -2328,6 +2816,7 @@
"Kraft setzen."
#. Tag: para
+#: configuration.xml:1299
#, fuzzy, no-c-format
msgid ""
"The XML configuration file is by default expected to be in the root of your "
@@ -2337,7 +2826,92 @@
"Stammverzeichnis Ihres <literal>CLASSPATH</literal>. Nachfolgend sehen Sie "
"ein Beispiel:"
+#. Tag: programlisting
+#: configuration.xml:1302
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+msgstr ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+
#. Tag: para
+#: configuration.xml:1304
#, fuzzy, no-c-format
msgid ""
"The advantage of this approach is the externalization of the mapping file "
@@ -2356,22 +2930,46 @@
"bereitserwähnten Vorteil durch die Benutzung der XML-Syntax gleichwertig."
#. Tag: para
+#: configuration.xml:1311
#, fuzzy, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr ""
"Mit der XML-Konfiguration wird der Start von Hibernate dann ganz einfach mit"
+#. Tag: programlisting
+#: configuration.xml:1314
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+
#. Tag: para
+#: configuration.xml:1316
#, fuzzy, no-c-format
msgid "You can select a different XML configuration file using:"
msgstr "Die Wahl einer anderen XML-Konfigurationsdatei erfolgt mittels"
+#. Tag: programlisting
+#: configuration.xml:1318
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr "Integration des J2EE-Applikationsservers"
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr ""
@@ -2379,6 +2977,7 @@
"Infrastruktur:"
#. Tag: para
+#: configuration.xml:1329
#, fuzzy, no-c-format
msgid ""
"<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC "
@@ -2401,6 +3000,7 @@
"Ihren Code übertragbar zu halten."
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
msgid ""
"<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its "
@@ -2410,6 +3010,7 @@
"<literal>SessionFactory</literal> nach dem Startup an JNDI binden."
#. Tag: para
+#: configuration.xml:1350
#, fuzzy, no-c-format
msgid ""
"<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</"
@@ -2430,6 +3031,7 @@
"(BMT/UserTransaction)."
#. Tag: para
+#: configuration.xml:1362
#, fuzzy, no-c-format
msgid ""
"<emphasis>JMX deployment:</emphasis> if you have a JMX capable application "
@@ -2449,6 +3051,7 @@
"(Datenquelle muss vor dem Hibernate Start verfügbar sein usw.). "
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
msgid ""
"Depending on your environment, you might have to set the configuration "
@@ -2461,11 +3064,13 @@
"Verbindungseinschränkungen) anzeigt."
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr "Konfiguration der Transaktionsstrategie"
#. Tag: para
+#: configuration.xml:1381
#, fuzzy, no-c-format
msgid ""
"The Hibernate <literal>Session</literal> API is independent of any "
@@ -2484,6 +3089,7 @@
"Bedarf aufzurufen."
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
msgid ""
"To keep your code portable between these two (and other) environments we "
@@ -2501,26 +3107,31 @@
"transaction.factory_class</literal> einstellen."
#. Tag: para
+#: configuration.xml:1397
#, fuzzy, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr "Es existieren drei Standard-Auswahlmöglichkeiten (eingebaut):"
-#. Tag: term
+#. Tag: literal
+#: configuration.xml:1401
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr "org.hibernate.transaction.JDBCTransactionFactory"
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr "delegiert an die Datenbank (JDBC) Transaktionen (default)"
-#. Tag: term
+#. Tag: literal
+#: configuration.xml:1409
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr "org.hibernate.transaction.JTATransactionFactory"
#. Tag: para
+#: configuration.xml:1412
#, fuzzy, no-c-format
msgid ""
"delegates to container-managed transactions if an existing transaction is "
@@ -2532,17 +3143,20 @@
"Andernfalls wird eine neue Transaktion gestartet und von einem Bean "
"gemanagte Transaktionen werden verwendet."
-#. Tag: term
+#. Tag: literal
+#: configuration.xml:1420
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr "org.hibernate.transaction.CMTTransactionFactory"
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr "delegiert an containerverwaltete JTA-Transaktionen"
#. Tag: para
+#: configuration.xml:1428
#, fuzzy, no-c-format
msgid ""
"You can also define your own transaction strategies (for a CORBA transaction "
@@ -2552,6 +3166,7 @@
"einen CORBA-Transaktionsdienst)."
#. Tag: para
+#: configuration.xml:1431
#, fuzzy, no-c-format
msgid ""
"Some features in Hibernate (i.e., the second level cache, Contextual "
@@ -2569,138 +3184,151 @@
"Mechanismus standardisiert:"
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr "JTA-TransactionManagers"
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr "Transaction-Factory"
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr "Applikationsserver"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1456
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
msgstr "org.hibernate.transaction.JBossTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr "JBoss"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1462
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
msgstr "org.hibernate.transaction.WeblogicTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr "Weblogic"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1468
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
-"literal>"
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr "org.hibernate.transaction.WebSphereTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr "WebSphere"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1474
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
-"literal>"
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr "WebSphere 6"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1480
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
msgstr "org.hibernate.transaction.OrionTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr "Orion"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1486
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
msgstr "org.hibernate.transaction.ResinTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr "Resin"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1492
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
msgstr "org.hibernate.transaction.JOTMTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr "JOTM"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1498
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
msgstr "org.hibernate.transaction.JOnASTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr "JOnAS"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1504
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
msgstr "org.hibernate.transaction.JRun4TransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr "JRun4"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1510
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
msgstr "org.hibernate.transaction.BESTransactionManagerLookup"
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr "Borland ES"
#. Tag: title
+#: configuration.xml:1520
#, fuzzy, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr "JNDI-gebundene SessionFactory"
#. Tag: para
+#: configuration.xml:1522
#, fuzzy, no-c-format
msgid ""
"A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the "
@@ -2715,6 +3343,7 @@
"diesselbe Registry!"
#. Tag: para
+#: configuration.xml:1528
#, fuzzy, no-c-format
msgid ""
"If you wish to have the <literal>SessionFactory</literal> bound to a JNDI "
@@ -2734,6 +3363,7 @@
"Tomcat - hilfreich)."
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
msgid ""
"When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will "
@@ -2748,6 +3378,7 @@
"literal> verwendet."
#. Tag: para
+#: configuration.xml:1542
#, fuzzy, no-c-format
msgid ""
"Hibernate will automatically place the <literal>SessionFactory</literal> in "
@@ -2764,6 +3395,7 @@
"Deployment mit <literal>HibernateService</literal> (wird später erläutert)."
#. Tag: para
+#: configuration.xml:1550
#, fuzzy, no-c-format
msgid ""
"If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other "
@@ -2775,6 +3407,7 @@
"<literal>SessionFactory</literal> erhalten."
#. Tag: para
+#: configuration.xml:1554
#, fuzzy, no-c-format
msgid ""
"It is recommended that you bind the <literal>SessionFactory</literal> to "
@@ -2783,7 +3416,7 @@
"recommend to hide the actual lookup code for a <literal>SessionFactory</"
"literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory"
"()</literal>. Note that such a class is also a convenient way to startup "
-"Hibernate—see chapter 1."
+"Hibernate—see chapter 1."
msgstr ""
"Wir empfehlen, dass Sie die <literal>SessionFactory</literal> in einer "
"gemanagten Umgebung an JNDI binden und andernfalls einen <literal>static</"
@@ -2796,22 +3429,24 @@
"Kapitel 1."
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr "Aktuelles Management des Sessionkontexts mit JTA"
#. Tag: para
+#: configuration.xml:1567
#, fuzzy, no-c-format
msgid ""
"The easiest way to handle <literal>Sessions</literal> and transactions is "
"Hibernate's automatic \"current\" <literal>Session</literal> management. For "
"a discussion of contextual sessions see <xref linkend=\"architecture-current-"
-"session\" />. Using the <literal>\"jta\"</literal> session context, if there "
+"session\"/>. Using the <literal>\"jta\"</literal> session context, if there "
"is no Hibernate <literal>Session</literal> associated with the current JTA "
"transaction, one will be started and associated with that JTA transaction "
"the first time you call <literal>sessionFactory.getCurrentSession()</"
"literal>. The <literal>Session</literal>s retrieved via "
-"<literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> "
+"<literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> "
"context are set to automatically flush before the transaction completes, "
"close after the transaction completes, and aggressively release JDBC "
"connections after each statement. This allows the <literal>Session</"
@@ -2844,11 +3479,13 @@
"ist die deklarative Transaktionsabgrenzung mit CMT zu bevorzugen."
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr "JMX-Deployment"
#. Tag: para
+#: configuration.xml:1592
#, fuzzy, no-c-format
msgid ""
"The line <literal>cfg.buildSessionFactory()</literal> still has to be "
@@ -2865,6 +3502,7 @@
"emphasis> erfolgen."
#. Tag: para
+#: configuration.xml:1598
#, fuzzy, no-c-format
msgid ""
"Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</"
@@ -2878,7 +3516,114 @@
"anbieterspezifisch. Nachfolgend sehen Sie ein Beispiel für <literal>jboss-"
"service.xml</literal> for JBoss 4.0.x:"
+#. Tag: programlisting
+#: configuration.xml:1604
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+
#. Tag: para
+#: configuration.xml:1606
#, fuzzy, no-c-format
msgid ""
"This file is deployed in a directory called <literal>META-INF</literal> and "
@@ -2902,327 +3647,53 @@
"Dienst und EJB-Deployment finden Sie in der JBoss AS Dokumentation."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addResource(\"Item.hbm.xml\")\n"
-#~ " .addResource(\"Bid.hbm.xml\");]]>"
-#~ msgstr ""
-#~ "Configuration cfg = new Configuration()\n"
-#~ " .addResource(\"Item.hbm.xml\")\n"
-#~ " .addResource(\"Bid.hbm.xml\");"
+#~ msgid "<emphasis>JDBC URL</emphasis>"
+#~ msgstr "jdbc-Treiberklasse"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class);]]>"
-#~ msgstr ""
-#~ "Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class);"
+#~ msgid "<emphasis>database user</emphasis>"
+#~ msgstr "<emphasis>Datenbankbenutzer</emphasis> (optional)"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class)\n"
-#~ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
-#~ "MySQLInnoDBDialect\")\n"
-#~ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/"
-#~ "jdbc/test\")\n"
-#~ " .setProperty(\"hibernate.order_updates\", \"true\");]]>"
-#~ msgstr ""
-#~ "Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class)\n"
-#~ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
-#~ "MySQLInnoDBDialect\")\n"
-#~ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/"
-#~ "jdbc/test\")\n"
-#~ " .setProperty(\"hibernate.order_updates\", \"true\");"
+#~ msgid "<emphasis>database user password</emphasis>"
+#~ msgstr "<emphasis>Passwort des Datenbankbenutzers</emphasis> (optional)"
#, fuzzy
-#~ msgid "<![CDATA[SessionFactory sessions = cfg.buildSessionFactory();]]>"
-#~ msgstr "SessionFactory sessions = cfg.buildSessionFactory();"
+#~ msgid "<emphasis>datasource JNDI name</emphasis>"
+#~ msgstr "<emphasis>Datenbankbenutzer</emphasis> (optional)"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Session session = sessions.openSession(); // open a new Session]]"
-#~ ">"
-#~ msgstr "Session session = sessions.openSession(); // open a new Session"
+#~ msgid "<property>hibernate.generate_statistics</property>"
+#~ msgstr "hibernate.generate_statistics"
-#~ msgid "database user"
-#~ msgstr "Datenbankbenutzer"
+#, fuzzy
+#~ msgid "<literal>hibernate.query.substitutions</literal>"
+#~ msgstr "hibernate.query.substitutions"
-#~ msgid "database user password"
-#~ msgstr "Datenbankbenutzer-Passwort"
-
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[hibernate.connection.driver_class = org.postgresql.Driver\n"
-#~ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
-#~ "hibernate.connection.username = myuser\n"
-#~ "hibernate.connection.password = secret\n"
-#~ "hibernate.c3p0.min_size=5\n"
-#~ "hibernate.c3p0.max_size=20\n"
-#~ "hibernate.c3p0.timeout=1800\n"
-#~ "hibernate.c3p0.max_statements=50\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
-#~ msgstr ""
-#~ "hibernate.connection.driver_class = org.postgresql.Driver\n"
-#~ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
-#~ "hibernate.connection.username = myuser\n"
-#~ "hibernate.connection.password = secret\n"
-#~ "hibernate.c3p0.min_size=5\n"
-#~ "hibernate.c3p0.max_size=20\n"
-#~ "hibernate.c3p0.timeout=1800\n"
-#~ "hibernate.c3p0.max_statements=50\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+#~ msgid "<literal>org.hibernate.SQL</literal>"
+#~ msgstr "org.hibernate.SQL"
-#~ msgid "datasource JNDI name"
-#~ msgstr "JNDI-Name der Datenquelle"
-
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
-#~ "hibernate.transaction.factory_class = \\\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ "hibernate.transaction.manager_lookup_class = \\\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
-#~ msgstr ""
-#~ "hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
-#~ "hibernate.transaction.factory_class = \\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ "hibernate.transaction.manager_lookup_class = \\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+#~ msgid "<literal>org.hibernate.type</literal>"
+#~ msgstr "org.hibernate.type"
-#~ msgid "<entry>DB2</entry>"
-#~ msgstr "<entry>DB2</entry>"
-
-#~ msgid "hibernate.query.substitutions true=1, false=0"
-#~ msgstr "hibernate.query.substitutions true=1, false=0"
-
-#~ msgid "hibernate.query.substitutions toLowercase=LOWER"
-#~ msgstr "hibernate.query.substitutions toLowercase=LOWER"
-
-#~ msgid "org.hibernate"
-#~ msgstr "org.hibernate"
-
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
-#~ " .addFile(\"Item.hbm.xml\")\n"
-#~ " .addFile(\"Bid.hbm.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "SessionFactory sf = new Configuration()\n"
-#~ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
-#~ " .addFile(\"Item.hbm.xml\")\n"
-#~ " .addFile(\"Bid.hbm.xml\")\n"
-#~ " .buildSessionFactory();"
+#~ msgid "<literal>org.hibernate.pretty</literal>"
+#~ msgstr "org.hibernate.pretty"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!DOCTYPE hibernate-configuration PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-configuration>\n"
-#~ "\n"
-#~ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
-#~ " <session-factory\n"
-#~ " name=\"java:hibernate/SessionFactory\">\n"
-#~ "\n"
-#~ " <!-- properties -->\n"
-#~ " <property name=\"connection.datasource\">java:/comp/env/jdbc/"
-#~ "MyDB</property>\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</"
-#~ "property>\n"
-#~ " <property name=\"show_sql\">false</property>\n"
-#~ " <property name=\"transaction.factory_class\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ " </property>\n"
-#~ " <property name=\"jta.UserTransaction\">java:comp/UserTransaction</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- mapping files -->\n"
-#~ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
-#~ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
-#~ "\n"
-#~ " <!-- cache settings -->\n"
-#~ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
-#~ "write\"/>\n"
-#~ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
-#~ "\"/>\n"
-#~ " <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
-#~ "usage=\"read-write\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-#~ msgstr ""
-#~ "<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!DOCTYPE hibernate-configuration PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-configuration>\n"
-#~ "\n"
-#~ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
-#~ " <session-factory\n"
-#~ " name=\"java:hibernate/SessionFactory\">\n"
-#~ "\n"
-#~ " <!-- properties -->\n"
-#~ " <property name=\"connection.datasource\">java:/comp/env/"
-#~ "jdbc/MyDB</property>\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect."
-#~ "MySQLDialect</property>\n"
-#~ " <property name=\"show_sql\">false</property>\n"
-#~ " <property name=\"transaction.factory_class\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ " </property>\n"
-#~ " <property name=\"jta.UserTransaction\">java:comp/"
-#~ "UserTransaction</property>\n"
-#~ "\n"
-#~ " <!-- mapping files -->\n"
-#~ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
-#~ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
-#~ "\n"
-#~ " <!-- cache settings -->\n"
-#~ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
-#~ "write\"/>\n"
-#~ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-"
-#~ "only\"/>\n"
-#~ " <collection-cache collection=\"org.hibernate.auction.Item.bids"
-#~ "\" usage=\"read-write\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>"
+#~ msgid "<literal>org.hibernate.cache</literal>"
+#~ msgstr "org.hibernate.cache"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration().configure()."
-#~ "buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+#~ msgid "<literal>org.hibernate.jdbc</literal>"
+#~ msgstr "org.hibernate.jdbc"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .configure(\"catdb.cfg.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "SessionFactory sf = new Configuration()\n"
-#~ " .configure(\"catdb.cfg.xml\")\n"
-#~ " .buildSessionFactory();"
+#~ msgid "<literal>org.hibernate.secure</literal>"
+#~ msgstr "org.hibernate.secure"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<server>\n"
-#~ "\n"
-#~ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
-#~ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
-#~ "\n"
-#~ " <!-- Required services -->\n"
-#~ " <depends>jboss.jca:service=RARDeployer</depends>\n"
-#~ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
-#~ "\n"
-#~ " <!-- Bind the Hibernate service to JNDI -->\n"
-#~ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Datasource settings -->\n"
-#~ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
-#~ " <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Transaction integration -->\n"
-#~ " <attribute name=\"TransactionStrategy\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory</attribute>\n"
-#~ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup</"
-#~ "attribute>\n"
-#~ " <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
-#~ " <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Fetching options -->\n"
-#~ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
-#~ "\n"
-#~ " <!-- Second-level caching -->\n"
-#~ " <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
-#~ " <attribute name=\"CacheProviderClass\">org.hibernate.cache."
-#~ "EhCacheProvider</attribute>\n"
-#~ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Logging -->\n"
-#~ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Mapping files -->\n"
-#~ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
-#~ "Category.hbm.xml</attribute>\n"
-#~ "\n"
-#~ "</mbean>\n"
-#~ "\n"
-#~ "</server>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<server>\n"
-#~ "\n"
-#~ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
-#~ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory"
-#~ "\">\n"
-#~ "\n"
-#~ " <!-- Required services -->\n"
-#~ " <depends>jboss.jca:service=RARDeployer</depends>\n"
-#~ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</"
-#~ "depends>\n"
-#~ "\n"
-#~ " <!-- Bind the Hibernate service to JNDI -->\n"
-#~ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Datasource settings -->\n"
-#~ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
-#~ " <attribute name=\"Dialect\">org.hibernate.dialect."
-#~ "HSQLDialect</attribute>\n"
-#~ "\n"
-#~ " <!-- Transaction integration -->\n"
-#~ " <attribute name=\"TransactionStrategy\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory</"
-#~ "attribute>\n"
-#~ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup</"
-#~ "attribute>\n"
-#~ " <attribute name=\"FlushBeforeCompletionEnabled\">true</"
-#~ "attribute>\n"
-#~ " <attribute name=\"AutoCloseSessionEnabled\">true</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Fetching options -->\n"
-#~ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
-#~ "\n"
-#~ " <!-- Second-level caching -->\n"
-#~ " <attribute name=\"SecondLevelCacheEnabled\">true</"
-#~ "attribute>\n"
-#~ " <attribute name=\"CacheProviderClass\">org.hibernate.cache."
-#~ "EhCacheProvider</attribute>\n"
-#~ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Logging -->\n"
-#~ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Mapping files -->\n"
-#~ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
-#~ "Category.hbm.xml</attribute>\n"
-#~ "\n"
-#~ "</mbean>\n"
-#~ "\n"
-#~ "</server>"
+#~ msgid "<literal>org.hibernate</literal>"
+#~ msgstr "JNDI-gebundene SessionFactory"
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/filters.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/filters.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/filters.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:35\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,11 +285,13 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr "Das Filtern von Daten"
#. Tag: para
+#: filters.xml:33
#, fuzzy, no-c-format
msgid ""
"Hibernate3 provides an innovative new approach to handling data with "
@@ -304,11 +306,13 @@
"oder deaktiviert werden kann."
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr "Hibernate Filter"
#. Tag: para
+#: filters.xml:41
#, fuzzy, no-c-format
msgid ""
"Hibernate3 has the ability to pre-define filter criteria and attach those "
@@ -332,9 +336,95 @@
"innerhalb der Anwendung parametrisiert werden."
#. Tag: para
+#: filters.xml:50
#, no-c-format
msgid ""
-"In order to use filters, they must first be defined and then attached to the "
+"Using annotatons filters are defined via <literal>@org.hibernate.annotations."
+"FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</"
+"literal>. A filter definition has a <methodname>name()</methodname> 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 "
+"<methodname>defaultCondition()</methodname> parameter for a given "
+"<literal>@FilterDef</literal> to set the default condition to use when none "
+"are defined in each individual <literal>@Filter</literal>. "
+"<literal>@FilterDef</literal>(s) can be defined at the class or package "
+"level."
+msgstr ""
+
+#. Tag: para
+#: filters.xml:63
+#, 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. The connection between "
+"<classname>@FilterName</classname> and <classname>@Filter</classname> is a "
+"matching name."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
+#, 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 want "
+"to target the association table, use the <literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid ""
+"Using <classname>@FilterJoinTable</classname> for filterting on the "
+"association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files for defining filters the situtation is very "
+"similar. The filters must first be defined and then attached to the "
"appropriate mapping elements. To define a filter, use the <literal><"
"filter-def/></literal> element within a <literal><hibernate-mapping/"
"></literal> element:"
@@ -344,22 +434,58 @@
"definieren, verwenden Sie das <literal><filter-def/></literal>-Element "
"innerhalb eines <literal><hibernate-mapping/></literal>-Elements:"
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "This filter can then be attached to a class:"
-msgstr "Anschließend kann dieser Filter einer Klasse zugefügt werden:"
+#. Tag: title
+#: filters.xml:97
+#, no-c-format
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: filters.xml:100
#, fuzzy, no-c-format
-msgid "Or, to a collection:"
-msgstr "oder einer Collection:"
+msgid ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+msgstr ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
#. Tag: para
+#: filters.xml:103
#, fuzzy, no-c-format
-msgid "Or, to both or multiples of each at the same time."
+msgid ""
+"This filter can then be attached to a class or collection (or, to both or "
+"multiples of each at the same time):"
msgstr "oder gar beiden (oder mehreren von beiden) gleichzeitig."
+#. Tag: title
+#: filters.xml:107
+#, no-c-format
+msgid ""
+"Attaching a filter to a class or collection using <literal><filter></"
+"literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:110
+#, no-c-format
+msgid ""
+"<class name=\"myClass\" ...>\n"
+" ...\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+"\n"
+" <set ...>\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+" </set> \n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: filters.xml:113
#, fuzzy, no-c-format
msgid ""
"The methods on <literal>Session</literal> are: <literal>enableFilter(String "
@@ -380,7 +506,18 @@
"Interface wiedergibt, explizit aktiviert werden. Die Verwendung des oben "
"definierten, einfachen Filters würde wie folgt aussehen:"
+#. Tag: programlisting
+#: filters.xml:123
+#, fuzzy, no-c-format
+msgid ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+msgstr ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+
#. Tag: para
+#: filters.xml:125
#, fuzzy, no-c-format
msgid ""
"Methods on the org.hibernate.Filter interface do allow the method-chaining "
@@ -391,6 +528,7 @@
"erlauben."
#. Tag: para
+#: filters.xml:128
#, fuzzy, no-c-format
msgid ""
"The following is a full example, using temporal data with an effective "
@@ -399,7 +537,80 @@
"Nachfolgend sehen Sie ein vollständiges Beispiel unter Verwendung temporaler "
"Daten mit effektivem Datumsformat für den Datensatz:"
+#. Tag: programlisting
+#: filters.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+
#. Tag: para
+#: filters.xml:133
#, fuzzy, no-c-format
msgid ""
"In order to ensure that you are provided with currently effective records, "
@@ -409,7 +620,28 @@
"der Angestelltendaten um sicherzustellen, dass Sie stets die aktuell "
"wirksamen Datensätze erhalten:"
+#. Tag: programlisting
+#: filters.xml:137
+#, fuzzy, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+msgstr ""
+"Session session = ...;\n"
+"session.enabledFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+
#. Tag: para
+#: filters.xml:139
#, fuzzy, no-c-format
msgid ""
"Even though a salary constraint was mentioned explicitly on the results in "
@@ -422,6 +654,7 @@
"Dollar ist, obwohl lediglich eine Gehaltsbedingung formuliert wurde."
#. Tag: para
+#: filters.xml:144
#, fuzzy, no-c-format
msgid ""
"If you want to use filters with outer joining, either through HQL or load "
@@ -436,6 +669,7 @@
"anschließend der (die) Spaltenname(n) nach dem Operator."
#. Tag: para
+#: filters.xml:149
#, fuzzy, no-c-format
msgid ""
"After being defined, a filter might be attached to multiple entities and/or "
@@ -450,7 +684,20 @@
"erlaubt <literal><filter-def/></literal> die Definition einer "
"Standardbedingung als Attribut oder als CDATA:"
+#. Tag: programlisting
+#: filters.xml:155
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+
#. Tag: para
+#: filters.xml:157
#, fuzzy, no-c-format
msgid ""
"This default condition will be used whenever the filter is attached to "
@@ -465,16 +712,14 @@
"bestimmten Fall außer Kraft setzt."
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
-#~ msgstr ""
-#~ "<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>"
+#~ msgid "This filter can then be attached to a class:"
+#~ msgstr "Anschließend kann dieser Filter einer Klasse zugefügt werden:"
#, fuzzy
+#~ msgid "Or, to a collection:"
+#~ msgstr "oder einer Collection:"
+
+#, fuzzy
#~ msgid ""
#~ "<![CDATA[<class name=\"myClass\" ...>\n"
#~ " ...\n"
@@ -499,110 +744,3 @@
#~ " <filter name=\"myFilter\" condition=\":myFilterParam = "
#~ "MY_FILTERED_COLUMN\"/>\n"
#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-#~ msgstr ""
-#~ "session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
-#~ "value\");"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class="
-#~ "\"Department\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column="
-#~ "\"eff_end_dt\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "Session session = ...;\n"
-#~ "session.enabledFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary "
-#~ "> :targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
-#~ msgstr ""
-#~ "<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/performance.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/performance.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/performance.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,16 +285,19 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "Verbesserung der Performance"
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "Abrufstrategien"
#. Tag: para
+#: performance.xml:36
#, fuzzy, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve "
@@ -309,11 +312,13 @@
"oder <literal>Criteria</literal>-Anfrage außer Kraft gesetzt werden."
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 definiert die folgenden Abrufstrategien:"
#. Tag: para
+#: performance.xml:46
#, fuzzy, no-c-format
msgid ""
"<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated "
@@ -325,6 +330,7 @@
"selben <literal>SELECT</literal> auf."
#. Tag: para
+#: performance.xml:53
#, fuzzy, no-c-format
msgid ""
"<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is "
@@ -340,6 +346,7 @@
"\" nur ausgeführt, wenn Sie tatsächlich auf die Assoziation zugreifen."
#. Tag: para
+#: performance.xml:61
#, fuzzy, no-c-format
msgid ""
"<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> "
@@ -356,6 +363,7 @@
"tatsächlich auf die Assoziation zugreifen."
#. Tag: para
+#: performance.xml:70
#, fuzzy, no-c-format
msgid ""
"<emphasis>Batch fetching</emphasis>: an optimization strategy for select "
@@ -370,11 +378,13 @@
"bestimmt."
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "Hibernate unterscheidet außerdem zwischen:"
#. Tag: para
+#: performance.xml:81
#, fuzzy, no-c-format
msgid ""
"<emphasis>Immediate fetching</emphasis>: an association, collection or "
@@ -385,6 +395,7 @@
"sofort abgerufen."
#. Tag: para
+#: performance.xml:87
#, fuzzy, no-c-format
msgid ""
"<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when "
@@ -396,6 +407,7 @@
"(Das ist die Standardeinstellung für Collections)."
#. Tag: para
+#: performance.xml:93
#, fuzzy, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements "
@@ -409,6 +421,7 @@
"außer es ist unbedingt nötig (besonders geeignet für sehr große Collections)."
#. Tag: para
+#: performance.xml:101
#, fuzzy, no-c-format
msgid ""
"<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched "
@@ -420,6 +433,7 @@
"\" am zugehörigen Objekt aufgerufen wird."
#. Tag: para
+#: performance.xml:107
#, fuzzy, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is "
@@ -438,6 +452,7 @@
"selten benötigt."
#. Tag: para
+#: performance.xml:117
#, fuzzy, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued "
@@ -450,6 +465,7 @@
"Instrumentierung und wird selten benötigt."
#. Tag: para
+#: performance.xml:124
#, fuzzy, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when</emphasis> is the "
@@ -468,11 +484,13 @@
"einer bestimmten Klasse stets verfügbar sind."
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "Der Umgang mit \"lazy\"-Assoziationen"
#. Tag: para
+#: performance.xml:134
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
@@ -485,6 +503,7 @@
"Anwendungen sinnvoll."
#. Tag: para
+#: performance.xml:138
#, fuzzy, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate "
@@ -497,6 +516,7 @@
"auf feinkörnigerer Ebene aktiviert werden)."
#. Tag: para
+#: performance.xml:142
#, fuzzy, no-c-format
msgid ""
"Please be aware that access to a lazy association outside of the context of "
@@ -507,7 +527,36 @@
"des Kontexts einer geöffneten Hibernate Session führt zu einer "
"Ausnahmemeldung. Zum Beispiel:"
+#. Tag: programlisting
+#: performance.xml:146
+#, fuzzy, no-c-format
+msgid ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+
#. Tag: para
+#: performance.xml:148
#, fuzzy, no-c-format
msgid ""
"Since the permissions collection was not initialized when the "
@@ -524,6 +573,7 @@
"festgeschrieben wird, zu bewegen."
#. Tag: para
+#: performance.xml:155
#, fuzzy, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
@@ -542,6 +592,7 @@
"Datenbank in den Speicher abrufen müssen!"
#. Tag: para
+#: performance.xml:162
#, fuzzy, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
@@ -558,11 +609,13 @@
"Assoziationen und Collections identisch."
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "Abstimmung von Abrufstrategien"
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
@@ -572,7 +625,30 @@
"+1 Auswahlprobleme, weswegen sich die Aktivierung von \"Join-Fetching\" im "
"Mapping-Dokument empfiehlt:"
+#. Tag: programlisting
+#: performance.xml:176
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"permissions\"\n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+msgstr ""
+"<set name=\"permissions\" \n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+
+#. Tag: programlisting
+#: performance.xml:178
+#, fuzzy, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch</literal> strategy defined in the mapping document "
@@ -582,26 +658,31 @@
"Auswirkungen auf:"
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr "Abruf mittels <literal>get()</literal> oder <literal>load()</literal>"
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr "einem impliziten Abruf, der beim Navigieren der Assoziation erfolgt"
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr "<literal>Criteria</literal>-Anfragen"
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr "HQL-Anfragen, wenn <literal>subselect</literal>-Abruf verwendet wird"
#. Tag: para
+#: performance.xml:204
#, fuzzy, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
@@ -614,6 +695,7 @@
"Ausführung einer bestimmten HQL-Anfrage führen kann."
#. Tag: para
+#: performance.xml:209
#, fuzzy, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
@@ -632,6 +714,7 @@
"<literal>setFetchMode(FetchMode.JOIN)</literal> benutzen."
#. Tag: para
+#: performance.xml:216
#, fuzzy, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get()</literal> "
@@ -642,7 +725,22 @@
"Sie dies durch <literal>get()</literal> oder <literal>load()</literal> tun, "
"verwenden Sie einfach eine <literal>Criteria</literal>-Anfrage, zum Beispiel:"
+#. Tag: programlisting
+#: performance.xml:220
+#, fuzzy, no-c-format
+msgid ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+msgstr ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+
#. Tag: para
+#: performance.xml:222
#, fuzzy, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
@@ -652,6 +750,7 @@
"oder \"Fetch Plan\" bezeichnen)."
#. Tag: para
+#: performance.xml:225
#, fuzzy, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
@@ -661,11 +760,13 @@
"Verwendung des Cachespeichers der zweiten Ebene."
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "Einendige Assoziationsproxies"
#. Tag: para
+#: performance.xml:232
#, fuzzy, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
@@ -684,6 +785,7 @@
"Bibliothek)."
#. Tag: para
+#: performance.xml:239
#, fuzzy, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
@@ -696,6 +798,7 @@
"Assoziationen zu aktivieren."
#. Tag: para
+#: performance.xml:244
#, fuzzy, no-c-format
msgid ""
"The mapping file may declare an interface to use as the proxy interface for "
@@ -712,6 +815,7 @@
"Konstruktor für alle persistenten Klassen!</emphasis>"
#. Tag: para
+#: performance.xml:251
#, fuzzy, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
@@ -720,7 +824,26 @@
"Es gibt einige Fallstricke, derer man sich bewusst sein sollte, wenn man "
"diese Vorgehensweise zum Beispiel auf polymorphe Klassen ausweitet."
+#. Tag: programlisting
+#: performance.xml:254
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat</literal> will never be castable to "
@@ -732,12 +855,52 @@
"sein, selbst wenn die zu Grunde liegende Instanz eine Instanz von "
"<literal>DomesticCat</literal> ist:"
+#. Tag: programlisting
+#: performance.xml:260
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+msgstr ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+
#. Tag: para
+#: performance.xml:262
#, fuzzy, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr "Zweitens ist es möglich, Proxy <literal>==</literal> zu brechen."
+#. Tag: programlisting
+#: performance.xml:265
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+msgstr ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
@@ -748,7 +911,18 @@
"jetzt zwei Verweise auf verschiedene Proxy-Objekte besitzen, so bleibt die "
"zu Grunde liegende Instanz nach wie vor dasselbe Objekt:"
+#. Tag: programlisting
+#: performance.xml:271
+#, fuzzy, no-c-format
+msgid ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+
#. Tag: para
+#: performance.xml:273
#, fuzzy, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or "
@@ -758,6 +932,7 @@
"Klasse oder eine Klasse mit einer <literal>final</literal>-Methode verwenden."
#. Tag: para
+#: performance.xml:276
#, fuzzy, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
@@ -771,6 +946,7 @@
"Klasse."
#. Tag: para
+#: performance.xml:281
#, fuzzy, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
@@ -787,7 +963,26 @@
"Business-Methoden deklariert. Diese Interfaces sollten Sie z.B. in der "
"Mapping-Datei spezifizieren."
+#. Tag: programlisting
+#: performance.xml:289
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:291
#, fuzzy, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat</literal> and "
@@ -799,17 +994,34 @@
"sein, selbst wenn die zu Grunde liegende Instanz eine Instanz von "
"<literal>DomesticCat</literal> ist:"
+#. Tag: programlisting
+#: performance.xml:295
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();"
+msgstr ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.iterate(\"from CatImpl as cat where cat."
+"name='fritz'\");\n"
+"Cat fritz = (Cat) iter.next();"
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr ""
#. Tag: para
+#: performance.xml:300
#, fuzzy, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr "<literal>full join</literal> (in der Regel nicht sehr nützlich)"
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
@@ -821,6 +1033,7 @@
"literal> deklarieren müssen."
#. Tag: para
+#: performance.xml:308
#, fuzzy, no-c-format
msgid ""
"Certain operations do <emphasis>not</emphasis> require proxy initialization:"
@@ -828,6 +1041,7 @@
"Bestimmte Vorgänge benötigen <emphasis>keine</emphasis> Proxy-Initialisierung"
#. Tag: para
+#: performance.xml:313
#, fuzzy, no-c-format
msgid ""
"<literal>equals()</literal>: if the persistent class does not override "
@@ -837,6 +1051,7 @@
"literal> nicht außer Kraft setzt"
#. Tag: para
+#: performance.xml:318
#, fuzzy, no-c-format
msgid ""
"<literal>hashCode()</literal>: if the persistent class does not override "
@@ -846,11 +1061,13 @@
"()</literal> nicht außer Kraft setzt"
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "Die \"Getter\"-Methode des Bezeichners"
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()</"
@@ -860,6 +1077,7 @@
"<literal>hashCode()</literal> außer Kraft setzen."
#. Tag: para
+#: performance.xml:330
#, fuzzy, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default "
@@ -874,11 +1092,13 @@
"unmittelbaren Proxy-Initialisierung."
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "Initialisierung von Collections und Proxies"
#. Tag: para
+#: performance.xml:340
#, fuzzy, no-c-format
msgid ""
"A <literal>LazyInitializationException</literal> will be thrown by Hibernate "
@@ -893,6 +1113,7 @@
"auf das Proxy hat, sich in abgesetztem Status befindet."
#. Tag: para
+#: performance.xml:346
#, fuzzy, no-c-format
msgid ""
"Sometimes a proxy or collection needs to be initialized before closing the "
@@ -909,6 +1130,7 @@
"und nicht praktisch für generischen Code."
#. Tag: para
+#: performance.xml:353
#, fuzzy, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize()</literal> and "
@@ -929,6 +1151,7 @@
"von \"kittens\"."
#. Tag: para
+#: performance.xml:362
#, fuzzy, no-c-format
msgid ""
"Another option is to keep the <literal>Session</literal> open until all "
@@ -949,6 +1172,7 @@
"ist. Es gibt zwei einfache Wege, damit umzugehen:"
#. Tag: para
+#: performance.xml:372
#, fuzzy, no-c-format
msgid ""
"In a web-based application, a servlet filter can be used to close the "
@@ -973,6 +1197,7 @@
"in Ansicht\"-Modell finden Sie im Hibernate Wiki."
#. Tag: para
+#: performance.xml:385
#, fuzzy, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
@@ -1002,6 +1227,7 @@
"Fassade</emphasis> einsetzen."
#. Tag: para
+#: performance.xml:401
#, fuzzy, no-c-format
msgid ""
"You can also attach a previously loaded object to a new <literal>Session</"
@@ -1018,6 +1244,7 @@
"Transaktionssemantik käme!"
#. Tag: para
+#: performance.xml:410
#, fuzzy, no-c-format
msgid ""
"Sometimes you do not want to initialize a large collection, but still need "
@@ -1029,6 +1256,7 @@
"Daten."
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid ""
"You can use a collection filter to get the size of a collection without "
@@ -1037,7 +1265,18 @@
"Sie können einen Collection-Filter verwenden, um die Größe der Collection zu "
"ermitteln ohne diese zu initialisieren:"
+#. Tag: programlisting
+#: performance.xml:417
+#, fuzzy, no-c-format
+msgid ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+msgstr ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid ""
"The <literal>createFilter()</literal> method is also used to efficiently "
@@ -1048,12 +1287,24 @@
"effizient Untersätze einer Collection abzurufen, ohne die gesamte Collection "
"zu initialisieren:"
+#. Tag: programlisting
+#: performance.xml:423
+#, fuzzy, no-c-format
+msgid ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+msgstr ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "Die Verwendung von Stapelabruf (\"Batch-Fetching\")"
#. Tag: para
+#: performance.xml:429
#, fuzzy, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
@@ -1069,6 +1320,7 @@
"Collection-Ebene."
#. Tag: para
+#: performance.xml:434
#, fuzzy, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
@@ -1095,7 +1347,14 @@
"Bestimmung eines <literal>batch-size</literal> im Mapping von "
"<literal>Person</literal> festlegen:"
+#. Tag: programlisting
+#: performance.xml:447
+#, fuzzy, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr "<class name=\"Person\" batch-size=\"10\">...</class>"
+
#. Tag: para
+#: performance.xml:449
#, fuzzy, no-c-format
msgid ""
"Hibernate will now execute only three queries: the pattern is 10, 10, 5."
@@ -1103,6 +1362,7 @@
"Hibernate führt nun nur drei Anfragen aus, das Muster lautet 10, 10, 5."
#. Tag: para
+#: performance.xml:452
#, fuzzy, no-c-format
msgid ""
"You can also enable batch fetching of collections. For example, if each "
@@ -1122,7 +1382,24 @@
"<literal>cats</literal>-Collection im Mapping von <literal>Person</literal> "
"aktivieren, kann Hibernate Collections vorab abrufen:"
+#. Tag: programlisting
+#: performance.xml:461
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:463
#, fuzzy, no-c-format
msgid ""
"With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 "
@@ -1136,6 +1413,7 @@
"einer bestimmten <literal>Session</literal> ab."
#. Tag: para
+#: performance.xml:468
#, fuzzy, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
@@ -1150,11 +1428,13 @@
"Option für \"read-mostly\"-Bäume ist)."
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "Die Verwendung von \"Subselect-Fetching\""
#. Tag: para
+#: performance.xml:477
#, fuzzy, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
@@ -1167,11 +1447,13 @@
"Weise wie Stapelabruf, ohne das stückweise Laden."
#. Tag: title
+#: performance.xml:486
#, fuzzy, no-c-format
msgid "Fetch profiles"
msgstr "Abrufstrategien"
#. Tag: para
+#: performance.xml:488
#, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
@@ -1179,19 +1461,112 @@
"associated with the <interfacename>org.hibernate.SessionFactory</"
"interfacename> but enabled, by name, on the <interfacename>org.hibernate."
"Session</interfacename>. Once enabled on a <interfacename>org.hibernate."
-"Session</interfacename>, the fetch profile wull be in affect for that "
+"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session</interfacename> until it is explicitly "
"disabled."
msgstr ""
#. Tag: para
+#: performance.xml:498
#, no-c-format
msgid ""
-"So what does that mean? Well lets explain that by way of an example. Say we "
-"have the following mappings:"
+"So what does that mean? Well lets explain that by way of an example which "
+"show the different available approaches to configure a fetch profile:"
msgstr ""
+#. Tag: title
+#: performance.xml:503
+#, no-c-format
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+" @FetchProfile.FetchOverride(entity = Customer.class, association = "
+"\"orders\", mode = FetchMode.JOIN)\n"
+"})\n"
+"public class Customer {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" private long customerNumber;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Order> orders;\n"
+"\n"
+" // standard getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
+">\n"
+" </fetch-profile>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch association=\"orders\" style=\"join\"/>\n"
+" </fetch-profile>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:525
#, no-c-format
msgid ""
"Now normally when you get a reference to a particular customer, that "
@@ -1200,23 +1575,39 @@
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
-"to use a fetch profile to achieve that. Just add the following to your "
-"mapping:"
+"to use a fetch profile to achieve that. The following code will load both "
+"the customer <emphasis>and</emphasis>their orders:"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: performance.xml:536
#, no-c-format
-msgid "or even:"
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFetchProfile( \"customer-with-orders\" ); // name matches "
+"from mapping\n"
+"Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
msgid ""
-"Now the following code will actually load both the customer <emphasis>and "
-"their orders</emphasis>:"
+"<classname>@FetchProfile </classname>definitions are global and it does not "
+"matter on which class you place them. You can place the "
+"<classname>@FetchProfile</classname> annotation either onto a class or "
+"package (package-info.java). In order to define multiple fetch profiles for "
+"the same class or package <classname>@FetchProfiles</classname> can be used."
msgstr ""
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
@@ -1225,11 +1616,13 @@
msgstr ""
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "Die Verwendung von \"Lazy-Property-Fetching\""
#. Tag: para
+#: performance.xml:560
#, fuzzy, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
@@ -1251,6 +1644,7 @@
"kann."
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy</literal> attribute "
@@ -1259,7 +1653,34 @@
"Um das \"lazy\" Laden von Properties zu aktivieren, setzen Sie das "
"<literal>lazy</literal>-Attribut auf Ihr bestimmtes Property-Mapping:"
+#. Tag: programlisting
+#: performance.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:573
#, fuzzy, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
@@ -1272,11 +1693,49 @@
"unmittelbaren Abruf (sog. \"immediate Fetching\")."
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr "Für die Bytecode-Instrumentierung verwenden Sie folgende Ant-Funktion:"
+#. Tag: programlisting
+#: performance.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+msgstr ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+
#. Tag: para
+#: performance.xml:581
#, fuzzy, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
@@ -1291,6 +1750,7 @@
"und dies ist daher die bevorzugte Lösung."
#. Tag: para
+#: performance.xml:586
#, fuzzy, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
@@ -1300,11 +1760,13 @@
"übliche \"eager Fetching\" von Properties erzwingen."
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "Das Cache der zweiten Ebene"
#. Tag: para
+#: performance.xml:594
#, fuzzy, no-c-format
msgid ""
"A Hibernate <literal>Session</literal> is a transaction-level cache of "
@@ -1325,15 +1787,17 @@
"dass gecachte Daten in regelmäßigen Abständen gelöscht werden)."
#. Tag: para
+#: performance.xml:602
#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property <literal>hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
-"integrations with the open-source cache providers that are listed below. You "
-"can also implement your own and plug it in as outlined above. Note that "
-"versions prior to 3.2 use EhCache as the default cache provider."
+"integrations with the open-source cache providers that are listed in <xref "
+"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
+"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
+"the default cache provider."
msgstr ""
"Sie haben die Möglichkeit Hibernate mitzuteilen, welche Caching-"
"Implementierung es verwenden soll, indem Sie den Namen der Klasse bestimmen, "
@@ -1347,157 +1811,403 @@
"3.2 jedoch nicht mehr der Fall."
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "Cache-Provider"
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "Cache"
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "Provider-Klasse"
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "Typ"
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "Cluster-sicher"
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "Anfragen-Cache unterstützt"
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Hash-Tabelle (nicht für den Produktionsgebrauch vorgesehen)"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:644
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "org.hibernate.cache.HashtableCacheProvider"
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "Speicher"
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674
+#: performance.xml:992 performance.xml:994 performance.xml:996
+#: performance.xml:1004 performance.xml:1006 performance.xml:1008
+#: performance.xml:1016 performance.xml:1018 performance.xml:1020
+#: performance.xml:1028 performance.xml:1030 performance.xml:1040
+#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
-msgstr ""
+msgid "<entry>yes</entry>"
+msgstr "<entry>Ja</entry>"
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:656
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr "org.hibernate.cache.EhCacheProvider"
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "Speicher, Disk"
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:668
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr "org.hibernate.cache.OSCacheProvider"
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:680
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "org.hibernate.cache.SwarmCacheProvider"
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "geclustert (ip multicast)"
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "ja (geclusterte Außerkraftsetzung)"
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, fuzzy, no-c-format
msgid "JBoss Cache 1.x"
msgstr "JBoss TreeCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:692
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr "org.hibernate.cache.TreeCacheProvider"
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "geclustert (ip multicast), transaktional"
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "ja (Replikation)"
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "ja (clock sync req.)"
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, fuzzy, no-c-format
msgid "JBoss Cache 2"
msgstr "JBoss TreeCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:704
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "org.hibernate.transaction.JDBCTransactionFactory"
#. Tag: entry
+#: performance.xml:708
#, fuzzy, no-c-format
msgid "yes (replication or invalidation)"
msgstr "ja (geclusterte Außerkraftsetzung)"
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "Cache-Mappings"
#. Tag: para
+#: performance.xml:719
#, no-c-format
msgid ""
-"The <literal><cache></literal> element of a class or collection "
-"mapping has the following form:"
+"As we have done in previous chapters we are looking at the two different "
+"possibiltites to configure caching. First configuration via annotations and "
+"then via Hibernate mapping files."
msgstr ""
-"Das <literal><cache></literal>-Element des Mappings einer Klasse oder "
-"Collection besitzt folgende Form:"
#. Tag: para
+#: performance.xml:723
#, no-c-format
msgid ""
+"By default, entities are not part of the second level cache and we recommend "
+"you to stick to this setting. However, you can override this by setting the "
+"<literal>shared-cache-mode</literal> element in your <filename>persistence."
+"xml</filename> file or by using the <literal>javax.persistence.sharedCache."
+"mode </literal>property in your configuration. The following values are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid ""
+"<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): "
+"entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid ""
+"<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly "
+"marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid ""
+"<literal>ALL</literal>: all entities are always cached even if marked as non "
+"cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid ""
+"<literal>NONE</literal>: no entity are cached even if marked as cacheable. "
+"This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid ""
+"The cache concurrency strategy used by default can be set globaly via the "
+"<literal>hibernate.cache.default_cache_concurrency_strategy</literal> "
+"configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, fuzzy, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr "<literal>Criteria</literal>-Anfragen"
+
+#. Tag: literal
+#: performance.xml:765
+#, fuzzy, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr "<literal>Criteria</literal>-Anfragen"
+
+#. Tag: literal
+#: performance.xml:769
+#, fuzzy, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr "nonstrict-read-write"
+
+#. Tag: literal
+#: performance.xml:773
+#, fuzzy, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr "<literal>Criteria</literal>-Anfragen"
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid ""
+"It is recommended to define the cache concurrency strategy per entity rather "
+"than using a global one. Use the <classname>@org.hibernate.annotations."
+"Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid ""
+"Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+"@Entity \n"
+"@Cacheable\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid ""
+"Hibernate also let's you cache the content of a collection or the "
+"identifiers if the collection contains other entities. Use the "
+"<classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, fuzzy, no-c-format
+msgid "Caching collections using annotations"
+msgstr "Initialisierung von Collections und Proxies"
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+"@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: para
+#: performance.xml:802
+#, no-c-format
+msgid ""
+"shows the<literal> @org.hibernate.annotations.Cache</literal> annotations "
+"with its attributes. It allows you to define the caching strategy and region "
+"of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid ""
+"Let's now take a look at Hibernate mapping files. There the <literal><"
+"cache></literal> element of a class or collection mapping is used to "
+"configure the second level cache. Looking at <xref linkend=\"example-"
+"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, fuzzy, no-c-format
+msgid ""
+"<cache\n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+msgstr ""
+"<cache \n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
+msgid ""
"<literal>usage</literal> (required) specifies the caching strategy: "
"<literal>transactional</literal>, <literal>read-write</literal>, "
"<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
@@ -1507,6 +2217,7 @@
"<literal>nonstrict-read-write</literal> oder <literal>read-only</literal>"
#. Tag: para
+#: performance.xml:874
#, fuzzy, no-c-format
msgid ""
"<literal>region</literal> (optional: defaults to the class or collection "
@@ -1516,6 +2227,7 @@
"oder Collection) bestimmt den Namen des Cache-Bereichs der zweiten Ebene"
#. Tag: para
+#: performance.xml:880
#, fuzzy, no-c-format
msgid ""
"<literal>include</literal> (optional: defaults to <literal>all</literal>) "
@@ -1529,31 +2241,31 @@
"Attributebene \"lazy Fetching\" aktiviert ist."
#. Tag: para
+#: performance.xml:890
#, fuzzy, no-c-format
msgid ""
-"Alternatively, you can specify <literal><class-cache></literal> and "
-"<literal><collection-cache></literal> elements in <literal>hibernate."
-"cfg.xml</literal>."
+"Alternatively to <literal><cache></literal>, you can use <literal><"
+"class-cache></literal> and <literal><collection-cache></literal> "
+"elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
"Alternativ (vorzugsweise?) können Sie <literal><class-cache></literal> "
"und <literal><collection-cache></literal>-Elemente in "
"<literal>hibernate.cfg.xml</literal> bestimmen."
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid ""
-"The <literal>usage</literal> attribute specifies a <emphasis>cache "
-"concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
-"Das <literal>usage</literal>-Attribut bestimmt eine <emphasis>Cache-"
-"Nebenläufigkeitsstrategie</emphasis>."
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr "Strategie: \"read only\""
#. Tag: para
+#: performance.xml:902
#, fuzzy, no-c-format
msgid ""
"If your application needs to read, but not modify, instances of a persistent "
@@ -1567,11 +2279,13 @@
"sogar bei der Anwendung in einem Cluster völlig sicher."
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "Strategie: \"read/write\""
#. Tag: para
+#: performance.xml:911
#, fuzzy, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write</literal> "
@@ -1601,11 +2315,13 @@
"Cache-Provider tun dies <emphasis>nicht</emphasis>."
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr "Strategie: \"nonstrict read/write\""
#. Tag: para
+#: performance.xml:929
#, fuzzy, no-c-format
msgid ""
"If the application only occasionally needs to update data (i.e. if it is "
@@ -1629,11 +2345,13 @@
"wird."
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "Strategie: transaktional"
#. Tag: para
+#: performance.xml:943
#, fuzzy, no-c-format
msgid ""
"The <literal>transactional</literal> cache strategy provides support for "
@@ -1648,11 +2366,13 @@
"bestimmen."
#. Tag: title
+#: performance.xml:950
#, fuzzy, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "Cache-Nebenläufigkeitsstrategie-Support"
#. Tag: para
+#: performance.xml:953
#, fuzzy, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
@@ -1662,6 +2382,7 @@
"Nebenläufigkeitsstrategien kompatibel sind."
#. Tag: para
+#: performance.xml:957
#, fuzzy, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
@@ -1672,36 +2393,43 @@
"Nebenläufigkeitsstrategien kompatibel sind."
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr "Cache-Nebenläufigkeitsstrategie-Support"
#. Tag: entry
-#, no-c-format
-msgid "read-only"
-msgstr "read-only"
+#: performance.xml:978
+#, fuzzy, no-c-format
+msgid "<entry>read-only</entry>"
+msgstr "<entry>Ja</entry>"
#. Tag: entry
-#, no-c-format
-msgid "nonstrict-read-write"
+#: performance.xml:980
+#, fuzzy, no-c-format
+msgid "<entry>nonstrict-read-write</entry>"
msgstr "nonstrict-read-write"
#. Tag: entry
-#, no-c-format
-msgid "read-write"
-msgstr "read-write"
+#: performance.xml:982
+#, fuzzy, no-c-format
+msgid "<entry>read-write</entry>"
+msgstr "<entry>Ja</entry>"
#. Tag: entry
-#, no-c-format
-msgid "transactional"
-msgstr "transactional"
+#: performance.xml:984
+#, fuzzy, no-c-format
+msgid "<entry>transactional</entry>"
+msgstr "<entry>Ja</entry>"
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "Management der Caches"
#. Tag: para
+#: performance.xml:1069
#, fuzzy, no-c-format
msgid ""
"Whenever you pass an object to <literal>save()</literal>, <literal>update()</"
@@ -1719,6 +2447,7 @@
"<literal>Session</literal> hinzugefügt."
#. Tag: para
+#: performance.xml:1076
#, fuzzy, no-c-format
msgid ""
"When <literal>flush()</literal> is subsequently called, the state of that "
@@ -1735,7 +2464,36 @@
"müssen, so können mittels der <literal>evict()</literal>-Methode das Objekt "
"und dessen Collections aus dem Cache der ersten Ebene entfernt werden."
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid ""
+"Explcitly evicting a cached instance from the first level cache using "
+"<methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, fuzzy, no-c-format
+msgid ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+msgstr ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session</literal> also provides a <literal>contains()</literal> "
@@ -1746,6 +2504,7 @@
"gehört."
#. Tag: para
+#: performance.xml:1094
#, fuzzy, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear()</"
@@ -1755,6 +2514,7 @@
"verwenden Sie <literal>Session.clear()</literal>"
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
@@ -1766,7 +2526,34 @@
"gesamten Klasse, Collection-Instanz oder der gesamten Collection-Rolle zu "
"räumen."
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid ""
+"Second-level cache eviction via <methodname>SessionFactoty.evict() </"
+"methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, fuzzy, no-c-format
+msgid ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+msgstr ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+
#. Tag: para
+#: performance.xml:1110
#, fuzzy, no-c-format
msgid ""
"The <literal>CacheMode</literal> controls how a particular session interacts "
@@ -1776,6 +2563,7 @@
"mit dem Cache der zweiten Ebene interagiert."
#. Tag: para
+#: performance.xml:1115
#, fuzzy, no-c-format
msgid ""
"<literal>CacheMode.NORMAL</literal>: will read items from and write items to "
@@ -1785,6 +2573,7 @@
"Posten in das Cache der zweiten Ebene"
#. Tag: para
+#: performance.xml:1120
#, fuzzy, no-c-format
msgid ""
"<literal>CacheMode.GET</literal>: will read items from the second-level "
@@ -1795,6 +2584,7 @@
"Aktualisierung der Daten"
#. Tag: para
+#: performance.xml:1126
#, fuzzy, no-c-format
msgid ""
"<literal>CacheMode.PUT</literal>: will write items to the second-level "
@@ -1804,6 +2594,7 @@
"Ebene, aber liest nicht aus dem Cache der zweiten Ebene"
#. Tag: para
+#: performance.xml:1131
#, fuzzy, no-c-format
msgid ""
"<literal>CacheMode.REFRESH</literal>: will write items to the second-level "
@@ -1818,6 +2609,7 @@
"gelesenen Objekte."
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
@@ -1826,7 +2618,30 @@
"Um die Inhalte eines Cache der zweiten Ebene oder eines Cache-Bereichs zu "
"durchsuchen, verwenden Sie die <literal>Statistics</literal>-API:"
+#. Tag: title
+#: performance.xml:1143
+#, fuzzy, no-c-format
+msgid ""
+"Browsing the second-level cache entries via the <classname>Statistics</"
+"classname> API"
+msgstr ""
+"Um die Inhalte eines Cache der zweiten Ebene oder eines Cache-Bereichs zu "
+"durchsuchen, verwenden Sie die <literal>Statistics</literal>-API:"
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, fuzzy, no-c-format
+msgid ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+msgstr ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+
#. Tag: para
+#: performance.xml:1149
#, fuzzy, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
@@ -1836,11 +2651,29 @@
"zwingen, Cache-Eingaben in einem lesbaren Format zu halten:"
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+msgstr ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr "Das Anfragen-Cache"
#. Tag: para
+#: performance.xml:1162
#, fuzzy, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
@@ -1851,11 +2684,13 @@
"das Anfragen-Cache zu benutzen, müssen Sie es zuerst aktivieren:"
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr ""
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
@@ -1868,12 +2703,20 @@
"need to enable the query cache:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1177
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr "hibernate.cache.use_query_cache true"
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr ""
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the "
@@ -1881,6 +2724,7 @@
msgstr ""
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding "
@@ -1889,10 +2733,11 @@
msgstr ""
#. Tag: para
+#: performance.xml:1194
#, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
-"timeouts is is very important that the cache timeout of the underlying cache "
+"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
@@ -1900,6 +2745,7 @@
msgstr ""
#. Tag: para
+#: performance.xml:1203
#, fuzzy, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
@@ -1916,6 +2762,7 @@
"ihre Ergebnisse dem Cache hinzuzufügen, wenn sie ausgeführt wird."
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
@@ -1926,11 +2773,13 @@
msgstr ""
#. Tag: title
+#: performance.xml:1221
#, fuzzy, no-c-format
msgid "Query cache regions"
msgstr "Anfragen-Cache unterstützt"
#. Tag: para
+#: performance.xml:1223
#, fuzzy, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
@@ -1941,7 +2790,28 @@
"können Sie einen benannten Cache-Bereich für eine bestimmte Anfrage "
"festlegen, indem Sie <literal>Query.setCacheRegion()</literal> aufrufen."
+#. Tag: programlisting
+#: performance.xml:1227
+#, fuzzy, no-c-format
+msgid ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+msgstr ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+
#. Tag: para
+#: performance.xml:1229
#, fuzzy, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
@@ -1964,11 +2834,13 @@
"durch <literal>SessionFactory.evictQueries()</literal>."
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "Die Perfomance der Collection verstehen"
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
@@ -1977,31 +2849,37 @@
msgstr ""
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "Taxonomie"
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "Hibernate unterscheidet drei Grundtypen von Collections:"
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "Collections von Werten"
#. Tag: para
+#: performance.xml:1259
#, fuzzy, no-c-format
msgid "one-to-many associations"
msgstr "\"One-to-Many\"-Assoziationen"
#. Tag: para
+#: performance.xml:1263
#, fuzzy, no-c-format
msgid "many-to-many associations"
msgstr "\"Many-to-Many\"-Assoziationen"
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
@@ -2019,21 +2897,25 @@
"Primärschlüssels berücksichtigen. Das legt die folgende Klassifizierung nahe:"
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "indizierte Collections"
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "Sets"
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "Bags"
#. Tag: para
+#: performance.xml:1288
#, fuzzy, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
@@ -2050,6 +2932,7 @@
"Hibernate diese zu aktualisieren oder löschen versucht."
#. Tag: para
+#: performance.xml:1295
#, fuzzy, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key></literal> and "
@@ -2075,6 +2958,7 @@
"deklarieren)."
#. Tag: para
+#: performance.xml:1306
#, fuzzy, no-c-format
msgid ""
"<literal><idbag></literal> mappings define a surrogate key, so they "
@@ -2085,6 +2969,7 @@
"lassen. Genau genommen, ist das der beste Fall."
#. Tag: para
+#: performance.xml:1309
#, fuzzy, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
@@ -2102,6 +2987,7 @@
"ineffizient sein."
#. Tag: para
+#: performance.xml:1316
#, fuzzy, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
@@ -2116,6 +3002,7 @@
"Hibernate einzelne Reihen der Collection \"lokalisiert\")."
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
@@ -2124,6 +3011,7 @@
"aktualisierenden Collections"
#. Tag: para
+#: performance.xml:1326
#, fuzzy, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
@@ -2135,6 +3023,7 @@
"Aktualisierens von Reihen die effizientesten Vorgänge erlauben."
#. Tag: para
+#: performance.xml:1330
#, fuzzy, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
@@ -2154,6 +3043,7 @@
"ab. Auch hier gilt diese Überlegung nicht für \"One-to-Many\"-Assoziationen."
#. Tag: para
+#: performance.xml:1338
#, fuzzy, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
@@ -2170,6 +3060,7 @@
"Modell die natürlichste ist."
#. Tag: para
+#: performance.xml:1344
#, fuzzy, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
@@ -2185,11 +3076,13 @@
"hinsichtlich der Performance der Collection-Aktualisierung nicht gelten."
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr "Bags und Listen sind die effizientesten invertierten Collections"
#. Tag: para
+#: performance.xml:1354
#, fuzzy, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
@@ -2212,12 +3105,30 @@
"literal> reagieren müssen (anders als bei einem <literal>Set</literal>). "
"Dadurch kann der folgende Code wesentlich schneller werden."
+#. Tag: programlisting
+#: performance.xml:1365
+#, fuzzy, no-c-format
+msgid ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+msgstr ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "\"One-Shot-Löschung\""
#. Tag: para
+#: performance.xml:1371
#, fuzzy, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
@@ -2232,6 +3143,7 @@
"literal> heraus, und wir sind fertig!"
#. Tag: para
+#: performance.xml:1377
#, fuzzy, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
@@ -2246,6 +3158,7 @@
"\"). Das ist auf jeden Fall wünschenswert."
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
@@ -2256,6 +3169,7 @@
"Vorgehensweisen:"
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr ""
@@ -2263,6 +3177,7 @@
"einfügen"
#. Tag: para
+#: performance.xml:1394
#, fuzzy, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE</literal> and insert "
@@ -2272,6 +3187,7 @@
"und die fünf aktuellen Elemente (einzeln) einfügen"
#. Tag: para
+#: performance.xml:1400
#, fuzzy, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
@@ -2284,6 +3200,7 @@
"verwirren könnte usw.)"
#. Tag: para
+#: performance.xml:1404
#, fuzzy, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
@@ -2297,6 +3214,7 @@
"leistungsfähig erweisen."
#. Tag: para
+#: performance.xml:1409
#, fuzzy, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
@@ -2306,11 +3224,13 @@
"\"</literal> gemappte Collections."
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "Leistungsüberwachung"
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
@@ -2324,11 +3244,13 @@
"literal> verfügbar."
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "Die Überwachung einer SessionFactory"
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory</literal> metrics in two ways. Your "
@@ -2341,6 +3263,7 @@
"selbst zu lesen und anzuzeigen."
#. Tag: para
+#: performance.xml:1430
#, fuzzy, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
@@ -2354,7 +3277,56 @@
"eines pro Factory aktivieren. Sehen Sie sich den folgenden Code für "
"minimalistische Konfigurationsbeispiele an:"
+#. Tag: programlisting
+#: performance.xml:1435
+#, fuzzy, no-c-format
+msgid ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, fuzzy, no-c-format
+msgid ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+
#. Tag: para
+#: performance.xml:1439
#, fuzzy, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
@@ -2364,6 +3336,7 @@
"aktivieren"
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics</literal> "
@@ -2373,6 +3346,7 @@
"generate_statistics</literal> auf <literal>false</literal>"
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> "
@@ -2383,6 +3357,7 @@
"literal>"
#. Tag: para
+#: performance.xml:1458
#, fuzzy, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear()</"
@@ -2395,11 +3370,13 @@
"geschickt werden."
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "Metriken"
#. Tag: para
+#: performance.xml:1466
#, fuzzy, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
@@ -2413,6 +3390,7 @@
"drei Kategorien beschrieben:"
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid ""
"Metrics related to the general <literal>Session</literal> usage, such as "
@@ -2423,6 +3401,7 @@
"Verbindungen usw."
#. Tag: para
+#: performance.xml:1479
#, fuzzy, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
@@ -2433,6 +3412,7 @@
"\")"
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
@@ -2442,6 +3422,7 @@
"Anfrage oder Cache-Region beziehen."
#. Tag: para
+#: performance.xml:1489
#, fuzzy, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
@@ -2458,6 +3439,7 @@
"auf 10 Sekunden genau sein."
#. Tag: para
+#: performance.xml:1495
#, fuzzy, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
@@ -2480,7 +3462,46 @@
"<literal>SecondLevelCacheStatistics</literal> und <literal>QueryStatistics</"
"literal> API-Javadoc. Der folgende Code zeigt ein einfaches Beispiel:"
+#. Tag: programlisting
+#: performance.xml:1506
+#, fuzzy, no-c-format
+msgid ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+
#. Tag: para
+#: performance.xml:1508
#, fuzzy, no-c-format
msgid ""
"You can work on all entities, collections, queries and region caches, by "
@@ -2496,6 +3517,29 @@
"<literal>getCollectionRoleNames()</literal> und "
"<literal>getSecondLevelCacheRegionNames()</literal>."
+#~ msgid ""
+#~ "The <literal><cache></literal> element of a class or collection "
+#~ "mapping has the following form:"
+#~ msgstr ""
+#~ "Das <literal><cache></literal>-Element des Mappings einer Klasse "
+#~ "oder Collection besitzt folgende Form:"
+
+#~ msgid ""
+#~ "The <literal>usage</literal> attribute specifies a <emphasis>cache "
+#~ "concurrency strategy</emphasis>."
+#~ msgstr ""
+#~ "Das <literal>usage</literal>-Attribut bestimmt eine <emphasis>Cache-"
+#~ "Nebenläufigkeitsstrategie</emphasis>."
+
+#~ msgid "read-only"
+#~ msgstr "read-only"
+
+#~ msgid "read-write"
+#~ msgstr "read-write"
+
+#~ msgid "transactional"
+#~ msgstr "transactional"
+
#, fuzzy
#~ msgid ""
#~ "This setting creates two new cache regions: one holding cached query "
@@ -2519,258 +3563,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[s = sessions.openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ " \n"
-#~ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
-#~ " .setString(\"userName\", userName).uniqueResult();\n"
-#~ "Map permissions = u.getPermissions();\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();\n"
-#~ "\n"
-#~ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // "
-#~ "Error!]]>"
-#~ msgstr ""
-#~ "s = sessions.openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ " \n"
-#~ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
-#~ " .setString(\"userName\", userName).uniqueResult();\n"
-#~ "Map permissions = u.getPermissions();\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();\n"
-#~ "\n"
-#~ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"permissions\" \n"
-#~ " fetch=\"join\">\n"
-#~ " <key column=\"userId\"/>\n"
-#~ " <one-to-many class=\"Permission\"/>\n"
-#~ "</set]]>"
-#~ msgstr ""
-#~ "<set name=\"permissions\" \n"
-#~ " fetch=\"join\">\n"
-#~ " <key column=\"userId\"/>\n"
-#~ " <one-to-many class=\"Permission\"/>\n"
-#~ "</set"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>]]>"
-#~ msgstr "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[User user = (User) session.createCriteria(User.class)\n"
-#~ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
-#~ " .add( Restrictions.idEq(userId) )\n"
-#~ " .uniqueResult();]]>"
-#~ msgstr ""
-#~ "User user = (User) session.createCriteria(User.class)\n"
-#~ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
-#~ " .add( Restrictions.idEq(userId) )\n"
-#~ " .uniqueResult();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Cat\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Cat\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
-#~ "proxy (does not hit the db)\n"
-#~ "if ( cat.isDomesticCat() ) { // hit the db to initialize "
-#~ "the proxy\n"
-#~ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy "
-#~ "(does not hit the db)\n"
-#~ "if ( cat.isDomesticCat() ) { // hit the db to initialize "
-#~ "the proxy\n"
-#~ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
-#~ " ....\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // "
-#~ "instantiate a Cat proxy\n"
-#~ "DomesticCat dc = \n"
-#~ " (DomesticCat) session.load(DomesticCat.class, id); // acquire "
-#~ "new DomesticCat proxy!\n"
-#~ "System.out.println(cat==dc); // false]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
-#~ "Cat proxy\n"
-#~ "DomesticCat dc = \n"
-#~ " (DomesticCat) session.load(DomesticCat.class, id); // acquire "
-#~ "new DomesticCat proxy!\n"
-#~ "System.out.println(cat==dc); // false"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[cat.setWeight(11.0); // hit the db to initialize the proxy\n"
-#~ "System.out.println( dc.getWeight() ); // 11.0]]>"
-#~ msgstr ""
-#~ "cat.setWeight(11.0); // hit the db to initialize the proxy\n"
-#~ "System.out.println( dc.getWeight() ); // 11.0"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"CatImpl\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"CatImpl\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
-#~ "Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
-#~ "name='fritz'\").iterate();\n"
-#~ "Cat fritz = (Cat) iter.next();]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
-#~ "Iterator iter = session.iterate(\"from CatImpl as cat where cat."
-#~ "name='fritz'\");\n"
-#~ "Cat fritz = (Cat) iter.next();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" )."
-#~ "list().get(0) ).intValue()]]>"
-#~ msgstr ""
-#~ "( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
-#~ "(0) ).intValue()"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0)."
-#~ "setMaxResults(10).list();]]>"
-#~ msgstr ""
-#~ "s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
-#~ "list();"
-
-#, fuzzy
-#~ msgid "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"
-#~ msgstr "<class name=\"Person\" batch-size=\"10\">...</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <set name=\"cats\" batch-size=\"3\">\n"
-#~ " ...\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <set name=\"cats\" batch-size=\"3\">\n"
-#~ " ...\n"
-#~ " </set>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Document\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
-#~ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
-#~ "\"true\"/>\n"
-#~ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
-#~ "\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Document\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
-#~ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
-#~ "\"true\"/>\n"
-#~ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy="
-#~ "\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<target name=\"instrument\" depends=\"compile\">\n"
-#~ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
-#~ "instrument.InstrumentTask\">\n"
-#~ " <classpath path=\"${jar.path}\"/>\n"
-#~ " <classpath path=\"${classes.dir}\"/>\n"
-#~ " <classpath refid=\"lib.class.path\"/>\n"
-#~ " </taskdef>\n"
-#~ "\n"
-#~ " <instrument verbose=\"true\">\n"
-#~ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"
-#~ " <include name=\"*.class\"/>\n"
-#~ " </fileset>\n"
-#~ " </instrument>\n"
-#~ "</target>]]>"
-#~ msgstr ""
-#~ "<target name=\"instrument\" depends=\"compile\">\n"
-#~ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
-#~ "instrument.InstrumentTask\">\n"
-#~ " <classpath path=\"${jar.path}\"/>\n"
-#~ " <classpath path=\"${classes.dir}\"/>\n"
-#~ " <classpath refid=\"lib.class.path\"/>\n"
-#~ " </taskdef>\n"
-#~ "\n"
-#~ " <instrument verbose=\"true\">\n"
-#~ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/"
-#~ "model\">\n"
-#~ " <include name=\"*.class\"/>\n"
-#~ " </fileset>\n"
-#~ " </instrument>\n"
-#~ "</target>"
-
-#~ msgid "<entry>yes</entry>"
-#~ msgstr "<entry>Ja</entry>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<cache \n"
-#~ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
-#~ " region=\"RegionName\"\n"
-#~ " include=\"all|non-lazy\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<cache \n"
-#~ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
-#~ " region=\"RegionName\"\n"
-#~ " include=\"all|non-lazy\"\n"
-#~ "/>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<class name=\"eg.Immutable\" mutable=\"false\">\n"
#~ " <cache usage=\"read-only\"/>\n"
#~ " ....\n"
@@ -2800,177 +3592,3 @@
#~ " ....\n"
#~ " </set>\n"
#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ScrollableResult cats = sess.createQuery(\"from Cat as cat\")."
-#~ "scroll(); //a huge result set\n"
-#~ "while ( cats.next() ) {\n"
-#~ " Cat cat = (Cat) cats.get(0);\n"
-#~ " doSomethingWithACat(cat);\n"
-#~ " sess.evict(cat);\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //"
-#~ "a huge result set\n"
-#~ "while ( cats.next() ) {\n"
-#~ " Cat cat = (Cat) cats.get(0);\n"
-#~ " doSomethingWithACat(cat);\n"
-#~ " sess.evict(cat);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sessionFactory.evict(Cat.class, catId); //evict a particular "
-#~ "Cat\n"
-#~ "sessionFactory.evict(Cat.class); //evict all Cats\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a "
-#~ "particular collection of kittens\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
-#~ "collections]]>"
-#~ msgstr ""
-#~ "sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
-#~ "sessionFactory.evict(Cat.class); //evict all Cats\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a "
-#~ "particular collection of kittens\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
-#~ "collections"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Map cacheEntries = sessionFactory.getStatistics()\n"
-#~ " .getSecondLevelCacheStatistics(regionName)\n"
-#~ " .getEntries();]]>"
-#~ msgstr ""
-#~ "Map cacheEntries = sessionFactory.getStatistics()\n"
-#~ " .getSecondLevelCacheStatistics(regionName)\n"
-#~ " .getEntries();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[hibernate.generate_statistics true\n"
-#~ "hibernate.cache.use_structured_entries true]]>"
-#~ msgstr ""
-#~ "hibernate.generate_statistics true\n"
-#~ "hibernate.cache.use_structured_entries true"
-
-#, fuzzy
-#~ msgid "<![CDATA[hibernate.cache.use_query_cache true]]>"
-#~ msgstr "hibernate.cache.use_query_cache true"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List blogs = sess.createQuery(\"from Blog blog where blog."
-#~ "blogger = :blogger\")\n"
-#~ " .setEntity(\"blogger\", blogger)\n"
-#~ " .setMaxResults(15)\n"
-#~ " .setCacheable(true)\n"
-#~ " .setCacheRegion(\"frontpages\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :"
-#~ "blogger\")\n"
-#~ " .setEntity(\"blogger\", blogger)\n"
-#~ " .setMaxResults(15)\n"
-#~ " .setCacheable(true)\n"
-#~ " .setCacheRegion(\"frontpages\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Parent p = (Parent) sess.load(Parent.class, id);\n"
-#~ "Child c = new Child();\n"
-#~ "c.setParent(p);\n"
-#~ "p.getChildren().add(c); //no need to fetch the collection!\n"
-#~ "sess.flush();]]>"
-#~ msgstr ""
-#~ "Parent p = (Parent) sess.load(Parent.class, id);\n"
-#~ "Child c = new Child();\n"
-#~ "c.setParent(p);\n"
-#~ "p.getChildren().add(c); //no need to fetch the collection!\n"
-#~ "sess.flush();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// MBean service registration for a specific SessionFactory\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "stats.setSessionFactory(sessionFactory); // Bind the stats to a "
-#~ "SessionFactory\n"
-#~ "server.registerMBean(stats, on); // Register the Mbean on the server]]>"
-#~ msgstr ""
-#~ "// MBean service registration for a specific SessionFactory\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "stats.setSessionFactory(sessionFactory); // Bind the stats to a "
-#~ "SessionFactory\n"
-#~ "server.registerMBean(stats, on); // Register the Mbean on the server"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// MBean service registration for all SessionFactory's\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"all\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "server.registerMBean(stats, on); // Register the MBean on the server]]>"
-#~ msgstr ""
-#~ "// MBean service registration for all SessionFactory's\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"all\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "server.registerMBean(stats, on); // Register the MBean on the server"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Statistics stats = HibernateUtil.sessionFactory.getStatistics"
-#~ "();\n"
-#~ "\n"
-#~ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
-#~ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
-#~ "double queryCacheHitRatio =\n"
-#~ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
-#~ "\n"
-#~ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
-#~ "\n"
-#~ "EntityStatistics entityStats =\n"
-#~ " stats.getEntityStatistics( Cat.class.getName() );\n"
-#~ "long changes =\n"
-#~ " entityStats.getInsertCount()\n"
-#~ " + entityStats.getUpdateCount()\n"
-#~ " + entityStats.getDeleteCount();\n"
-#~ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );]]>"
-#~ msgstr ""
-#~ "Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
-#~ "\n"
-#~ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
-#~ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
-#~ "double queryCacheHitRatio =\n"
-#~ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
-#~ "\n"
-#~ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
-#~ "\n"
-#~ "EntityStatistics entityStats =\n"
-#~ " stats.getEntityStatistics( Cat.class.getName() );\n"
-#~ "long changes =\n"
-#~ " entityStats.getInsertCount()\n"
-#~ " + entityStats.getUpdateCount()\n"
-#~ " + entityStats.getDeleteCount();\n"
-#~ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/persistent_classes.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/persistent_classes.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/persistent_classes.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,18 +285,20 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "Persistente Klassen"
#. Tag: para
+#: persistent_classes.xml:34
#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
-"application). Not all instances of a persistent class are considered to be "
-"in the persistent state. For example, an instance can instead be transient "
-"or detached."
+"application). The term \"persistent\" here means that the classes are able "
+"to be persisted, not that they are in the persistent state (see <xref "
+"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"Unter persistenten Klassen versteht man diejenigen Klassen in einer "
"Anwendung, die die Entities des Unternehmensproblems (z.B. Kunde und "
@@ -306,13 +308,15 @@
"(\"transient\") oder abgesetzt (\"detached\") sein."
#. Tag: para
+#: persistent_classes.xml:41
#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
-"these rules are hard requirements. Indeed, Hibernate3 assumes very little "
+"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
-"in other ways (using trees of <literal>Map</literal> instances, for example)."
+"in other ways (using trees of <interfacename>java.util.Map</interfacename> "
+"instances, for example)."
msgstr ""
"Hibernate funktioniert am besten, wenn diese Klassen einigen einfachen "
"Regeln folgen, die auch als \"Plain Old Java Object\" (POJO) "
@@ -323,20 +327,181 @@
"literal>-Instanzen-Trees."
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "Ein einfaches POJO-Beispiel"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
+#, no-c-format
+msgid "Simple POJO representing a cat"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:53
#, fuzzy, no-c-format
msgid ""
-"Most Java applications require a persistent class representing felines. For "
-"example:"
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+"private Long id; // identifier\n"
+"\n"
+"private Date birthdate;\n"
+"private Color color;\n"
+"private char sex;\n"
+"private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+"\n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() );\n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
msgstr ""
-"Die meisten Java-Anwendungen erfordern eine persistente Klasse, die Katzen "
-"(\"felines\") repräsentiert."
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+" private Long id; // identifier\n"
+"\n"
+" private Date birthdate;\n"
+" private Color color;\n"
+" private char sex;\n"
+" private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+" \n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+"kitten.setLitterId( kittens.size() ); \n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
@@ -344,19 +509,21 @@
msgstr ""
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "Implementierung eines \"No-Argument\"-Konstruktors"
#. Tag: para
+#: persistent_classes.xml:64
#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> has a no-argument constructor. All persistent classes "
-"must have a default constructor (which can be non-public) so that Hibernate "
-"can instantiate them using <literal>Constructor.newInstance()</literal>. It "
-"is recommended that you have a default constructor with at least "
-"<emphasis>package</emphasis> visibility for runtime proxy generation in "
-"Hibernate."
+"<classname>Cat</classname> has a no-argument constructor. All persistent "
+"classes must have a default constructor (which can be non-public) so that "
+"Hibernate can instantiate them using <literal><classname>java.lang.reflect."
+"Constructor</classname>.newInstance()</literal>. It is recommended that this "
+"constructor be defined with at least <emphasis>package</emphasis> visibility "
+"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat</literal> besitzt einen \"No-Argument\"-Konstruktor. Alle "
"persistenten Klassen müssen über einen Standard-Konstruktor verfügen (der "
@@ -367,74 +534,44 @@
"Runtime in Hibernate besitzt."
#. Tag: title
-#, no-c-format
-msgid "Provide an identifier property (optional)"
+#: persistent_classes.xml:74
+#, fuzzy, no-c-format
+msgid "Provide an identifier property"
msgstr "Bereitstellung einer Bezeichner-Property (optional)"
#. Tag: para
-#, fuzzy, no-c-format
+#: persistent_classes.xml:77
+#, no-c-format
msgid ""
-"<literal>Cat</literal> has a property called <literal>id</literal>. This "
-"property maps to the primary key column of a database table. The property "
-"might have been called anything, and its type might have been any primitive "
-"type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or "
-"<literal>java.util.Date</literal>. If your legacy database table has "
-"composite keys, you can use a user-defined class with properties of these "
-"types (see the section on composite identifiers later in the chapter.)"
+"Historically this was considered option. While still not (yet) enforced, "
+"this should be considered a deprecated feature as it will be completely "
+"required to provide a identifier property in an upcoming release."
msgstr ""
-"<literal>Cat</literal> besitzt eine Property mit Namen <literal>id</"
-"literal>. Diese Property mappt zur Spalte des Primärschlüssels der "
-"Datenbanktabelle. Die Property könnte auch einen beliebigen Namen tragen und "
-"könnte irgendeinen primitiven Typ besitzen, etwa einen primitiven \"Wrapper"
-"\"-Typ, <literal>java.lang.String</literal> oder <literal>java.util.Date</"
-"literal>. (Falls Ihre Legacy-Datenbanktabelle zusammengesetzte Schlüssel "
-"besitzt, können Sie sogar eine benutzerdefinierte Klasse mit Properties "
-"dieser Typen verwenden - wir gehen in einem späteren Abschnitt auf "
-"zusammengesetzte Bezeichner ein)."
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
msgid ""
-"The identifier property is strictly optional. You can leave them off and let "
-"Hibernate keep track of object identifiers internally. We do not recommend "
-"this, however."
+"<classname>Cat</classname> has a property named <literal>id</literal>. This "
+"property maps to the primary key column(s) of the underlying database table. "
+"The type of the identifier property can be any \"basic\" type (see <xref "
+"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
+"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
-"Die Bezeichner-Property ist völlig optional. Sie können sie ausgeschaltet "
-"lassen und Hibernate verfolgt die Objektbezeichner intern. Allerdings "
-"empfehlen wir diese Einstellung nicht."
#. Tag: para
-#, fuzzy, no-c-format
+#: persistent_classes.xml:92
+#, no-c-format
msgid ""
-"In fact, some functionality is available only to classes that declare an "
-"identifier property:"
+"Identifiers do not necessarily need to identify column(s) in the database "
+"physically defined as a primary key. They should just identify columns that "
+"can be used to uniquely identify rows in the underlying table."
msgstr ""
-"Tatsächlich sind einige Funktionalitäten nur für Klassen mit deklarierter "
-"Bezeichner-Property verfügbar:"
#. Tag: para
+#: persistent_classes.xml:99
#, fuzzy, no-c-format
msgid ""
-"Transitive reattachment for detached objects (cascade update or cascade "
-"merge) - see <xref linkend=\"objectstate-transitive\" />"
-msgstr ""
-"Transitives Reattachment für abgesetzte Objekte (in Reihe erfolgende "
-"Aktualisierung oder in Reihe erfolgendes Zusammenfügen (auch: \"Cascade "
-"Update\" bzw. \"Cascade Merge\") - siehe"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
-msgstr "Session.saveOrUpdate()"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>Session.merge()</literal>"
-msgstr "Session.merge()"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
"We recommend that you declare consistently-named identifier properties on "
"persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr ""
@@ -443,42 +580,100 @@
"primitiver) Typ ist ebenfalls zu bevorzugen."
#. Tag: title
-#, no-c-format
-msgid "Prefer non-final classes (optional)"
+#: persistent_classes.xml:107
+#, fuzzy, no-c-format
+msgid "Prefer non-final classes (semi-optional)"
msgstr "Bevorzugung nicht-finaler Klassen (optional)"
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
msgid ""
-"A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon "
-"the persistent class being either non-final, or the implementation of an "
-"interface that declares all public methods."
+"A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), "
+"depends upon the persistent class being either non-final, or the "
+"implementation of an interface that declares all public methods. You can "
+"persist <literal>final</literal> classes that do not implement an interface "
+"with Hibernate; you will not, however, be able to use proxies for lazy "
+"association fetching which will ultimately limit your options for "
+"performance tuning. To persist a <literal>final</literal> class which does "
+"not implement a \"full\" interface you must disable proxy generation. See "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
+"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
+"ann\"/>."
msgstr ""
-"Ein zentrales Feature von Hibernate, <emphasis>Proxies</emphasis>, hängt "
-"davon ab, ob die persistente Klasse entweder nicht-final oder der alle "
-"Methoden als öffentlich erklärenden Implemetierung eines Interface."
+#. Tag: title
+#: persistent_classes.xml:121
+#, no-c-format
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:122
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:126
+#, no-c-format
+msgid "Disabling proxies in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:127
+#, no-c-format
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: persistent_classes.xml:130
+#, no-c-format
msgid ""
-"You can persist <literal>final</literal> classes that do not implement an "
-"interface with Hibernate. You will not, however, be able to use proxies for "
-"lazy association fetching which will ultimately limit your options for "
-"performance tuning."
+"If the <literal>final</literal> class does implement a proper interface, you "
+"could alternatively tell Hibernate to use the interface instead when "
+"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
+"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
+"final-example-proxy-interface-ann\"/>."
msgstr ""
-"Sie können <literal>final</literal>e Klassen, die kein Interface mit "
-"Hibernate implementieren, persistieren, aber Sie werden keine Proxies für "
-"das \"Lazy Fetching\" von Assoziationen (d.h. das Nachladen assoziierter "
-"Objekte bei Bedarf) verwenden können - was Ihre Optionen bei der "
-"Feinabstimmung der Performance einschränkt."
+#. Tag: title
+#: persistent_classes.xml:139
+#, no-c-format
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:144
+#, no-c-format
+msgid "Proxying an interface in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:145
+#, no-c-format
+msgid ""
+"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
+"ICat { ... }]]>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:148
#, fuzzy, no-c-format
msgid ""
-"You should also avoid declaring <literal>public final</literal> methods on "
-"the non-final classes. If you want to use a class with a <literal>public "
-"final</literal> method, you must explicitly disable proxying by setting "
-"<literal>lazy=\"false\"</literal>."
+"You should also avoid declaring <literal>public final</literal> methods as "
+"this will again limit the ability to generate <emphasis>proxies</emphasis> "
+"from this class. If you want to use a class with <literal>public final</"
+"literal> methods, you must explicitly disable proxying. Again, see <xref "
+"linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/"
+">."
msgstr ""
"Sie sollten es vermeiden, <literal>public final</literal>-Methoden an den "
"nicht-finalen Klassen zu deklarieren. Wenn Sie eine Klasse mit einer "
@@ -487,6 +682,7 @@
"deaktivieren."
#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr ""
@@ -494,9 +690,10 @@
"(optional)"
#. Tag: para
+#: persistent_classes.xml:160
#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> declares accessor methods for all its persistent "
+"<classname>Cat</classname> declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
@@ -515,22 +712,26 @@
"Feldzugriff wechseln."
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:169
+#, fuzzy, no-c-format
msgid ""
-"Properties need <emphasis>not</emphasis> be declared public - Hibernate can "
-"persist a property with a default, <literal>protected</literal> or "
-"<literal>private</literal> get / set pair."
+"Properties need <emphasis>not</emphasis> be declared public. Hibernate can "
+"persist a property declared with <literal>package</literal>, "
+"<literal>protected</literal> or <literal>private</literal> visibility as "
+"well."
msgstr ""
"Properties müssen <emphasis>nicht</emphasis> als öffentlich deklariert "
"werden - Hibernate kann eine Property als <literal>protected</literal> oder "
"<literal>private</literal> \"Get\"-/ \"Set\"-Paar persistieren."
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "Implementierung der Vererbung"
#. Tag: para
+#: persistent_classes.xml:180
#, fuzzy, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
@@ -539,7 +740,38 @@
"Eine Subklasse muss ebenfalls die ersten und zweiten Regeln berücksichtigen. "
"Sie erbt ihre Bezeichner-Property von der Superklasse <literal>Cat</literal>."
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, fuzzy, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+msgstr ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+
#. Tag: title
+#: persistent_classes.xml:188
#, fuzzy, no-c-format
msgid ""
"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
@@ -548,6 +780,7 @@
"Methoden außer Kraft setzen, falls Sie"
#. Tag: para
+#: persistent_classes.xml:191
#, fuzzy, no-c-format
msgid ""
"You have to override the <literal>equals()</literal> and <literal>hashCode()"
@@ -557,6 +790,7 @@
"Methoden außer Kraft setzen, falls Sie"
#. Tag: para
+#: persistent_classes.xml:196
#, fuzzy, no-c-format
msgid ""
"intend to put instances of persistent classes in a <literal>Set</literal> "
@@ -568,11 +802,13 @@
"repräsentieren) <emphasis>und</emphasis>"
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "planen, den Wiederanbindung abgesetzter Instanzen zu verwenden"
#. Tag: para
+#: persistent_classes.xml:206
#, fuzzy, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
@@ -589,6 +825,7 @@
"aussagekräftige Semantik für <literal>Set</literal>s wünschen."
#. Tag: para
+#: persistent_classes.xml:212
#, fuzzy, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()</literal>/"
@@ -625,6 +862,7 @@
"Java-Semantik hinsichtlich Objektidentität und Gleichheit basiert."
#. Tag: para
+#: persistent_classes.xml:228
#, fuzzy, no-c-format
msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
@@ -642,11 +880,64 @@
"identifiziert Ihre Instanz in der Realität (ein <emphasis>natürlicher</"
"emphasis> Schlüsselkandidat bzw. \"Candidate Key\"):"
+#. Tag: programlisting
+#: persistent_classes.xml:235
+#, fuzzy, no-c-format
+msgid ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+msgstr ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: persistent_classes.xml:237
#, fuzzy, no-c-format
msgid ""
"A business key does not have to be as solid as a database primary key "
-"candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable "
+"candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable "
"or unique properties are usually good candidates for a business key."
msgstr ""
"Bitte beachten Sie, dass ein \"Business Key\" nicht so beständig wie ein "
@@ -655,25 +946,29 @@
"Properties sind in der Regel eine gute Wahl für einen Business Key."
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr "Dynamische Modelle"
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr ""
-#. Tag: para
+#. Tag: emphasis
+#: persistent_classes.xml:249
#, fuzzy, no-c-format
msgid ""
-"<emphasis>The following features are currently considered experimental and "
-"may change in the near future.</emphasis>"
+"The following features are currently considered experimental and may change "
+"in the near future."
msgstr ""
"Bitte beachten Sie, dass die folgenden Features als experimentell gelten und "
"sich in naher Zukunft ändern können."
#. Tag: para
+#: persistent_classes.xml:253
#, fuzzy, no-c-format
msgid ""
"Persistent entities do not necessarily have to be represented as POJO "
@@ -690,12 +985,13 @@
"Klassen, sondern nur Mapping-Dateien."
#. Tag: para
+#: persistent_classes.xml:259
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactory</"
"literal> using the <literal>default_entity_mode</literal> configuration "
-"option (see <xref linkend=\"configuration-optional-properties\" />)."
+"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"In der Standardeinstellung arbeitet Hibernate im regulären POJO-Modus. Sie "
"können einen Standard-Entity-Repräsentationsmodus für eine bestimmte "
@@ -704,6 +1000,7 @@
"(siehe <xref linkend=\"configuration-optional-properties\"/>)."
#. Tag: para
+#: persistent_classes.xml:265
#, fuzzy, no-c-format
msgid ""
"The following examples demonstrate the representation using <literal>Map</"
@@ -715,7 +1012,80 @@
"<literal>entity-name</literal> anstelle von (oder zusätzlich zu) einem "
"Klassennamen deklariert werden:"
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: persistent_classes.xml:272
#, fuzzy, no-c-format
msgid ""
"Even though associations are declared using target class names, the target "
@@ -726,6 +1096,7 @@
"Klassennamen deklariert werden."
#. Tag: para
+#: persistent_classes.xml:276
#, fuzzy, no-c-format
msgid ""
"After setting the default entity mode to <literal>dynamic-map</literal> for "
@@ -736,7 +1107,55 @@
"für die <literal>SessionFactory</literal> gesetzt ist, können wir zur "
"Runtime mit <literal>Map</literal>s von <literal>Map</literal>s arbeiten:"
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, fuzzy, no-c-format
+msgid ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+msgstr ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"Session s = openSession();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+
#. Tag: para
+#: persistent_classes.xml:283
#, fuzzy, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
@@ -756,6 +1175,7 @@
"Modells später problemlos hinzugefügt werden kann."
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session</"
@@ -764,7 +1184,36 @@
"Die Modi für die Entity Repräsentation können auch auf per <literal>Session</"
"literal>-Basis eingestellt werden:"
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, fuzzy, no-c-format
+msgid ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+msgstr ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+
#. Tag: para
+#: persistent_classes.xml:295
#, fuzzy, no-c-format
msgid ""
"Please note that the call to <literal>getSession()</literal> using an "
@@ -786,31 +1235,35 @@
"Transaktion und Verbindung der primären Arbeitseinheit überlassen können."
#. Tag: para
+#: persistent_classes.xml:304
#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
-"<xref linkend=\"xml\" />."
+"<xref linkend=\"xml\"/>."
msgstr ""
"Weitere Informationen zum Leistungsvermögen der XML-Repräsentation finden "
"Sie unter <xref linkend=\"xml\"/>."
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizer"
#. Tag: para
+#: persistent_classes.xml:312
#, fuzzy, no-c-format
msgid ""
-"<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO "
-"through its constructor. It also knows how to access the POJO properties "
-"using the defined property accessors."
+"<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-"
+"interfaces are responsible for managing a particular representation of a "
+"piece of data given that representation's <classname>org.hibernate."
+"EntityMode</classname>. If a given piece of data is thought of as a data "
+"structure, then a tuplizer is the thing that knows how to create such a data "
+"structure, how to extract values from such a data structure and how to "
+"inject values into such a data structure. For example, for the POJO entity "
+"mode, the corresponding tuplizer knows how create the POJO through its "
+"constructor. It also knows how to access the POJO properties using the "
+"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer</literal> und seine untergeordneten "
"Schnittstellen sind angesichts des <literal>org.hibernate.EntityMode</"
@@ -830,27 +1283,44 @@
"Komponenten übernehmen."
#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
+msgid "There are two (high-level) types of Tuplizers:"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:326
+#, no-c-format
msgid ""
-"There are two high-level types of Tuplizers, represented by the <literal>org."
-"hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate."
-"tuple.component.ComponentTuplizer</literal> interfaces. "
-"<literal>EntityTuplizer</literal>s are responsible for managing the above "
-"mentioned contracts in regards to entities, while "
-"<literal>ComponentTuplizer</literal>s do the same for components."
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"which is responsible for managing the above mentioned contracts in regards "
+"to entities"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:332
+#, no-c-format
+msgid ""
+"<interfacename>org.hibernate.tuple.component.ComponentTuplizer</"
+"interfacename> which does the same for components"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:340
#, fuzzy, no-c-format
msgid ""
-"Users can also plug in their own tuplizers. Perhaps you require that a "
-"<literal>java.util.Map</literal> implementation other than <literal>java."
-"util.HashMap</literal> be used while in the dynamic-map entity-mode. Or "
-"perhaps you need to define a different proxy generation strategy than the "
-"one used by default. Both would be achieved by defining a custom tuplizer "
-"implementation. Tuplizer definitions are attached to the entity or component "
-"mapping they are meant to manage. Going back to the example of our customer "
-"entity:"
+"Users can also plug in their own tuplizers. Perhaps you require that "
+"<interfacename>java.util.Map</interfacename> implementation other than "
+"<classname>java.util.HashMap</classname> be used while in the dynamic-map "
+"entity-mode. Or perhaps you need to define a different proxy generation "
+"strategy than the one used by default. Both would be achieved by defining a "
+"custom tuplizer implementation. Tuplizer definitions are attached to the "
+"entity or component mapping they are meant to manage. Going back to the "
+"example of our <classname>Customer</classname> entity, <xref linkend="
+"\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom "
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
+"\"/> shows how to do the same in <literal>hbm.xml</literal>"
msgstr ""
"Benutzer können auch ihre eigenen Tuplizer einbinden. Es ist möglich, dass "
"Sie während des \"dynamic-map\" Entity-Modus eine andere Implementierung von "
@@ -863,29 +1333,217 @@
"Entity an:"
#. Tag: title
+#: persistent_classes.xml:353
+#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class entity-name=\"Customer\">\n"
+" <!--\n"
+" Override the dynamic-map entity-mode\n"
+" tuplizer for the customer entity\n"
+" -->\n"
+" <tuplizer entity-mode=\"dynamic-map\"\n"
+" class=\"CustomMapTuplizerImpl\"/>\n"
+"\n"
+" <id name=\"id\" type=\"long\" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <!-- other properties -->\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
#, fuzzy, no-c-format
msgid "EntityNameResolvers"
msgstr "EntityResolver"
#. Tag: para
+#: persistent_classes.xml:365
#, no-c-format
msgid ""
-"The <interfacename>org.hibernate.EntityNameResolver</interfacename> "
-"interface is a contract for resolving the entity name of a given entity "
-"instance. The interface defines a single method "
-"<methodname>resolveEntityName</methodname> which is passed the entity "
-"instance and is expected to return the appropriate entity name (null is "
-"allowed and would indicate that the resolver does not know how to resolve "
-"the entity name of the given entity instance). Generally speaking, an "
-"<interfacename>org.hibernate.EntityNameResolver</interfacename> is going to "
-"be most useful in the case of dynamic models. One example might be using "
-"proxied interfaces as your domain model. The hibernate test suite has an "
-"example of this exact style of usage under the <package>org.hibernate.test."
-"dynamicentity.tuplizer2</package>. Here is some of the code from that "
-"package for illustration."
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> is a "
+"contract for resolving the entity name of a given entity instance. The "
+"interface defines a single method <methodname>resolveEntityName</methodname> "
+"which is passed the entity instance and is expected to return the "
+"appropriate entity name (null is allowed and would indicate that the "
+"resolver does not know how to resolve the entity name of the given entity "
+"instance). Generally speaking, an <interfacename>org.hibernate."
+"EntityNameResolver</interfacename> is going to be most useful in the case of "
+"dynamic models. One example might be using proxied interfaces as your domain "
+"model. The hibernate test suite has an example of this exact style of usage "
+"under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. "
+"Here is some of the code from that package for illustration."
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, no-c-format
+msgid ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an\n"
+" * interface as the domain model and simply store persistent state in an "
+"internal\n"
+" * Map. This is an extremely trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" *\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names\n"
+" * should be resolved. Since this particular impl can handle resolution for "
+"all of our\n"
+" * entities we want to take advantage of the fact that SessionFactoryImpl "
+"keeps these\n"
+" * in a Set so that we only ever have one instance registered. Why? Well, "
+"when it\n"
+" * comes time to resolve an entity name, Hibernate must iterate over all the "
+"registered\n"
+" * resolvers. So keeping that number down helps that process be as speedy "
+"as possible.\n"
+" * Hence the equals and hashCode implementations as is\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ..."
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
msgid ""
"In order to register an <interfacename>org.hibernate.EntityNameResolver</"
@@ -893,14 +1551,16 @@
msgstr ""
#. Tag: para
+#: persistent_classes.xml:383
#, no-c-format
msgid ""
-"Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link>, implementing the <methodname>getEntityNameResolvers</methodname> "
-"method."
+"Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers"
+"\"/>), implementing the <methodname>getEntityNameResolvers</methodname> "
+"method"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</"
@@ -911,385 +1571,88 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[package eg;\n"
-#~ "import java.util.Set;\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Cat {\n"
-#~ " private Long id; // identifier\n"
-#~ "\n"
-#~ " private Date birthdate;\n"
-#~ " private Color color;\n"
-#~ " private char sex;\n"
-#~ " private float weight;\n"
-#~ " private int litterId;\n"
-#~ "\n"
-#~ " private Cat mother;\n"
-#~ " private Set kittens = new HashSet();\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id=id;\n"
-#~ " }\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setBirthdate(Date date) {\n"
-#~ " birthdate = date;\n"
-#~ " }\n"
-#~ " public Date getBirthdate() {\n"
-#~ " return birthdate;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setWeight(float weight) {\n"
-#~ " this.weight = weight;\n"
-#~ " }\n"
-#~ " public float getWeight() {\n"
-#~ " return weight;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Color getColor() {\n"
-#~ " return color;\n"
-#~ " }\n"
-#~ " void setColor(Color color) {\n"
-#~ " this.color = color;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setSex(char sex) {\n"
-#~ " this.sex=sex;\n"
-#~ " }\n"
-#~ " public char getSex() {\n"
-#~ " return sex;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setLitterId(int id) {\n"
-#~ " this.litterId = id;\n"
-#~ " }\n"
-#~ " public int getLitterId() {\n"
-#~ " return litterId;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setMother(Cat mother) {\n"
-#~ " this.mother = mother;\n"
-#~ " }\n"
-#~ " public Cat getMother() {\n"
-#~ " return mother;\n"
-#~ " }\n"
-#~ " void setKittens(Set kittens) {\n"
-#~ " this.kittens = kittens;\n"
-#~ " }\n"
-#~ " public Set getKittens() {\n"
-#~ " return kittens;\n"
-#~ " }\n"
-#~ " \n"
-#~ " // addKitten not needed by Hibernate\n"
-#~ " public void addKitten(Cat kitten) {\n"
-#~ " kitten.setMother(this);\n"
-#~ " kitten.setLitterId( kittens.size() ); \n"
-#~ " kittens.add(kitten);\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "Most Java applications require a persistent class representing felines. "
+#~ "For example:"
#~ msgstr ""
-#~ "package eg;\n"
-#~ "import java.util.Set;\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Cat {\n"
-#~ " private Long id; // identifier\n"
-#~ "\n"
-#~ " private Date birthdate;\n"
-#~ " private Color color;\n"
-#~ " private char sex;\n"
-#~ " private float weight;\n"
-#~ " private int litterId;\n"
-#~ "\n"
-#~ " private Cat mother;\n"
-#~ " private Set kittens = new HashSet();\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id=id;\n"
-#~ " }\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setBirthdate(Date date) {\n"
-#~ " birthdate = date;\n"
-#~ " }\n"
-#~ " public Date getBirthdate() {\n"
-#~ " return birthdate;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setWeight(float weight) {\n"
-#~ " this.weight = weight;\n"
-#~ " }\n"
-#~ " public float getWeight() {\n"
-#~ " return weight;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Color getColor() {\n"
-#~ " return color;\n"
-#~ " }\n"
-#~ " void setColor(Color color) {\n"
-#~ " this.color = color;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setSex(char sex) {\n"
-#~ " this.sex=sex;\n"
-#~ " }\n"
-#~ " public char getSex() {\n"
-#~ " return sex;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setLitterId(int id) {\n"
-#~ " this.litterId = id;\n"
-#~ " }\n"
-#~ " public int getLitterId() {\n"
-#~ " return litterId;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setMother(Cat mother) {\n"
-#~ " this.mother = mother;\n"
-#~ " }\n"
-#~ " public Cat getMother() {\n"
-#~ " return mother;\n"
-#~ " }\n"
-#~ " void setKittens(Set kittens) {\n"
-#~ " this.kittens = kittens;\n"
-#~ " }\n"
-#~ " public Set getKittens() {\n"
-#~ " return kittens;\n"
-#~ " }\n"
-#~ " \n"
-#~ " // addKitten not needed by Hibernate\n"
-#~ " public void addKitten(Cat kitten) {\n"
-#~ " kitten.setMother(this);\n"
-#~ "kitten.setLitterId( kittens.size() ); \n"
-#~ " kittens.add(kitten);\n"
-#~ " }\n"
-#~ "}"
+#~ "Die meisten Java-Anwendungen erfordern eine persistente Klasse, die "
+#~ "Katzen (\"felines\") repräsentiert."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[package eg;\n"
-#~ "\n"
-#~ "public class DomesticCat extends Cat {\n"
-#~ " private String name;\n"
-#~ "\n"
-#~ " public String getName() {\n"
-#~ " return name;\n"
-#~ " }\n"
-#~ " protected void setName(String name) {\n"
-#~ " this.name=name;\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "<literal>Cat</literal> has a property called <literal>id</literal>. This "
+#~ "property maps to the primary key column of a database table. The property "
+#~ "might have been called anything, and its type might have been any "
+#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
+#~ "String</literal> or <literal>java.util.Date</literal>. If your legacy "
+#~ "database table has composite keys, you can use a user-defined class with "
+#~ "properties of these types (see the section on composite identifiers later "
+#~ "in the chapter.)"
#~ msgstr ""
-#~ "package eg;\n"
-#~ "\n"
-#~ "public class DomesticCat extends Cat {\n"
-#~ " private String name;\n"
-#~ "\n"
-#~ " public String getName() {\n"
-#~ " return name;\n"
-#~ " }\n"
-#~ " protected void setName(String name) {\n"
-#~ " this.name=name;\n"
-#~ " }\n"
-#~ "}"
+#~ "<literal>Cat</literal> besitzt eine Property mit Namen <literal>id</"
+#~ "literal>. Diese Property mappt zur Spalte des Primärschlüssels der "
+#~ "Datenbanktabelle. Die Property könnte auch einen beliebigen Namen tragen "
+#~ "und könnte irgendeinen primitiven Typ besitzen, etwa einen primitiven "
+#~ "\"Wrapper\"-Typ, <literal>java.lang.String</literal> oder <literal>java."
+#~ "util.Date</literal>. (Falls Ihre Legacy-Datenbanktabelle zusammengesetzte "
+#~ "Schlüssel besitzt, können Sie sogar eine benutzerdefinierte Klasse mit "
+#~ "Properties dieser Typen verwenden - wir gehen in einem späteren Abschnitt "
+#~ "auf zusammengesetzte Bezeichner ein)."
+#~ msgid ""
+#~ "The identifier property is strictly optional. You can leave them off and "
+#~ "let Hibernate keep track of object identifiers internally. We do not "
+#~ "recommend this, however."
+#~ msgstr ""
+#~ "Die Bezeichner-Property ist völlig optional. Sie können sie ausgeschaltet "
+#~ "lassen und Hibernate verfolgt die Objektbezeichner intern. Allerdings "
+#~ "empfehlen wir diese Einstellung nicht."
+
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[public class Cat {\n"
-#~ "\n"
-#~ " ...\n"
-#~ " public boolean equals(Object other) {\n"
-#~ " if (this == other) return true;\n"
-#~ " if ( !(other instanceof Cat) ) return false;\n"
-#~ "\n"
-#~ " final Cat cat = (Cat) other;\n"
-#~ "\n"
-#~ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
-#~ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
-#~ "\n"
-#~ " return true;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " int result;\n"
-#~ " result = getMother().hashCode();\n"
-#~ " result = 29 * result + getLitterId();\n"
-#~ " return result;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
+#~ "In fact, some functionality is available only to classes that declare an "
+#~ "identifier property:"
#~ msgstr ""
-#~ "public class Cat {\n"
-#~ "\n"
-#~ " ...\n"
-#~ " public boolean equals(Object other) {\n"
-#~ " if (this == other) return true;\n"
-#~ " if ( !(other instanceof Cat) ) return false;\n"
-#~ "\n"
-#~ " final Cat cat = (Cat) other;\n"
-#~ "\n"
-#~ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
-#~ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
-#~ "\n"
-#~ " return true;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " int result;\n"
-#~ " result = getMother().hashCode();\n"
-#~ " result = 29 * result + getLitterId();\n"
-#~ " return result;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
+#~ "Tatsächlich sind einige Funktionalitäten nur für Klassen mit deklarierter "
+#~ "Bezeichner-Property verfügbar:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class entity-name=\"Customer\">\n"
-#~ "\n"
-#~ " <id name=\"id\"\n"
-#~ " type=\"long\"\n"
-#~ " column=\"ID\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " column=\"NAME\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <property name=\"address\"\n"
-#~ " column=\"ADDRESS\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"organization\"\n"
-#~ " column=\"ORGANIZATION_ID\"\n"
-#~ " class=\"Organization\"/>\n"
-#~ "\n"
-#~ " <bag name=\"orders\"\n"
-#~ " inverse=\"true\"\n"
-#~ " lazy=\"false\"\n"
-#~ " cascade=\"all\">\n"
-#~ " <key column=\"CUSTOMER_ID\"/>\n"
-#~ " <one-to-many class=\"Order\"/>\n"
-#~ " </bag>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ " \n"
-#~ "</hibernate-mapping>]]>"
+#~ "Transitive reattachment for detached objects (cascade update or cascade "
+#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class entity-name=\"Customer\">\n"
-#~ "\n"
-#~ " <id name=\"id\"\n"
-#~ " type=\"long\"\n"
-#~ " column=\"ID\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " column=\"NAME\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <property name=\"address\"\n"
-#~ " column=\"ADDRESS\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"organization\"\n"
-#~ " column=\"ORGANIZATION_ID\"\n"
-#~ " class=\"Organization\"/>\n"
-#~ "\n"
-#~ " <bag name=\"orders\"\n"
-#~ " inverse=\"true\"\n"
-#~ " lazy=\"false\"\n"
-#~ " cascade=\"all\">\n"
-#~ " <key column=\"CUSTOMER_ID\"/>\n"
-#~ " <one-to-many class=\"Order\"/>\n"
-#~ " </bag>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ " \n"
-#~ "</hibernate-mapping>"
+#~ "Transitives Reattachment für abgesetzte Objekte (in Reihe erfolgende "
+#~ "Aktualisierung oder in Reihe erfolgendes Zusammenfügen (auch: \"Cascade "
+#~ "Update\" bzw. \"Cascade Merge\") - siehe"
#, fuzzy
+#~ msgid "<literal>Session.saveOrUpdate()</literal>"
+#~ msgstr "Session.saveOrUpdate()"
+
+#, fuzzy
+#~ msgid "<literal>Session.merge()</literal>"
+#~ msgstr "Session.merge()"
+
#~ msgid ""
-#~ "<![CDATA[Session s = openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ "Session s = openSession();\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "\n"
-#~ "// Create an organization\n"
-#~ "Map foobar = new HashMap();\n"
-#~ "foobar.put(\"name\", \"Foobar Inc.\");\n"
-#~ "\n"
-#~ "// Link both\n"
-#~ "david.put(\"organization\", foobar);\n"
-#~ "\n"
-#~ "// Save both\n"
-#~ "s.save(\"Customer\", david);\n"
-#~ "s.save(\"Organization\", foobar);\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();]]>"
+#~ "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends "
+#~ "upon the persistent class being either non-final, or the implementation "
+#~ "of an interface that declares all public methods."
#~ msgstr ""
-#~ "Session s = openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ "Session s = openSession();\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "\n"
-#~ "// Create an organization\n"
-#~ "Map foobar = new HashMap();\n"
-#~ "foobar.put(\"name\", \"Foobar Inc.\");\n"
-#~ "\n"
-#~ "// Link both\n"
-#~ "david.put(\"organization\", foobar);\n"
-#~ "\n"
-#~ "// Save both\n"
-#~ "s.save(\"Customer\", david);\n"
-#~ "s.save(\"Organization\", foobar);\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();"
+#~ "Ein zentrales Feature von Hibernate, <emphasis>Proxies</emphasis>, hängt "
+#~ "davon ab, ob die persistente Klasse entweder nicht-final oder der alle "
+#~ "Methoden als öffentlich erklärenden Implemetierung eines Interface."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode."
-#~ "MAP);\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "dynamicSession.save(\"Customer\", david);\n"
-#~ "...\n"
-#~ "dynamicSession.flush();\n"
-#~ "dynamicSession.close()\n"
-#~ "...\n"
-#~ "// Continue on pojoSession\n"
-#~ "]]>"
+#~ "You can persist <literal>final</literal> classes that do not implement an "
+#~ "interface with Hibernate. You will not, however, be able to use proxies "
+#~ "for lazy association fetching which will ultimately limit your options "
+#~ "for performance tuning."
#~ msgstr ""
-#~ "Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "dynamicSession.save(\"Customer\", david);\n"
-#~ "...\n"
-#~ "dynamicSession.flush();\n"
-#~ "dynamicSession.close()\n"
-#~ "...\n"
-#~ "// Continue on pojoSession"
+#~ "Sie können <literal>final</literal>e Klassen, die kein Interface mit "
+#~ "Hibernate implementieren, persistieren, aber Sie werden keine Proxies für "
+#~ "das \"Lazy Fetching\" von Assoziationen (d.h. das Nachladen assoziierter "
+#~ "Objekte bei Bedarf) verwenden können - was Ihre Optionen bei der "
+#~ "Feinabstimmung der Performance einschränkt."
#, fuzzy
#~ msgid ""
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,10 +1,11 @@
-#
+#
# AUTHOR <EMAIL at ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-02-11T05:38:15\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
@@ -13,13 +14,24 @@
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr "Vorwort"
#. Tag: para
-#, no-c-format
-msgid "Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. Hibernate is an Object/Relational Mapping tool for Java environments. The term Object/Relational Mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema."
+#: preface.xml:35
+#, fuzzy, no-c-format
+msgid ""
+"Working with both Object-Oriented software and Relational Databases can be "
+"cumbersome and time consuming. Development costs are significantly higher "
+"due to a paradigm mismatch between how data is represented in objects versus "
+"relational databases. Hibernate is an Object/Relational Mapping solution for "
+"Java environments. The term Object/Relational Mapping refers to the "
+"technique of mapping a data representation from an object model to a "
+"relational data model with a SQL-based schema; see <ulink url=\"http://en."
+"wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/"
+"Object-relational_mapping</ulink> for a discussion."
msgstr ""
"Die Arbeit mit objektorientierter Software und einer relationalen Datenbank "
"kann sich in Unternehmensumgebungen heutzutage als mühsam und zeitaufwendig "
@@ -29,8 +41,36 @@
"Objektmodell zu einem relationalen Datenmodell mit SQL-basiertem Schema."
#. Tag: para
+#: preface.xml:46
+#, no-c-format
+msgid ""
+"While having a strong background in SQL is not required to use Hibernate, "
+"having a basic understanding of the concepts can greatly help you understand "
+"Hibernate more fully and quickly. Probably the single best background is an "
+"understanding of data modeling principles. You might want to consider these "
+"resources as a good starting point:"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:54
+#, no-c-format
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:59
+#, no-c-format
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
+
+#. Tag: para
+#: preface.xml:66
#, fuzzy, no-c-format
-msgid "Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. It can also significantly reduce development time otherwise spent with manual data handling in SQL and JDBC."
+msgid ""
+"Hibernate not only takes care of the mapping from Java classes to database "
+"tables (and from Java data types to SQL data types), but also provides data "
+"query and retrieval facilities. It can also significantly reduce development "
+"time otherwise spent with manual data handling in SQL and JDBC."
msgstr ""
"Hibernate besorgt nicht nur das Mapping von Java-Klassen zu "
"Datenbanktabellen (und von Java-Datentypen zu SQL-Datentypen ), sondern "
@@ -39,8 +79,28 @@
"Datenbearbeitung in SQL und JDBC entfällt."
#. Tag: para
+#: preface.xml:72
+#, no-c-format
+msgid ""
+"Hibernate’s design goal is to relieve the developer from 95% of common data "
+"persistence-related programming tasks by eliminating the need for manual, "
+"hand-crafted data processing using SQL and JDBC. However, unlike many other "
+"persistence solutions, Hibernate does not hide the power of SQL from you and "
+"guarantees that your investment in relational technology and knowledge is as "
+"valid as always."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:79
#, fuzzy, no-c-format
-msgid "Hibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects."
+msgid ""
+"Hibernate may not be the best solution for data-centric applications that "
+"only use stored-procedures to implement the business logic in the database, "
+"it is most useful with object-oriented domain models and business logic in "
+"the Java-based middle-tier. However, Hibernate can certainly help you to "
+"remove or encapsulate vendor-specific SQL code and will help with the common "
+"task of result set translation from a tabular representation to a graph of "
+"objects."
msgstr ""
"Hibernate will dem Entwickler 95 Prozent der mit gängiger Datenpersistenz "
"verbundenen Programmierarbeit abnehmen. Hibernate ist möglicherweise nicht "
@@ -54,30 +114,47 @@
"Repräsentation in ein Objektdiagramm."
#. Tag: para
+#: preface.xml:88
#, no-c-format
-msgid "If you are new to Hibernate and Object/Relational Mapping or even Java, please follow these steps:"
+msgid ""
+"If you are new to Hibernate and Object/Relational Mapping or even Java, "
+"please follow these steps:"
msgstr ""
"Falls Ihnen Hibernate und Objekt/Relationales Mapping oder sogar Java neu "
"sind, orientieren Sie sich bitte an folgenden Schritten:"
#. Tag: para
+#: preface.xml:95
#, fuzzy, no-c-format
-msgid "Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step instructions. The source code for the tutorial is included in the distribution in the <literal>doc/reference/tutorial/</literal> directory."
+msgid ""
+"Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step "
+"instructions. The source code for the tutorial is included in the "
+"distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
"Lesen Sie <xref linkend=\"tutorial\"/> für eine schrittweise Anleitung. Der "
"Quellcode der Anleitung ist Teil der Distrubution im <literal>doc/reference/"
"tutorial/</literal>-Verzeichnis."
#. Tag: para
-#, no-c-format
-msgid "Read <xref linkend=\"architecture\" /> to understand the environments where Hibernate can be used."
+#: preface.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"Read <xref linkend=\"architecture\"/> to understand the environments where "
+"Hibernate can be used."
msgstr ""
"Lesen Sie <xref linkend=\"architecture\"/>, um mehr über die Umgebungen zu "
"erfahren, in denen Hibernate eingesetzt werden kann."
#. Tag: para
+#: preface.xml:109
#, fuzzy, no-c-format
-msgid "View the <literal>eg/</literal> directory in the Hibernate distribution. It contains a simple standalone application. Copy your JDBC driver to the <literal>lib/</literal> directory and edit <literal>etc/hibernate.properties</literal>, specifying correct values for your database. From a command prompt in the distribution directory, type <literal>ant eg</literal> (using Ant), or under Windows, type <literal>build eg</literal>."
+msgid ""
+"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
+"contains a simple standalone application. Copy your JDBC driver to the "
+"<literal>lib/</literal> directory and edit <literal>etc/hibernate."
+"properties</literal>, specifying correct values for your database. From a "
+"command prompt in the distribution directory, type <literal>ant eg</literal> "
+"(using Ant), or under Windows, type <literal>build eg</literal>."
msgstr ""
"Schauen Sie sich das <literal>eg/</literal>-Verzeichnis in der Hibernate "
"Distribution an, es enthält eine einfache, selbständige Anwendung. Kopieren "
@@ -88,8 +165,15 @@
"Verwendung von Ant) oder in Windows tippen Sie <literal>build eg</literal>."
#. Tag: para
+#: preface.xml:120
#, fuzzy, no-c-format
-msgid "Use this reference documentation as your primary source of information. Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+msgid ""
+"Use this reference documentation as your primary source of information. "
+"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
+"more help with application design, or if you prefer a step-by-step tutorial. "
+"Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and "
+"download the example application from <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>."
msgstr ""
"Verwenden Sie diese Referenzdokumentation als Ihre primäre "
"Informationsquelle. Weitere Informationen finden Sie außerdem unter "
@@ -100,6 +184,7 @@
"org."
#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr ""
@@ -107,15 +192,22 @@
"Hibernate."
#. Tag: para
+#: preface.xml:135
#, no-c-format
-msgid "Links to third party demos, examples, and tutorials are maintained on the Hibernate website."
+msgid ""
+"Links to third party demos, examples, and tutorials are maintained on the "
+"Hibernate website."
msgstr ""
"Auf der Hibernate Website befinden sich auch Demos, Beispiele und "
"Anleitungen Dritter."
#. Tag: para
+#: preface.xml:141
#, no-c-format
-msgid "The Community Area on the Hibernate website is a good resource for design patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, etc.)."
+msgid ""
+"The Community Area on the Hibernate website is a good resource for design "
+"patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, "
+"etc.)."
msgstr ""
"Bei Fragen wenden Sie sich an das Benutzerforum, das mit der Hibernate "
"Website verlinkt ist. Wir bieten auch ein JIRA-Problemverfolgungssystem für "
@@ -126,12 +218,64 @@
"Verbindung."
#. Tag: para
-#, fuzzy, no-c-format
-msgid "If you have questions, use the user forum linked on the Hibernate website. We also provide a JIRA issue tracking system for bug reports and feature requests. If you are interested in the development of Hibernate, join the developer mailing list. If you are interested in translating this documentation into your language, contact us on the developer mailing list."
+#: preface.xml:149
+#, no-c-format
+msgid ""
+"There are a number of ways to become involved in the Hibernate community, "
+"including"
msgstr ""
#. Tag: para
+#: preface.xml:153
#, no-c-format
-msgid "Commercial development support, production support, and training for Hibernate is available through JBoss Inc. (see http://www.hibernate.org/SupportTraining/). Hibernate is a Professional Open Source project and a critical component of the JBoss Enterprise Middleware System (JEMS) suite of products."
+msgid ""
+"Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/"
+"issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
msgstr ""
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid ""
+"Trying your hand at fixing some bugs or implementing enhancements. Again, "
+"see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate."
+"org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid ""
+"<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/"
+"community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid ""
+"There are forums for users to ask questions and receive help from the "
+"community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid ""
+"There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat"
+"\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid ""
+"Helping improve or translate this documentation. Contact us on the developer "
+"mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/query_sql.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/query_sql.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/query_sql.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,11 +285,13 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr "Native SQL"
#. Tag: para
+#: query_sql.xml:33
#, fuzzy, no-c-format
msgid ""
"You can also express queries in the native SQL dialect of your database. "
@@ -305,6 +307,7 @@
"direkten, auf SQL/JDBC basierenden Anwendung zu Hibernate zur Verfügung."
#. Tag: para
+#: query_sql.xml:39
#, fuzzy, no-c-format
msgid ""
"Hibernate3 allows you to specify handwritten SQL, including stored "
@@ -315,11 +318,13 @@
"festlegen."
#. Tag: title
+#: query_sql.xml:43
#, fuzzy, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr "oder als eine <literal>List</literal>,"
#. Tag: para
+#: query_sql.xml:45
#, fuzzy, no-c-format
msgid ""
"Execution of native SQL queries is controlled via the <literal>SQLQuery</"
@@ -333,18 +338,31 @@
"Anfragen."
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr "Skalare Anfragen"
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr ""
"Die grundlegendste SQL-Anfrage erfolgt durch eine Liste von Skalaren "
"(Werten)."
+#. Tag: programlisting
+#: query_sql.xml:56
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+
#. Tag: para
+#: query_sql.xml:58
#, fuzzy, no-c-format
msgid ""
"These will return a List of Object arrays (Object[]) with scalar values for "
@@ -357,6 +375,7 @@
"erhaltenen Skalarwerte ableiten."
#. Tag: para
+#: query_sql.xml:63
#, fuzzy, no-c-format
msgid ""
"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or "
@@ -367,22 +386,40 @@
"vermeiden oder einfach expliziter zu sein, können Sie <literal>addScalar()</"
"literal> verwenden."
+#. Tag: programlisting
+#: query_sql.xml:67
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr "Diese Anfrage spezifiziert:"
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr "den SQL-Anfragen-String"
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr "die wiederzugebenden Spalten und Typen"
#. Tag: para
+#: query_sql.xml:81
#, fuzzy, no-c-format
msgid ""
"This will return Object arrays, but now it will not use "
@@ -401,6 +438,7 @@
"wiedergeben könnte."
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
msgid ""
"It is possible to leave out the type information for all or some of the "
@@ -409,7 +447,22 @@
"Es ist möglich, die Typeninformationen für alle oder einige der Skalare "
"auszulassen."
+#. Tag: programlisting
+#: query_sql.xml:92
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+
#. Tag: para
+#: query_sql.xml:94
#, fuzzy, no-c-format
msgid ""
"This is essentially the same query as before, but now "
@@ -422,6 +475,7 @@
"wird."
#. Tag: para
+#: query_sql.xml:99
#, fuzzy, no-c-format
msgid ""
"How the java.sql.Types returned from ResultSetMetaData is mapped to "
@@ -436,11 +490,13 @@
"Dialekt anzupassen."
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr "Entity-Anfragen"
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
msgid ""
"The above queries were all about returning scalar values, basically "
@@ -453,12 +509,26 @@
"Sie, wie Sie Entity-Objekte von einer nativen SQL-Anfrage mittels "
"<literal>addEntity()</literal> erhalten."
+#. Tag: programlisting
+#: query_sql.xml:114
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr "die von der Anfrage wiedergegebene Entity"
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
msgid ""
"Assuming that Cat is mapped as a class with the columns ID, NAME and "
@@ -470,6 +540,7 @@
"antworten, in der jedes Element eine Entity von Cat ist."
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
msgid ""
"If the entity is mapped with a <literal>many-to-one</literal> to another "
@@ -487,17 +558,30 @@
"wie im folgenden Beispiel für eine <literal>many-to-one</literal> zu "
"<literal>Dog</literal> wollen wir lieber explizit sein:"
+#. Tag: programlisting
+#: query_sql.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+msgstr ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr "Dies ermöglicht die ordnungsgemäße Funktion von cat.getDog()."
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr "Umgang mit Assoziationen und Collections"
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
msgid ""
"It is possible to eagerly join in the <literal>Dog</literal> to avoid the "
@@ -510,7 +594,23 @@
"geschieht mittels der <literal>addJoin()</literal>-Methode, die es Ihnen "
"ermöglicht, eine Assoziation oder Collection zu verbinden."
+#. Tag: programlisting
+#: query_sql.xml:153
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+msgstr ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d \n"
+" WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+
#. Tag: para
+#: query_sql.xml:155
#, fuzzy, no-c-format
msgid ""
"In this example, the returned <literal>Cat</literal>'s will have their "
@@ -528,7 +628,23 @@
"von Collections zu tun, z.B. wenn <literal>Cat</literal> satt dessen eine "
"\"One-to-many\" zu <literal>Dog</literal> hätte."
+#. Tag: programlisting
+#: query_sql.xml:163
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+msgstr ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d\n"
+" WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+
#. Tag: para
+#: query_sql.xml:165
#, fuzzy, no-c-format
msgid ""
"At this stage you are reaching the limits of what is possible with native "
@@ -543,11 +659,13 @@
"Alias-/Spaltennamen nicht ausreichen."
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr "Wiedergabe mehrerer Entities"
#. Tag: para
+#: query_sql.xml:175
#, fuzzy, no-c-format
msgid ""
"Until now, the result set column names are assumed to be the same as the "
@@ -561,6 +679,7 @@
"dieselben Spaltennamen stets in mehr als einer Tabelle vorkommen."
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
msgid ""
"Column alias injection is needed in the following query (which most likely "
@@ -569,7 +688,22 @@
"Spalten Alias-Einspeisung wird bei der folgenden Anfrage benötigt (die aller "
"Wahrscheinlichkeit nach fehlschlagen wird):"
+#. Tag: programlisting
+#: query_sql.xml:183
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+
#. Tag: para
+#: query_sql.xml:185
#, fuzzy, no-c-format
msgid ""
"The query was intended to return two Cat instances per row: a cat and its "
@@ -588,12 +722,28 @@
"Spalten besitzt."
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
msgstr ""
"Die folgende Form ist nicht anfällig für die Duplizierung von Spaltennamen:"
+#. Tag: programlisting
+#: query_sql.xml:195
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
msgid ""
"the SQL query string, with placeholders for Hibernate to inject column "
@@ -603,11 +753,13 @@
"eingespeisten Aliasse"
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr "die von der Anfrage erhaltenen Entities"
#. Tag: para
+#: query_sql.xml:210
#, fuzzy, no-c-format
msgid ""
"The {cat.*} and {mother.*} notation used above is a shorthand for \"all "
@@ -628,12 +780,36 @@
"Sie, dass wir sogar die Property-Aliasse in der \"where\"-Klausel verwenden "
"können, wenn wir das möchten."
+#. Tag: programlisting
+#: query_sql.xml:219
+#, fuzzy, no-c-format
+msgid ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr "Alias- und Property-Referenzen"
#. Tag: para
+#: query_sql.xml:224
#, fuzzy, no-c-format
msgid ""
"In most cases the above alias injection is needed. For queries relating to "
@@ -648,6 +824,7 @@
"einzuspeisen."
#. Tag: para
+#: query_sql.xml:229
#, fuzzy, no-c-format
msgid ""
"The following table shows the different ways you can use the alias "
@@ -661,178 +838,211 @@
"wahrscheinlich unterschiedlichen Namen besitzen."
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr "Alias-Einspeisungsnamen"
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr "Beschreibung"
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr "Syntax"
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr "Beispiel"
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr "Eine einfache Property"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:258
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+msgid "{[aliasname].[propertyname]"
msgstr "{[aliasname].[propertyname]"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:260
#, fuzzy, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "A_NAME as {item.name}"
+msgstr "A_NAME as {item.name}"
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr "Eine zusammengesetzte Property"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:266
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr "{[aliasname].[componentname].[propertyname]}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:268
#, fuzzy, no-c-format
-msgid ""
-"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
-"literal>"
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
msgstr "CURRENCY als {item.amount.currency}, VALUE als {item.amount.value}"
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr "Diskriminator einer Entity"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:275
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "{[aliasname].class}"
+msgstr "{[aliasname].class}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:277
#, fuzzy, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "DISC as {item.class}"
+msgstr "DISC as {item.class}"
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr "Alle Properties einer Entity"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "{[aliasname].*}"
+msgstr "{[aliasname].*}"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<literal>{item.*}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+#. Tag: literal
+#: query_sql.xml:285
+#, no-c-format
+msgid "{item.*}"
+msgstr "{item.*}"
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr "Ein Collection-Schlüssel"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:291
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "{[aliasname].key}"
+msgstr "{[aliasname].key}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:293
#, fuzzy, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "ORGID as {coll.key}"
+msgstr "ORGID als {coll.key}"
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr "Die id einer Collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:299
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "{[aliasname].id}"
+msgstr "{[aliasname].id}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:301
#, fuzzy, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+msgid "EMPID as {coll.id}"
+msgstr "EMPID als {coll.id}"
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr "Das Element einer Collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:307
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
-msgstr "{coll.element.*}"
+msgid "{[aliasname].element}"
+msgstr "{[aliasname].element}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:309
#, fuzzy, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
-msgstr "{coll.element.*}"
+msgid "XID as {coll.element}"
+msgstr "XID als {coll.element}"
#. Tag: entry
+#: query_sql.xml:313
#, fuzzy, no-c-format
msgid "property of the element in the collection"
msgstr "Property des Elements in der Collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:315
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+msgid "{[aliasname].element.[propertyname]}"
msgstr "{[aliasname].element.[propertyname]}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:317
#, fuzzy, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
-msgstr "{coll.element.*}"
+msgid "NAME as {coll.element.name}"
+msgstr "NAME als {coll.element.name}"
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr "Alle Properties des Elements in der Collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:323
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
-msgstr "{coll.element.*}"
+msgid "{[aliasname].element.*}"
+msgstr "{[aliasname].element.*}"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:325
#, fuzzy, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
-msgstr "{coll.element.*}"
+msgid "{coll.element.*}"
+msgstr "{coll.*}"
#. Tag: entry
+#: query_sql.xml:329
#, fuzzy, no-c-format
-msgid "All properties of the the collection"
+msgid "All properties of the collection"
msgstr "Alle Properties der Collection"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<literal>{coll.*}</literal>"
-msgstr "oder als eine <literal>List</literal>,"
+#. Tag: literal
+#: query_sql.xml:333
+#, no-c-format
+msgid "{coll.*}"
+msgstr "{coll.*}"
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr "Wiedergabe nicht gemanagter Entities"
#. Tag: para
+#: query_sql.xml:344
#, fuzzy, no-c-format
msgid ""
"It is possible to apply a ResultTransformer to native SQL queries, allowing "
@@ -841,12 +1051,24 @@
"Es ist möglich, einen ResultTransformer (Ergebnistransformer) an nativen SQL-"
"Anfragen anzuwenden, der die Wiedergabe nicht gemanagter Entities ermöglicht."
+#. Tag: programlisting
+#: query_sql.xml:347
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr "ein Ergebnistransformer"
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
msgid ""
"The above query will return a list of <literal>CatDTO</literal> which has "
@@ -858,11 +1080,13 @@
"entsprechenden Properties oder Felder eingespeist hat."
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr "Umgang mit Vererbung"
#. Tag: para
+#: query_sql.xml:369
#, fuzzy, no-c-format
msgid ""
"Native SQL queries which query for entities that are mapped as part of an "
@@ -874,35 +1098,109 @@
"enthalten."
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr "Parameter"
#. Tag: para
+#: query_sql.xml:377
#, fuzzy, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr ""
"Native SQL-Anfragen unterstützen sowohl positionelle als auch benannte "
"Parameter:"
+#. Tag: programlisting
+#: query_sql.xml:380
+#, fuzzy, no-c-format
+msgid ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr "Benannte SQL-Anfragen"
#. Tag: para
+#: query_sql.xml:387
#, fuzzy, no-c-format
msgid ""
-"Named SQL queries can be defined in the mapping document and called in "
-"exactly the same way as a named HQL query. In this case, you do "
-"<emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
+"Named SQL queries can also be defined in the mapping document and called in "
+"exactly the same way as a named HQL query (see <xref linkend=\"objectstate-"
+"querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> "
+"need to call <literal>addEntity()</literal>."
msgstr ""
"Benannte SQL-Anfragen können im Mapping-Dokument definiert und auf dieselbe "
"Weise wie eine benannte HQL-Anfrage benannt werden. In diesem Fall muss "
"<emphasis>nicht</emphasis> der Aufruf <literal>addEntity()</literal> "
"erfolgen."
+#. Tag: title
+#: query_sql.xml:394
+#, no-c-format
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:397
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, fuzzy, no-c-format
+msgid ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+msgstr ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+
#. Tag: para
+#: query_sql.xml:406
#, fuzzy, no-c-format
msgid ""
"The <literal><return-join></literal> element is use to join "
@@ -913,7 +1211,52 @@
"collection></literal>-Elemente werden verwendet, um Assoziationen zu "
"verbinden bzw. Anfragen, die Collections definieren, zu initialisieren."
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" adddress.STREET AS {address.street},\n"
+" adddress.CITY AS {address.city},\n"
+" adddress.STATE AS {address.state},\n"
+" adddress.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS adddress\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
msgid ""
"A named SQL query may return a scalar value. You must declare the column "
@@ -924,7 +1267,34 @@
"unter Verwendung des <literal><return-scalar></literal>-Elements den "
"Spalten-Alias und den Hibernate-Typ deklarieren:"
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name, \n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name,\n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:426
#, fuzzy, no-c-format
msgid ""
"You can externalize the resultset mapping information in a <literal><"
@@ -937,7 +1307,58 @@
"entweder über mehrere benannte Anfragen hinweg oder durch die "
"<literal>setResultSetMapping()</literal>-API wiederzuverwenden."
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, fuzzy, no-c-format
+msgid ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" adddress.STREET AS {address.street},\n"
+" adddress.CITY AS {address.city},\n"
+" adddress.STATE AS {address.state},\n"
+" adddress.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS adddress\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:438
#, fuzzy, no-c-format
msgid ""
"You can, alternatively, use the resultset mapping information in your hbm "
@@ -947,13 +1368,346 @@
"Dateien direkt in Java Code verwenden."
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, fuzzy, no-c-format
+msgid ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+msgstr ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid ""
+"So far we have only looked at externalizing SQL queries using Hibernate "
+"mapping files. The same concept is also available with anntations and is "
+"called named native queries. You can use <classname>@NamedNativeQuery</"
+"classname> (<classname>@NamedNativeQueries</classname>) in conjunction with "
+"<literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</"
+"literal>). Like <literal>@NamedQuery</literal>, "
+"<classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</"
+"literal> can be defined at class level, but their scope is global to the "
+"application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid ""
+"shows how 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. "
+"In the example 2 entities, <literal>Night</literal> and <literal>Area</"
+"literal>, are returned and each property is declared and associated to a "
+"column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid ""
+"In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set "
+"mapping is implicit. We only describe the entity class of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid ""
+"Finally, 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. This can be seen in "
+"<xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid ""
+"Named SQL query using <classname>@NamedNativeQuery</classname> together with "
+"<classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+" resultSetMapping=\"joinMapping\")\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"implicit\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", \n"
+" query=\"select * from SpaceShip\", \n"
+" resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column = \"name\"),\n"
+" @FieldResult(name=\"model\", column = \"model\"),\n"
+" @FieldResult(name=\"speed\", column = \"speed\"),\n"
+" @FieldResult(name=\"captain.firstname\", column = "
+"\"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column = \"lastn"
+"\"),\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"
+"@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
+#: query_sql.xml:510
+#, no-c-format
+msgid ""
+"If you retrieve a single entity using the default mapping, you can specify "
+"the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip"
+"\", resultClass=SpaceShip.class)\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+"@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension"
+"\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension "
+"from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr ""
"Die Verwendung der Return-Property zur expliziten Spezifizierung von "
"Spalten-/Aliasnamen"
#. Tag: para
+#: query_sql.xml:538
#, fuzzy, no-c-format
msgid ""
"You can explicitly tell Hibernate what column aliases to use with "
@@ -964,7 +1718,36 @@
"anweisen, welche Aliasse es verwenden soll, statt die <literal>{}</literal>-"
"Syntax zu verwenden, bei der Hibernate seine eigenen Aliasse einspeist."
+#. Tag: programlisting
+#: query_sql.xml:543
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:545
#, fuzzy, no-c-format
msgid ""
"<literal><return-property></literal> also works with multiple columns. "
@@ -975,7 +1758,44 @@
"Spalten. Dies löst die Einschränkungen der <literal>{}</literal>-Syntax, die "
"keine feinstufige Steuerung mehrspaltiger Properties erlaubt."
+#. Tag: programlisting
+#: query_sql.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:552
#, fuzzy, no-c-format
msgid ""
"In this example <literal><return-property></literal> was used in "
@@ -988,6 +1808,7 @@
"entscheiden, wie auf Spalten und Properties verwiesen werden soll."
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
msgid ""
"If your mapping has a discriminator you must use <literal><return-"
@@ -998,11 +1819,13 @@
"Diskriminator-Spalte festzulegen."
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr "Die Verwendung gespeicherter Prozeduren für Anfragen"
#. Tag: para
+#: query_sql.xml:565
#, fuzzy, no-c-format
msgid ""
"Hibernate3 provides support for queries via stored procedures and functions. "
@@ -1018,14 +1841,82 @@
"Ein Beispiel für eine solche gespeicherte Funktion in Oracle 9 und späteren "
"Versionen lautet wie folgt:"
+#. Tag: programlisting
+#: query_sql.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+msgstr ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr ""
"Um diese Anfrage in Hibernate zu verwenden, müssen Sie sie durch eine "
"benannte Anfrage mappen."
+#. Tag: programlisting
+#: query_sql.xml:576
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:578
#, fuzzy, no-c-format
msgid ""
"Stored procedures currently only return scalars and entities. <literal><"
@@ -1037,11 +1928,13 @@
"<literal><load-collection></literal> werden nicht unterstützt."
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr "Regeln/Einschränkungen bei der Verwendung gespeicherter Prozeduren"
#. Tag: para
+#: query_sql.xml:585
#, fuzzy, no-c-format
msgid ""
"You cannot use stored procedures with Hibernate unless you follow some "
@@ -1060,6 +1953,7 @@
"für Prozeduren verfügen."
#. Tag: para
+#: query_sql.xml:593
#, fuzzy, no-c-format
msgid ""
"Stored procedure queries cannot be paged with <literal>setFirstResult()/"
@@ -1069,6 +1963,7 @@
"setMaxResults()</literal> seitenweise umgespeichert werden."
#. Tag: para
+#: query_sql.xml:596
#, fuzzy, no-c-format
msgid ""
"The recommended call form is standard SQL92: <literal>{ ? = call functionName"
@@ -1081,11 +1976,13 @@
"unterstützt."
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr "Für Oracle gelten die folgenden Regeln:"
#. Tag: para
+#: query_sql.xml:605
#, fuzzy, no-c-format
msgid ""
"A function must return a result set. The first parameter of a procedure must "
@@ -1102,11 +1999,13 @@
"Literatur zu Oracle."
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr "Für Sybase oder MS SQL Server gelten die folgenden Regeln:"
#. Tag: para
+#: query_sql.xml:618
#, fuzzy, no-c-format
msgid ""
"The procedure must return a result set. Note that since these servers can "
@@ -1121,6 +2020,7 @@
"Ergebnissatz darstellt. Alles andere wird verworfen."
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
msgid ""
"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it "
@@ -1131,6 +2031,7 @@
"Voraussetzung."
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr ""
@@ -1138,68 +2039,179 @@
"\" (aktualisieren) und \"delete\" (löschen)"
#. Tag: para
+#: query_sql.xml:638
#, no-c-format
msgid ""
"Hibernate3 can use custom SQL for create, update, and delete operations. The "
"SQL can be overridden at the statement level or inidividual column level. "
"This section describes statement overrides. For columns, see <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-"
+"annotations\"/> shows how to define custom SQL operatons using annotations."
msgstr ""
+#. Tag: title
+#: query_sql.xml:646
+#, no-c-format
+msgid "Custom CRUD via annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:648
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"@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"
+"@Loader(namedQuery = \"chaos\")\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
+#: query_sql.xml:651
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can "
+"be achieved using Hibernate mapping files and the <literal><sql-insert>"
+"</literal>, <literal><sql-update></literal> and <literal><sql-"
+"delete></literal> nodes. This can be seen in <xref linkend=\"example-"
+"custom-crdu-via-xml\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
#, fuzzy, no-c-format
msgid ""
-"The class and collection persisters in Hibernate already contain a set of "
-"configuration time generated strings (insertsql, deletesql, updatesql etc.). "
-"The mapping tags <literal><sql-insert></literal>, <literal><sql-"
-"delete></literal>, and <literal><sql-update></literal> override "
-"these strings:"
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
msgstr ""
-"Hibernate3 kann angepasste SQL-Anweisungen für \"create\", \"update\", und "
-"\"delete\" Vorgänge verwenden. Die Klassen- und Collection-Persister in "
-"Hibernate enthalten bereits einen Satz von zur Konfigurationszeit "
-"generierten Strings (insertsql, deletesql, updatesql usw.). Die Mapping-Tags "
-"<literal><sql-insert></literal>, <literal><sql-delete></literal> "
-"und <literal><sql-update></literal> setzen diese Strings außer Kraft:"
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
#. Tag: para
-#, fuzzy, no-c-format
+#: query_sql.xml:666
+#, no-c-format
msgid ""
-"The SQL is directly executed in your database, so you can use any dialect "
-"you like. This will reduce the portability of your mapping if you use "
-"database specific SQL."
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to <constant>true</constant>. In "
+"annotations as well as in xml."
msgstr ""
-"Die SQL wird direkt in Ihrer Datenbank ausgeführt, Sie können daher jeden "
-"beliebigen Dialekt verwenden. Dies wird natürlich die Übertragbarkeit Ihres "
-"Mappings reduzieren, wenn Sie Datenbank-spezifische SQL benutzen."
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
msgid ""
-"Stored procedures are supported if the <literal>callable</literal> attribute "
-"is set:"
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
msgstr ""
-"Gespeicherte Prozeduren werden unterstützt, wenn das <literal>callable</"
-"literal>-Attribut wie folgt eingestellt ist:"
#. Tag: para
-#, fuzzy, no-c-format
+#: query_sql.xml:675
+#, no-c-format
msgid ""
-"The order of the positional parameters is vital, as they must be in the same "
-"sequence as Hibernate expects them."
+"none: no check is performed: the store procedure is expected to fail upon "
+"issues"
msgstr ""
-"Die Reihenfolge der positionellen Parameter ist gegenwärtig entscheidend, da "
-"sie dieselbe Sequenz besitzen müssen, wie Hibernate sie erwartet."
#. Tag: para
+#: query_sql.xml:680
+#, no-c-format
+msgid "count: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:685
+#, no-c-format
+msgid ""
+"param: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:690
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal> parameter "
+"which is again available in annoations as well as in xml."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:693
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations respectively xml nodes to "
+"override the collection related statements -see <xref linkend=\"example-"
+"overriding-sql-collections-annotations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:698
+#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?"
+"\")\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:705
#, fuzzy, no-c-format
msgid ""
-"You can view 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 view the expected sequence, do not include "
-"your custom SQL in the mapping files, as this will override the Hibernate "
-"generated static SQL."
+"The parameter order is important and is defined by the order Hibernate "
+"handles 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 or mapping files "
+"as that will override the Hibernate generated static sql)"
msgstr ""
"Sie können die erwartete Reihenfolge sehen, indem Sie Debug-Protokollierung "
"für die<literal>org.hibernate.persister.entity</literal>-Ebene aktivieren. "
@@ -1210,13 +2222,68 @@
"generierte statische sql außer Kraft setzt)."
#. Tag: para
+#: query_sql.xml:715
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>@org.hibernate.annotations.Table</literal> and either (or all) "
+"attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"@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"
+" sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values"
+"(upper(?), ?)\") )\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:726
+#, no-c-format
+msgid ""
+"The previous example also shows that you can give a comment to a given table "
+"(primary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:731
#, fuzzy, no-c-format
msgid ""
-"The stored procedures are in most cases required to return the number of "
-"rows inserted, updated and deleted, as Hibernate has some runtime checks for "
-"the success of the statement. Hibernate always registers the first statement "
-"parameter as a numeric output parameter for the CUD operations:"
+"The SQL is directly executed in your database, so you can use any dialect "
+"you like. This will, however, reduce the portability of your mapping if you "
+"use database specific SQL."
msgstr ""
+"Die SQL wird direkt in Ihrer Datenbank ausgeführt, Sie können daher jeden "
+"beliebigen Dialekt verwenden. Dies wird natürlich die Übertragbarkeit Ihres "
+"Mappings reduzieren, wenn Sie Datenbank-spezifische SQL benutzen."
+
+#. Tag: para
+#: query_sql.xml:736
+#, fuzzy, no-c-format
+msgid ""
+"Last but not least, stored procedures are in most cases required to return "
+"the number of rows inserted, updated and deleted. Hibernate always registers "
+"the first statement parameter as a numeric output parameter for the CUD "
+"operations:"
+msgstr ""
"Die gespeicherten Prozeduren sind in den meisten Fällen (bzw. fast immer) "
"für die Wiedergabe der Anzahl von eingefügten/aktualisierten/gelöschten "
"Reihen erforderlich, da Hibernate einige Runtime-Überprüfungen hinsichtlich "
@@ -1224,21 +2291,82 @@
"Anweisungsparameter als numerischen Ausgabeparameter für die CUD-Vorgänge:"
#. Tag: title
+#: query_sql.xml:742
#, no-c-format
+msgid "Stored procedures and their return value"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:744
+#, fuzzy, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+msgstr ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
msgid "Custom SQL for loading"
msgstr "Angepasste SQL für das Laden"
#. Tag: para
+#: query_sql.xml:751
#, no-c-format
msgid ""
"You can also declare your own SQL (or HQL) queries for entity loading. As "
"with inserts, updates, and deletes, this can be done at the individual "
-"column level as described in <xref linkend=\"mapping-column-read-and-write"
-"\" /> or at the statement level. Here is an example of a statement level "
+"column level as described in <xref linkend=\"mapping-column-read-and-write\"/"
+"> or at the statement level. Here is an example of a statement level "
"override:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:757
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:759
#, fuzzy, no-c-format
msgid ""
"This is just a named query declaration, as discussed earlier. You can "
@@ -1248,18 +2376,77 @@
"erläutert. Sie können auf diese benannte Anfrage in einem Klassen-Mapping "
"verweisen:"
+#. Tag: programlisting
+#: query_sql.xml:762
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+
#. Tag: para
+#: query_sql.xml:764
#, no-c-format
msgid "This even works with stored procedures."
msgstr "Das funktioniert sogar mit gespeicherten Prozeduren."
#. Tag: para
+#: query_sql.xml:766
#, fuzzy, no-c-format
msgid "You can even define a query for collection loading:"
msgstr ""
"Sie können sogar eine Anfrage für das Laden von Collections definieren:"
+#. Tag: programlisting
+#: query_sql.xml:768
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+msgstr ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+
+#. Tag: programlisting
+#: query_sql.xml:770
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:772
#, fuzzy, no-c-format
msgid ""
"You can also define an entity loader that loads a collection by join "
@@ -1268,526 +2455,144 @@
"Sie könnten sogar einen Entity-Loader definieren, der eine Collection "
"mittels \"Join-Fetching\" lädt:"
-#, fuzzy
-#~ msgid ""
-#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
-#~ msgstr ""
-#~ "Sie können auch Ihre eigenen SQL (oder HQL)-Anfragen für das Laden von "
-#~ "Entities deklarieren:"
+#. Tag: programlisting
+#: query_sql.xml:775
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid ""
+"The annotation equivalent <literal><loader></literal> is the @Loader "
+"annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/"
+">."
+msgstr ""
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\", Hibernate.STRING)\n"
-#~ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\", Hibernate.STRING)\n"
-#~ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+#~ msgid "<literal>A_NAME as {item.name}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\")\n"
-#~ " .addScalar(\"BIRTHDATE\")\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\")\n"
-#~ " .addScalar(\"BIRTHDATE\")"
+#~ msgid "<literal>{[aliasname].class}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat."
-#~ "class);\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity"
-#~ "(Cat.class);\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity"
-#~ "(Cat.class);"
+#~ msgid "<literal>DISC as {item.class}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM "
-#~ "CATS\").addEntity(Cat.class);\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
-#~ "addEntity(Cat.class);"
+#~ msgid "<literal>{[aliasname].*}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, "
-#~ "D_ID, D_NAME FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dog\");\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
-#~ "FROM CATS c, DOGS d \n"
-#~ " WHERE c.DOG_ID = d.D_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dog\");"
+#~ msgid "<literal>{item.*}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, "
-#~ "CAT_ID FROM CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dogs\");\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID "
-#~ "FROM CATS c, DOGS d\n"
-#~ " WHERE c.ID = d.CAT_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dogs\");"
+#~ msgid "<literal>{[aliasname].key}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE "
-#~ "c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c."
-#~ "MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)"
+#~ msgid "<literal>ORGID as {coll.key}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, "
-#~ "CATS m WHERE c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m "
-#~ "WHERE c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)"
+#~ msgid "<literal>{[aliasname].id}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
-#~ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother."
-#~ "*} \" +\n"
-#~ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
-#~ "\n"
-#~ "List loggedCats = sess.createSQLQuery(sql)\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class).list()\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
-#~ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother."
-#~ "*} \" +\n"
-#~ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
-#~ "\n"
-#~ "List loggedCats = sess.createSQLQuery(sql)\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class).list()"
+#~ msgid "<literal>EMPID as {coll.id}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid "A_NAME as {item.name}"
-#~ msgstr "A_NAME as {item.name}"
+#~ msgid "<literal>{[aliasname].element}</literal>"
+#~ msgstr "{coll.element.*}"
#, fuzzy
-#~ msgid "{[aliasname].class}"
-#~ msgstr "{[aliasname].class}"
+#~ msgid "<literal>XID as {coll.element}</literal>"
+#~ msgstr "{coll.element.*}"
#, fuzzy
-#~ msgid "DISC as {item.class}"
-#~ msgstr "DISC as {item.class}"
+#~ msgid "<literal>NAME as {coll.element.name}</literal>"
+#~ msgstr "{coll.element.*}"
#, fuzzy
-#~ msgid "{[aliasname].*}"
-#~ msgstr "{[aliasname].*}"
+#~ msgid "<literal>{[aliasname].element.*}</literal>"
+#~ msgstr "{coll.element.*}"
-#~ msgid "{item.*}"
-#~ msgstr "{item.*}"
-
#, fuzzy
-#~ msgid "{[aliasname].key}"
-#~ msgstr "{[aliasname].key}"
+#~ msgid "<literal>{coll.element.*}</literal>"
+#~ msgstr "{coll.element.*}"
#, fuzzy
-#~ msgid "ORGID as {coll.key}"
-#~ msgstr "ORGID als {coll.key}"
+#~ msgid "<literal>{coll.*}</literal>"
+#~ msgstr "oder als eine <literal>List</literal>,"
#, fuzzy
-#~ msgid "{[aliasname].id}"
-#~ msgstr "{[aliasname].id}"
-
-#, fuzzy
-#~ msgid "EMPID as {coll.id}"
-#~ msgstr "EMPID als {coll.id}"
-
-#, fuzzy
-#~ msgid "{[aliasname].element}"
-#~ msgstr "{[aliasname].element}"
-
-#, fuzzy
-#~ msgid "XID as {coll.element}"
-#~ msgstr "XID als {coll.element}"
-
-#, fuzzy
-#~ msgid "NAME as {coll.element.name}"
-#~ msgstr "NAME als {coll.element.name}"
-
-#, fuzzy
-#~ msgid "{[aliasname].element.*}"
-#~ msgstr "{[aliasname].element.*}"
-
-#, fuzzy
-#~ msgid "{coll.element.*}"
-#~ msgstr "{coll.*}"
-
-#~ msgid "{coll.*}"
-#~ msgstr "{coll.*}"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
-#~ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))]]>"
+#~ "The class and collection persisters in Hibernate already contain a set of "
+#~ "configuration time generated strings (insertsql, deletesql, updatesql "
+#~ "etc.). The mapping tags <literal><sql-insert></literal>, "
+#~ "<literal><sql-delete></literal>, and <literal><sql-update></"
+#~ "literal> override these strings:"
#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
-#~ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+#~ "Hibernate3 kann angepasste SQL-Anweisungen für \"create\", \"update\", "
+#~ "und \"delete\" Vorgänge verwenden. Die Klassen- und Collection-Persister "
+#~ "in Hibernate enthalten bereits einen Satz von zur Konfigurationszeit "
+#~ "generierten Strings (insertsql, deletesql, updatesql usw.). Die Mapping-"
+#~ "Tags <literal><sql-insert></literal>, <literal><sql-delete></"
+#~ "literal> und <literal><sql-update></literal> setzen diese Strings "
+#~ "außer Kraft:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE "
-#~ "NAME like ?\").addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(0, \"Pus%\").list();\n"
-#~ " \n"
-#~ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
-#~ "addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(\"name\", \"Pus%\").list(); ]]>"
+#~ "Stored procedures are supported if the <literal>callable</literal> "
+#~ "attribute is set:"
#~ msgstr ""
-#~ "Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?"
-#~ "\").addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(0, \"Pus%\").list();\n"
-#~ " \n"
-#~ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
-#~ "addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(\"name\", \"Pus%\").list();"
+#~ "Gespeicherte Prozeduren werden unterstützt, wenn das <literal>callable</"
+#~ "literal>-Attribut wie folgt eingestellt ist:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"persons\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex}\n"
-#~ " FROM PERSON person\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
+#~ "The order of the positional parameters is vital, as they must be in the "
+#~ "same sequence as Hibernate expects them."
#~ msgstr ""
-#~ "<sql-query name=\"persons\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex}\n"
-#~ " FROM PERSON person\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
+#~ "Die Reihenfolge der positionellen Parameter ist gegenwärtig entscheidend, "
+#~ "da sie dieselbe Sequenz besitzen müssen, wie Hibernate sie erwartet."
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[List people = sess.getNamedQuery(\"persons\")\n"
-#~ " .setString(\"namePattern\", namePattern)\n"
-#~ " .setMaxResults(50)\n"
-#~ " .list();]]>"
+#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
#~ msgstr ""
-#~ "List people = sess.getNamedQuery(\"persons\")\n"
-#~ " .setString(\"namePattern\", namePattern)\n"
-#~ " .setMaxResults(50)\n"
-#~ " .list();"
+#~ "Sie können auch Ihre eigenen SQL (oder HQL)-Anfragen für das Laden von "
+#~ "Entities deklarieren:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"personsWith\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " address.STREET AS {address.street},\n"
-#~ " address.CITY AS {address.city},\n"
-#~ " address.STATE AS {address.state},\n"
-#~ " address.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS address\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"personsWith\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/"
-#~ ">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " adddress.STREET AS {address.street},\n"
-#~ " adddress.CITY AS {address.city},\n"
-#~ " adddress.STATE AS {address.state},\n"
-#~ " adddress.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS adddress\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"mySqlQuery\">\n"
-#~ " <return-scalar column=\"name\" type=\"string\"/>\n"
-#~ " <return-scalar column=\"age\" type=\"long\"/>\n"
-#~ " SELECT p.NAME AS name,\n"
-#~ " p.AGE AS age,\n"
-#~ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"mySqlQuery\">\n"
-#~ " <return-scalar column=\"name\" type=\"string\"/>\n"
-#~ " <return-scalar column=\"age\" type=\"long\"/>\n"
-#~ " SELECT p.NAME AS name,\n"
-#~ " p.AGE AS age,\n"
-#~ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<resultset name=\"personAddress\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
-#~ "</resultset>\n"
-#~ "\n"
-#~ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " address.STREET AS {address.street},\n"
-#~ " address.CITY AS {address.city},\n"
-#~ " address.STATE AS {address.state},\n"
-#~ " address.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS address\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<resultset name=\"personAddress\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/"
-#~ ">\n"
-#~ "</resultset>\n"
-#~ "\n"
-#~ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " adddress.STREET AS {address.street},\n"
-#~ " adddress.CITY AS {address.city},\n"
-#~ " adddress.STATE AS {address.state},\n"
-#~ " adddress.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS adddress\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = sess.createSQLQuery(\n"
-#~ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where "
-#~ "kitten.mother = cat.id\"\n"
-#~ " )\n"
-#~ " .setResultSetMapping(\"catAndKitten\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "List cats = sess.createSQLQuery(\n"
-#~ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where "
-#~ "kitten.mother = cat.id\"\n"
-#~ " )\n"
-#~ " .setResultSetMapping(\"catAndKitten\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"mySqlQuery\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\">\n"
-#~ " <return-property name=\"name\" column=\"myName\"/>\n"
-#~ " <return-property name=\"age\" column=\"myAge\"/>\n"
-#~ " <return-property name=\"sex\" column=\"mySex\"/>\n"
-#~ " </return>\n"
-#~ " SELECT person.NAME AS myName,\n"
-#~ " person.AGE AS myAge,\n"
-#~ " person.SEX AS mySex,\n"
-#~ " FROM PERSON person WHERE person.NAME LIKE :name\n"
-#~ "</sql-query>\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"mySqlQuery\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\">\n"
-#~ " <return-property name=\"name\" column=\"myName\"/>\n"
-#~ " <return-property name=\"age\" column=\"myAge\"/>\n"
-#~ " <return-property name=\"sex\" column=\"mySex\"/>\n"
-#~ " </return>\n"
-#~ " SELECT person.NAME AS myName,\n"
-#~ " person.AGE AS myAge,\n"
-#~ " person.SEX AS mySex,\n"
-#~ " FROM PERSON person WHERE person.NAME LIKE :name\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"organizationCurrentEmployments\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
-#~ " </return>\n"
-#~ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
-#~ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
-#~ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT\n"
-#~ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
-#~ " ORDER BY STARTDATE ASC\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"organizationCurrentEmployments\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
-#~ " </return>\n"
-#~ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
-#~ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
-#~ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT\n"
-#~ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
-#~ " ORDER BY STARTDATE ASC\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[CREATE OR REPLACE FUNCTION selectAllEmployments\n"
-#~ " RETURN SYS_REFCURSOR\n"
-#~ "AS\n"
-#~ " st_cursor SYS_REFCURSOR;\n"
-#~ "BEGIN\n"
-#~ " OPEN st_cursor FOR\n"
-#~ " SELECT EMPLOYEE, EMPLOYER,\n"
-#~ " STARTDATE, ENDDATE,\n"
-#~ " REGIONCODE, EID, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT;\n"
-#~ " RETURN st_cursor;\n"
-#~ " END;]]>"
-#~ msgstr ""
-#~ "CREATE OR REPLACE FUNCTION selectAllEmployments\n"
-#~ " RETURN SYS_REFCURSOR\n"
-#~ "AS\n"
-#~ " st_cursor SYS_REFCURSOR;\n"
-#~ "BEGIN\n"
-#~ " OPEN st_cursor FOR\n"
-#~ " SELECT EMPLOYEE, EMPLOYER,\n"
-#~ " STARTDATE, ENDDATE,\n"
-#~ " REGIONCODE, EID, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT;\n"
-#~ " RETURN st_cursor;\n"
-#~ " END;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
-#~ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
-#~ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
-#~ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
-#~ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
-#~ " <return-property name=\"id\" column=\"EID\"/>\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " </return>\n"
-#~ " { ? = call selectAllEmployments() }\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
-#~ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
-#~ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
-#~ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
-#~ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/"
-#~ ">\n"
-#~ " <return-property name=\"id\" column=\"EID\"/>\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " </return>\n"
-#~ " { ? = call selectAllEmployments() }\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<class name=\"Person\">\n"
#~ " <id name=\"id\">\n"
#~ " <generator class=\"increment\"/>\n"
#~ " </id>\n"
#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</sql-"
-#~ "insert>\n"
-#~ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-update>\n"
-#~ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
-#~ "</sql-insert>\n"
-#~ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
-#~ "update>\n"
-#~ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
#~ " <sql-insert callable=\"true\">{call createPerson (?, ?)}</sql-"
#~ "insert>\n"
#~ " <sql-delete callable=\"true\">{? = call deletePerson (?)}</sql-"
@@ -1808,126 +2613,3 @@
#~ " <sql-update callable=\"true\">{? = call updatePerson (?, ?)}"
#~ "</sql-update>\n"
#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN "
-#~ "VARCHAR2)\n"
-#~ " RETURN NUMBER IS\n"
-#~ "BEGIN\n"
-#~ "\n"
-#~ " update PERSON\n"
-#~ " set\n"
-#~ " NAME = uname,\n"
-#~ " where\n"
-#~ " ID = uid;\n"
-#~ "\n"
-#~ " return SQL%ROWCOUNT;\n"
-#~ "\n"
-#~ "END updatePerson;]]>"
-#~ msgstr ""
-#~ "CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN "
-#~ "VARCHAR2)\n"
-#~ " RETURN NUMBER IS\n"
-#~ "BEGIN\n"
-#~ "\n"
-#~ " update PERSON\n"
-#~ " set\n"
-#~ " NAME = uname,\n"
-#~ " where\n"
-#~ " ID = uid;\n"
-#~ "\n"
-#~ " return SQL%ROWCOUNT;\n"
-#~ "\n"
-#~ "END updatePerson;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
-#~ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
-#~ " FROM PERSON\n"
-#~ " WHERE ID=?\n"
-#~ " FOR UPDATE\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/"
-#~ ">\n"
-#~ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
-#~ " FROM PERSON\n"
-#~ " WHERE ID=?\n"
-#~ " FOR UPDATE\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <loader query-ref=\"person\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <loader query-ref=\"person\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"employments\" inverse=\"true\">\n"
-#~ " <key/>\n"
-#~ " <one-to-many class=\"Employment\"/>\n"
-#~ " <loader query-ref=\"employments\"/>\n"
-#~ "</set>]]>"
-#~ msgstr ""
-#~ "<set name=\"employments\" inverse=\"true\">\n"
-#~ " <key/>\n"
-#~ " <one-to-many class=\"Employment\"/>\n"
-#~ " <loader query-ref=\"employments\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"employments\">\n"
-#~ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
-#~ " SELECT {emp.*}\n"
-#~ " FROM EMPLOYMENT emp\n"
-#~ " WHERE EMPLOYER = :id\n"
-#~ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"employments\">\n"
-#~ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
-#~ " SELECT {emp.*}\n"
-#~ " FROM EMPLOYMENT emp\n"
-#~ " WHERE EMPLOYER = :id\n"
-#~ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\"/>\n"
-#~ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
-#~ " SELECT NAME AS {pers.*}, {emp.*}\n"
-#~ " FROM PERSON pers\n"
-#~ " LEFT OUTER JOIN EMPLOYMENT emp\n"
-#~ " ON pers.ID = emp.PERSON_ID\n"
-#~ " WHERE ID=?\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\"/>\n"
-#~ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
-#~ " SELECT NAME AS {pers.*}, {emp.*}\n"
-#~ " FROM PERSON pers\n"
-#~ " LEFT OUTER JOIN EMPLOYMENT emp\n"
-#~ " ON pers.ID = emp.PERSON_ID\n"
-#~ " WHERE ID=?\n"
-#~ "</sql-query>"
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/session_api.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/session_api.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/session_api.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,11 +285,13 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "Das Arbeiten mit Objekten"
#. Tag: para
+#: session_api.xml:33
#, fuzzy, no-c-format
msgid ""
"Hibernate is a full object/relational mapping solution that not only shields "
@@ -308,6 +310,7 @@
"Anwendungen."
#. Tag: para
+#: session_api.xml:40
#, no-c-format
msgid ""
"In other words, Hibernate application developers should always think about "
@@ -323,17 +326,20 @@
"Bedeutung, wenn die Performance des Systems eingestellt wird."
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "Statusarten von Hibernate Objekten"
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr ""
"Hibernate definiert und unterstützt die folgenden Arten des Objektstatus:"
#. Tag: para
+#: session_api.xml:53
#, fuzzy, no-c-format
msgid ""
"<emphasis>Transient</emphasis> - an object is transient if it has just been "
@@ -358,6 +364,7 @@
"Wechsel nötig sind)."
#. Tag: para
+#: session_api.xml:65
#, fuzzy, no-c-format
msgid ""
"<emphasis>Persistent</emphasis> - a persistent instance has a representation "
@@ -380,6 +387,7 @@
"wenn ein Objekt transient gemacht werden soll."
#. Tag: para
+#: session_api.xml:77
#, fuzzy, no-c-format
msgid ""
"<emphasis>Detached</emphasis> - a detached instance is an object that has "
@@ -405,6 +413,7 @@
"Sicht des Benutzers."
#. Tag: para
+#: session_api.xml:90
#, fuzzy, no-c-format
msgid ""
"We will now discuss the states and state transitions (and the Hibernate "
@@ -414,14 +423,16 @@
"Methoden, die einen Wechsel auslösen) ein."
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "Objekte persistent machen"
#. Tag: para
+#: session_api.xml:97
#, fuzzy, no-c-format
msgid ""
-"Newly instantiated instances of a a persistent class are considered "
+"Newly instantiated instances of a persistent class are considered "
"<emphasis>transient</emphasis> by Hibernate. We can make a transient "
"instance <emphasis>persistent</emphasis> by associating it with a session:"
msgstr ""
@@ -430,7 +441,24 @@
"Instanz jedoch <emphasis>persistent</emphasis> machen, indem wir sie mit "
"einer Session assoziieren:"
+#. Tag: programlisting
+#: session_api.xml:102
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+
#. Tag: para
+#: session_api.xml:104
#, fuzzy, no-c-format
msgid ""
"If <literal>Cat</literal> has a generated identifier, the identifier is "
@@ -452,6 +480,7 @@
"verwenden, mit der Semantik der frühen EJB3-Fassung."
#. Tag: para
+#: session_api.xml:115
#, no-c-format
msgid ""
"<literal>persist()</literal> makes a transient instance persistent. However, "
@@ -464,6 +493,7 @@
msgstr ""
#. Tag: para
+#: session_api.xml:126
#, no-c-format
msgid ""
"<literal>save()</literal> does guarantee to return an identifier. If an "
@@ -474,6 +504,7 @@
msgstr ""
#. Tag: para
+#: session_api.xml:135
#, fuzzy, no-c-format
msgid ""
"Alternatively, you can assign the identifier using an overloaded version of "
@@ -482,7 +513,28 @@
"Alternativ können Sie den Bezeichner unter Verwendung einer überladenen "
"Version von <literal>save()</literal> zuordnen."
+#. Tag: programlisting
+#: session_api.xml:138
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+msgstr ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+
#. Tag: para
+#: session_api.xml:140
#, fuzzy, no-c-format
msgid ""
"If the object you make persistent has associated objects (e.g. the "
@@ -503,6 +555,7 @@
"<literal>save()</literal> die Objekte in der falschen Reihenfolge speichern."
#. Tag: para
+#: session_api.xml:148
#, fuzzy, no-c-format
msgid ""
"Usually you do not bother with this detail, as you will normally use "
@@ -519,11 +572,13 @@
"diesem Kapitel noch näher auf transitive Persistenz ein."
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr "Das Laden eines Objekts"
#. Tag: para
+#: session_api.xml:159
#, fuzzy, no-c-format
msgid ""
"The <literal>load()</literal> methods of <literal>Session</literal> provide "
@@ -537,12 +592,46 @@
"und lädt den Status in eine neu instantiierte Instanz der Klasse, in "
"persistentem Zustand."
+#. Tag: programlisting
+#: session_api.xml:165
+#, fuzzy, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, fuzzy, no-c-format
+msgid ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr "Alternativ können Sie den Status in eine beliebige Instanz laden:"
+#. Tag: programlisting
+#: session_api.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+msgstr ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+
#. Tag: para
+#: session_api.xml:173
#, fuzzy, no-c-format
msgid ""
"Be aware that <literal>load()</literal> will throw an unrecoverable "
@@ -565,6 +654,7 @@
"size</literal> für das Klassen-Mapping definiert ist."
#. Tag: para
+#: session_api.xml:182
#, fuzzy, no-c-format
msgid ""
"If you are not certain that a matching row exists, you should use the "
@@ -576,7 +666,26 @@
"die Datenbank zugreift und mit einer Nullmeldung reagiert, falls keine "
"passende Reihe existiert."
+#. Tag: programlisting
+#: session_api.xml:186
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+msgstr ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+
#. Tag: para
+#: session_api.xml:188
#, fuzzy, no-c-format
msgid ""
"You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</"
@@ -587,7 +696,14 @@
"literal> laden, indem Sie einen <literal>LockMode</literal> verwenden. Siehe "
"dazu auch die API-Dokumentation."
+#. Tag: programlisting
+#: session_api.xml:192
+#, fuzzy, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+
#. Tag: para
+#: session_api.xml:194
#, fuzzy, no-c-format
msgid ""
"Any associated instances or contained collections will <emphasis>not</"
@@ -602,6 +718,7 @@
"Cascade Style\")."
#. Tag: para
+#: session_api.xml:199
#, no-c-format
msgid ""
"It is possible to re-load an object and all its collections at any time, "
@@ -613,13 +730,26 @@
"dann von Nutzen, wenn Datenbank-Trigger zur Initialisierung der Objekt-"
"Properties verwendet werden."
+#. Tag: programlisting
+#: session_api.xml:204
+#, fuzzy, no-c-format
+msgid ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+
#. Tag: para
+#: session_api.xml:206
#, fuzzy, no-c-format
msgid ""
"How much does Hibernate load from the database and how many SQL "
"<literal>SELECT</literal>s will it use? This depends on the "
"<emphasis>fetching strategy</emphasis>. This is explained in <xref linkend="
-"\"performance-fetching\" />."
+"\"performance-fetching\"/>."
msgstr ""
"An diesem Punkt stellt sich eine wichtige Frage: Wie viel lädt Hibernate aus "
"der Datenbank und wie viele SQL <literal>SELECT</literal>s werden verwendet? "
@@ -628,11 +758,13 @@
"erläutert."
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "Anfragen"
#. Tag: para
+#: session_api.xml:215
#, fuzzy, no-c-format
msgid ""
"If you do not know the identifiers of the objects you are looking for, you "
@@ -652,11 +784,13 @@
"Ergebnissatzes in die Objekte ausdrücken."
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "Ausführen von Anfragen"
#. Tag: para
+#: session_api.xml:226
#, no-c-format
msgid ""
"HQL and native SQL queries are represented with an instance of <literal>org."
@@ -671,7 +805,62 @@
"und für das Ausführen der tatsächlichen Anfrage. Sie können mittels der "
"<literal>Session</literal> immer eine <literal>Query</literal> erhalten:"
+#. Tag: programlisting
+#: session_api.xml:232
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+
#. Tag: para
+#: session_api.xml:234
#, fuzzy, no-c-format
msgid ""
"A query is usually executed by invoking <literal>list()</literal>. The "
@@ -696,11 +885,13 @@
"<literal>Set</literal> jedoch ganz einfach filtern."
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "Iterationsergebnisse"
#. Tag: para
+#: session_api.xml:246
#, fuzzy, no-c-format
msgid ""
"Occasionally, you might be able to achieve better performance by executing "
@@ -724,12 +915,46 @@
"lediglich mit den Bezeichnern reagiert und <emphasis>n</emphasis> "
"zusätzliche Auswahlen zur Initialisierung der tatsächlichen Instanzen."
+#. Tag: programlisting
+#: session_api.xml:257
+#, fuzzy, no-c-format
+msgid ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+msgstr ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "Anfragen, die mit Tupeln reagieren"
#. Tag: para
+#: session_api.xml:263
#, fuzzy, no-c-format
msgid ""
"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
@@ -738,12 +963,44 @@
"Hibernate Anfragen reagieren manchmal mit Tupeln (d.h. einer Liste "
"korrelierter Datenwerte), wobei jeder Tupel als Array wiedergegeben wird:"
+#. Tag: programlisting
+#: session_api.xml:266
+#, fuzzy, no-c-format
+msgid ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}"
+msgstr ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = tuple[0];\n"
+" Cat mother = tuple[1];\n"
+" ....\n"
+"}"
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "Skalare Ergebnisse"
#. Tag: para
+#: session_api.xml:272
#, fuzzy, no-c-format
msgid ""
"Queries can specify a property of a class in the <literal>select</literal> "
@@ -755,12 +1012,48 @@
"Properties oder Datengruppen werden als \"skalare\" Ergebnisse angesehen "
"(und nicht als Entities in persistentem Zustand)."
+#. Tag: programlisting
+#: session_api.xml:277
+#, fuzzy, no-c-format
+msgid ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+msgstr ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "Bind-Parameter"
#. Tag: para
+#: session_api.xml:283
#, fuzzy, no-c-format
msgid ""
"Methods on <literal>Query</literal> are provided for binding values to named "
@@ -777,6 +1070,7 @@
"sind:"
#. Tag: para
+#: session_api.xml:292
#, no-c-format
msgid ""
"named parameters are insensitive to the order they occur in the query string"
@@ -785,21 +1079,77 @@
"sie im Anfragenstring erscheinen"
#. Tag: para
+#: session_api.xml:297
#, fuzzy, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "sie können innerhalb derselben Anfrage mehrere Male vorkommen"
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "sie dokumentieren sich selbst"
+#. Tag: programlisting
+#: session_api.xml:305
+#, fuzzy, no-c-format
+msgid ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, fuzzy, no-c-format
+msgid ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, fuzzy, no-c-format
+msgid ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+msgstr ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "Nummerierung"
#. Tag: para
+#: session_api.xml:315
#, fuzzy, no-c-format
msgid ""
"If you need to specify bounds upon your result set, that is, the maximum "
@@ -811,7 +1161,22 @@
"erhalten wollen), sollten Sie Methoden des <literal>Query</literal>-"
"Interface verwenden:"
+#. Tag: programlisting
+#: session_api.xml:320
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+msgstr ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
msgid ""
"Hibernate knows how to translate this limit query into the native SQL of "
@@ -821,11 +1186,13 @@
"übersetzen ist."
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr "Scrollbare Iteration"
#. Tag: para
+#: session_api.xml:329
#, fuzzy, no-c-format
msgid ""
"If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the "
@@ -838,7 +1205,60 @@
"<literal>ScrollableResults</literal>-Objekt zu erhalten, das die flexible "
"Navigation der Anfragenergebnisse ermöglicht."
+#. Tag: programlisting
+#: session_api.xml:334
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+msgstr ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+
#. Tag: para
+#: session_api.xml:336
#, fuzzy, no-c-format
msgid ""
"Note that an open database connection and cursor is required for this "
@@ -851,27 +1271,115 @@
"Nummerierungsfunktionalität benötigen."
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "Externalisierung benannter Anfragen"
#. Tag: para
+#: session_api.xml:345
+#, no-c-format
+msgid ""
+"Queries can also be configured as so called named queries using annotations "
+"or Hibernate mapping documents. <literal>@NamedQuery</literal> and "
+"<literal>@NamedQueries</literal> can be defined at the class level as seen "
+"in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: session_api.xml:361
#, fuzzy, no-c-format
msgid ""
-"You can also define named queries in the mapping document. Remember to use a "
-"<literal>CDATA</literal> section if your query contains characters that "
-"could be interpreted as markup."
+"Using a mapping document can be configured using the <literal><query></"
+"literal> node. Remember to use a <literal>CDATA</literal> section if your "
+"query contains characters that could be interpreted as markup."
msgstr ""
"Sie können benannte Anfragen auch im Mapping-Dokument definieren. (Vergessen "
"Sie nicht einen <literal>CDATA</literal>-Abschnitt zu verwenden, falls Ihre "
"Anfrage Zeichen enthält, die als Markup interpretiert werden könnten)."
+#. Tag: title
+#: session_api.xml:367
+#, no-c-format
+msgid "Defining a named query using <literal><query></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, fuzzy, no-c-format
+msgid ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+msgstr ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+
#. Tag: para
-#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+#: session_api.xml:373
+#, fuzzy, no-c-format
+msgid ""
+"Parameter binding and executing is done programatically as seen in <xref "
+"linkend=\"example-parameter-binding-named-query\"/>."
msgstr "Die Bindung und Ausführung der Parameter erfolgen befehlsorientiert:"
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+msgstr ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+
#. Tag: para
+#: session_api.xml:382
#, fuzzy, no-c-format
msgid ""
"The actual program code is independent of the query language that is used. "
@@ -884,6 +1392,7 @@
"Sie sie in Mapping-Dateien platzieren."
#. Tag: para
+#: session_api.xml:387
#, fuzzy, no-c-format
msgid ""
"Also note that a query declaration inside a <literal><hibernate-"
@@ -901,11 +1410,13 @@
"vorangestellt wird."
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "Das Filtern von Collections"
#. Tag: para
+#: session_api.xml:399
#, fuzzy, no-c-format
msgid ""
"A collection <emphasis>filter</emphasis> is a special type of query that can "
@@ -917,7 +1428,26 @@
"werden kann. Der Anfragenstring kann auf <literal>this</literal> verweisen, "
"womit das aktuelle Element der Collection gemeint ist."
+#. Tag: programlisting
+#: session_api.xml:404
+#, fuzzy, no-c-format
+msgid ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+msgstr ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+
#. Tag: para
+#: session_api.xml:406
#, fuzzy, no-c-format
msgid ""
"The returned collection is considered a bag that is a copy of the given "
@@ -931,6 +1461,7 @@
"mit dem erwarteten Verhalten)."
#. Tag: para
+#: session_api.xml:411
#, fuzzy, no-c-format
msgid ""
"Observe that filters do not require a <literal>from</literal> clause, "
@@ -941,7 +1472,22 @@
"(jedoch bei Bedarf einen besitzen können). Filter sind nicht darauf "
"beschränkt, die Elemente der Collection selbst wiederzugeben."
+#. Tag: programlisting
+#: session_api.xml:415
+#, fuzzy, no-c-format
+msgid ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+msgstr ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+
#. Tag: para
+#: session_api.xml:417
#, fuzzy, no-c-format
msgid ""
"Even an empty filter query is useful, e.g. to load a subset of elements in a "
@@ -950,12 +1496,28 @@
"Selbst eine Anfrage mit leerem Filter ist von Nutzen, wenn man etwa einen "
"Untersatz von Elementen in einer riesigen Collection lädt."
+#. Tag: programlisting
+#: session_api.xml:420
+#, fuzzy, no-c-format
+msgid ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+msgstr ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr "Kriterienanfragen"
#. Tag: para
+#: session_api.xml:426
#, fuzzy, no-c-format
msgid ""
"HQL is extremely powerful, but some developers prefer to build queries "
@@ -968,22 +1530,39 @@
"statt des Erstellens von Anfragenstrings. Hibernate liefert für diese Fälle "
"eine API für intuitive <literal>Criteria</literal>-Anfragen:"
+#. Tag: programlisting
+#: session_api.xml:431
+#, fuzzy, no-c-format
+msgid ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+msgstr ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Expression.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+
#. Tag: para
+#: session_api.xml:433
#, fuzzy, no-c-format
msgid ""
"The <literal>Criteria</literal> and the associated <literal>Example</"
-"literal> API are discussed in more detail in <xref linkend=\"querycriteria"
-"\" />."
+"literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"
+">."
msgstr ""
"Die <literal>Criteria</literal> und die zugehörige <literal>Example</"
"literal>-API werden unter <xref linkend=\"querycriteria\"/> näher erläutert."
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "Anfragen in nativer SQL"
#. Tag: para
+#: session_api.xml:441
#, fuzzy, no-c-format
msgid ""
"You can express a query in SQL, using <literal>createSQLQuery()</literal> "
@@ -1000,23 +1579,62 @@
"Hibernate API verwenden wollen, müssen Sie die SQL-Aliasse in Klammern mit "
"einschließen:"
+#. Tag: programlisting
+#: session_api.xml:448
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE "
+"ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();"
+msgstr ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10\",\n"
+" \"cat\",\n"
+" Cat.class\n"
+").list();"
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()"
+msgstr ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\",\n"
+" \"cat\",\n"
+" Cat.class\n"
+").list()"
+
#. Tag: para
+#: session_api.xml:452
#, fuzzy, no-c-format
msgid ""
"SQL queries can contain named and positional parameters, just like Hibernate "
"queries. More information about native SQL queries in Hibernate can be found "
-"in <xref linkend=\"querysql\" />."
+"in <xref linkend=\"querysql\"/>."
msgstr ""
"SQL-Anfragen können - wie auch Hibernate Anfragen - benannte und "
"positionelle Parameter enthalten. Weitere Informationen zu nativen SQL-"
"Anfragen in Hibernate finden Sie in <xref linkend=\"querysql\"/>."
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr "Änderungen an persistenten Objekten vornehmen"
#. Tag: para
+#: session_api.xml:461
#, fuzzy, no-c-format
msgid ""
"<emphasis>Transactional persistent instances</emphasis> (i.e. objects "
@@ -1041,7 +1659,20 @@
"()</literal> und dessen direkte Modifizierung während die <literal>Session</"
"literal> geöffnet ist:"
+#. Tag: programlisting
+#: session_api.xml:473
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+
#. Tag: para
+#: session_api.xml:475
#, fuzzy, no-c-format
msgid ""
"Sometimes this programming model is inefficient, as it requires in the same "
@@ -1056,6 +1687,7 @@
"Verwendung abgesetzter Instanzen eine alternative Vorgehensweise."
#. Tag: para
+#: session_api.xml:481
#, fuzzy, no-c-format
msgid ""
"Hibernate does not offer its own API for direct execution of "
@@ -1067,7 +1699,7 @@
"the notion of mass operations conflicts with object/relational mapping for "
"online transaction processing-oriented applications. Future versions of "
"Hibernate can, however, provide special mass operation functions. See <xref "
-"linkend=\"batch\" /> for some possible batch operation tricks."
+"linkend=\"batch\"/> for some possible batch operation tricks."
msgstr ""
"Bitte beachten Sie, dass Hibernate keine eigene API für die direkte "
"Ausführung von <literal>UPDATE</literal> oder <literal>DELETE</literal>-"
@@ -1084,11 +1716,13 @@
"mögliche Tricks zur Batch-Bearbeitung."
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr "Änderungen an abgesetzten Objekten"
#. Tag: para
+#: session_api.xml:499
#, no-c-format
msgid ""
"Many applications need to retrieve an object in one transaction, send it to "
@@ -1105,6 +1739,7 @@
"um die Isolation der \"langen\" Arbeitseinheit zu gewährleisten."
#. Tag: para
+#: session_api.xml:505
#, no-c-format
msgid ""
"Hibernate supports this model by providing for reattachment of detached "
@@ -1115,7 +1750,36 @@
"update()</literal> oder <literal>Session.merge()</literal>-Methoden die "
"Möglichkeit der Wiederanbindung abgesetzter Instanzen bietet:"
+#. Tag: programlisting
+#: session_api.xml:509
+#, fuzzy, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+msgstr ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
msgid ""
"If the <literal>Cat</literal> with identifier <literal>catId</literal> had "
@@ -1128,6 +1792,7 @@
"gemeldet worden."
#. Tag: para
+#: session_api.xml:516
#, fuzzy, no-c-format
msgid ""
"Use <literal>update()</literal> if you are certain that the session does not "
@@ -1148,13 +1813,14 @@
"als erstes ausgeführte Vorgang ist."
#. Tag: para
+#: session_api.xml:524
#, fuzzy, no-c-format
msgid ""
"The application should individually <literal>update()</literal> detached "
"instances that are reachable from the given detached instance "
"<emphasis>only</emphasis> if it wants their state to be updated. This can be "
"automated using <emphasis>transitive persistence</emphasis>. See <xref "
-"linkend=\"objectstate-transitive\" /> for more information."
+"linkend=\"objectstate-transitive\"/> for more information."
msgstr ""
"Die Anwendung sollte von der gegebenen abgesetzten Instanz aus erreichbare "
"abgesetzte Instanzen einzeln mittels <literal>update()</literal> "
@@ -1164,6 +1830,7 @@
"<xref linkend=\"objectstate-transitive\"/>."
#. Tag: para
+#: session_api.xml:530
#, fuzzy, no-c-format
msgid ""
"The <literal>lock()</literal> method also allows an application to "
@@ -1174,7 +1841,26 @@
"ebenfalls, ein Objekt mit einer neuen Session zu re-assoziieren. Allerdings "
"darf die abgesetzte Instanz in diesem Fall nicht verändert worden sein!"
+#. Tag: programlisting
+#: session_api.xml:534
+#, fuzzy, no-c-format
+msgid ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+
#. Tag: para
+#: session_api.xml:536
#, fuzzy, no-c-format
msgid ""
"Note that <literal>lock()</literal> can be used with various "
@@ -1189,20 +1875,23 @@
"<literal>lock()</literal>."
#. Tag: para
+#: session_api.xml:541
#, fuzzy, no-c-format
msgid ""
"Other models for long units of work are discussed in <xref linkend="
-"\"transactions-optimistic\" />."
+"\"transactions-optimistic\"/>."
msgstr ""
"Andere Modelle für lange Arbeitseinheiten werden in <xref linkend="
"\"transactions-optimistic\"/> erläutert."
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr "Automatische Statuserkennung"
#. Tag: para
+#: session_api.xml:548
#, no-c-format
msgid ""
"Hibernate users have requested a general purpose method that either saves a "
@@ -1216,7 +1905,38 @@
"abgesetzten Instanzen aktualisiert/erneut hinzufügt. Die "
"<literal>saveOrUpdate()</literal>-Methode implementiert diese Funktionalität."
+#. Tag: programlisting
+#: session_api.xml:554
+#, fuzzy, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+msgstr ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
msgid ""
"The usage and semantics of <literal>saveOrUpdate()</literal> seems to be "
@@ -1234,6 +1954,7 @@
"ganze Anwendungen ohne irgendeine dieser Methoden aus."
#. Tag: para
+#: session_api.xml:563
#, no-c-format
msgid ""
"Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are "
@@ -1243,26 +1964,31 @@
"</literal> in folgenden Situationen zum Einsatz:"
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr "die Anwendung lädt ein Objekt in der ersten Session"
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr "das Objekt wird an den UI-\"Tier\" weitergegeben"
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr "am Objekt werden einige Modifikationen vorgenommen"
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr "das Objekt wird zurück an den \"Business-Logic-Tier\" geleitet"
#. Tag: para
+#: session_api.xml:585
#, no-c-format
msgid ""
"the application persists these modifications by calling <literal>update()</"
@@ -1272,17 +1998,20 @@
"<literal>update()</literal> in einer zweiten Session"
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr "<literal>saveOrUpdate()</literal> tut folgendes:"
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr ""
"falls das Objekt in dieser Session bereits persistent ist, geschieht nichts"
#. Tag: para
+#: session_api.xml:599
#, no-c-format
msgid ""
"if another object associated with the session has the same identifier, throw "
@@ -1292,6 +2021,7 @@
"besitzt, wird eine Ausnahme gemeldet"
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
msgstr ""
@@ -1299,6 +2029,7 @@
"<literal>save()</literal>"
#. Tag: para
+#: session_api.xml:609
#, no-c-format
msgid ""
"if the object's identifier has the value assigned to a newly instantiated "
@@ -1309,6 +2040,7 @@
"literal>"
#. Tag: para
+#: session_api.xml:614
#, fuzzy, no-c-format
msgid ""
"if the object is versioned by a <literal><version></literal> or "
@@ -1322,17 +2054,20 @@
"speichern Sie mittels <literal>save()</literal>"
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
msgstr ""
"andernfalls aktualisieren Sie das Objekt mittels <literal>update()</literal>"
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr "und <literal>merge()</literal> ist völlig anders:"
#. Tag: para
+#: session_api.xml:630
#, no-c-format
msgid ""
"if there is a persistent instance with the same identifier currently "
@@ -1344,6 +2079,7 @@
"vorgegebenen Objekts in die persistente Instanz"
#. Tag: para
+#: session_api.xml:636
#, no-c-format
msgid ""
"if there is no persistent instance currently associated with the session, "
@@ -1354,11 +2090,13 @@
"erstellen Sie eine neue persistente Instanz"
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr "die persistente Instanz wird zurückgeschickt"
#. Tag: para
+#: session_api.xml:646
#, no-c-format
msgid ""
"the given instance does not become associated with the session, it remains "
@@ -1368,11 +2106,13 @@
"abgesetzt"
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr "Das Löschen persistenter Objekte"
#. Tag: para
+#: session_api.xml:655
#, fuzzy, no-c-format
msgid ""
"<literal>Session.delete()</literal> will remove an object's state from the "
@@ -1385,7 +2125,14 @@
"Verweis auf ein gelöschtes Objekt beinhalten. Durch <literal>delete()</"
"literal> wird eine persistente Instanz gewissermaßen transient gemacht."
+#. Tag: programlisting
+#: session_api.xml:660
+#, fuzzy, no-c-format
+msgid "sess.delete(cat);"
+msgstr "sess.delete(cat);"
+
#. Tag: para
+#: session_api.xml:662
#, fuzzy, no-c-format
msgid ""
"You can delete objects in any order, without risk of foreign key constraint "
@@ -1401,11 +2148,13 @@
"vergessen, dies mit den untergeordneten Objekten ebenfalls zu tun."
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "Objektreplikation zwischen zwei verschiedenen Datenspeichern"
#. Tag: para
+#: session_api.xml:672
#, fuzzy, no-c-format
msgid ""
"It is sometimes useful to be able to take a graph of persistent instances "
@@ -1416,7 +2165,40 @@
"zu können und diese in einem anderen Datenspeicher persistent machen zu "
"können, ohne Bezeichnerwerte erneut generieren zu müssen."
+#. Tag: programlisting
+#: session_api.xml:676
+#, fuzzy, no-c-format
+msgid ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+msgstr ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+
#. Tag: para
+#: session_api.xml:678
#, fuzzy, no-c-format
msgid ""
"The <literal>ReplicationMode</literal> determines how <literal>replicate()</"
@@ -1426,6 +2208,7 @@
"literal> mit Konflikten mit bestehenden Reihen in der Datenbank umgeht."
#. Tag: para
+#: session_api.xml:684
#, fuzzy, no-c-format
msgid ""
"<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is "
@@ -1435,6 +2218,7 @@
"bereits eine Datenbankreihe mit demselben Bezeichner existiert"
#. Tag: para
+#: session_api.xml:689
#, fuzzy, no-c-format
msgid ""
"<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing "
@@ -1444,6 +2228,7 @@
"Datenbankreihe mit demselben Bezeichner"
#. Tag: para
+#: session_api.xml:694
#, fuzzy, no-c-format
msgid ""
"<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there "
@@ -1453,6 +2238,7 @@
"eine Datenbankreihe mit demselben Bezeichner existiert"
#. Tag: para
+#: session_api.xml:700
#, fuzzy, no-c-format
msgid ""
"<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its "
@@ -1464,6 +2250,7 @@
"oder ignoriert andernfalls das Objekt"
#. Tag: para
+#: session_api.xml:706
#, no-c-format
msgid ""
"Usecases for this feature include reconciling data entered into different "
@@ -1477,11 +2264,13 @@
"von während nicht-ACID Transaktionen gemachten Änderungen und mehr."
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr "Das Räumen der Session"
#. Tag: para
+#: session_api.xml:715
#, fuzzy, no-c-format
msgid ""
"Sometimes the <literal>Session</literal> will execute the SQL statements "
@@ -1496,26 +2285,31 @@
"emphasis>"
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr "vor dem Ausführen einiger Anfragen"
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr "von <literal>org.hibernate.Transaction.commit()</literal>"
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr "von <literal>Session.flush()</literal>"
#. Tag: para
+#: session_api.xml:736
#, fuzzy, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "Die SQL-Anweisungen werden in der folgenden Reihenfolge herausgegeben"
#. Tag: para
+#: session_api.xml:740
#, fuzzy, no-c-format
msgid ""
"all entity insertions in the same order the corresponding objects were saved "
@@ -1525,16 +2319,19 @@
"wurden mittels <literal>Session.save()</literal> gespeichert"
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr "alle Entity-Aktualisierungen"
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr "alle Collection-Löschungen"
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr ""
@@ -1542,11 +2339,13 @@
"Collection"
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr "alle Einfügungen in Collections"
#. Tag: para
+#: session_api.xml:761
#, fuzzy, no-c-format
msgid ""
"all entity deletions in the same order the corresponding objects were "
@@ -1557,6 +2356,7 @@
"literal>"
#. Tag: para
+#: session_api.xml:766
#, fuzzy, no-c-format
msgid ""
"An exception is that objects using <literal>native</literal> ID generation "
@@ -1566,6 +2366,7 @@
"Generierung verwenden, beim Speichern eingefügt werden)."
#. Tag: para
+#: session_api.xml:769
#, fuzzy, no-c-format
msgid ""
"Except when you explicitly <literal>flush()</literal>, there are absolutely "
@@ -1582,6 +2383,7 @@
"liefert."
#. Tag: para
+#: session_api.xml:776
#, fuzzy, no-c-format
msgid ""
"It is possible to change the default behavior so that flush occurs less "
@@ -1591,7 +2393,7 @@
"never flush unless <literal>flush()</literal> is called explicitly. The last "
"mode is useful for long running units of work, where a <literal>Session</"
"literal> is kept open and disconnected for a long time (see <xref linkend="
-"\"transactions-optimistic-longsession\" />)."
+"\"transactions-optimistic-longsession\"/>)."
msgstr ""
"Es ist möglich das Verhalten in der Standardeinstellung so zu verändern, "
"dass die Räumung seltener erfolgt.Die <literal>FlushMode</literal>-Klasse "
@@ -1604,13 +2406,48 @@
"längere Zeit hinweg geöffnet und abgekuppelt bleibt (siehe <xref linkend="
"\"transactions-optimistic-longsession\"/>)."
+#. Tag: programlisting
+#: session_api.xml:786
+#, fuzzy, no-c-format
+msgid ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+msgstr ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+
#. Tag: para
+#: session_api.xml:788
#, fuzzy, no-c-format
msgid ""
"During flush, an exception might occur (e.g. if a DML operation violates a "
"constraint). Since handling exceptions involves some understanding of "
"Hibernate's transactional behavior, we discuss it in <xref linkend="
-"\"transactions\" />."
+"\"transactions\"/>."
msgstr ""
"Während der Räumung kann es zu einer Ausnahmemeldung kommen (wenn z.B. ein "
"DML-Vorgang eine Bedingung verletzt). Da der Umgang mit Ausnahmen ein "
@@ -1618,11 +2455,13 @@
"voraussetzt, erläutern wir es in <xref linkend=\"transactions\"/>."
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr "Transitive Persistenz"
#. Tag: para
+#: session_api.xml:797
#, no-c-format
msgid ""
"It is quite cumbersome to save, delete, or reattach individual objects, "
@@ -1636,6 +2475,7 @@
"Beziehung). Sehen Sie sich das folgende Beispiel an:"
#. Tag: para
+#: session_api.xml:802
#, fuzzy, no-c-format
msgid ""
"If the children in a parent/child relationship would be value typed (e.g. a "
@@ -1660,6 +2500,7 @@
"wird das untergeordnete Objekt aus der Datenbank gelöscht."
#. Tag: para
+#: session_api.xml:812
#, fuzzy, no-c-format
msgid ""
"Now consider the same scenario with parent and child objects being entities, "
@@ -1681,6 +2522,7 @@
"Erreichbarkeit</emphasis>."
#. Tag: para
+#: session_api.xml:820
#, no-c-format
msgid ""
"For each basic operation of the Hibernate session - including "
@@ -1699,13 +2541,27 @@
"möchten, dass ein Vorgang entlang einer Assoziation weitergegeben wird, so "
"müssen Sie dass im Mapping-Dokument angeben. Zum Beispiel wie folgt aussehen:"
+#. Tag: programlisting
+#: session_api.xml:828
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr "<one-to-one name=\"person\" cascade=\"persist\"/>"
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr ""
"Die Arten der Weitergabe (sog. \"Cascade Styles\") können kombiniert werden:"
+#. Tag: programlisting
+#: session_api.xml:832
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+
#. Tag: para
+#: session_api.xml:834
#, fuzzy, no-c-format
msgid ""
"You can even use <literal>cascade=\"all\"</literal> to specify that "
@@ -1719,30 +2575,133 @@
"festgelegt, dass keine Vorgänge weitergegeben werden."
#. Tag: para
+#: session_api.xml:839
#, no-c-format
msgid ""
+"In case you are using annotatons you probably have noticed the "
+"<literal>cascade</literal> attribute taking an array of "
+"<classname>CascadeType</classname> as a value. The cascade concept in JPA is "
+"very is similar to the transitive persistence and cascading of operations as "
+"described above, but with slightly different semantics and cascading types:"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:848
+#, no-c-format
+msgid ""
+"<literal>CascadeType.PERSIST</literal>: cascades the persist (create) "
+"operation to associated entities persist() is called or if the entity is "
+"managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:854
+#, no-c-format
+msgid ""
+"<literal>CascadeType.MERGE</literal>: cascades the merge operation to "
+"associated entities if merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:860
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REMOVE</literal>: cascades the remove operation to "
+"associated entities if delete() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:865
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to "
+"associated entities if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:870
+#, no-c-format
+msgid ""
+"<literal>CascadeType.DETACH:</literal> cascades the detach operation to "
+"associated entities if detach() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:875
+#, fuzzy, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr "<literal>saveOrUpdate()</literal> tut folgendes:"
+
+#. Tag: para
+#: session_api.xml:880
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc..."
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:884
+#, no-c-format
+msgid ""
"A special cascade style, <literal>delete-orphan</literal>, applies only to "
"one-to-many associations, and indicates that the <literal>delete()</literal> "
"operation should be applied to any child object that is removed from the "
-"association."
+"association. Using annotations there is no <literal>CascadeType.DELETE-"
+"ORPHAN</literal> equivalent. Instead you can use the attribute "
+"<literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-"
+"many-with-orphan-removal\"/>. If an entity is removed from a "
+"<classname>@OneToMany</classname> collection or an associated entity is "
+"dereferenced from a <classname>@OneToOne</classname> association, this "
+"associated entity can be marked for deletion if <literal>orphanRemoval</"
+"literal> is set to true."
msgstr ""
-"Eine besondere Art der Weitergabe namens <literal>delete-orphan</literal> "
-"gilt nur bei \"One-to-Many\"-Assoziationen und zeigt an, dass der "
-"<literal>delete()</literal>-Vorgang angewendet werden soll, wenn ein "
-"untergeordnetes Objekt aus der Assoziation entfernt wird."
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+"@Entity \n"
+"public class Customer {\n"
+" private Set<Order> orders;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+" public Set<Order> getOrders() { return orders; }\n"
+"\n"
+" public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+"\n"
+" [...]\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Order { ... }\n"
+"\n"
+"Customer customer = em.find(Customer.class, 1l);\n"
+"Order order = em.find(Order.class, 1l);\n"
+"customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:903
#, no-c-format
msgid "Recommendations:"
msgstr "Empfehlungen:"
#. Tag: para
+#: session_api.xml:907
#, fuzzy, no-c-format
msgid ""
-"It does not usually make sense to enable cascade on a <literal><many-to-"
-"one></literal> or <literal><many-to-many></literal> association. "
-"Cascade is often useful for <literal><one-to-one></literal> and "
-"<literal><one-to-many></literal> associations."
+"It does not usually make sense to enable cascade on a many-to-one or many-to-"
+"many association. In fact the <literal>@ManyToOne</literal> and "
+"<literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</"
+"literal> attribute. Cascading is often useful for one-to-one and one-to-many "
+"associations."
msgstr ""
"Es macht in der Regel keinen Sinn, die Weitergabe bei einer <literal><"
"many-to-one></literal> oder <literal><many-to-many></literal>-"
@@ -1751,11 +2710,13 @@
"Assoziationen von Nutzen."
#. Tag: para
+#: session_api.xml:915
#, fuzzy, no-c-format
msgid ""
"If the child object's lifespan is bounded by the lifespan of the parent "
"object, make it a <emphasis>life cycle object</emphasis> by specifying "
-"<literal>cascade=\"all,delete-orphan\"</literal>."
+"<literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany"
+"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
msgstr ""
"Falls die Lebensdauer des untergeordneten Objekts an die Lebensdauer des "
"übergeordneten Objekts gebunden ist, erklären Sie es zum <emphasis>"
@@ -1763,6 +2724,7 @@
"orphan\"</literal> festlegen."
#. Tag: para
+#: session_api.xml:923
#, no-c-format
msgid ""
"Otherwise, you might not need cascade at all. But if you think that you will "
@@ -1776,6 +2738,7 @@
"<literal>cascade=\"persist,merge,save-update\"</literal> verwenden."
#. Tag: para
+#: session_api.xml:931
#, no-c-format
msgid ""
"Mapping an association (either a single valued association, or a collection) "
@@ -1791,15 +2754,16 @@
"untergeordneten Objekts (oder Objekte) führt."
#. Tag: para
+#: session_api.xml:937
#, fuzzy, no-c-format
msgid ""
"Furthermore, a mere reference to a child from a persistent parent will "
"result in save/update of the child. This metaphor is incomplete, however. A "
"child which becomes unreferenced by its parent is <emphasis>not</emphasis> "
-"automatically deleted, except in the case of a <literal><one-to-many></"
-"literal> association mapped with <literal>cascade=\"delete-orphan\"</"
-"literal>. The precise semantics of cascading operations for a parent/child "
-"relationship are as follows:"
+"automatically deleted, except in the case of a one-to-many association "
+"mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise "
+"semantics of cascading operations for a parent/child relationship are as "
+"follows:"
msgstr ""
"Desweiteren führt schon der Verweis eines übergeordneten Objektes auf ein "
"untergeordnetes Objekt zur Speicherung/Aktualisierung des letzteren. Diese "
@@ -1811,6 +2775,7 @@
"\"Parent\"/\"Child\"-Beziehung lautet wie folgt:"
#. Tag: para
+#: session_api.xml:948
#, no-c-format
msgid ""
"If a parent is passed to <literal>persist()</literal>, all children are "
@@ -1820,6 +2785,7 @@
"sämtliche \"Children\" ebenfalls <literal>persist()</literal>"
#. Tag: para
+#: session_api.xml:953
#, no-c-format
msgid ""
"If a parent is passed to <literal>merge()</literal>, all children are passed "
@@ -1829,6 +2795,7 @@
"sämtliche \"Children\" ebenfalls <literal>merge()</literal>"
#. Tag: para
+#: session_api.xml:958
#, no-c-format
msgid ""
"If a parent is passed to <literal>save()</literal>, <literal>update()</"
@@ -1840,6 +2807,7 @@
"\"Children\" ebenfalls <literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:964
#, no-c-format
msgid ""
"If a transient or detached child becomes referenced by a persistent parent, "
@@ -1850,6 +2818,7 @@
"</literal>"
#. Tag: para
+#: session_api.xml:970
#, no-c-format
msgid ""
"If a parent is deleted, all children are passed to <literal>delete()</"
@@ -1859,6 +2828,7 @@
"<literal>delete()</literal>"
#. Tag: para
+#: session_api.xml:975
#, no-c-format
msgid ""
"If a child is dereferenced by a persistent parent, <emphasis>nothing special "
@@ -1873,6 +2843,7 @@
"\" Child gelöscht wird."
#. Tag: para
+#: session_api.xml:983
#, fuzzy, no-c-format
msgid ""
"Finally, note that cascading of operations can be applied to an object graph "
@@ -1892,11 +2863,13 @@
"transitiv."
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr "Die Verwendung von Metadata"
#. Tag: para
+#: session_api.xml:995
#, fuzzy, no-c-format
msgid ""
"Hibernate requires a rich meta-level model of all entity and value types. "
@@ -1915,6 +2888,7 @@
"und möglicherweise zugehörige Entities)."
#. Tag: para
+#: session_api.xml:1002
#, fuzzy, no-c-format
msgid ""
"Hibernate exposes metadata via the <literal>ClassMetadata</literal> and "
@@ -1927,650 +2901,49 @@
"literal>-Hierarchie dar. Instanzen der Metadata-Interfaces sind durch die "
"<literal>SessionFactory</literal> verfügbar."
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[DomesticCat fritz = new DomesticCat();\n"
-#~ "fritz.setColor(Color.GINGER);\n"
-#~ "fritz.setSex('M');\n"
-#~ "fritz.setName(\"Fritz\");\n"
-#~ "Long generatedId = (Long) sess.save(fritz);]]>"
-#~ msgstr ""
-#~ "DomesticCat fritz = new DomesticCat();\n"
-#~ "fritz.setColor(Color.GINGER);\n"
-#~ "fritz.setSex('M');\n"
-#~ "fritz.setName(\"Fritz\");\n"
-#~ "Long generatedId = (Long) sess.save(fritz);"
+#. Tag: programlisting
+#: session_api.xml:1007
+#, fuzzy, no-c-format
+msgid ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
+msgstr ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[DomesticCat pk = new DomesticCat();\n"
-#~ "pk.setColor(Color.TABBY);\n"
-#~ "pk.setSex('F');\n"
-#~ "pk.setName(\"PK\");\n"
-#~ "pk.setKittens( new HashSet() );\n"
-#~ "pk.addKitten(fritz);\n"
-#~ "sess.save( pk, new Long(1234) );]]>"
+#~ "A special cascade style, <literal>delete-orphan</literal>, applies only "
+#~ "to one-to-many associations, and indicates that the <literal>delete()</"
+#~ "literal> operation should be applied to any child object that is removed "
+#~ "from the association."
#~ msgstr ""
-#~ "DomesticCat pk = new DomesticCat();\n"
-#~ "pk.setColor(Color.TABBY);\n"
-#~ "pk.setSex('F');\n"
-#~ "pk.setName(\"PK\");\n"
-#~ "pk.setKittens( new HashSet() );\n"
-#~ "pk.addKitten(fritz);\n"
-#~ "sess.save( pk, new Long(1234) );"
-
-#, fuzzy
-#~ msgid "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"
-#~ msgstr "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// you need to wrap primitive identifiers\n"
-#~ "long id = 1234;\n"
-#~ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
-#~ "(id) );]]>"
-#~ msgstr ""
-#~ "// you need to wrap primitive identifiers\n"
-#~ "long id = 1234;\n"
-#~ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
-#~ "(id) );"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "// load pk's state into cat\n"
-#~ "sess.load( cat, new Long(pkId) );\n"
-#~ "Set kittens = cat.getKittens();]]>"
-#~ msgstr ""
-#~ "Cat cat = new DomesticCat();\n"
-#~ "// load pk's state into cat\n"
-#~ "sess.load( cat, new Long(pkId) );\n"
-#~ "Set kittens = cat.getKittens();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id);\n"
-#~ "if (cat==null) {\n"
-#~ " cat = new Cat();\n"
-#~ " sess.save(cat, id);\n"
-#~ "}\n"
-#~ "return cat;]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) sess.get(Cat.class, id);\n"
-#~ "if (cat==null) {\n"
-#~ " cat = new Cat();\n"
-#~ " sess.save(cat, id);\n"
-#~ "}\n"
-#~ "return cat;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);]]>"
-#~ msgstr "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.save(cat);\n"
-#~ "sess.flush(); //force the SQL INSERT\n"
-#~ "sess.refresh(cat); //re-read the state (after the trigger executes)]]>"
-#~ msgstr ""
-#~ "sess.save(cat);\n"
-#~ "sess.flush(); //force the SQL INSERT\n"
-#~ "sess.refresh(cat); //re-read the state (after the trigger executes)"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.birthdate < ?\")\n"
-#~ " .setDate(0, date)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List mothers = session.createQuery(\n"
-#~ " \"select mother from Cat as cat join cat.mother as mother where cat."
-#~ "name = ?\")\n"
-#~ " .setString(0, name)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List kittens = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.mother = ?\")\n"
-#~ " .setEntity(0, pk)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "Cat mother = (Cat) session.createQuery(\n"
-#~ " \"select cat.mother from Cat as cat where cat = ?\")\n"
-#~ " .setEntity(0, izi)\n"
-#~ " .uniqueResult();]]\n"
-#~ "\n"
-#~ "Query mothersWithKittens = (Cat) session.createQuery(\n"
-#~ " \"select mother from Cat as mother left join fetch mother.kittens"
-#~ "\");\n"
-#~ "Set uniqueMothers = new HashSet(mothersWithKittens.list());]]>"
-#~ msgstr ""
-#~ "List cats = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.birthdate < ?\")\n"
-#~ " .setDate(0, date)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List mothers = session.createQuery(\n"
-#~ " \"select mother from Cat as cat join cat.mother as mother where cat."
-#~ "name = ?\")\n"
-#~ " .setString(0, name)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List kittens = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.mother = ?\")\n"
-#~ " .setEntity(0, pk)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "Cat mother = (Cat) session.createQuery(\n"
-#~ " \"select cat.mother from Cat as cat where cat = ?\")\n"
-#~ " .setEntity(0, izi)\n"
-#~ " .uniqueResult();]]\n"
-#~ "\n"
-#~ "Query mothersWithKittens = (Cat) session.createQuery(\n"
-#~ " \"select mother from Cat as mother left join fetch mother.kittens"
-#~ "\");\n"
-#~ "Set uniqueMothers = new HashSet(mothersWithKittens.list());"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// fetch ids\n"
-#~ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
-#~ "iterate();\n"
-#~ "while ( iter.hasNext() ) {\n"
-#~ " Qux qux = (Qux) iter.next(); // fetch the object\n"
-#~ " // something we couldnt express in the query\n"
-#~ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
-#~ " // delete the current instance\n"
-#~ " iter.remove();\n"
-#~ " // dont need to process the rest\n"
-#~ " break;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "// fetch ids\n"
-#~ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
-#~ "iterate();\n"
-#~ "while ( iter.hasNext() ) {\n"
-#~ " Qux qux = (Qux) iter.next(); // fetch the object\n"
-#~ " // something we couldnt express in the query\n"
-#~ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
-#~ " // delete the current instance\n"
-#~ " iter.remove();\n"
-#~ " // dont need to process the rest\n"
-#~ " break;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Iterator kittensAndMothers = sess.createQuery(\n"
-#~ " \"select kitten, mother from Cat kitten join kitten.mother "
-#~ "mother\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( kittensAndMothers.hasNext() ) {\n"
-#~ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
-#~ " Cat kitten = (Cat) tuple[0];\n"
-#~ " Cat mother = (Cat) tuple[1];\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Iterator kittensAndMothers = sess.createQuery(\n"
-#~ " \"select kitten, mother from Cat kitten join kitten.mother "
-#~ "mother\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( kittensAndMothers.hasNext() ) {\n"
-#~ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
-#~ " Cat kitten = tuple[0];\n"
-#~ " Cat mother = tuple[1];\n"
-#~ " ....\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Iterator results = sess.createQuery(\n"
-#~ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat "
-#~ "\" +\n"
-#~ " \"group by cat.color\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( results.hasNext() ) {\n"
-#~ " Object[] row = (Object[]) results.next();\n"
-#~ " Color type = (Color) row[0];\n"
-#~ " Date oldest = (Date) row[1];\n"
-#~ " Integer count = (Integer) row[2];\n"
-#~ " .....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Iterator results = sess.createQuery(\n"
-#~ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat "
-#~ "\" +\n"
-#~ " \"group by cat.color\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( results.hasNext() ) {\n"
-#~ " Object[] row = (Object[]) results.next();\n"
-#~ " Color type = (Color) row[0];\n"
-#~ " Date oldest = (Date) row[1];\n"
-#~ " Integer count = (Integer) row[2];\n"
-#~ " .....\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//named parameter (preferred)\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
-#~ "\");\n"
-#~ "q.setString(\"name\", \"Fritz\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgstr ""
-#~ "//named parameter (preferred)\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
-#~ "\");\n"
-#~ "q.setString(\"name\", \"Fritz\");\n"
-#~ "Iterator cats = q.iterate();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//positional parameter\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
-#~ "q.setString(0, \"Izi\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgstr ""
-#~ "//positional parameter\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
-#~ "q.setString(0, \"Izi\");\n"
-#~ "Iterator cats = q.iterate();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//named parameter list\n"
-#~ "List names = new ArrayList();\n"
-#~ "names.add(\"Izi\");\n"
-#~ "names.add(\"Fritz\");\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
-#~ "namesList)\");\n"
-#~ "q.setParameterList(\"namesList\", names);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "//named parameter list\n"
-#~ "List names = new ArrayList();\n"
-#~ "names.add(\"Izi\");\n"
-#~ "names.add(\"Fritz\");\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
-#~ "namesList)\");\n"
-#~ "q.setParameterList(\"namesList\", names);\n"
-#~ "List cats = q.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.createQuery(\"from DomesticCat cat\");\n"
-#~ "q.setFirstResult(20);\n"
-#~ "q.setMaxResults(10);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "Query q = sess.createQuery(\"from DomesticCat cat\");\n"
-#~ "q.setFirstResult(20);\n"
-#~ "q.setMaxResults(10);\n"
-#~ "List cats = q.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.createQuery(\"select cat.name, cat from "
-#~ "DomesticCat cat \" +\n"
-#~ " \"order by cat.name\");\n"
-#~ "ScrollableResults cats = q.scroll();\n"
-#~ "if ( cats.first() ) {\n"
-#~ "\n"
-#~ " // find the first name on each page of an alphabetical list of cats "
-#~ "by name\n"
-#~ " firstNamesOfPages = new ArrayList();\n"
-#~ " do {\n"
-#~ " String name = cats.getString(0);\n"
-#~ " firstNamesOfPages.add(name);\n"
-#~ " }\n"
-#~ " while ( cats.scroll(PAGE_SIZE) );\n"
-#~ "\n"
-#~ " // Now get the first page of cats\n"
-#~ " pageOfCats = new ArrayList();\n"
-#~ " cats.beforeFirst();\n"
-#~ " int i=0;\n"
-#~ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add( cats.get"
-#~ "(1) );\n"
-#~ "\n"
-#~ "}\n"
-#~ "cats.close()]]>"
-#~ msgstr ""
-#~ "Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" "
-#~ "+\n"
-#~ " \"order by cat.name\");\n"
-#~ "ScrollableResults cats = q.scroll();\n"
-#~ "if ( cats.first() ) {\n"
-#~ "\n"
-#~ " // find the first name on each page of an alphabetical list of cats "
-#~ "by name\n"
-#~ " firstNamesOfPages = new ArrayList();\n"
-#~ " do {\n"
-#~ " String name = cats.getString(0);\n"
-#~ " firstNamesOfPages.add(name);\n"
-#~ " }\n"
-#~ " while ( cats.scroll(PAGE_SIZE) );\n"
-#~ "\n"
-#~ " // Now get the first page of cats\n"
-#~ " pageOfCats = new ArrayList();\n"
-#~ " cats.beforeFirst();\n"
-#~ " int i=0;\n"
-#~ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
-#~ "( cats.get(1) );\n"
-#~ "\n"
-#~ "}\n"
-#~ "cats.close()"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
-#~ " from eg.DomesticCat as cat\n"
-#~ " where cat.name = ?\n"
-#~ " and cat.weight > ?\n"
-#~ "] ]></query>]]>"
-#~ msgstr ""
-#~ "<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
-#~ " from eg.DomesticCat as cat\n"
-#~ " where cat.name = ?\n"
-#~ " and cat.weight > ?\n"
-#~ "] ]></query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
-#~ "q.setString(0, name);\n"
-#~ "q.setInt(1, minWeight);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
-#~ "q.setString(0, name);\n"
-#~ "q.setInt(1, minWeight);\n"
-#~ "List cats = q.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Collection blackKittens = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"where this.color = ?\")\n"
-#~ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
-#~ " .list()\n"
-#~ ");]]>"
-#~ msgstr ""
-#~ "Collection blackKittens = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"where this.color = ?\")\n"
-#~ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
-#~ " .list()\n"
-#~ ");"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Collection blackKittenMates = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "Collection blackKittenMates = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Collection tenKittens = session.createFilter(\n"
-#~ " mother.getKittens(), \"\")\n"
-#~ " .setFirstResult(0).setMaxResults(10)\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "Collection tenKittens = session.createFilter(\n"
-#~ " mother.getKittens(), \"\")\n"
-#~ " .setFirstResult(0).setMaxResults(10)\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Criteria crit = session.createCriteria(Cat.class);\n"
-#~ "crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
-#~ "crit.setMaxResults(10);\n"
-#~ "List cats = crit.list();]]>"
-#~ msgstr ""
-#~ "Criteria crit = session.createCriteria(Cat.class);\n"
-#~ "crit.add( Expression.eq( \"color\", eg.Color.BLACK ) );\n"
-#~ "crit.setMaxResults(10);\n"
-#~ "List cats = crit.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT "
-#~ "{cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list();]]>"
-#~ msgstr ""
-#~ "List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10\",\n"
-#~ " \"cat\",\n"
-#~ " Cat.class\n"
-#~ ").list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
-#~ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... "
-#~ "\" +\n"
-#~ " \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list()]]>"
-#~ msgstr ""
-#~ "List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
-#~ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... "
-#~ "\" +\n"
-#~ " \"FROM CAT {cat} WHERE ROWNUM<10\",\n"
-#~ " \"cat\",\n"
-#~ " Cat.class\n"
-#~ ").list()"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long"
-#~ "(69) );\n"
-#~ "cat.setName(\"PK\");\n"
-#~ "sess.flush(); // changes to cat are automatically detected and "
-#~ "persisted]]>"
-#~ msgstr ""
-#~ "DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
-#~ "cat.setName(\"PK\");\n"
-#~ "sess.flush(); // changes to cat are automatically detected and persisted"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
-#~ "Cat potentialMate = new Cat();\n"
-#~ "firstSession.save(potentialMate);\n"
-#~ "\n"
-#~ "// in a higher layer of the application\n"
-#~ "cat.setMate(potentialMate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.update(cat); // update cat\n"
-#~ "secondSession.update(mate); // update mate]]>"
-#~ msgstr ""
-#~ "// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
-#~ "Cat potentialMate = new Cat();\n"
-#~ "firstSession.save(potentialMate);\n"
-#~ "\n"
-#~ "// in a higher layer of the application\n"
-#~ "cat.setMate(potentialMate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.update(cat); // update cat\n"
-#~ "secondSession.update(mate); // update mate"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//just reassociate:\n"
-#~ "sess.lock(fritz, LockMode.NONE);\n"
-#~ "//do a version check, then reassociate:\n"
-#~ "sess.lock(izi, LockMode.READ);\n"
-#~ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
-#~ "sess.lock(pk, LockMode.UPGRADE);]]>"
-#~ msgstr ""
-#~ "//just reassociate:\n"
-#~ "sess.lock(fritz, LockMode.NONE);\n"
-#~ "//do a version check, then reassociate:\n"
-#~ "sess.lock(izi, LockMode.READ);\n"
-#~ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
-#~ "sess.lock(pk, LockMode.UPGRADE);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
-#~ "\n"
-#~ "// in a higher tier of the application\n"
-#~ "Cat mate = new Cat();\n"
-#~ "cat.setMate(mate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.saveOrUpdate(cat); // update existing state (cat has a "
-#~ "non-null id)\n"
-#~ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a "
-#~ "null id)]]>"
-#~ msgstr ""
-#~ "// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
-#~ "\n"
-#~ "// in a higher tier of the application\n"
-#~ "Cat mate = new Cat();\n"
-#~ "cat.setMate(mate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.saveOrUpdate(cat); // update existing state (cat has a "
-#~ "non-null id)\n"
-#~ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a "
-#~ "null id)"
-
-#, fuzzy
-#~ msgid "<![CDATA[sess.delete(cat);]]>"
-#~ msgstr "sess.delete(cat);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//retrieve a cat from one database\n"
-#~ "Session session1 = factory1.openSession();\n"
-#~ "Transaction tx1 = session1.beginTransaction();\n"
-#~ "Cat cat = session1.get(Cat.class, catId);\n"
-#~ "tx1.commit();\n"
-#~ "session1.close();\n"
-#~ "\n"
-#~ "//reconcile with a second database\n"
-#~ "Session session2 = factory2.openSession();\n"
-#~ "Transaction tx2 = session2.beginTransaction();\n"
-#~ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
-#~ "tx2.commit();\n"
-#~ "session2.close();]]>"
-#~ msgstr ""
-#~ "//retrieve a cat from one database\n"
-#~ "Session session1 = factory1.openSession();\n"
-#~ "Transaction tx1 = session1.beginTransaction();\n"
-#~ "Cat cat = session1.get(Cat.class, catId);\n"
-#~ "tx1.commit();\n"
-#~ "session1.close();\n"
-#~ "\n"
-#~ "//reconcile with a second database\n"
-#~ "Session session2 = factory2.openSession();\n"
-#~ "Transaction tx2 = session2.beginTransaction();\n"
-#~ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
-#~ "tx2.commit();\n"
-#~ "session2.close();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess = sf.openSession();\n"
-#~ "Transaction tx = sess.beginTransaction();\n"
-#~ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale "
-#~ "state\n"
-#~ "\n"
-#~ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
-#~ "izi.setName(iznizi);\n"
-#~ "\n"
-#~ "// might return stale data\n"
-#~ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
-#~ "\n"
-#~ "// change to izi is not flushed!\n"
-#~ "...\n"
-#~ "tx.commit(); // flush occurs\n"
-#~ "sess.close();]]>"
-#~ msgstr ""
-#~ "sess = sf.openSession();\n"
-#~ "Transaction tx = sess.beginTransaction();\n"
-#~ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale "
-#~ "state\n"
-#~ "\n"
-#~ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
-#~ "izi.setName(iznizi);\n"
-#~ "\n"
-#~ "// might return stale data\n"
-#~ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
-#~ "\n"
-#~ "// change to izi is not flushed!\n"
-#~ "...\n"
-#~ "tx.commit(); // flush occurs\n"
-#~ "sess.close();"
-
-#, fuzzy
-#~ msgid "<![CDATA[<one-to-one name=\"person\" cascade=\"persist\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" cascade=\"persist\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat fritz = ......;\n"
-#~ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
-#~ "\n"
-#~ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
-#~ "String[] propertyNames = catMeta.getPropertyNames();\n"
-#~ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
-#~ "\n"
-#~ "// get a Map of all properties which are not collections or associations\n"
-#~ "Map namedValues = new HashMap();\n"
-#~ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
-#~ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
-#~ "isCollectionType() ) {\n"
-#~ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Cat fritz = ......;\n"
-#~ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
-#~ "\n"
-#~ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
-#~ "String[] propertyNames = catMeta.getPropertyNames();\n"
-#~ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
-#~ "\n"
-#~ "// get a Map of all properties which are not collections or associations\n"
-#~ "Map namedValues = new HashMap();\n"
-#~ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
-#~ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
-#~ "isCollectionType() ) {\n"
-#~ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
-#~ " }\n"
-#~ "}"
+#~ "Eine besondere Art der Weitergabe namens <literal>delete-orphan</literal> "
+#~ "gilt nur bei \"One-to-Many\"-Assoziationen und zeigt an, dass der "
+#~ "<literal>delete()</literal>-Vorgang angewendet werden soll, wenn ein "
+#~ "untergeordnetes Objekt aus der Assoziation entfernt wird."
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/tutorial.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/tutorial.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/tutorial.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de at li.org>\n"
@@ -285,11 +285,13 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr ""
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
msgid ""
"Intended for new users, this chapter provides an step-by-step introduction "
@@ -300,6 +302,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
msgid ""
"This tutorial expects the user have knowledge of both Java and SQL. If you "
@@ -308,6 +311,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
msgid ""
"The distribution contains another example application under the "
@@ -315,11 +319,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr "Teil 1 - Die erste Hibernate Anwendung"
#. Tag: para
+#: tutorial.xml:64
#, fuzzy, no-c-format
msgid ""
"For this example, we will set up a small database application that can store "
@@ -330,6 +336,7 @@
"Informationen zu deren Organisatoren."
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
msgid ""
"Although you can use whatever database you feel comfortable using, we will "
@@ -339,11 +346,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr ""
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
msgid ""
"The first thing we need to do is to set up the development environment. We "
@@ -357,6 +366,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
msgid ""
"We will be using Maven in this tutorial, taking advantage of its transitive "
@@ -364,11 +374,65 @@
"automatically set up a project for us based on the maven descriptor."
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:97
+#, no-c-format
+msgid ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:100
#, no-c-format
msgid ""
"It is not a requirement to use Maven. If you wish to use something else to "
-"build this tutoial (such as Ant), the layout will remain the same. The only "
+"build this tutorial (such as Ant), the layout will remain the same. The only "
"change is that you will need to manually account for all the needed "
"dependencies. If you use something like <ulink url=\"http://ant.apache.org/"
"ivy/\">Ivy</ulink> providing transitive dependency management you would "
@@ -383,17 +447,20 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:117
#, no-c-format
msgid ""
"Save this file as <filename>pom.xml</filename> in the project root directory."
msgstr ""
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr "Die erste Klasse"
#. Tag: para
+#: tutorial.xml:126
#, fuzzy, no-c-format
msgid ""
"Next, we create a class that represents the event we want to store in the "
@@ -402,7 +469,86 @@
"Anschließend erstellen wir eine Klasse, die die Veranstaltung repräsentiert, "
"die in der Datenbank gespeichert werden soll."
+#. Tag: programlisting
+#: tutorial.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:133
#, fuzzy, no-c-format
msgid ""
"This class uses standard JavaBean naming conventions for property getter and "
@@ -421,6 +567,7 @@
"Reflexion zu instanziieren."
#. Tag: para
+#: tutorial.xml:141
#, fuzzy, no-c-format
msgid ""
"The <literal>id</literal> property holds a unique identifier value for a "
@@ -451,6 +598,7 @@
"persönlichen Bedürfnissen anpassen."
#. Tag: para
+#: tutorial.xml:156
#, fuzzy, no-c-format
msgid ""
"The no-argument constructor is a requirement for all persistent classes; "
@@ -467,6 +615,7 @@
"Instrumentierung benötigt."
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
msgid ""
"Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</"
@@ -474,11 +623,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr "Die Mapping-Datei"
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
msgid ""
"Hibernate needs to know how to load and store objects of the persistent "
@@ -493,11 +644,35 @@
"dieser Tabelle verwendet werden sollen."
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr "Die Grundstruktur einer Mapping-Datei sieht wie folgt aus:"
+#. Tag: programlisting
+#: tutorial.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping>\n"
+"[...]\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:187
#, fuzzy, no-c-format
msgid ""
"Hibernate DTD is sophisticated. You can use it for auto-completion of XML "
@@ -520,6 +695,7 @@
"</literal>-Verzeichnis der Hibernate-Distribution enthalten."
#. Tag: para
+#: tutorial.xml:200
#, fuzzy, no-c-format
msgid ""
"We will omit the DTD declaration in future examples to shorten the code. It "
@@ -529,6 +705,7 @@
"Code zu verkürzen. Natürlich ist dies nicht optional."
#. Tag: para
+#: tutorial.xml:206
#, fuzzy, no-c-format
msgid ""
"Between the two <literal>hibernate-mapping</literal> tags, include a "
@@ -542,7 +719,28 @@
"ersten Klasse sind) benötigen ein solches Mapping zu einer Tabelle in der "
"SQL-Datenbank:"
+#. Tag: programlisting
+#: tutorial.xml:213
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:215
#, fuzzy, no-c-format
msgid ""
"So far we have told Hibernate how to persist and load object of class "
@@ -562,7 +760,32 @@
"Generierungsstrategie von Hibernate für eine Ersatzspalte des primären "
"Kernbegriffs:"
+#. Tag: programlisting
+#: tutorial.xml:225
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
msgid ""
"The <literal>id</literal> element is the declaration of the identifier "
@@ -574,6 +797,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
msgid ""
"The nested <literal>generator</literal> element specifies the identifier "
@@ -586,14 +810,15 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:249
#, no-c-format
msgid ""
"<literal>native</literal> is no longer consider the best strategy in terms "
-"of portability. for further discussion, see <xref linkend=\"portability-idgen"
-"\" />"
+"of portability. for further discussion, see"
msgstr ""
#. Tag: para
+#: tutorial.xml:255
#, fuzzy, no-c-format
msgid ""
"Lastly, we need to tell Hibernate about the remaining entity class "
@@ -603,7 +828,38 @@
"in die Mapping-Datei auf. In der Standardeinstellung werden keine Properties "
"der Klasse als persistent angesehen:"
+#. Tag: programlisting
+#: tutorial.xml:261
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/"
+">\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:263
#, fuzzy, no-c-format
msgid ""
"Similar to the <literal>id</literal> element, the <literal>name</literal> "
@@ -619,6 +875,7 @@
"</literal> sowie <literal>getTitle()/setTitle()</literal> suchen."
#. Tag: para
+#: tutorial.xml:274
#, fuzzy, no-c-format
msgid ""
"Why does the <literal>date</literal> property mapping include the "
@@ -637,6 +894,7 @@
"einem anderen Namen gemappt werden sollte."
#. Tag: para
+#: tutorial.xml:284
#, fuzzy, no-c-format
msgid ""
"The <literal>title</literal> mapping also lacks a <literal>type</literal> "
@@ -674,6 +932,7 @@
"verwahrt."
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
msgid ""
"Hibernate makes this mapping type determination using reflection when the "
@@ -683,6 +942,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
msgid ""
"Save this mapping file as <filename>src/main/resources/org/hibernate/"
@@ -690,11 +950,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr "Die Konfiguration von Hibernate"
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
msgid ""
"At this point, you should have the persistent class and its mapping file in "
@@ -703,11 +965,13 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:324
#, no-c-format
msgid "We do this do that the data remains between runs."
msgstr ""
#. Tag: para
+#: tutorial.xml:329
#, fuzzy, no-c-format
msgid ""
"We will utilize the Maven exec plugin to launch the HSQLDB server by "
@@ -730,6 +994,7 @@
"Sie HSQL DB erneut."
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
msgid ""
"Hibernate will be connecting to the database on behalf of your application, "
@@ -743,6 +1008,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:351
#, fuzzy, no-c-format
msgid ""
"The built-in Hibernate connection pool is in no way intended for production "
@@ -750,6 +1016,7 @@
msgstr "Hash-Tabelle (nicht für den Produktionsgebrauch vorgesehen)"
#. Tag: para
+#: tutorial.xml:357
#, fuzzy, no-c-format
msgid ""
"For Hibernate's configuration, we can use a simple <literal>hibernate."
@@ -763,12 +1030,108 @@
"Aufbau verwendet werden. Die meisten Benutzer bevorzugen die XML-"
"Konfigurationsdatei:"
+#. Tag: programlisting
+#: tutorial.xml:363
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+msgstr ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb."
+"jdbcDriver</property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://"
+"localhost</property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"HSQLDialect</property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management --"
+">\n"
+" <property name=\"current_session_context_class\">thread</"
+"property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">create</property>\n"
+"\n"
+" <mapping resource=\"events/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr ""
#. Tag: para
+#: tutorial.xml:369
#, fuzzy, no-c-format
msgid ""
"You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory "
@@ -785,6 +1148,7 @@
"einfachere Inbetriebnahme)."
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
msgid ""
"The first four <literal>property</literal> elements contain the necessary "
@@ -793,13 +1157,15 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:383
#, no-c-format
msgid ""
"In most cases, Hibernate is able to properly determine which dialect to use. "
-"See <xref linkend=\"portability-dialectresolver\" /> for more information."
+"See <xref linkend=\"portability-dialectresolver\"/> for more information."
msgstr ""
#. Tag: para
+#: tutorial.xml:389
#, fuzzy, no-c-format
msgid ""
"Hibernate's automatic session management for persistence contexts is "
@@ -823,6 +1189,7 @@
"hinzugefügt."
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
msgid ""
"Save this file as <filename>hibernate.cfg.xml</filename> into the "
@@ -830,11 +1197,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:406
#, fuzzy, no-c-format
msgid "Building with Maven"
msgstr "\"Builden\" mit Ant"
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
msgid ""
"We will now build the tutorial with Maven. You will need to have Maven "
@@ -845,12 +1214,43 @@
"make sure we can compile everything so far:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+"<![CDATA[[hibernateTutorial]$ mvn compile\n"
+"[INFO] Scanning for projects...\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Building First Hibernate Tutorial\n"
+"[INFO] task-segment: [compile]\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] [resources:resources]\n"
+"[INFO] Using default encoding to copy filtered resources.\n"
+"[INFO] [compiler:compile]\n"
+"[INFO] Compiling 1 source file to /home/steve/projects/sandbox/"
+"hibernateTutorial/target/classes\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] BUILD SUCCESSFUL\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Total time: 2 seconds\n"
+"[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+"[INFO] Final Memory: 5M/547M\n"
+"[INFO] "
+"------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr "Inbetriebnahme und Helfer"
#. Tag: para
+#: tutorial.xml:425
#, fuzzy, no-c-format
msgid ""
"It is time to load and store some <literal>Event</literal> objects, but "
@@ -876,6 +1276,7 @@
"threadsicheres, allgemeingültiges Objekt, das einmal instanziiert ist."
#. Tag: para
+#: tutorial.xml:439
#, fuzzy, no-c-format
msgid ""
"We will create a <literal>HibernateUtil</literal> helper class that takes "
@@ -887,7 +1288,69 @@
"<literal>SessionFactory</literal> ermöglicht. Werfen wir einen Blick auf die "
"Implementierung:"
+#. Tag: programlisting
+#: tutorial.xml:445
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.util;\n"
+"\n"
+"import org.hibernate.SessionFactory;\n"
+"import org.hibernate.cfg.Configuration;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory = buildSessionFactory"
+"();\n"
+"\n"
+" private static SessionFactory buildSessionFactory() {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" return new Configuration().configure().buildSessionFactory();\n"
+" }\n"
+" catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"package util;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" sessionFactory = new Configuration().configure()."
+"buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
msgid ""
"Save this code as <filename>src/main/java/org/hibernate/tutorial/util/"
@@ -895,6 +1358,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:452
#, fuzzy, no-c-format
msgid ""
"This class not only produces the global <interfacename>org.hibernate."
@@ -912,6 +1376,7 @@
"aufsuchen."
#. Tag: para
+#: tutorial.xml:461
#, fuzzy, no-c-format
msgid ""
"If you give the <interfacename>org.hibernate.SessionFactory</interfacename> "
@@ -929,6 +1394,7 @@
"Optionen werden in der Referenz-Dokumentation von Hibernate näher erläutert."
#. Tag: para
+#: tutorial.xml:470
#, fuzzy, no-c-format
msgid ""
"You now need to configure a logging system. Hibernate uses commons logging "
@@ -952,6 +1418,7 @@
"werden nur die Hibernate Startup-Nachrichten in stdout dargesellt."
#. Tag: para
+#: tutorial.xml:480
#, fuzzy, no-c-format
msgid ""
"The tutorial infrastructure is complete and you are now ready to do some "
@@ -961,14 +1428,16 @@
"Benutzung von Hibernate beginnen."
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr "Das Laden und Speichern von Objekten"
#. Tag: para
+#: tutorial.xml:490
#, fuzzy, no-c-format
msgid ""
-"We are now ready to start doing some real worjk with Hibernate. Let's start "
+"We are now ready to start doing some real work with Hibernate. Let's start "
"by writing an <literal>EventManager</literal> class with a <literal>main()</"
"literal> method:"
msgstr ""
@@ -976,7 +1445,85 @@
"<literal>EventManager</literal>-Klasse wird mit einer <literal>main()</"
"literal>-Methode geschrieben:"
+#. Tag: programlisting
+#: tutorial.xml:496
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial;\n"
+"\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.*;\n"
+"\n"
+"import org.hibernate.tutorial.domain.Event;\n"
+"import org.hibernate.tutorial.util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"import util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+"\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:498
#, fuzzy, no-c-format
msgid ""
"In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</"
@@ -991,10 +1538,11 @@
"ehe wir dies starten."
#. Tag: para
+#: tutorial.xml:505
#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> is designed to represent a "
-"single unit of work (a single atmoic piece of work to be performed). For now "
+"single unit of work (a single atomic piece of work to be performed). For now "
"we will keep things simple and assume a one-to-one granularity between a "
"Hibernate <interface>org.hibernate.Session</interface> and a database "
"transaction. To shield our code from the actual underlying transaction "
@@ -1012,6 +1560,7 @@
"Hibernate <literal>Session</literal> verfügbar ist."
#. Tag: para
+#: tutorial.xml:518
#, fuzzy, no-c-format
msgid ""
"What does <literal>sessionFactory.getCurrentSession()</literal> do? First, "
@@ -1036,6 +1585,7 @@
"sie endet."
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
msgid ""
"Hibernate offers three methods of current session tracking. The \"thread\" "
@@ -1045,6 +1595,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:541
#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> begins when the first call to "
@@ -1070,6 +1621,7 @@
"gehen darauf später in dieser Anleitung ein)."
#. Tag: para
+#: tutorial.xml:554
#, fuzzy, no-c-format
msgid ""
"Related to the unit of work scope, should the Hibernate <interface>org."
@@ -1099,9 +1651,10 @@
"gezeigt."
#. Tag: para
+#: tutorial.xml:571
#, fuzzy, no-c-format
msgid ""
-"See <xref linkend=\"transactions\" /> for more information about transaction "
+"See <xref linkend=\"transactions\"/> for more information about transaction "
"handling and demarcation. The previous example also skipped any error "
"handling and rollback."
msgstr ""
@@ -1110,6 +1663,7 @@
"und Zurücksetzen wurden im vorherigen Beispiel weggelassen."
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
msgid ""
"To run this, we will make use of the Maven exec plugin to call our class "
@@ -1118,11 +1672,13 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
msgstr ""
#. Tag: para
+#: tutorial.xml:589
#, fuzzy, no-c-format
msgid ""
"You should see Hibernate starting up and, depending on your configuration, "
@@ -1132,7 +1688,18 @@
"nach der von Ihnen verwendeten Konfiguration - eine Menge an "
"Protokollausgaben. Am Ende sehen Sie die folgende Zeile:"
+#. Tag: programlisting
+#: tutorial.xml:594
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) "
+"values (?, ?, ?)]]>"
+msgstr ""
+"[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values "
+"(?, ?, ?)"
+
#. Tag: para
+#: tutorial.xml:596
#, fuzzy, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr ""
@@ -1140,26 +1707,86 @@
"Anweisung:"
#. Tag: para
+#: tutorial.xml:600
#, fuzzy, no-c-format
msgid "To list stored events an option is added to the main method:"
msgstr ""
"Als nächstes sollen auch die gespeicherten Veranstaltungen gelistet werden, "
"daher fügen wir eine Option zur Hauptmethode hinzu:"
+#. Tag: programlisting
+#: tutorial.xml:604
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+" else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\n"
+" \"Event: \" + theEvent.getTitle() + \" Time: \" + "
+"theEvent.getDate()\n"
+" );\n"
+" }\n"
+" }]]>"
+msgstr ""
+"if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+"}\n"
+"else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\"Event: \" + theEvent.getTitle() +\n"
+" \" Time: \" + theEvent.getDate());\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:606
#, fuzzy, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr ""
"Eine neue <literal>listEvents() method</literal> wird ebenfalls hinzugefügt:"
+#. Tag: programlisting
+#: tutorial.xml:610
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private List listEvents() {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+" session.getTransaction().commit();\n"
+" return result;\n"
+" }]]>"
+msgstr ""
+"private List listEvents() {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+"\n"
+" session.beginTransaction();\n"
+"\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" return result;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:612
#, fuzzy, no-c-format
msgid ""
"Here, we are using a Hibernate Query Language (HQL) query to load all "
"existing <literal>Event</literal> objects from the database. Hibernate will "
"generate the appropriate SQL, send it to the database and populate "
"<literal>Event</literal> objects with the data. You can create more complex "
-"queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
+"queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
msgstr ""
"Mittels HQL-Anfrage (\"Hibernate Query Language\") werden alle bestehenden "
"<literal>Event</literal>-Objekte aus der Datenbank geladen. Hibernate "
@@ -1168,6 +1795,7 @@
"Daten. Natürlich können mit HQL auch komplexere Anfragen erstellt werden."
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
msgid ""
"Now we can call our new functionality, again using the Maven exec plugin: "
@@ -1176,11 +1804,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr "Teil 2 - Mapping-Assoziationen"
#. Tag: para
+#: tutorial.xml:632
#, fuzzy, no-c-format
msgid ""
"So far we have mapped a single persistent entity class to a table in "
@@ -1194,16 +1824,53 @@
"Veranstaltungen, an denen diese teilnehmen, hinzu."
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr "Das Mappen der Personenklasse"
#. Tag: para
+#: tutorial.xml:642
#, fuzzy, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
msgstr "Der erste Teil der <literal>Person</literal>-Klasse ist einfach:"
+#. Tag: programlisting
+#: tutorial.xml:646
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
msgid ""
"Save this to a file named <filename>src/main/java/org/hibernate/tutorial/"
@@ -1211,20 +1878,63 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
msgid ""
"Next, create the new mapping file as <filename>src/main/resources/org/"
"hibernate/tutorial/domain/Person.hbm.xml</filename>"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:658
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr ""
"Anschließend fügen Sie dann das neue Mapping der Konfiguration von Hibernate "
"hinzu:"
+#. Tag: programlisting
+#: tutorial.xml:664
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+"<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>"
+
#. Tag: para
+#: tutorial.xml:666
#, fuzzy, no-c-format
msgid ""
"Create an association between these two entities. Persons can participate in "
@@ -1237,11 +1947,13 @@
"Richtungsabhängigkeit, Multiplizität und des Collection-Verhaltens."
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr "Eine unidirektionale \"Set\"-basierte Assoziation"
#. Tag: para
+#: tutorial.xml:678
#, fuzzy, no-c-format
msgid ""
"By adding a collection of events to the <literal>Person</literal> class, you "
@@ -1260,7 +1972,38 @@
"literal>, weil die Collection keine doppelten Elemente enthält und die "
"Reihenfolge für uns nicht von Bedeutung ist."
+#. Tag: programlisting
+#: tutorial.xml:689
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}]]>"
+msgstr ""
+"public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:691
#, fuzzy, no-c-format
msgid ""
"Before mapping this association, let's consider the other side. We could "
@@ -1285,7 +2028,42 @@
"nennen wir dies eine <emphasis>\"Many-to-Many\"</emphasis>-Assoziation. Wir "
"verwenden daher Hibernates \"Many-to-Many\"-Mapping:"
+#. Tag: programlisting
+#: tutorial.xml:704
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>]]>"
+msgstr ""
+"<class name=\"events.Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"events.Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>"
+
#. Tag: para
+#: tutorial.xml:706
#, fuzzy, no-c-format
msgid ""
"Hibernate supports a broad range of collection mappings, a <literal>set</"
@@ -1314,16 +2092,49 @@
"(korrekt: die Klasse auf der anderen Seite der Verweis-Collection)."
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr "Das Datenbankschema für dieses Mapping lautet daher:"
+#. Tag: programlisting
+#: tutorial.xml:726
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+"_____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|"
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr "Das Bearbeiten der Assoziation"
#. Tag: para
+#: tutorial.xml:733
#, fuzzy, no-c-format
msgid ""
"Now we will bring some people and events together in a new method in "
@@ -1332,7 +2143,38 @@
"Nun werden einige Personen und Veranstaltungen in einer neuen Methode im "
"<literal>EventManager</literal> vereint:"
+#. Tag: programlisting
+#: tutorial.xml:737
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addPersonToEvent(Long personId, Long eventId) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:739
#, fuzzy, no-c-format
msgid ""
"After loading a <literal>Person</literal> and an <literal>Event</literal>, "
@@ -1371,6 +2213,7 @@
"definiert."
#. Tag: para
+#: tutorial.xml:758
#, fuzzy, no-c-format
msgid ""
"You can load person and event in different units of work. Or you can modify "
@@ -1386,7 +2229,75 @@
"<emphasis>\"detached\"</emphasis> d.h. abgesetzt). Sie können eine "
"Collection sogar modifizieren, wenn diese abgesetzt ist:"
+#. Tag: programlisting
+#: tutorial.xml:767
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p."
+"events where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use "
+"it detached\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory()."
+"getCurrentSession();\n"
+" session2.beginTransaction();\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addPersonToEvent(Long personId, Long eventId) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p.events "
+"where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use it "
+"detached\n"
+"\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session2.beginTransaction();\n"
+"\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:769
#, fuzzy, no-c-format
msgid ""
"The call to <literal>update</literal> makes a detached object persistent "
@@ -1403,6 +2314,7 @@
"Entity-Objekts vorgenommen wurden."
#. Tag: para
+#: tutorial.xml:778
#, fuzzy, no-c-format
msgid ""
"This is not much use in our example, but it is an important concept you can "
@@ -1422,7 +2334,29 @@
"sein, dass Sie einige der vorherigen Methoden ändern müssen, damit der "
"Identifier wiedergegeben wird):"
+#. Tag: programlisting
+#: tutorial.xml:786
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
+"());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" "
+"+ eventId);\n"
+" }]]>"
+msgstr ""
+"else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" + "
+"eventId);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:788
#, fuzzy, no-c-format
msgid ""
"This is an example of an association between two equally important classes : "
@@ -1454,6 +2388,7 @@
"z.B. <literal>Address</literal> oder <literal>MonetaryAmount</literal>."
#. Tag: para
+#: tutorial.xml:806
#, fuzzy, no-c-format
msgid ""
"You can also design a collection of value types. This is conceptually "
@@ -1465,11 +2400,13 @@
"Entities, sieht aber in Java fast genauso aus."
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr "Collection von Werten"
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
msgid ""
"Let's add a collection of email addresses to the <literal>Person</literal> "
@@ -1477,12 +2414,52 @@
"interfacename> of <classname>java.lang.String</classname> instances:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:823
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private Set emailAddresses = new HashSet();\n"
+"\n"
+" public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+" }\n"
+"\n"
+" public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+" }]]>"
+msgstr ""
+"private Set emailAddresses = new HashSet();\n"
+"\n"
+"public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+"}\n"
+"\n"
+"public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:825
#, fuzzy, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr "Das Mapping dieses <literal>Set</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:829
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+" </set>]]>"
+msgstr ""
+"<set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+"</set>"
+
#. Tag: para
+#: tutorial.xml:831
#, fuzzy, no-c-format
msgid ""
"The difference compared with the earlier mapping is the use of the "
@@ -1510,11 +2487,57 @@
"dem die <literal>String</literal>-Werte gespeichert werden."
#. Tag: para
+#: tutorial.xml:847
#, fuzzy, no-c-format
msgid "Here is the updated schema:"
msgstr "Werfen wir einen Blick auf das aktualisierte Schema:"
+#. Tag: programlisting
+#: tutorial.xml:851
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
+"*PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+"_____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--"
+"> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|"
+
#. Tag: para
+#: tutorial.xml:853
#, fuzzy, no-c-format
msgid ""
"You can see that the primary key of the collection table is in fact a "
@@ -1529,6 +2552,7 @@
"in Java ist."
#. Tag: para
+#: tutorial.xml:859
#, fuzzy, no-c-format
msgid ""
"You can now try to add elements to this collection, just like we did before "
@@ -1538,7 +2562,40 @@
"dieser zu entnehmen, genau wie wir es zuvor bei der Verbindung von Personen "
"und Veranstaltungen getan haben. In Java ist es derselbe Code:"
+#. Tag: programlisting
+#: tutorial.xml:864
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addEmailToPerson(Long personId, String "
+"emailAddress) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" // adding to the emailAddress collection might trigger a lazy load "
+"of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addEmailToPerson(Long personId, String emailAddress) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+"\n"
+" // The getEmailAddresses() might trigger a lazy load of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:866
#, fuzzy, no-c-format
msgid ""
"This time we did not use a <emphasis>fetch</emphasis> query to initialize "
@@ -1554,11 +2611,13 @@
"optimieren."
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr "Bidirektionale Assoziationen"
#. Tag: para
+#: tutorial.xml:877
#, fuzzy, no-c-format
msgid ""
"Next you will map a bi-directional association. You will make the "
@@ -1575,6 +2634,7 @@
"eingesehen und aufgerufen werden."
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
msgid ""
"A relational database is more flexible than a network programming language, "
@@ -1583,6 +2643,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:893
#, fuzzy, no-c-format
msgid ""
"First, add a collection of participants to the <literal>Event</literal> "
@@ -1591,7 +2652,32 @@
"Zuerst wird eine Collection von Teilnehmern der <literal>Event</literal> "
"Veranstaltungsklasse hinzugefügt:"
+#. Tag: programlisting
+#: tutorial.xml:898
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private Set participants = new HashSet();\n"
+"\n"
+" public Set getParticipants() {\n"
+" return participants;\n"
+" }\n"
+"\n"
+" public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+" }]]>"
+msgstr ""
+"private Set participants = new HashSet();\n"
+"\n"
+"public Set getParticipants() {\n"
+" return participants;\n"
+"}\n"
+"\n"
+"public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:900
#, fuzzy, no-c-format
msgid ""
"Now map this side of the association in <literal>Event.hbm.xml</literal>."
@@ -1599,7 +2685,23 @@
"Nun mappen Sie auch diese Seite der Assoziation in <literal>Event.hbm.xml</"
"literal>."
+#. Tag: programlisting
+#: tutorial.xml:904
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse="
+"\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+" </set>]]>"
+msgstr ""
+"<set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+"</set>"
+
#. Tag: para
+#: tutorial.xml:906
#, fuzzy, no-c-format
msgid ""
"These are normal <literal>set</literal> mappings in both mapping documents. "
@@ -1617,6 +2719,7 @@
"Element des Collection-Mappings des<literal>Event</literal>s."
#. Tag: para
+#: tutorial.xml:914
#, fuzzy, no-c-format
msgid ""
"What this means is that Hibernate should take the other side, the "
@@ -1630,11 +2733,13 @@
"beiden Entities erstellt wird, wird das noch verständlicher."
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr "Die Bearbeitung bidirektionaler Verbindungen"
#. Tag: para
+#: tutorial.xml:925
#, fuzzy, no-c-format
msgid ""
"First, keep in mind that Hibernate does not affect normal Java semantics. "
@@ -1660,6 +2765,7 @@
"nie vergessen es zu tun."
#. Tag: para
+#: tutorial.xml:935
#, fuzzy, no-c-format
msgid ""
"Many developers program defensively and create link management methods to "
@@ -1669,7 +2775,48 @@
"Methoden Verbindung, um beide Seiten korrekt einzustellen, z.B. in "
"<literal>Person</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:940
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ protected Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"\n"
+" public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+" }\n"
+"\n"
+" public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+" }]]>"
+msgstr ""
+"protected Set getEvents() {\n"
+" return events;\n"
+"}\n"
+"\n"
+"protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+"}\n"
+"\n"
+"public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+"}\n"
+"\n"
+"public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:942
#, fuzzy, no-c-format
msgid ""
"The get and set methods for the collection are now protected. This allows "
@@ -1684,6 +2831,7 @@
"Collection auf der anderen Seite zu tun."
#. Tag: para
+#: tutorial.xml:949
#, fuzzy, no-c-format
msgid ""
"What about the <literal>inverse</literal> mapping attribute? For you, and "
@@ -1718,11 +2866,13 @@
"beiden Seiten sein."
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr "Teil 3 - Die EventManager-Webanwendung"
#. Tag: para
+#: tutorial.xml:967
#, fuzzy, no-c-format
msgid ""
"A Hibernate web application uses <literal>Session</literal> and "
@@ -1739,11 +2889,13 @@
"Formular, in das neue Veranstaltungen eingetragen werden können."
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr "Das Schreiben des Grundservlets"
#. Tag: para
+#: tutorial.xml:977
#, fuzzy, no-c-format
msgid ""
"First we need create our basic processing servlet. Since our servlet only "
@@ -1753,7 +2905,76 @@
"Das Servlet bearbeitet nur HTTP <literal>GET</literal>-Anfragen, daher wird "
"die <literal>doGet()</literal>-Methode implementiert:"
+#. Tag: programlisting
+#: tutorial.xml:983
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.web;\n"
+"\n"
+"// Imports\n"
+"\n"
+"public class EventManagerServlet extends HttpServlet {\n"
+"\n"
+" protected void doGet(\n"
+" HttpServletRequest request,\n"
+" HttpServletResponse response) throws ServletException, "
+"IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy"
+"\" );\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().commit();\n"
+" }\n"
+" catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().rollback();\n"
+" if ( ServletException.class.isInstance( ex ) ) {\n"
+" throw ( ServletException ) ex;\n"
+" }\n"
+" else {\n"
+" throw new ServletException( ex );\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"protected void doGet(HttpServletRequest request,\n"
+" HttpServletResponse response)\n"
+" throws ServletException, IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat(\"dd.MM.yyyy\");\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().getTransaction().commit();\n"
+"\n"
+" } catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().getTransaction().rollback();\n"
+" throw new ServletException(ex);\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
msgid ""
"Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/"
@@ -1761,6 +2982,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:990
#, fuzzy, no-c-format
msgid ""
"The pattern applied here is called <emphasis>session-per-request</emphasis>. "
@@ -1780,6 +3002,7 @@
"Auto-Commit-Modus wird in Anwendungen nicht verwendet)."
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
msgid ""
"Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> "
@@ -1794,6 +3017,7 @@
"aktuellen Java-Thread gebunden wird."
#. Tag: para
+#: tutorial.xml:1006
#, fuzzy, no-c-format
msgid ""
"Next, the possible actions of the request are processed and the response "
@@ -1803,6 +3027,7 @@
"HTML-Antwort gerendert. Dieser Teil wird in Kürze behandelt."
#. Tag: para
+#: tutorial.xml:1011
#, fuzzy, no-c-format
msgid ""
"Finally, the unit of work ends when processing and rendering are complete. "
@@ -1826,11 +3051,13 @@
"Ihrer Ansicht in JSP in Erwägung ziehen, nicht in einem Servlet."
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr "Bearbeitung und Rendering"
#. Tag: para
+#: tutorial.xml:1027
#, fuzzy, no-c-format
msgid ""
"Now you can implement the processing of the request and the rendering of the "
@@ -1838,7 +3065,73 @@
msgstr ""
"Implementieren wir nun die Anfragenbearbeitung und das Rendern der Seite."
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ // Write HTML header\n"
+" PrintWriter out = response.getWriter();\n"
+" out.println(\"<html><head><title>Event Manager</title></head><body>"
+"\");\n"
+"\n"
+" // Handle actions\n"
+" if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date.</i></"
+"b>\");\n"
+" }\n"
+" else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse"
+"(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>\");\n"
+" }\n"
+" }\n"
+"\n"
+" // Print page\n"
+" printEventForm(out);\n"
+" listEvents(out, dateFormatter);\n"
+"\n"
+" // Write HTML footer\n"
+" out.println(\"</body></html>\");\n"
+" out.flush();\n"
+" out.close();]]>"
+msgstr ""
+"// Write HTML header\n"
+"PrintWriter out = response.getWriter();\n"
+"out.println(\"<html><head><title>Event Manager</"
+"title></head><body>\");\n"
+"\n"
+"// Handle actions\n"
+"if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date."
+"</i></b>\");\n"
+" } else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>"
+"\");\n"
+" }\n"
+"}\n"
+"\n"
+"// Print page\n"
+"printEventForm(out);\n"
+"listEvents(out, dateFormatter);\n"
+"\n"
+"// Write HTML footer\n"
+"out.println(\"</body></html>\");\n"
+"out.flush();\n"
+"out.close();"
+
#. Tag: para
+#: tutorial.xml:1033
#, fuzzy, no-c-format
msgid ""
"This coding style, with a mix of Java and HTML, would not scale in a more "
@@ -1856,7 +3149,36 @@
"Liste sämtlicher Veranstaltungen in der Datenbank gedruckt. Die erste "
"Methode ist trivial und gibt nur HTML aus."
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
+"\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+" }]]>"
+msgstr ""
+"private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/"
+">\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
msgid ""
"The <literal>listEvents()</literal> method uses the Hibernate "
@@ -1866,7 +3188,62 @@
"Thread gebundene Hibernate <literal>Session</literal> bei der Ausführung "
"einer Abfrage:"
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
+"dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" Iterator it = result.iterator();\n"
+" while (it.hasNext()) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate()) "
+"+ \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+" }]]>"
+msgstr ""
+"private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list"
+"();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" for (Iterator it = result.iterator(); it.hasNext();) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>"
+"\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate"
+"()) + \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
msgid ""
"Finally, the <literal>store</literal> action is dispatched to the "
@@ -1877,7 +3254,31 @@
"<literal>createAndStoreEvent()</literal>-Methode gesendet, die ebenfalls die "
"<literal>Session</literal> des aktuellen Threads verwendet:"
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) "
+"{\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+" }]]>"
+msgstr ""
+"protected void createAndStoreEvent(String title, Date theDate) {\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1060
#, fuzzy, no-c-format
msgid ""
"The servlet is now complete. A request to the servlet will be processed in a "
@@ -1900,11 +3301,13 @@
"Sie weitere Beispiele."
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr "Deployment und Test"
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
msgid ""
"To deploy this application for testing we must create a Web ARchive (WAR). "
@@ -1912,7 +3315,50 @@
"web.xml</filename>"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/"
+"xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
+"servlet-class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>]]>"
+msgstr ""
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n"
+" http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>events.EventManagerServlet</servlet-"
+"class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>"
+
#. Tag: para
+#: tutorial.xml:1084
#, fuzzy, no-c-format
msgid ""
"To build and deploy call <literal>mvn package</literal> in your project "
@@ -1928,14 +3374,16 @@
"ändern, um diese Anwendung auszuführen."
#. Tag: para
+#: tutorial.xml:1091
#, no-c-format
msgid ""
"If you do not have Tomcat installed, download it from <ulink url=\"http://"
-"tomcat.apache.org/\" /> and follow the installation instructions. Our "
+"tomcat.apache.org/\"></ulink> and follow the installation instructions. Our "
"application requires no changes to the standard Tomcat configuration."
msgstr ""
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
msgid ""
"Once deployed and Tomcat is running, access the application at "
@@ -1954,11 +3402,13 @@
"Ausnahmen."
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr "Zusammenfassung"
#. Tag: para
+#: tutorial.xml:1114
#, fuzzy, no-c-format
msgid ""
"This tutorial covered the basics of writing a simple standalone Hibernate "
@@ -1967,1181 +3417,3 @@
msgstr ""
"Diese Anleitung behandelt in Grundzügen die Erstellung einer einfachen "
"selbständigen Hibernate-Applikation und einer kleinen Webanwendung."
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Event {\n"
-#~ " private Long id;\n"
-#~ "\n"
-#~ " private String title;\n"
-#~ " private Date date;\n"
-#~ "\n"
-#~ " public Event() {}\n"
-#~ "\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id = id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Date getDate() {\n"
-#~ " return date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setDate(Date date) {\n"
-#~ " this.date = date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getTitle() {\n"
-#~ " return title;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setTitle(String title) {\n"
-#~ " this.title = title;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Event {\n"
-#~ " private Long id;\n"
-#~ "\n"
-#~ " private String title;\n"
-#~ " private Date date;\n"
-#~ "\n"
-#~ " public Event() {}\n"
-#~ "\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id = id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Date getDate() {\n"
-#~ " return date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setDate(Date date) {\n"
-#~ " this.date = date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getTitle() {\n"
-#~ " return title;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setTitle(String title) {\n"
-#~ " this.title = title;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping>\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Event\" table=\"EVENTS\">\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/"
-#~ ">\n"
-#~ " <property name=\"title\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE"
-#~ "\"/>\n"
-#~ " <property name=\"title\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!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"
-#~ "\n"
-#~ " <session-factory>\n"
-#~ "\n"
-#~ " <!-- Database connection settings -->\n"
-#~ " <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
-#~ "property>\n"
-#~ " <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
-#~ "property>\n"
-#~ " <property name=\"connection.username\">sa</property>\n"
-#~ " <property name=\"connection.password\"></property>\n"
-#~ "\n"
-#~ " <!-- JDBC connection pool (use the built-in) -->\n"
-#~ " <property name=\"connection.pool_size\">1</property>\n"
-#~ "\n"
-#~ " <!-- SQL dialect -->\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Enable Hibernate's automatic session context management -->\n"
-#~ " <property name=\"current_session_context_class\">thread</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Disable the second-level cache -->\n"
-#~ " <property name=\"cache.provider_class\">org.hibernate.cache."
-#~ "NoCacheProvider</property>\n"
-#~ "\n"
-#~ " <!-- Echo all executed SQL to stdout -->\n"
-#~ " <property name=\"show_sql\">true</property>\n"
-#~ "\n"
-#~ " <!-- Drop and re-create the database schema on startup -->\n"
-#~ " <property name=\"hbm2ddl.auto\">update</property>\n"
-#~ "\n"
-#~ " <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/"
-#~ ">\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-#~ msgstr ""
-#~ "<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!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"
-#~ "\n"
-#~ " <session-factory>\n"
-#~ "\n"
-#~ " <!-- Database connection settings -->\n"
-#~ " <property name=\"connection.driver_class\">org.hsqldb."
-#~ "jdbcDriver</property>\n"
-#~ " <property name=\"connection.url\">jdbc:hsqldb:hsql://"
-#~ "localhost</property>\n"
-#~ " <property name=\"connection.username\">sa</property>\n"
-#~ " <property name=\"connection.password\"></property>\n"
-#~ "\n"
-#~ " <!-- JDBC connection pool (use the built-in) -->\n"
-#~ " <property name=\"connection.pool_size\">1</property>\n"
-#~ "\n"
-#~ " <!-- SQL dialect -->\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect."
-#~ "HSQLDialect</property>\n"
-#~ "\n"
-#~ " <!-- Enable Hibernate's automatic session context management --"
-#~ ">\n"
-#~ " <property name=\"current_session_context_class\">thread</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Disable the second-level cache -->\n"
-#~ " <property name=\"cache.provider_class\">org.hibernate.cache."
-#~ "NoCacheProvider</property>\n"
-#~ "\n"
-#~ " <!-- Echo all executed SQL to stdout -->\n"
-#~ " <property name=\"show_sql\">true</property>\n"
-#~ "\n"
-#~ " <!-- Drop and re-create the database schema on startup -->\n"
-#~ " <property name=\"hbm2ddl.auto\">create</property>\n"
-#~ "\n"
-#~ " <mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.util;\n"
-#~ "\n"
-#~ "import org.hibernate.SessionFactory;\n"
-#~ "import org.hibernate.cfg.Configuration;\n"
-#~ "\n"
-#~ "public class HibernateUtil {\n"
-#~ "\n"
-#~ " private static final SessionFactory sessionFactory = "
-#~ "buildSessionFactory();\n"
-#~ "\n"
-#~ " private static SessionFactory buildSessionFactory() {\n"
-#~ " try {\n"
-#~ " // Create the SessionFactory from hibernate.cfg.xml\n"
-#~ " return new Configuration().configure().buildSessionFactory"
-#~ "();\n"
-#~ " }\n"
-#~ " catch (Throwable ex) {\n"
-#~ " // Make sure you log the exception, as it might be swallowed\n"
-#~ " System.err.println(\"Initial SessionFactory creation failed."
-#~ "\" + ex);\n"
-#~ " throw new ExceptionInInitializerError(ex);\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " public static SessionFactory getSessionFactory() {\n"
-#~ " return sessionFactory;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package util;\n"
-#~ "\n"
-#~ "import org.hibernate.*;\n"
-#~ "import org.hibernate.cfg.*;\n"
-#~ "\n"
-#~ "public class HibernateUtil {\n"
-#~ "\n"
-#~ " private static final SessionFactory sessionFactory;\n"
-#~ "\n"
-#~ " static {\n"
-#~ " try {\n"
-#~ " // Create the SessionFactory from hibernate.cfg.xml\n"
-#~ " sessionFactory = new Configuration().configure()."
-#~ "buildSessionFactory();\n"
-#~ " } catch (Throwable ex) {\n"
-#~ " // Make sure you log the exception, as it might be swallowed\n"
-#~ " System.err.println(\"Initial SessionFactory creation failed."
-#~ "\" + ex);\n"
-#~ " throw new ExceptionInInitializerError(ex);\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " public static SessionFactory getSessionFactory() {\n"
-#~ " return sessionFactory;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial;\n"
-#~ "\n"
-#~ "import org.hibernate.Session;\n"
-#~ "\n"
-#~ "import java.util.*;\n"
-#~ "\n"
-#~ "import org.hibernate.tutorial.domain.Event;\n"
-#~ "import org.hibernate.tutorial.util.HibernateUtil;\n"
-#~ "\n"
-#~ "public class EventManager {\n"
-#~ "\n"
-#~ " public static void main(String[] args) {\n"
-#~ " EventManager mgr = new EventManager();\n"
-#~ "\n"
-#~ " if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory().close();\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void createAndStoreEvent(String title, Date theDate) {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ " session.save(theEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "import org.hibernate.Session;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "import util.HibernateUtil;\n"
-#~ "\n"
-#~ "public class EventManager {\n"
-#~ "\n"
-#~ " public static void main(String[] args) {\n"
-#~ " EventManager mgr = new EventManager();\n"
-#~ "\n"
-#~ " if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory().close();\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void createAndStoreEvent(String title, Date theDate) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ "\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " session.save(theEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, "
-#~ "EVENT_ID) values (?, ?, ?)]]>"
-#~ msgstr ""
-#~ "[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values "
-#~ "(?, ?, ?)"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ " else if (args[0].equals(\"list\")) {\n"
-#~ " List events = mgr.listEvents();\n"
-#~ " for (int i = 0; i < events.size(); i++) {\n"
-#~ " Event theEvent = (Event) events.get(i);\n"
-#~ " System.out.println(\n"
-#~ " \"Event: \" + theEvent.getTitle() + \" Time: \" + "
-#~ "theEvent.getDate()\n"
-#~ " );\n"
-#~ " }\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ "}\n"
-#~ "else if (args[0].equals(\"list\")) {\n"
-#~ " List events = mgr.listEvents();\n"
-#~ " for (int i = 0; i < events.size(); i++) {\n"
-#~ " Event theEvent = (Event) events.get(i);\n"
-#~ " System.out.println(\"Event: \" + theEvent.getTitle() +\n"
-#~ " \" Time: \" + theEvent.getDate());\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private List listEvents() {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ " List result = session.createQuery(\"from Event\").list();\n"
-#~ " session.getTransaction().commit();\n"
-#~ " return result;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private List listEvents() {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ "\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " List result = session.createQuery(\"from Event\").list();\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " return result;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Long id;\n"
-#~ " private int age;\n"
-#~ " private String firstname;\n"
-#~ " private String lastname;\n"
-#~ "\n"
-#~ " public Person() {}\n"
-#~ "\n"
-#~ " // Accessor methods for all properties, private setter for 'id'\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "\n"
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Long id;\n"
-#~ " private int age;\n"
-#~ " private String firstname;\n"
-#~ " private String lastname;\n"
-#~ "\n"
-#~ " public Person() {}\n"
-#~ "\n"
-#~ " // Accessor methods for all properties, private setter for 'id'\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "<mapping resource=\"events/Person.hbm.xml\"/>]]>"
-#~ msgstr ""
-#~ "<mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "<mapping resource=\"events/Person.hbm.xml\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[public class Person {\n"
-#~ "\n"
-#~ " private Set events = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Set events = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ "\n"
-#~ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"events.Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ "\n"
-#~ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <many-to-many column=\"EVENT_ID\" class=\"events.Event\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ " _____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | |\n"
-#~ " |_____________| |__________________| | PERSON |\n"
-#~ " | | | | |_____________|\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE |\n"
-#~ " |_____________| | FIRSTNAME |\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|\n"
-#~ " ]]>"
-#~ msgstr ""
-#~ "_____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | |\n"
-#~ " |_____________| |__________________| | PERSON |\n"
-#~ " | | | | |_____________|\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE |\n"
-#~ " |_____________| | FIRSTNAME |\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) "
-#~ "{\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ " aPerson.getEvents().add(anEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addPersonToEvent(Long personId, Long eventId) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) "
-#~ "{\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session\n"
-#~ " .createQuery(\"select p from Person p left join fetch p."
-#~ "events where p.id = :pid\")\n"
-#~ " .setParameter(\"pid\", personId)\n"
-#~ " .uniqueResult(); // Eager fetch the collection so we can "
-#~ "use it detached\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " // End of first unit of work\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) "
-#~ "is detached\n"
-#~ "\n"
-#~ " // Begin second unit of work\n"
-#~ "\n"
-#~ " Session session2 = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session2.beginTransaction();\n"
-#~ " session2.update(aPerson); // Reattachment of aPerson\n"
-#~ "\n"
-#~ " session2.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addPersonToEvent(Long personId, Long eventId) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session\n"
-#~ " .createQuery(\"select p from Person p left join fetch p."
-#~ "events where p.id = :pid\")\n"
-#~ " .setParameter(\"pid\", personId)\n"
-#~ " .uniqueResult(); // Eager fetch the collection so we can use "
-#~ "it detached\n"
-#~ "\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " // End of first unit of work\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
-#~ "detached\n"
-#~ "\n"
-#~ " // Begin second unit of work\n"
-#~ "\n"
-#~ " Session session2 = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session2.beginTransaction();\n"
-#~ "\n"
-#~ " session2.update(aPerson); // Reattachment of aPerson\n"
-#~ "\n"
-#~ " session2.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
-#~ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
-#~ "());\n"
-#~ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
-#~ " mgr.addPersonToEvent(personId, eventId);\n"
-#~ " System.out.println(\"Added person \" + personId + \" to event "
-#~ "\" + eventId);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "else if (args[0].equals(\"addpersontoevent\")) {\n"
-#~ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
-#~ " mgr.addPersonToEvent(personId, eventId);\n"
-#~ " System.out.println(\"Added person \" + personId + \" to event \" + "
-#~ "eventId);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private Set emailAddresses = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEmailAddresses() {\n"
-#~ " return emailAddresses;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEmailAddresses(Set emailAddresses) {\n"
-#~ " this.emailAddresses = emailAddresses;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private Set emailAddresses = new HashSet();\n"
-#~ "\n"
-#~ "public Set getEmailAddresses() {\n"
-#~ " return emailAddresses;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void setEmailAddresses(Set emailAddresses) {\n"
-#~ " this.emailAddresses = emailAddresses;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR"
-#~ "\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
-#~ " </set>]]>"
-#~ msgstr ""
-#~ "<set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ " _____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | | "
-#~ "___________________\n"
-#~ " |_____________| |__________________| | PERSON | "
-#~ "| |\n"
-#~ " | | | | |_____________| | "
-#~ "PERSON_EMAIL_ADDR |\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | | |"
-#~ "___________________|\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
-#~ "*PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE | | "
-#~ "*EMAIL_ADDR |\n"
-#~ " |_____________| | FIRSTNAME | |"
-#~ "___________________|\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|\n"
-#~ " ]]>"
-#~ msgstr ""
-#~ "_____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | | "
-#~ "___________________\n"
-#~ " |_____________| |__________________| | PERSON | "
-#~ "| |\n"
-#~ " | | | | |_____________| | "
-#~ "PERSON_EMAIL_ADDR |\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | "
-#~ "| |___________________|\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | "
-#~ "<--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE | | "
-#~ "*EMAIL_ADDR |\n"
-#~ " |_____________| | FIRSTNAME | |"
-#~ "___________________|\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addEmailToPerson(Long personId, String "
-#~ "emailAddress) {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " // adding to the emailAddress collection might trigger a lazy "
-#~ "load of the collection\n"
-#~ " aPerson.getEmailAddresses().add(emailAddress);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addEmailToPerson(Long personId, String emailAddress) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ "\n"
-#~ " // The getEmailAddresses() might trigger a lazy load of the "
-#~ "collection\n"
-#~ " aPerson.getEmailAddresses().add(emailAddress);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private Set participants = new HashSet();\n"
-#~ "\n"
-#~ " public Set getParticipants() {\n"
-#~ " return participants;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setParticipants(Set participants) {\n"
-#~ " this.participants = participants;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private Set participants = new HashSet();\n"
-#~ "\n"
-#~ "public Set getParticipants() {\n"
-#~ " return participants;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void setParticipants(Set participants) {\n"
-#~ " this.participants = participants;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" "
-#~ "inverse=\"true\">\n"
-#~ " <key column=\"EVENT_ID\"/>\n"
-#~ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
-#~ " </set>]]>"
-#~ msgstr ""
-#~ "<set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true"
-#~ "\">\n"
-#~ " <key column=\"EVENT_ID\"/>\n"
-#~ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ protected Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " protected void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void addToEvent(Event event) {\n"
-#~ " this.getEvents().add(event);\n"
-#~ " event.getParticipants().add(this);\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void removeFromEvent(Event event) {\n"
-#~ " this.getEvents().remove(event);\n"
-#~ " event.getParticipants().remove(this);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "protected Set getEvents() {\n"
-#~ " return events;\n"
-#~ "}\n"
-#~ "\n"
-#~ "protected void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void addToEvent(Event event) {\n"
-#~ " this.getEvents().add(event);\n"
-#~ " event.getParticipants().add(this);\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void removeFromEvent(Event event) {\n"
-#~ " this.getEvents().remove(event);\n"
-#~ " event.getParticipants().remove(this);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.web;\n"
-#~ "\n"
-#~ "// Imports\n"
-#~ "\n"
-#~ "public class EventManagerServlet extends HttpServlet {\n"
-#~ "\n"
-#~ " protected void doGet(\n"
-#~ " HttpServletRequest request,\n"
-#~ " HttpServletResponse response) throws ServletException, "
-#~ "IOException {\n"
-#~ "\n"
-#~ " SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM."
-#~ "yyyy\" );\n"
-#~ "\n"
-#~ " try {\n"
-#~ " // Begin unit of work\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "beginTransaction();\n"
-#~ "\n"
-#~ " // Process request and render page...\n"
-#~ "\n"
-#~ " // End unit of work\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "getTransaction().commit();\n"
-#~ " }\n"
-#~ " catch (Exception ex) {\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "getTransaction().rollback();\n"
-#~ " if ( ServletException.class.isInstance( ex ) ) {\n"
-#~ " throw ( ServletException ) ex;\n"
-#~ " }\n"
-#~ " else {\n"
-#~ " throw new ServletException( ex );\n"
-#~ " }\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "protected void doGet(HttpServletRequest request,\n"
-#~ " HttpServletResponse response)\n"
-#~ " throws ServletException, IOException {\n"
-#~ "\n"
-#~ " SimpleDateFormat dateFormatter = new SimpleDateFormat(\"dd.MM.yyyy"
-#~ "\");\n"
-#~ "\n"
-#~ " try {\n"
-#~ " // Begin unit of work\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().beginTransaction();\n"
-#~ "\n"
-#~ " // Process request and render page...\n"
-#~ "\n"
-#~ " // End unit of work\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().getTransaction().commit();\n"
-#~ "\n"
-#~ " } catch (Exception ex) {\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().getTransaction().rollback();\n"
-#~ " throw new ServletException(ex);\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ // Write HTML header\n"
-#~ " PrintWriter out = response.getWriter();\n"
-#~ " out.println(\"<html><head><title>Event Manager</title></"
-#~ "head><body>\");\n"
-#~ "\n"
-#~ " // Handle actions\n"
-#~ " if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
-#~ "\n"
-#~ " String eventTitle = request.getParameter(\"eventTitle\");\n"
-#~ " String eventDate = request.getParameter(\"eventDate\");\n"
-#~ "\n"
-#~ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
-#~ " out.println(\"<b><i>Please enter event title and date.</"
-#~ "i></b>\");\n"
-#~ " }\n"
-#~ " else {\n"
-#~ " createAndStoreEvent(eventTitle, dateFormatter.parse"
-#~ "(eventDate));\n"
-#~ " out.println(\"<b><i>Added event.</i></b>\");\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " // Print page\n"
-#~ " printEventForm(out);\n"
-#~ " listEvents(out, dateFormatter);\n"
-#~ "\n"
-#~ " // Write HTML footer\n"
-#~ " out.println(\"</body></html>\");\n"
-#~ " out.flush();\n"
-#~ " out.close();]]>"
-#~ msgstr ""
-#~ "// Write HTML header\n"
-#~ "PrintWriter out = response.getWriter();\n"
-#~ "out.println(\"<html><head><title>Event Manager</"
-#~ "title></head><body>\");\n"
-#~ "\n"
-#~ "// Handle actions\n"
-#~ "if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
-#~ "\n"
-#~ " String eventTitle = request.getParameter(\"eventTitle\");\n"
-#~ " String eventDate = request.getParameter(\"eventDate\");\n"
-#~ "\n"
-#~ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
-#~ " out.println(\"<b><i>Please enter event title and date."
-#~ "</i></b>\");\n"
-#~ " } else {\n"
-#~ " createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
-#~ " out.println(\"<b><i>Added event.</i></b>"
-#~ "\");\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "// Print page\n"
-#~ "printEventForm(out);\n"
-#~ "listEvents(out, dateFormatter);\n"
-#~ "\n"
-#~ "// Write HTML footer\n"
-#~ "out.println(\"</body></html>\");\n"
-#~ "out.flush();\n"
-#~ "out.close();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void printEventForm(PrintWriter out) {\n"
-#~ " out.println(\"<h2>Add new event:</h2>\");\n"
-#~ " out.println(\"<form>\");\n"
-#~ " out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
-#~ "\");\n"
-#~ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
-#~ "length='10'/><br/>\");\n"
-#~ " out.println(\"<input type='submit' name='action' value='store'/>"
-#~ "\");\n"
-#~ " out.println(\"</form>\");\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void printEventForm(PrintWriter out) {\n"
-#~ " out.println(\"<h2>Add new event:</h2>\");\n"
-#~ " out.println(\"<form>\");\n"
-#~ " out.println(\"Title: <input name='eventTitle' length='50'/><"
-#~ "br/>\");\n"
-#~ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
-#~ "length='10'/><br/>\");\n"
-#~ " out.println(\"<input type='submit' name='action' value='store'/>"
-#~ "\");\n"
-#~ " out.println(\"</form>\");\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
-#~ "dateFormatter) {\n"
-#~ "\n"
-#~ " List result = HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().createCriteria(Event.class).list();\n"
-#~ " if (result.size() > 0) {\n"
-#~ " out.println(\"<h2>Events in database:</h2>\");\n"
-#~ " out.println(\"<table border='1'>\");\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<th>Event title</th>\");\n"
-#~ " out.println(\"<th>Event date</th>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " Iterator it = result.iterator();\n"
-#~ " while (it.hasNext()) {\n"
-#~ " Event event = (Event) it.next();\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
-#~ " out.println(\"<td>\" + dateFormatter.format(event.getDate"
-#~ "()) + \"</td>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " }\n"
-#~ " out.println(\"</table>\");\n"
-#~ " }\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) "
-#~ "{\n"
-#~ "\n"
-#~ " List result = HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().createCriteria(Event.class).list"
-#~ "();\n"
-#~ " if (result.size() > 0) {\n"
-#~ " out.println(\"<h2>Events in database:</h2>\");\n"
-#~ " out.println(\"<table border='1'>\");\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<th>Event title</th>\");\n"
-#~ " out.println(\"<th>Event date</th>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " for (Iterator it = result.iterator(); it.hasNext();) {\n"
-#~ " Event event = (Event) it.next();\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<td>\" + event.getTitle() + \"</td>"
-#~ "\");\n"
-#~ " out.println(\"<td>\" + dateFormatter.format(event."
-#~ "getDate()) + \"</td>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " }\n"
-#~ " out.println(\"</table>\");\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ protected void createAndStoreEvent(String title, Date "
-#~ "theDate) {\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().save(theEvent);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "protected void createAndStoreEvent(String title, Date theDate) {\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().save(theEvent);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#~ "<web-app version=\"2.4\"\n"
-#~ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun."
-#~ "com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
-#~ "\n"
-#~ " <servlet>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
-#~ "servlet-class>\n"
-#~ " </servlet>\n"
-#~ "\n"
-#~ " <servlet-mapping>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <url-pattern>/eventmanager</url-pattern>\n"
-#~ " </servlet-mapping>\n"
-#~ "</web-app>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#~ "<web-app version=\"2.4\"\n"
-#~ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n"
-#~ " http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
-#~ "\n"
-#~ " <servlet>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <servlet-class>events.EventManagerServlet</servlet-"
-#~ "class>\n"
-#~ " </servlet>\n"
-#~ "\n"
-#~ " <servlet-mapping>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <url-pattern>/eventmanager</url-pattern>\n"
-#~ " </servlet-mapping>\n"
-#~ "</web-app>"
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/author_group.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/author_group.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/author_group.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: author_group\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-04T04:51:21\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-12 11:24+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -16,138 +16,296 @@
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
-msgstr "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
-msgstr "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
-msgstr "Max"
+msgid ""
+"<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</"
+"surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
-msgstr "Emmanuel"
+msgid ""
+"<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
-msgstr "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
-msgstr "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
-msgstr "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
-msgstr "Vincent"
+msgid "Graphic Design"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
-msgstr "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
-msgstr "Michael"
+msgid ""
+"<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> "
+"<email>kreimer at bbs.frc.utn.edu.ar</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
-msgstr "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
-msgstr "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
-msgstr "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
-msgstr "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
-msgstr "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
-msgstr "Francisco"
+msgid ""
+"<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></"
+"othercredit>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
-msgstr "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
-msgstr "Luiz Carlos"
+msgid ""
+"<firstname>Alvaro</firstname> <surname>Netto</surname> "
+"<email>alvaronetto at cetip.com.br</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
-msgstr "Marcel"
+msgid ""
+"<firstname>Anderson</firstname> <surname>Braulio</surname> "
+"<email>andersonbraulio at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
-msgstr "Paulo"
+msgid ""
+"<firstname>Daniel Vieira</firstname> <surname>Costa</surname> "
+"<email>danielvc at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
-msgstr "Pablo L."
+msgid ""
+"<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco."
+"gamarra at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
-msgstr "Renato"
+msgid ""
+"<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
-msgstr "Rogério"
+msgid ""
+"<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> "
+"<email>luizcarlos_rodrigues at yahoo.com.br</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
-msgstr "Wanderson"
+msgid ""
+"<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel."
+"castelo at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
-msgstr "Cao"
+msgid ""
+"<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail."
+"com</email>"
+msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
-msgstr "RedSaga"
+msgid ""
+"<firstname>Pablo L.</firstname> <surname>de Miranda</surname> "
+"<email>pablolmiranda at gmail.com</email>"
+msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
-msgstr "Líder de traducción"
+msgid ""
+"<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail."
+"com</email>"
+msgstr ""
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid ""
+"<firstname>Rogério</firstname> <surname>Araújo</surname> "
+"<email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid ""
+"<firstname>Wanderson</firstname> <surname>Siqueira</surname> "
+"<email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid ""
+"<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> "
+"<orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</"
+"contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
+
+#~ msgid "Gavin"
+#~ msgstr "Gavin"
+
+#~ msgid "Christian"
+#~ msgstr "Christian"
+
+#~ msgid "Max"
+#~ msgstr "Max"
+
+#~ msgid "Emmanuel"
+#~ msgstr "Emmanuel"
+
+#~ msgid "Steve"
+#~ msgstr "Steve"
+
+#~ msgid "James"
+#~ msgstr "James"
+
+#~ msgid "Cheyenne"
+#~ msgstr "Cheyenne"
+
+#~ msgid "Vincent"
+#~ msgstr "Vincent"
+
+#~ msgid "Sebastien"
+#~ msgstr "Sebastien"
+
+#~ msgid "Michael"
+#~ msgstr "Michael"
+
+#~ msgid "Baptiste"
+#~ msgstr "Baptiste"
+
+#~ msgid "Anthony"
+#~ msgstr "Anthony"
+
+#~ msgid "Alvaro"
+#~ msgstr "Alvaro"
+
+#~ msgid "Anderson"
+#~ msgstr "Anderson"
+
+#~ msgid "Daniel Vieira"
+#~ msgstr "Daniel Vieira"
+
+#~ msgid "Francisco"
+#~ msgstr "Francisco"
+
+#~ msgid "Gamarra"
+#~ msgstr "Gamarra"
+
+#~ msgid "Luiz Carlos"
+#~ msgstr "Luiz Carlos"
+
+#~ msgid "Marcel"
+#~ msgstr "Marcel"
+
+#~ msgid "Paulo"
+#~ msgstr "Paulo"
+
+#~ msgid "Pablo L."
+#~ msgstr "Pablo L."
+
+#~ msgid "Renato"
+#~ msgstr "Renato"
+
+#~ msgid "Rogério"
+#~ msgstr "Rogério"
+
+#~ msgid "Wanderson"
+#~ msgstr "Wanderson"
+
+#~ msgid "Cao"
+#~ msgstr "Cao"
+
+#~ msgid "RedSaga"
+#~ msgstr "RedSaga"
+
+#~ msgid "Translation Lead"
+#~ msgstr "Líder de traducción"
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/basic_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/basic_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/basic_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: basic_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 12:49+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,23 +24,144 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "Mapeo O/R Básico"
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "Declaración de mapeo"
#. Tag: para
+#: basic_mapping.xml:36
#, no-c-format
+msgid "Object/relational mappings can be defined in three approaches:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:41
+#, no-c-format
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:46
+#, no-c-format
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
msgid ""
-"Object/relational mappings are usually defined in an XML document. The "
-"mapping document is designed to be readable and hand-editable. The mapping "
-"language is Java-centric, meaning that mappings are constructed around "
-"persistent class declarations and not table declarations."
+"Annotations are split in two categories, the logical mapping annotations "
+"(describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid ""
+"JPA annotations are in the <literal>javax.persistence.*</literal> package. "
+"Hibernate specific extensions are in <literal>org.hibernate.annotations.*</"
+"literal>. You favorite IDE can auto-complete annotations and their "
+"attributes for you (even without a specific \"JPA\" plugin, since JPA "
+"annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
+#, fuzzy, no-c-format
+msgid "Here is an example of mapping"
+msgstr "Este es un ejemplo de mapeo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"@Entity \n"
+"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
+"discriminatorType=CHAR)\n"
+"public class Cat {\n"
+" \n"
+" @Id @GeneratedValue\n"
+" public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public BigDecimal getWeight() { return weight; }\n"
+" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+" private BigDecimal weight;\n"
+"\n"
+" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+" public Date getBirthdate() { return birthdate; }\n"
+" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+" private Date birthdate;\n"
+"\n"
+" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+" @NotNull @Column(updatable=false)\n"
+" public ColorType getColor() { return color; }\n"
+" public void setColor(ColorType color) { this.color = color; }\n"
+" private ColorType color;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public String getSex() { return sex; }\n"
+" public void setSex(String sex) { this.sex = sex; }\n"
+" private String sex;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public Integer getLitterId() { return litterId; }\n"
+" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+" private Integer litterId;\n"
+"\n"
+" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+" public Cat getMother() { return mother; }\n"
+" public void setMother(Cat mother) { this.mother = mother; }\n"
+" private Cat mother;\n"
+"\n"
+" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+" public Set<Cat> getKittens() { return kittens; }\n"
+" public void setKittens(Set<Cat> kittens) { this.kittens = "
+"kittens; }\n"
+" private Set<Cat> kittens = new HashSet<Cat>();\n"
+"}\n"
+"\n"
+"@Entity @DiscriminatorValue(\"D\")\n"
+"public class DomesticCat extends Cat {\n"
+"\n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name }\n"
+" private String name;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Dog { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:73
+#, fuzzy, no-c-format
+msgid ""
+"The legacy hbm.xml approach uses an XML schema designed to be readable and "
+"hand-editable. The mapping language is Java-centric, meaning that mappings "
+"are constructed around persistent class declarations and not table "
+"declarations."
+msgstr ""
"Los mapeos objeto/relacional usualmente se definen en un documento XML. El "
"documento de mapeo está diseñado para que se pueda leer y editar a mano. El "
"lenguaje de mapeo está centrado en Java, lo que significa que los mapeos se "
@@ -48,6 +169,7 @@
"de declaraciones de tablas."
#. Tag: para
+#: basic_mapping.xml:78
#, no-c-format
msgid ""
"Please note that even though many Hibernate users choose to write the XML by "
@@ -59,19 +181,93 @@
"documento de mapeo, incluyendo XDoclet, Middlegen y AndroMDA. "
#. Tag: para
+#: basic_mapping.xml:82
#, no-c-format
msgid "Here is an example mapping:"
msgstr "Este es un ejemplo de mapeo:"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:84
#, no-c-format
msgid ""
-"We will now discuss the content of the mapping document. We will only "
-"describe, however, the document elements and attributes that are used by "
-"Hibernate at runtime. The mapping document also contains some extra optional "
-"attributes and elements that affect the database schemas exported by the "
-"schema export tool (for example, the <literal> not-null</literal> attribute)."
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:86
+#, fuzzy, no-c-format
+msgid ""
+"We will now discuss the concepts of the mapping documents (both annotations "
+"and XML). We will only describe, however, the document elements and "
+"attributes that are used by Hibernate at runtime. The mapping document also "
+"contains some extra optional attributes and elements that affect the "
+"database schemas exported by the schema export tool (for example, the "
+"<literal> not-null</literal> attribute)."
+msgstr ""
"Ahora vamos a discutir el contenido del documento de mapeo. Sólamente "
"describiremos los elementos y atributos del documento que Hibernate utiliza "
"en tiempo de ejecución. El documento de mapeo también comprende algunos "
@@ -80,235 +276,431 @@
"ejemplo, el atributo <literal>not-null</literal>)."
#. Tag: title
+#: basic_mapping.xml:94
+#, fuzzy, no-c-format
+msgid "Entity"
+msgstr "EntityResolver"
+
+#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "Doctype"
-msgstr "Doctype"
+msgid ""
+"An entity is a regular Java object (aka POJO) which will be persisted by "
+"Hibernate."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:99
#, no-c-format
msgid ""
-"All XML mappings should declare the doctype shown. The actual DTD can be "
-"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
-"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
-"will always look for the DTD in its classpath first. If you experience "
-"lookups of the DTD using an Internet connection, check the DTD declaration "
-"against the contents of your classpath."
+"To mark an object as an entity in annotations, use the <classname>@Entity</"
+"classname> annotation."
msgstr ""
-"Todos los mapeos XML deben declarar el tipo de documento que se muestra. El "
-"DTD en sí se puede encontrar en la URL mencionada anteriormente, en el "
-"directorio <literal>hibernate-x.x.x/src/org/hibernate </literal>, o en "
-"<literal>hibernate3.jar</literal>. Hibernate siempre buscará el DTD primero "
-"en la ruta de clase. Si el DTD realiza búsquedas utilizando una conexión de "
-"Internet, verifique que su declaración DTD frente al contenido de su ruta de "
-"clase."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:102
#, no-c-format
-msgid "EntityResolver"
-msgstr "EntityResolver"
+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
+#: basic_mapping.xml:104
#, no-c-format
msgid ""
-"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
-"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
-"implementation with the SAXReader it uses to read in the xml files. This "
-"custom <literal>EntityResolver</literal> recognizes two different systemId "
-"namespaces:"
+"That's pretty much it, the rest is optional. There are however any options "
+"to tweak your entity mapping, let's explore them."
msgstr ""
-"Hibernate tratará primero de resolver los DTDs en su ruta de clase. La "
-"manera en que lo hace es registrando una implementación <literal>org.xml.sax."
-"EntityResolver</literal> personalizada con el SAXReader que utiliza para "
-"leer los archivos xml. Este <literal>EntityResolver</literal> personalizado "
-"reconoce dos diferentes espacios de nombre del identificador del sistema."
#. Tag: para
+#: basic_mapping.xml:107
#, no-c-format
msgid ""
-"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
-"encounters a systemId starting with <literal>http://hibernate.sourceforge."
-"net/</literal>. The resolver attempts to resolve these entities via the "
-"classloader which loaded the Hibernate classes."
+"<classname>@Table</classname> lets you define the table the entity will be "
+"persisted into. If undefined, the table name is the unqualified class name "
+"of the entity. You can also optionally define the catalog, the schema as "
+"well as unique constraints on the table."
msgstr ""
-"un <literal>hibernate namespace</literal> se reconoce cuando el resolvedor "
-"se encuentra con un identificador de sistema que inicia por <literal>http://"
-"hibernate.sourceforge.net/</literal>. El resolvedor intenta resolver estas "
-"entidades por medio del cargador de clases, el cual cargó las clases de "
-"Hibernate."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:112
#, no-c-format
msgid ""
-"a <literal>user namespace</literal> is recognized whenever the resolver "
-"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
-"The resolver will attempt to resolve these entities via (1) the current "
-"thread context classloader and (2) the classloader which loaded the "
-"Hibernate classes."
+"@Entity\n"
+"@Table(name=\"TBL_FLIGHT\", \n"
+" schema=\"AIR_COMMAND\", \n"
+" uniqueConstraints=\n"
+" @UniqueConstraint(\n"
+" name=\"flight_number\", \n"
+" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+"public class Flight implements Serializable {\n"
+" @Column(name=\"comp_prefix\")\n"
+" public String getCompagnyPrefix() { return companyPrefix; }\n"
+"\n"
+" @Column(name=\"flight_number\")\n"
+" public String getNumber() { return number; }\n"
+"}"
msgstr ""
-"un <literal>user namespace</literal> se reconoce cuando el resolvedor se "
-"encuentra con un identificador del sistema utilizando un protocolo URL "
-"<literal>classpath://</literal>. El resolvedor intentará resolver estas "
-"entidades por medio de (1) el cargador de clase del contexto del hilo actual "
-"y (2) el cargador de clase, el cual cargó las clases de Hibernate."
#. Tag: para
+#: basic_mapping.xml:114
#, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
-msgstr "Este es un ejemplo de la utilización de los espacios de nombre del usuario: "
+msgid ""
+"The constraint name is optional (generated if left undefined). The column "
+"names composing the constraint correspond to the column names as defined "
+"before the Hibernate <classname>NamingStrategy</classname> is applied."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:119
#, no-c-format
msgid ""
-"Where <literal>types.xml</literal> is a resource in the <literal>your."
-"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
-"custom\">typedef</link>."
+"<literal>@Entity.name</literal> lets you define the shortcut name of the "
+"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
+"class name of the class."
msgstr ""
-"En donde <literal>types.xml</literal> es un recurso en el paquete "
-"<literal>your.domain</literal> y comprende un <link linkend=\"mapping-types-"
-"custom\">typedef</link> personalizado."
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:123
#, no-c-format
-msgid "Hibernate-mapping"
-msgstr "Mapeo de Hibernate "
+msgid ""
+"Hibernate goes beyond the JPA specification and provide additional "
+"configurations. Some of them are hosted on <classname>@org.hibernate."
+"annotations.Entity</classname>:"
+msgstr ""
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:129
+#, fuzzy, no-c-format
msgid ""
-"This element has several optional attributes. The <literal>schema</literal> "
-"and <literal>catalog</literal> attributes specify that tables referred to in "
-"this mapping belong to the named schema and/or catalog. If they are "
-"specified, tablenames will be qualified by the given schema and catalog "
-"names. If they are missing, tablenames will be unqualified. The "
-"<literal>default-cascade</literal> attribute specifies what cascade style "
-"should be assumed for properties and collections that do not specify a "
-"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
-"literal> attribute allows you to use unqualified class names in the query "
-"language."
+"<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> "
+"(defaults to false): specifies that <literal>INSERT</literal> / "
+"<literal>UPDATE</literal> SQL should be generated at runtime and contain "
+"only the columns whose values are not null. The <literal>dynamic-update</"
+"literal> and <literal>dynamic-insert</literal> settings are not inherited by "
+"subclasses. Although these settings can increase performance in some cases, "
+"they can actually decrease performance in others."
msgstr ""
-"Este elemento tiene varios atributos opcionales. Los atributos "
-"<literal>schema</literal> y <literal>catalog</literal> especifican que las "
-"tablas a las que se refiere en este mapeo pertenecen al esquema y/o catálogo "
-"mencionado(s). De especificarse, los nombres de tablas serán calificados por "
-"el nombre del esquema y del catálogo dados. De omitirse, los nombres de las "
-"tablas no serán calificados. El atributo <literal>default-cascade</literal> "
-"especifica qué estilo de cascada se debe asumir para las propiedades y "
-"colecciones que no especifican un atributo <literal>cascade</literal>. Por "
-"defecto, el atributo <literal>auto-import</literal> nos permite utilizar "
-"nombres de clase sin calificar en el lenguaje de consulta."
+"Los valores de <literal>dynamic-update</literal> y <literal>dynamic-insert</"
+"literal> no son heredados por las subclases y por lo tanto deben "
+"especificarse en los elementos <literal><subclass></literal> o "
+"<literal><joined-subclass></literal>. Aunque en algunos casos, estos "
+"ajustes pueden incrementar el rendimiento, de hecho en otros casos, podrían "
+"disminuirlo."
#. Tag: para
-#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
+#: basic_mapping.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"<literal>selectBeforeUpdate</literal> (defaults to false): specifies that "
+"Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</"
+"literal> unless it is certain that an object is actually modified. Only when "
+"a transient object has been associated with a new session using "
+"<literal>update()</literal>, will Hibernate perform an extra SQL "
+"<literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is "
+"actually required. Use of <literal>select-before-update</literal> will "
+"usually decrease performance. It is useful to prevent a database update "
+"trigger being called unnecessarily if you reattach a graph of detached "
+"instances to a <literal>Session</literal>."
msgstr ""
-"<literal>schema</literal> (opcional): El nombre de un esquema de la base de "
-"datos. "
+"<literal>select-before-update</literal> (opcional, por defecto es "
+"<literal>false</literal>): Especifica que Hibernate <emphasis>nunca</"
+"emphasis> debe realizar un <literal>UPDATE</literal> SQL a menos de que se "
+"tenga certeza de que realmente se haya modificado un objeto. Sólo cuando un "
+"objeto transitorio ha sido asociado con una sesión nueva utilizando "
+"<literal>update()</literal>), Hibernate realizará una SQL <literal>SELECT</"
+"literal> extra para determinar si realmente se necesita un <literal>UPDATE</"
+"literal>."
#. Tag: para
+#: basic_mapping.xml:154
+#, fuzzy, no-c-format
+msgid ""
+"<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): "
+"determines whether implicit or explicit query polymorphisms is used. "
+"<emphasis>Implicit</emphasis> polymorphisms means that instances of the "
+"class will be returned by a query that names any superclass or implemented "
+"interface or class, and that instances of any subclass of the class will be "
+"returned by a query that names the class itself. <emphasis>Explicit</"
+"emphasis> polymorphisms means that class instances will be returned only by "
+"queries that explicitly name that class. Queries that name the class will "
+"return only instances of subclasses mapped. For most purposes, the default "
+"<literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit "
+"polymorphisms is useful when two different classes are mapped to the same "
+"table This allows a \"lightweight\" class that contains a subset of the "
+"table columns."
+msgstr ""
+"Por polimorfismo <emphasis>implícito</emphasis> se entiende que las "
+"instancias de la clase serán devueltas por una consulta que mencione "
+"cualquier superclase, o interfaz implementada, o la clase misma; y que las "
+"instancias de cualquier subclase de la clase serán retornadas por una "
+"petición que nombra a la clase misma. Por polimorfismo <emphasis>explícito</"
+"emphasis> se entiende que las instancias de la clase serán devueltas sólo "
+"por consultas que mencionen explícitamente la clase. Las consultas que "
+"mencionen la clase retornarán sólo instancias de subclases mapeadas dentro "
+"de esta declaración <literal><class></literal> como una <literal><"
+"subclass></literal> o <literal><joined-subclass></literal>. Para la "
+"mayoría de los propósitos el valor por defecto, <literal>polymorphism="
+"\"implicit\"</literal>, resulta apropiado. El polimorfismo explícito es útil "
+"cuando dos clases diferentes se encuentran mapeadas a la misma tabla. Esto "
+"permite tener una clase \"liviana\" que contenga un subconjunto de columnas "
+"de la tabla."
+
+#. Tag: para
+#: basic_mapping.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"<literal>persister</literal>: specifies a custom <literal>ClassPersister</"
+"literal>. The <literal>persister</literal> attribute lets you customize the "
+"persistence strategy used for the class. You can, for example, specify your "
+"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
+"or you can even provide a completely new implementation of the interface "
+"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
+"for example, persistence via stored procedure calls, serialization to flat "
+"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
+"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgstr ""
+"El atributo <literal>persister</literal> le permite personalizar la "
+"estrategia de persistencia para la clase. Por ejemplo, puede especificar su "
+"propia subclase de <literal>org.hibernate.persister.EntityPersister</"
+"literal>, o incluso puede proporcionar una implementación completamente "
+"nueva de la interfaz <literal>org.hibernate.persister.ClassPersister</"
+"literal> que implemente, por ejemplo, la persistencia por medio de llamadas "
+"a procedimientos almacenados, serialización a archivos planos o LDAP. Para "
+"ver un ejemplo simple (de \"persistencia\" a una <literal>Hashtable</"
+"literal>) consulte <literal>org.hibernate.test.CustomPersister</literal>. "
+
+#. Tag: para
+#: basic_mapping.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): "
+"determines the optimistic locking strategy. If you enable "
+"<literal>dynamicUpdate</literal>, you will have a choice of optimistic "
+"locking strategies:"
+msgstr ""
+"Si activa <literal>dynamic-update</literal>, usted tendrá la opción de "
+"estrategias de bloqueo optimistas:"
+
+#. Tag: para
+#: basic_mapping.xml:192
#, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
+msgid "<literal>version</literal>: check the version/timestamp columns"
msgstr ""
-"<literal>catalog</literal> (opcional): El nombre de un catálogo de la base "
-"de datos. "
+"<literal>version</literal>: chequea las columnas de versión/sello de fecha"
#. Tag: para
+#: basic_mapping.xml:197
#, no-c-format
+msgid "<literal>all</literal>: check all columns"
+msgstr "<literal>all</literal>: chequea todas las columnas"
+
+#. Tag: para
+#: basic_mapping.xml:201
+#, no-c-format
msgid ""
-"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
-"literal>): a default cascade style."
+"<literal>dirty</literal>: check the changed columns, allowing some "
+"concurrent updates"
msgstr ""
-"<literal>default-cascade</literal> (opcional - por defecto es <literal>none</"
-"literal>): Un estilo de cascada por defecto. "
+"<literal>dirty</literal>: chequea las columnas modificadas permitiendo "
+"algunas actualizaciones concurrentes"
#. Tag: para
+#: basic_mapping.xml:206
#, no-c-format
+msgid "<literal>none</literal>: do not use optimistic locking"
+msgstr "<literal>none</literal>: no utilice bloqueo optimista"
+
+#. Tag: para
+#: basic_mapping.xml:211
+#, no-c-format
msgid ""
-"<literal>default-access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing all properties. "
-"It can be a custom implementation of <literal>PropertyAccessor</literal>."
+"It is <emphasis>strongly</emphasis> recommended that you use version/"
+"timestamp columns for optimistic locking with Hibernate. This strategy "
+"optimizes performance and correctly handles modifications made to detached "
+"instances (i.e. when <literal>Session.merge()</literal> is used)."
msgstr ""
-"<literal>default-access</literal> (opcional - por defecto es "
-"<literal>property</literal>): La estrategia que Hibernate debe utilizar para "
-"acceder a todas las propiedades. Puede ser una implementación personalizada "
-"de <literal>PropertyAccessor</literal>."
+"Le recomendamos <emphasis>mucho</emphasis> que utilice columnas de versión/"
+"sello de fecha para el bloqueo optimista con Hibernate. Esta estrategia "
+"optimiza el rendimiento y maneja correctamente las modificaciones realizadas "
+"a las instancias separadas, (por ejemplo, cuando se utiliza <literal>Session."
+"merge()</literal>)."
#. Tag: para
+#: basic_mapping.xml:220
#, no-c-format
msgid ""
-"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
-"literal>): the default value for unspecified <literal>lazy</literal> "
-"attributes of class and collection mappings."
+"Be sure to import <classname>@javax.persistence.Entity</classname> to mark a "
+"class as an entity. It's a common mistake to import <classname>@org."
+"hibernate.annotations.Entity</classname> by accident."
msgstr ""
-"<literal>default-lazy</literal> (opcional - por defecto es <literal>true</"
-"literal>): El valor por defecto para los atributos <literal>lazy</literal> "
-"no especificados de mapeos de clase y de colección."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:227
+#, fuzzy, no-c-format
msgid ""
-"<literal>auto-import</literal> (optional - defaults to <literal>true</"
-"literal>): specifies whether we can use unqualified class names of classes "
-"in this mapping in the query language."
+"Some entities are not mutable. They cannot be updated or deleted by the "
+"application. This allows Hibernate to make some minor performance "
+"optimizations.. Use the <classname>@Immutable</classname> annotation."
msgstr ""
-"<literal>auto-import</literal> (opcional - por defecto es <literal>true</"
-"literal>): Especifica si podemos utilizar nombres de clases no calificados "
-"de clases en este mapeo en el lenguaje de consulta."
+"Las clases inmutables, <literal>mutable=\"false\"</literal>, no pueden ser "
+"actualizadas o borradas por la aplicación. Esto le permite a Hibernate "
+"realizar ciertas optimizaciones menores de rendimiento. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:232
+#, fuzzy, no-c-format
msgid ""
-"<literal>package</literal> (optional): specifies a package prefix to use for "
-"unqualified class names in the mapping document."
+"You can also alter how Hibernate deals with lazy initialization for this "
+"class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false "
+"to disable lazy fetching (not recommended). You can also specify an "
+"interface to use for lazy initializing proxies (defaults to the class "
+"itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. "
+"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
+"the named interface. The persistent object will load when a method of the "
+"proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
-"<literal>package</literal> (opcional): Especifica un prefijo de paquete que "
-"se debe utilizar para los nombres de clase no calificados en el documento de "
-"mapeo."
+"El atributo opcional <literal>proxy</literal> activa la inicialización "
+"perezosa de instancias persistentes de la clase. Hibernate inicialmente "
+"retornará proxies CGLIB que implementan la interfaz mencionada. El objeto "
+"persistente real será cargado cuando se invoque un método del proxy. Vea "
+"\"Inicialización de colecciones y proxies\" a continuación."
#. Tag: para
+#: basic_mapping.xml:243
#, no-c-format
msgid ""
-"If you have two persistent classes with the same unqualified name, you "
-"should set <literal>auto-import=\"false\"</literal>. An exception will "
-"result if you attempt to assign two classes to the same \"imported\" name."
+"<classname>@BatchSize</classname> specifies a \"batch size\" for fetching "
+"instances of this class by identifier. Not yet loaded instances are loaded "
+"batch-size at a time (default 1)."
msgstr ""
-"Si tiene dos clases persistentes con el mismo nombre (sin calificar), debe "
-"establecer <literal>auto-import=\"false\"</literal>. Se presentará una "
-"excepción si usted intenta asignar dos clases al mismo nombre \"importado\"."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:247
+#, fuzzy, no-c-format
msgid ""
-"The <literal>hibernate-mapping</literal> element allows you to nest several "
-"persistent <literal><class></literal> mappings, as shown above. It is, "
-"however, good practice (and expected by some tools) to map only a single "
-"persistent class, or a single class hierarchy, in one mapping file and name "
-"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
-"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
-"<literal>Animal.hbm.xml</literal>."
+"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
+"objects of this class. Use <classname>@Where</classname> for that."
msgstr ""
-"El elemento <literal>hibernate-mapping</literal> le permite anidar varios "
-"mapeos <literal><class></literal> persistentes, como se mostró "
-"anteriormente. Sin embargo, es una buena práctica (y algunas herramientas "
-"esperan) que mapee sólamente una clase persistente, o a una sóla jerarquía "
-"de clases, en un archivo de mapeo y nombrarlo como la superclase "
-"persistente. Por ejemplo, <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm."
-"xml</literal>, o si utiliza herencia, <literal>Animal.hbm.xml</literal>."
+"<literal>where</literal> (opcional) especifica una condición SQL "
+"<literal>WHERE</literal> arbitraria para utilizarla en la recuperación de "
+"objetos de esta clase. "
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:251
+#, fuzzy, no-c-format
+msgid ""
+"In the same vein, <classname>@Check</classname> lets you define an SQL "
+"expression used to generate a multi-row <emphasis>check</emphasis> "
+"constraint for automatic schema generation."
+msgstr ""
+"<literal>check</literal> (opcional): Una expresión SQL utilizada para "
+"generar una restricción <emphasis>check</emphasis> multi-filas para la "
+"generación automática de esquemas."
+
+#. Tag: para
+#: basic_mapping.xml:255
+#, fuzzy, no-c-format
+msgid ""
+"There is no difference between a view and a base table for a Hibernate "
+"mapping. This is transparent at the database level, although some DBMS do "
+"not support views properly, especially with updates. Sometimes you want to "
+"use a view, but you cannot create one in the database (i.e. with a legacy "
+"schema). In this case, you can map an immutable and read-only entity to a "
+"given SQL subselect expression using <classname>@org.hibernate.annotations."
+"Subselect</classname>:"
+msgstr ""
+"Para un mapeo de Hibernate, no hay diferencia entre una vista y una tabla "
+"base. Esto es transparente a nivel de base de datos, aunque algunos DBMS no "
+"soportan correctamente las vistas, especialmente con las actualizaciones. A "
+"veces usted quiere utilizar una vista, pero no puede crear una en la base de "
+"datos (por ejemplo, con un esquema heredado). En este caso, usted puede "
+"mapear una entidad inmutable de sólo lectura a una expresión de subconsulta "
+"SQL dada."
+
+#. Tag: programlisting
+#: basic_mapping.xml:263
#, no-c-format
-msgid "Class"
-msgstr "Clase"
+msgid ""
+"@Entity\n"
+"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+" + \"from item \"\n"
+" + \"join bid on bid.item_id = item.id \"\n"
+" + \"group by item.name\")\n"
+"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+"public class Summary {\n"
+" @Id\n"
+" public String getId() { return id; }\n"
+" ...\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:265
#, no-c-format
msgid ""
-"You can declare a persistent class using the <literal>class</literal> "
-"element. For example:"
+"Declare the tables to synchronize this entity with, ensuring that auto-flush "
+"happens correctly and that queries against the derived entity do not return "
+"stale data. The <literal><subselect></literal> is available both as an "
+"attribute and a nested mapping element."
msgstr ""
+"Declara las tablas con las cuales se debe sincronizar esta entidad, "
+"asegurándose de que el auto-vaciado ocurra correctamente y que las consultas "
+"frente a la entidad derivada no devuelvan datos desactualizados. El "
+"<literal><subselect></literal> se encuentra disponible tanto como un "
+"atributo y como un elemento anidado de mapeo."
+
+#. Tag: para
+#: basic_mapping.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"We will now explore the same options using the hbm.xml structure. You can "
+"declare a persistent class using the <literal>class</literal> element. For "
+"example:"
+msgstr ""
"Puede declarar una clase persistente utilizando el elemento <literal>class</"
"literal>. Por ejemplo:"
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, no-c-format
+msgid ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:323
#, no-c-format
msgid ""
"<literal>name</literal> (optional): the fully qualified Java class name of "
@@ -320,6 +712,7 @@
"el mapeo es para una entidad que no es POJO."
#. Tag: para
+#: basic_mapping.xml:330
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to the unqualified class "
@@ -329,6 +722,7 @@
"calificado): El nombre de su tabla en la base de datos."
#. Tag: para
+#: basic_mapping.xml:335
#, no-c-format
msgid ""
"<literal>discriminator-value</literal> (optional - defaults to the class "
@@ -342,6 +736,7 @@
"literal> y <literal>not null</literal>. "
#. Tag: para
+#: basic_mapping.xml:343
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -351,6 +746,7 @@
"literal>): Especifica que las instancias de la clase (no) son mutables. "
#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): overrides the schema name specified by "
@@ -361,6 +757,7 @@
"literal>. "
#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
#, no-c-format
msgid ""
"<literal>catalog</literal> (optional): overrides the catalog name specified "
@@ -371,6 +768,7 @@
"literal>. "
#. Tag: para
+#: basic_mapping.xml:361
#, no-c-format
msgid ""
"<literal>proxy</literal> (optional): specifies an interface to use for lazy "
@@ -381,6 +779,7 @@
"la clase. "
#. Tag: para
+#: basic_mapping.xml:367
#, no-c-format
msgid ""
"<literal>dynamic-update</literal> (optional - defaults to <literal>false</"
@@ -393,6 +792,7 @@
"valores hayan cambiado. "
#. Tag: para
+#: basic_mapping.xml:374
#, no-c-format
msgid ""
"<literal>dynamic-insert</literal> (optional - defaults to <literal>false</"
@@ -405,6 +805,7 @@
"valores no son nulos. "
#. Tag: para
+#: basic_mapping.xml:381
#, no-c-format
msgid ""
"<literal>select-before-update</literal> (optional - defaults to "
@@ -425,10 +826,11 @@
"literal>."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:393
+#, fuzzy, no-c-format
msgid ""
-"<literal>polymorphism</literal> (optional - defaults to <literal>implicit</"
-"literal>): determines whether implicit or explicit query polymorphism is "
+"<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</"
+"literal>): determines whether implicit or explicit query polymorphisms is "
"used."
msgstr ""
"<literal>polymorphism</literal> (opcional, por defecto es <literal>implicit</"
@@ -436,6 +838,7 @@
"explícito. "
#. Tag: para
+#: basic_mapping.xml:399
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -447,6 +850,7 @@
"objetos de esta clase. "
#. Tag: para
+#: basic_mapping.xml:405
#, no-c-format
msgid ""
"<literal>persister</literal> (optional): specifies a custom "
@@ -456,6 +860,7 @@
"<literal>ClassPersister</literal> personalizado. "
#. Tag: para
+#: basic_mapping.xml:410
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): "
@@ -467,6 +872,7 @@
"clase por identificador."
#. Tag: para
+#: basic_mapping.xml:416
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>version</"
@@ -476,6 +882,7 @@
"<literal>version</literal>): Determina la estrategia optimista de bloqueo. "
#. Tag: para
+#: basic_mapping.xml:422
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional): lazy fetching can be disabled by setting "
@@ -485,14 +892,15 @@
"deshabilitar por completo al establecer <literal>lazy=\"false\"</literal>."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:427
+#, fuzzy, no-c-format
msgid ""
"<literal>entity-name</literal> (optional - defaults to the class name): "
"Hibernate3 allows a class to be mapped multiple times, potentially to "
"different tables. It also allows entity mappings that are represented by "
"Maps or XML at the Java level. In these cases, you should provide an "
"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
-"classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
+"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
"<literal>entity-name</literal> (opcional - por defecto es el nombre de la "
"clase): Hibernate3 permite mapear una clase varias veces, potencialmente a "
@@ -503,6 +911,7 @@
"> y <xref linkend=\"xml\" />."
#. Tag: para
+#: basic_mapping.xml:437
#, no-c-format
msgid ""
"<literal>check</literal> (optional): an SQL expression used to generate a "
@@ -514,6 +923,7 @@
"generación automática de esquemas."
#. Tag: para
+#: basic_mapping.xml:443
#, no-c-format
msgid ""
"<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. "
@@ -530,6 +940,7 @@
"tupla almacenada."
#. Tag: para
+#: basic_mapping.xml:452
#, no-c-format
msgid ""
"<literal>subselect</literal> (optional): maps an immutable and read-only "
@@ -542,6 +953,7 @@
"información."
#. Tag: para
+#: basic_mapping.xml:459
#, no-c-format
msgid ""
"<literal>abstract</literal> (optional): is used to mark abstract "
@@ -551,6 +963,7 @@
"abstractas en las jerarquías <literal><union-subclass></literal>."
#. Tag: para
+#: basic_mapping.xml:466
#, no-c-format
msgid ""
"It is acceptable for the named persistent class to be an interface. You can "
@@ -567,311 +980,1232 @@
"literal>."
#. Tag: para
+#: basic_mapping.xml:472
#, no-c-format
+msgid "Here is how to do a virtual view (subselect) in XML:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:474
+#, no-c-format
msgid ""
-"Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated "
-"or deleted by the application. This allows Hibernate to make some minor "
-"performance optimizations."
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"Las clases inmutables, <literal>mutable=\"false\"</literal>, no pueden ser "
-"actualizadas o borradas por la aplicación. Esto le permite a Hibernate "
-"realizar ciertas optimizaciones menores de rendimiento. "
#. Tag: para
+#: basic_mapping.xml:476
#, no-c-format
msgid ""
-"The optional <literal>proxy</literal> attribute enables lazy initialization "
-"of persistent instances of the class. Hibernate will initially return CGLIB "
-"proxies that implement the named interface. The persistent object will load "
-"when a method of the proxy is invoked. See \"Initializing collections and "
-"proxies\" below."
+"The <literal><subselect></literal> is available both as an attribute "
+"and a nested mapping element."
msgstr ""
-"El atributo opcional <literal>proxy</literal> activa la inicialización "
-"perezosa de instancias persistentes de la clase. Hibernate inicialmente "
-"retornará proxies CGLIB que implementan la interfaz mencionada. El objeto "
-"persistente real será cargado cuando se invoque un método del proxy. Vea "
-"\"Inicialización de colecciones y proxies\" a continuación."
+#. Tag: title
+#: basic_mapping.xml:481
+#, fuzzy, no-c-format
+msgid "Identifiers"
+msgstr "Identificadores asignados"
+
#. Tag: para
+#: basic_mapping.xml:483
+#, fuzzy, no-c-format
+msgid ""
+"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
+"the database table. Most classes will also have a JavaBeans-style property "
+"holding the unique identifier of an instance."
+msgstr ""
+"Las clases mapeadas <emphasis>tienen</emphasis> que declarar la columna de "
+"clave primaria de la tabla de la base de datos. La mayoría de las clases "
+"también tendrán una propiedad de estilo Javabeans que tenga el identificador "
+"único de una instancia. El elemento <literal><id></literal> define el "
+"mapeo de esa propiedad a la columna de clave primaria."
+
+#. Tag: para
+#: basic_mapping.xml:488
#, no-c-format
+msgid "Mark the identifier property with <classname>@Id</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
msgid ""
-"<emphasis>Implicit</emphasis> polymorphism means that instances of the class "
-"will be returned by a query that names any superclass or implemented "
-"interface or class, and that instances of any subclass of the class will be "
-"returned by a query that names the class itself. <emphasis>Explicit</"
-"emphasis> polymorphism means that class instances will be returned only by "
-"queries that explicitly name that class. Queries that name the class will "
-"return only instances of subclasses mapped inside this <literal><class>"
-"</literal> declaration as a <literal><subclass></literal> or "
-"<literal><joined-subclass></literal>. For most purposes, the default "
-"<literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit "
-"polymorphism is useful when two different classes are mapped to the same "
-"table This allows a \"lightweight\" class that contains a subset of the "
-"table columns."
+"@Entity\n"
+"public class Person {\n"
+" @Id Integer getId() { ... }\n"
+" ...\n"
+"}"
msgstr ""
-"Por polimorfismo <emphasis>implícito</emphasis> se entiende que las "
-"instancias de la clase serán devueltas por una consulta que mencione "
-"cualquier superclase, o interfaz implementada, o la clase misma; y que las "
-"instancias de cualquier subclase de la clase serán retornadas por una "
-"petición que nombra a la clase misma. Por polimorfismo <emphasis>explícito</"
-"emphasis> se entiende que las instancias de la clase serán devueltas sólo "
-"por consultas que mencionen explícitamente la clase. Las consultas que "
-"mencionen la clase retornarán sólo instancias de subclases mapeadas dentro "
-"de esta declaración <literal><class></literal> como una <literal><"
-"subclass></literal> o <literal><joined-subclass></literal>. Para la "
-"mayoría de los propósitos el valor por defecto, <literal>polymorphism="
-"\"implicit\"</literal>, resulta apropiado. El polimorfismo explícito es útil "
-"cuando dos clases diferentes se encuentran mapeadas a la misma tabla. Esto "
-"permite tener una clase \"liviana\" que contenga un subconjunto de columnas "
-"de la tabla."
#. Tag: para
+#: basic_mapping.xml:493
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><id></literal> element which defines the "
+"mapping from that property to the primary key column."
+msgstr ""
+"Observe el uso de etiquetas <literal><column></literal> para mapear "
+"una propiedad a múltiples columnas."
+
+#. Tag: programlisting
+#: basic_mapping.xml:509
#, no-c-format
msgid ""
-"The <literal>persister</literal> attribute lets you customize the "
-"persistence strategy used for the class. You can, for example, specify your "
-"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
-"or you can even provide a completely new implementation of the interface "
-"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
-"for example, persistence via stored procedure calls, serialization to flat "
-"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
-"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
msgstr ""
-"El atributo <literal>persister</literal> le permite personalizar la "
-"estrategia de persistencia para la clase. Por ejemplo, puede especificar su "
-"propia subclase de <literal>org.hibernate.persister.EntityPersister</"
-"literal>, o incluso puede proporcionar una implementación completamente "
-"nueva de la interfaz <literal>org.hibernate.persister.ClassPersister</"
-"literal> que implemente, por ejemplo, la persistencia por medio de llamadas "
-"a procedimientos almacenados, serialización a archivos planos o LDAP. Para "
-"ver un ejemplo simple (de \"persistencia\" a una <literal>Hashtable</"
-"literal>) consulte <literal>org.hibernate.test.CustomPersister</literal>. "
#. Tag: para
+#: basic_mapping.xml:513
#, no-c-format
msgid ""
-"The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> "
-"settings are not inherited by subclasses, so they can also be specified on "
-"the <literal><subclass></literal> or <literal><joined-subclass></"
-"literal> elements. Although these settings can increase performance in some "
-"cases, they can actually decrease performance in others."
+"<literal>name</literal> (optional): the name of the identifier property."
msgstr ""
-"Los valores de <literal>dynamic-update</literal> y <literal>dynamic-insert</"
-"literal> no son heredados por las subclases y por lo tanto deben "
-"especificarse en los elementos <literal><subclass></literal> o "
-"<literal><joined-subclass></literal>. Aunque en algunos casos, estos "
-"ajustes pueden incrementar el rendimiento, de hecho en otros casos, podrían "
-"disminuirlo."
+"<literal>name</literal> (opcional): El nombre de la propiedad del "
+"identificador. s"
#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
#, no-c-format
msgid ""
-"Use of <literal>select-before-update</literal> will usually decrease "
-"performance. It is useful to prevent a database update trigger being called "
-"unnecessarily if you reattach a graph of detached instances to a "
-"<literal>Session</literal>."
+"<literal>type</literal> (optional): a name that indicates the Hibernate type."
msgstr ""
-"El uso de <literal>select-before-update</literal> disminuirá el rendimiento. "
-"Es muy útil prevenir que se llame innecesariamente a un disparador de "
-"actualización de la base de datos al volver a unir un gráfico de instancias "
-"separadas a una <literal>Session</literal>."
+"<literal>type</literal> (opcional): un nombre que indica el tipo de "
+"Hibernate."
#. Tag: para
+#: basic_mapping.xml:523
#, no-c-format
msgid ""
-"If you enable <literal>dynamic-update</literal>, you will have a choice of "
-"optimistic locking strategies:"
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the primary key column."
msgstr ""
-"Si activa <literal>dynamic-update</literal>, usted tendrá la opción de "
-"estrategias de bloqueo optimistas:"
+"<literal>column</literal> (opcional - por defecto es el nombre de la "
+"propiedad): El nombre de la columna de la clave principal."
#. Tag: para
+#: basic_mapping.xml:528
#, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
-msgstr "<literal>version</literal>: chequea las columnas de versión/sello de fecha"
+msgid ""
+"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
+"value): an identifier property value that indicates an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session."
+msgstr ""
+"<literal>unsaved-value</literal> (opcional - por defecto es un valor "
+"\"sensible\"): Un valor de la propiedad identificadora que indica que una "
+"instancia está recién instanciada (sin guardar), distinguiéndola de las "
+"instancias separadas que fueron guardadas o cargadas en una sesión previa."
#. Tag: para
+#: basic_mapping.xml:536
#, no-c-format
-msgid "<literal>all</literal>: check all columns"
-msgstr "<literal>all</literal>: chequea todas las columnas"
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing the property "
+"value."
+msgstr ""
+"<literal>access</literal> (opcional - por defecto es <literal>property</"
+"literal>): La estrategia que Hibernate debe utilizar para acceder al valor "
+"de la propiedad. "
#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
msgid ""
-"<literal>dirty</literal>: check the changed columns, allowing some "
-"concurrent updates"
+"If the <literal>name</literal> attribute is missing, it is assumed that the "
+"class has no identifier property."
msgstr ""
-"<literal>dirty</literal>: chequea las columnas modificadas permitiendo "
-"algunas actualizaciones concurrentes"
+"Si se omite el atributo <literal>name</literal>, se asume que la clase no "
+"tiene propiedad identificadora."
#. Tag: para
+#: basic_mapping.xml:546
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>unsaved-value</literal> attribute is almost never needed in "
+"Hibernate3 and indeed has no corresponding element in annotations."
+msgstr ""
+"El atributo <literal>unsaved-value</literal> casi nunca se necesita en "
+"Hibernate3."
+
+#. Tag: para
+#: basic_mapping.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"You can also declare the identifier as a composite identifier. This allows "
+"access to legacy data with composite keys. Its use is strongly discouraged "
+"for anything else."
+msgstr ""
+"Hay una declaración <literal><composite-id></literal> opcional para "
+"permitir acceso a los datos heredados con claves compuestas. Le disuadimos "
+"seriamente de su utilización para cualquier otra cosa."
+
+#. Tag: title
+#: basic_mapping.xml:555
+#, fuzzy, no-c-format
+msgid "Composite identifier"
+msgstr "Identificadores asignados"
+
+#. Tag: para
+#: basic_mapping.xml:557
#, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
-msgstr "<literal>none</literal>: no utilice bloqueo optimista"
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:562
#, no-c-format
msgid ""
-"It is <emphasis>strongly</emphasis> recommended that you use version/"
-"timestamp columns for optimistic locking with Hibernate. This strategy "
-"optimizes performance and correctly handles modifications made to detached "
-"instances (i.e. when <literal>Session.merge()</literal> is used)."
+"use a component type to represent the identifier and map it as a property in "
+"the entity: you then annotated the property as <classname>@EmbeddedId</"
+"classname>. The component type has to be <classname>Serializable</classname>."
msgstr ""
-"Le recomendamos <emphasis>mucho</emphasis> que utilice columnas de versión/"
-"sello de fecha para el bloqueo optimista con Hibernate. Esta estrategia "
-"optimiza el rendimiento y maneja correctamente las modificaciones realizadas "
-"a las instancias separadas, (por ejemplo, cuando se utiliza <literal>Session."
-"merge()</literal>)."
#. Tag: para
+#: basic_mapping.xml:569
#, no-c-format
msgid ""
-"There is no difference between a view and a base table for a Hibernate "
-"mapping. This is transparent at the database level, although some DBMS do "
-"not support views properly, especially with updates. Sometimes you want to "
-"use a view, but you cannot create one in the database (i.e. with a legacy "
-"schema). In this case, you can map an immutable and read-only entity to a "
-"given SQL subselect expression:"
+"map multiple properties as <classname>@Id</classname> properties: the "
+"identifier type is then the entity class itself and needs to be "
+"<classname>Serializable</classname>. This approach is unfortunately not "
+"standard and only supported by Hibernate."
msgstr ""
-"Para un mapeo de Hibernate, no hay diferencia entre una vista y una tabla "
-"base. Esto es transparente a nivel de base de datos, aunque algunos DBMS no "
-"soportan correctamente las vistas, especialmente con las actualizaciones. A "
-"veces usted quiere utilizar una vista, pero no puede crear una en la base de "
-"datos (por ejemplo, con un esquema heredado). En este caso, usted puede "
-"mapear una entidad inmutable de sólo lectura a una expresión de subconsulta "
-"SQL dada."
#. Tag: para
+#: basic_mapping.xml:577
#, no-c-format
msgid ""
-"Declare the tables to synchronize this entity with, ensuring that auto-flush "
-"happens correctly and that queries against the derived entity do not return "
-"stale data. The <literal><subselect></literal> is available both as an "
-"attribute and a nested mapping element."
+"map multiple properties as <classname>@Id</classname> properties and declare "
+"an external class to be the identifier type. This class, which needs to be "
+"<classname>Serializable</classname>, is declared on the entity via the "
+"<classname>@IdClass</classname> annotation. The identifier type must contain "
+"the same properties as the identifier properties of the entity: each "
+"property name must be the same, its type must be the same as well if the "
+"entity property is of a basic type, its type must be the type of the primary "
+"key of the associated entity if the entity property is an association "
+"(either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</"
+"classname>)."
msgstr ""
-"Declara las tablas con las cuales se debe sincronizar esta entidad, "
-"asegurándose de que el auto-vaciado ocurra correctamente y que las consultas "
-"frente a la entidad derivada no devuelvan datos desactualizados. El "
-"<literal><subselect></literal> se encuentra disponible tanto como un "
-"atributo y como un elemento anidado de mapeo."
+#. Tag: para
+#: basic_mapping.xml:592
+#, no-c-format
+msgid ""
+"As you can see the last case is far from obvious. It has been inherited from "
+"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
+"to use it (for simplicity sake)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:596
+#, no-c-format
+msgid "Let's explore all three cases using examples."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:599
#, no-c-format
-msgid "id"
-msgstr "id"
+msgid "id as a property using a component type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:601
#, no-c-format
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
msgid ""
-"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
-"the database table. Most classes will also have a JavaBeans-style property "
-"holding the unique identifier of an instance. The <literal><id></"
-"literal> element defines the mapping from that property to the primary key "
-"column."
+"@Entity\n"
+"class User {\n"
+" @EmbeddedId\n"
+" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
+"\")\n"
+" UserId id;\n"
+"\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
msgstr ""
-"Las clases mapeadas <emphasis>tienen</emphasis> que declarar la columna de "
-"clave primaria de la tabla de la base de datos. La mayoría de las clases "
-"también tendrán una propiedad de estilo Javabeans que tenga el identificador "
-"único de una instancia. El elemento <literal><id></literal> define el "
-"mapeo de esa propiedad a la columna de clave primaria."
#. Tag: para
+#: basic_mapping.xml:606
#, no-c-format
-msgid "<literal>name</literal> (optional): the name of the identifier property."
+msgid ""
+"You can notice that the <classname>UserId</classname> class is serializable. "
+"To override the column mapping, use <classname>@AttributeOverride</"
+"classname>."
msgstr ""
-"<literal>name</literal> (opcional): El nombre de la propiedad del "
-"identificador. s"
#. Tag: para
+#: basic_mapping.xml:610
#, no-c-format
-msgid "<literal>type</literal> (optional): a name that indicates the Hibernate type."
+msgid ""
+"An embedded id can itself contains the primary key of an associated entity."
msgstr ""
-"<literal>type</literal> (opcional): un nombre que indica el tipo de "
-"Hibernate."
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"\n"
+" @MapsId(\"userId\")\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" @OneToOne User user;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" UserId userId;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:615
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to the property name): the "
-"name of the primary key column."
+"In the embedded id object, the association is represented as the identifier "
+"of the associated entity. But you can link its value to a regular "
+"association in the entity via the <classname>@MapsId</classname> annotation. "
+"The <classname>@MapsId</classname> value correspond to the property name of "
+"the embedded id object containing the associated entity's identifier. In the "
+"database, it means that the <literal>Customer.user</literal> and the "
+"<literal>CustomerId.userId</literal> properties share the same underlying "
+"column (<literal>user_fk</literal> in this case)."
msgstr ""
-"<literal>column</literal> (opcional - por defecto es el nombre de la "
-"propiedad): El nombre de la columna de la clave principal."
#. Tag: para
+#: basic_mapping.xml:627
#, no-c-format
msgid ""
-"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
-"value): an identifier property value that indicates an instance is newly "
-"instantiated (unsaved), distinguishing it from detached instances that were "
-"saved or loaded in a previous session."
+"The component type used as identifier must implement <methodname>equals()</"
+"methodname> and <methodname>hashCode()</methodname>."
msgstr ""
-"<literal>unsaved-value</literal> (opcional - por defecto es un valor "
-"\"sensible\"): Un valor de la propiedad identificadora que indica que una "
-"instancia está recién instanciada (sin guardar), distinguiéndola de las "
-"instancias separadas que fueron guardadas o cargadas en una sesión previa."
#. Tag: para
+#: basic_mapping.xml:632
#, no-c-format
msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing the property "
-"value."
+"In practice, your code only sets the <literal>Customer.user</literal> "
+"property and the user id value is copied by Hibernate into the "
+"<literal>CustomerId.userId</literal> property."
msgstr ""
-"<literal>access</literal> (opcional - por defecto es <literal>property</"
-"literal>): La estrategia que Hibernate debe utilizar para acceder al valor "
-"de la propiedad. "
#. Tag: para
+#: basic_mapping.xml:638
#, no-c-format
msgid ""
-"If the <literal>name</literal> attribute is missing, it is assumed that the "
-"class has no identifier property."
+"The id value can be copied as late as flush time, don't rely on it until "
+"after flush time."
msgstr ""
-"Si se omite el atributo <literal>name</literal>, se asume que la clase no "
-"tiene propiedad identificadora."
#. Tag: para
+#: basic_mapping.xml:642
#, no-c-format
msgid ""
-"The <literal>unsaved-value</literal> attribute is almost never needed in "
-"Hibernate3."
+"While not supported in JPA, Hibernate lets you place your association "
+"directly in the embedded id component (instead of having to use the "
+"<classname>@MapsId</classname> annotation)."
msgstr ""
-"El atributo <literal>unsaved-value</literal> casi nunca se necesita en "
-"Hibernate3."
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:648
#, no-c-format
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:651
+#, no-c-format
msgid ""
-"There is an alternative <literal><composite-id></literal> declaration "
-"that allows access to legacy data with composite keys. Its use is strongly "
-"discouraged for anything else."
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" node=\"element-name|.\">\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
msgstr ""
-"Hay una declaración <literal><composite-id></literal> opcional para "
-"permitir acceso a los datos heredados con claves compuestas. Le disuadimos "
-"seriamente de su utilización para cualquier otra cosa."
+#. Tag: para
+#: basic_mapping.xml:653
+#, no-c-format
+msgid "First a simple example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
+msgid ""
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:657
+#, no-c-format
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"\n"
+" <many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" </many-to-one>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:662
+#, no-c-format
+msgid "Notice a few things in the previous example:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:666
+#, no-c-format
+msgid ""
+"the order of the properties (and column) matters. It must be the same "
+"between the association and the primary key of the associated entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:672
+#, no-c-format
+msgid ""
+"the many to one uses the same columns as the primary key and thus must be "
+"marked as read only (<literal>insertable</literal> and <literal>updatable</"
+"literal> to false)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:679
+#, no-c-format
+msgid ""
+"unlike with <classname>@MapsId</classname>, the id value of the associated "
+"entity is not transparently copied, check the <literal>foreign</literal> id "
+"generator for more information."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:686
+#, no-c-format
+msgid ""
+"The last example shows how to map association directly in the embedded id "
+"component."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:691
+#, no-c-format
+msgid ""
+"This is the recommended approach to map composite identifier. The following "
+"options should not be considered unless some constraint are present."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:697
#, no-c-format
-msgid "Generator"
-msgstr "Generador"
+msgid "Multiple id properties without identifier type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:699
#, no-c-format
msgid ""
-"The optional <literal><generator></literal> child element names a Java "
-"class used to generate unique identifiers for instances of the persistent "
-"class. If any parameters are required to configure or initialize the "
-"generator instance, they are passed using the <literal><param></"
-"literal> element."
+"Another, arguably more natural, approach is to place <classname>@Id</"
+"classname> on multiple properties of your entity. This approach is only "
+"supported by Hibernate (not JPA compliant) but does not require an extra "
+"embeddable component."
msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:706
+#, no-c-format
+msgid ""
+"In this case <classname>Customer</classname> is its own identifier "
+"representation: it must implement <classname>Serializable</classname> and "
+"must implement <methodname>equals()</methodname> and <methodname>hashCode()</"
+"methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:712
+#, no-c-format
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id>\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:718
+#, no-c-format
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:721
+#, no-c-format
+msgid ""
+"<classname>@IdClass</classname> on an entity points to the class (component) "
+"representing the identifier of the class. The properties marked "
+"<classname>@Id</classname> on the entity must have their corresponding "
+"property on the <classname>@IdClass</classname>. The return type of search "
+"twin property must be either identical for basic properties or must "
+"correspond to the identifier class of the associated entity for an "
+"association."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:730
+#, no-c-format
+msgid ""
+"This approach is inherited from the EJB 2 days and we recommend against its "
+"use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" UserId user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:737
+#, no-c-format
+msgid ""
+"<classname>Customer</classname> and <classname>CustomerId</classname> do "
+"have the same properties <literal>customerNumber</literal> as well as "
+"<literal>user</literal>. <classname>CustomerId</classname> must be "
+"<classname>Serializable</classname> and implement <classname>equals()</"
+"classname> and <classname>hashCode()</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:745
+#, no-c-format
+msgid ""
+"While not JPA standard, Hibernate let's you declare the vanilla associated "
+"property in the <classname>@IdClass</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:751
+#, no-c-format
+msgid ""
+"This feature is of limited interest though as you are likely to have chosen "
+"the <classname>@IdClass</classname> approach to stay JPA compliant or you "
+"have a quite twisted mind."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:762
+#, fuzzy, no-c-format
+msgid "Identifier generator"
+msgstr "Generadores mejorados del identificador"
+
+#. Tag: para
+#: basic_mapping.xml:764
+#, no-c-format
+msgid ""
+"Hibernate can generate and populate identifier values for you automatically. "
+"This is the recommended approach over \"business\" or \"natural\" id "
+"(especially composite ids)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:768
+#, no-c-format
+msgid ""
+"Hibernate offers various generation strategies, let's explore the most "
+"common ones first that happens to be standardized by JPA:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:774
+#, fuzzy, no-c-format
+msgid ""
+"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
+msgstr ""
+"soporta columnas de identidad en DB2, MySQL, MS SQL Server, Sybase y "
+"HypersonicSQL. El identificador devuelto es de tipo <literal>long</literal>, "
+"<literal>short</literal> o <literal>int</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo "
+"algorithm to efficiently generate identifiers of type <literal>long</"
+"literal>, <literal>short</literal> or <literal>int</literal>, given a named "
+"database sequence."
+msgstr ""
+"utiliza un algoritmo alto/bajo para generar eficientemente identificadores "
+"de tipo <literal>long</literal>, <literal>short</literal> o <literal>int</"
+"literal>, dada una secuencia de base de datos."
+
+#. Tag: para
+#: basic_mapping.xml:788
+#, fuzzy, no-c-format
+msgid ""
+"TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in "
+"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
+"type <literal>long</literal>, <literal>short</literal> or <literal>int</"
+"literal>, given a table and column as a source of hi values. The hi/lo "
+"algorithm generates identifiers that are unique only for a particular "
+"database."
+msgstr ""
+"utiliza un algoritmo alto/bajo para generar eficientemente identificadores "
+"de tipo <literal>long</literal>, <literal>short</literal> o <literal>int</"
+"literal>, dada una tabla y columna como fuente de valores altos (por defecto "
+"<literal>hibernate_unique_key</literal> y <literal>next_hi</literal> "
+"respectivamente). El algoritmo alto/bajo genera identificadores que son "
+"únicos sólamente para una base de datos particular."
+
+#. Tag: para
+#: basic_mapping.xml:798
+#, fuzzy, no-c-format
+msgid ""
+"AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or "
+"<literal>TABLE</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"selecciona <literal>identity</literal>, <literal>sequence</literal> o "
+"<literal>hilo</literal> dependiendo de las capacidades de la base de datos "
+"subyacente. "
+
+#. Tag: para
+#: basic_mapping.xml:805
+#, no-c-format
+msgid ""
+"We recommend all new projects to use the new enhanced identifier generators. "
+"They are deactivated by default for entities using annotations but can be "
+"activated using <code>hibernate.id.new_generator_mappings=true</code>. These "
+"new generators are more efficient and closer to the JPA 2 specification "
+"semantic."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:812
+#, no-c-format
+msgid ""
+"However they are not backward compatible with existing Hibernate based "
+"application (if a sequence or a table is used for id generation). See "
+"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
+"to activate them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:818
+#, no-c-format
+msgid ""
+"To mark an id property as generated, use the <classname>@GeneratedValue</"
+"classname> annotation. You can specify the strategy used (default to "
+"<literal>AUTO</literal>) by setting <literal>strategy</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue\n"
+" Integer getId() { ... };\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Invoice {\n"
+" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+" Integer getId() { ... };\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid ""
+"<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional "
+"configurations that you can set using <classname>@SequenceGenerator</"
+"classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
+#, fuzzy, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr "<literal>name</literal>: El nombre de la propiedad. "
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> / <literal>sequenceName</literal>: name of the "
+"table or the sequence (defaulting respectively to "
+"<literal>hibernate_sequences</literal> and <literal>hibernate_sequence</"
+"literal>)"
+msgstr ""
+"<literal>sequence_name</literal> (opcional, por defecto es "
+"<literal>hibernate_sequence</literal>): el nombre de la secuencia o la tabla "
+"a utilizar."
+
+#. Tag: para
+#: basic_mapping.xml:843
+#, fuzzy, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, fuzzy, no-c-format
+msgid ""
+"<literal>initialValue</literal>: the value from which the id is to start "
+"generating"
+msgstr "<literal>table</literal>: El nombre de la tabla unida. "
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid ""
+"<literal>allocationSize</literal>: the amount to increment by when "
+"allocating id numbers from the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid ""
+"In addition, the <classname>TABLE</classname> strategy also let you "
+"customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
+#, fuzzy, no-c-format
+msgid ""
+"<literal>pkColumnName</literal>: the column name containing the entity "
+"identifier"
+msgstr "<literal>name</literal>: El nombre de la propiedad. "
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, fuzzy, no-c-format
+msgid ""
+"<literal>valueColumnName</literal>: the column name containing the "
+"identifier value"
+msgstr ""
+"<literal>name</literal> (opcional): El nombre de la propiedad del "
+"identificador. s"
+
+#. Tag: para
+#: basic_mapping.xml:873
+#, fuzzy, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr "<literal>id-type</literal>: el tipo del identificador."
+
+#. Tag: para
+#: basic_mapping.xml:878
+#, no-c-format
+msgid ""
+"<literal>uniqueConstraints</literal>: any potential column constraint on the "
+"table containing the ids"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:883
+#, no-c-format
+msgid ""
+"To link a table or sequence generator definition with an actual generated "
+"property, use the same name in both the definition <literal>name</literal> "
+"and the generator value <literal>generator</literal> as shown below."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+"@Id \n"
+"@GeneratedValue(\n"
+" strategy=GenerationType.SEQUENCE, \n"
+" generator=\"SEQ_GEN\")\n"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:890
+#, no-c-format
+msgid ""
+"The scope of a generator definition 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 in "
+"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
+"\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+"@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"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:898
+#, no-c-format
+msgid ""
+"If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used "
+"to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</"
+"literal> are application level generators."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:904
+#, no-c-format
+msgid ""
+"Package level definition is not supported by the JPA specification. However, "
+"you can use the <literal>@GenericGenerator</literal> at the package level "
+"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:910
+#, no-c-format
+msgid ""
+"These are the four standard JPA generators. Hibernate goes beyond that and "
+"provide additional generators or additional options as we will see below. "
+"You can also write your own custom identifier generator by implementing "
+"<classname>org.hibernate.id.IdentifierGenerator</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:916
+#, no-c-format
+msgid ""
+"To define a custom generator, use the <classname>@GenericGenerator</"
+"classname> annotation (and its plural counter part "
+"<classname>@GenericGenerators</classname>) that describes the class of the "
+"identifier generator or its short cut name (as described below) and a list "
+"of key/value parameters. When using <classname>@GenericGenerator</classname> "
+"and assigning it via <classname>@GeneratedValue.generator</classname>, the "
+"<classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+"@GenericGenerator(\n"
+" name=\"trigger-generated\", \n"
+" strategy = \"select\",\n"
+" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+")\n"
+"public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, fuzzy, no-c-format
+msgid ""
+"The hbm.xml approach uses the optional <literal><generator></literal> "
+"child element inside <literal><id></literal>. If any parameters are "
+"required to configure or initialize the generator instance, they are passed "
+"using the <literal><param></literal> element."
+msgstr ""
"El elemento hijo opcional <literal><generator></literal> nombra una "
"clase Java utilizada para generar identificadores únicos para instancias de "
"la clase persistente. De requerirse algún parámetro para configurar o "
"inicializar la instancia del generador, se pasa utilizando el elemento "
"<literal><param></literal>."
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:937
+#, no-c-format
+msgid "Various additional generators"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:939
#, no-c-format
msgid ""
"All generators implement the interface <literal>org.hibernate.id."
@@ -887,12 +2221,14 @@
"ya incorporadas. Los nombres de atajo para los generadores incorporados son "
"los siguientes:"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:946
#, no-c-format
-msgid "<literal>increment</literal>"
-msgstr "<literal>increment</literal>"
+msgid "increment"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
msgid ""
"generates identifiers of type <literal>long</literal>, <literal>short</"
@@ -905,12 +2241,14 @@
"otro proceso está insertando datos en la misma tabla. <emphasis>No lo "
"utilice en un clúster.</emphasis>"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:958
#, no-c-format
-msgid "<literal>identity</literal>"
-msgstr "<literal>identity</literal>"
+msgid "identity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
msgid ""
"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
@@ -921,12 +2259,14 @@
"HypersonicSQL. El identificador devuelto es de tipo <literal>long</literal>, "
"<literal>short</literal> o <literal>int</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:969
#, no-c-format
-msgid "<literal>sequence</literal>"
-msgstr "<literal>sequence</literal>"
+msgid "sequence"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
msgid ""
"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
@@ -937,12 +2277,14 @@
"en Interbase. El identificador devuelto es de tipo <literal>long</literal>, "
"<literal>short</literal> o <literal>int</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:980
#, no-c-format
-msgid "<literal>hilo</literal>"
-msgstr "<literal>hilo</literal>"
+msgid "hilo"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -959,12 +2301,14 @@
"respectivamente). El algoritmo alto/bajo genera identificadores que son "
"únicos sólamente para una base de datos particular."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:996
#, no-c-format
-msgid "<literal>seqhilo</literal>"
-msgstr "<literal>seqhilo</literal>"
+msgid "seqhilo"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -975,38 +2319,122 @@
"de tipo <literal>long</literal>, <literal>short</literal> o <literal>int</"
"literal>, dada una secuencia de base de datos."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
+#, fuzzy, no-c-format
+msgid "uuid"
+msgstr "id"
+
+#. Tag: para
+#: basic_mapping.xml:1010
#, no-c-format
-msgid "<literal>uuid</literal>"
-msgstr "<literal>uuid</literal>"
+msgid ""
+"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
+"represented as a string of 32 hexidecimal digits. Users can also configure "
+"it to use a separator (config parameter \"separator\") which separates the "
+"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
+"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
+"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
+"discussed below."
+msgstr ""
+#. Tag: literal
+#: basic_mapping.xml:1023
+#, no-c-format
+msgid "uuid2"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
msgid ""
-"uses a 128-bit UUID algorithm to generate identifiers of type string that "
-"are unique within a network (the IP address is used). The UUID is encoded as "
-"a string of 32 hexadecimal digits in length."
+"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
+"\"version\" (the RFC term) generated depends on the pluggable \"generation "
+"strategy\" used (see below). Capable of generating values as <classname>java."
+"util.UUID</classname>, <classname>java.lang.String</classname> or as a byte "
+"array of length 16 (<literal>byte[16]</literal>). The \"generation strategy"
+"\" is defined by the interface <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
+"configuration parameters for defining which generation strategy to use:"
msgstr ""
-"utiliza un algoritmo UUID de 128 bits para generar identificadores de tipo "
-"cadena, únicos dentro de una red (se utiliza la direccón IP). El UUID se "
-"codifica como una cadena hexadecimal de 32 dígitos de largo."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1038
#, no-c-format
-msgid "<literal>guid</literal>"
-msgstr "<literal>guid</literal>"
+msgid "uuid_gen_strategy_class"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1041
#, no-c-format
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1047
+#, no-c-format
+msgid "uuid_gen_strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1050
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the "
+"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
+"<methodname>randomUUID</methodname> method of <classname>java.util.UUID</"
+"classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - "
+"generates \"version 1\" UUID values, using IP address since mac address not "
+"available. If you need mac address to be used, consider leveraging one of "
+"the existing third party UUID generators which sniff out mac address and "
+"integrating it via the <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
+"time of this writing include <ulink url=\"http://johannburkard.de/software/"
+"uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url="
+"\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/"
+"sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, fuzzy, no-c-format
+msgid "guid"
+msgstr "id"
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
-msgstr "utiliza una cadena GUID generada por base de datos en MS SQL Server y MySQL."
+msgstr ""
+"utiliza una cadena GUID generada por base de datos en MS SQL Server y MySQL."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1094
#, no-c-format
-msgid "<literal>native</literal>"
-msgstr "<literal>native</literal>"
+msgid "native"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1097
#, no-c-format
msgid ""
"selects <literal>identity</literal>, <literal>sequence</literal> or "
@@ -1017,12 +2445,14 @@
"<literal>hilo</literal> dependiendo de las capacidades de la base de datos "
"subyacente. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1105
#, no-c-format
-msgid "<literal>assigned</literal>"
-msgstr "<literal>assigned</literal>"
+msgid "assigned"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1108
#, no-c-format
msgid ""
"lets the application assign an identifier to the object before <literal>save"
@@ -1033,12 +2463,14 @@
"llame a <literal>save()</literal>. Esta es la estrategia por defecto si no "
"se especifica un elemento <literal><generator></literal>. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1117
#, no-c-format
-msgid "<literal>select</literal>"
-msgstr "<literal>select</literal>"
+msgid "select"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1120
#, no-c-format
msgid ""
"retrieves a primary key, assigned by a database trigger, by selecting the "
@@ -1048,12 +2480,14 @@
"seleccionando la fila por alguna clave única y recuperando el valor de la "
"clave principal."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1127
#, no-c-format
-msgid "<literal>foreign</literal>"
-msgstr "<literal>foreign</literal>"
+msgid "foreign"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1130
#, no-c-format
msgid ""
"uses the identifier of another associated object. It is usually used in "
@@ -1064,12 +2498,14 @@
"conjunto cón a una asociación de clave principal <literal><one-to-one>"
"</literal>."
-#. Tag: term
-#, no-c-format
-msgid "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1138
+#, fuzzy, no-c-format
+msgid "sequence-identity"
msgstr "<literal>sequence-identity</literal>"
#. Tag: para
+#: basic_mapping.xml:1141
#, no-c-format
msgid ""
"a specialized sequence generation strategy that utilizes a database sequence "
@@ -1089,11 +2525,13 @@
"Oracle."
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "Algoritmo alto/bajo"
#. Tag: para
+#: basic_mapping.xml:1157
#, no-c-format
msgid ""
"The <literal>hilo</literal> and <literal>seqhilo</literal> generators "
@@ -1108,7 +2546,33 @@
"tener el siguiente valor \"alto\" disponible. La segunda utiliza una "
"secuencia del estilo de Oracle, donde se encuentre soportada."
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1167
#, no-c-format
msgid ""
"Unfortunately, you cannot use <literal>hilo</literal> when supplying your "
@@ -1124,11 +2588,13 @@
"<literal>hibernate.transaction.manager_lookup_class</literal>."
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "Algoritmo UUID"
#. Tag: para
+#: basic_mapping.xml:1177
#, no-c-format
msgid ""
"The UUID contains: IP address, startup time of the JVM that is accurate to a "
@@ -1143,11 +2609,13 @@
"sin tener que utilizar JNI."
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "Columnas de identidad y secuencias"
#. Tag: para
+#: basic_mapping.xml:1187
#, no-c-format
msgid ""
"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
@@ -1163,7 +2631,30 @@
"del estilo <literal>sequence</literal>. Ambas estrategias requieren dos "
"consultas SQL para insertar un nuevo objeto. Por ejemplo:"
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1199
#, no-c-format
msgid ""
"For cross-platform development, the <literal>native</literal> strategy will, "
@@ -1177,20 +2668,22 @@
"capacidades de la base de datos subyacente."
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "Identificadores asignados"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1209
+#, fuzzy, no-c-format
msgid ""
"If you want the application to assign identifiers, as opposed to having "
"Hibernate generate them, you can use the <literal>assigned</literal> "
"generator. This special generator uses the identifier value already assigned "
"to the object's identifier property. The generator is used when the primary "
"key is a natural key instead of a surrogate key. This is the default "
-"behavior if you do not specify a <literal><generator></literal> "
-"element."
+"behavior if you do not specify <classname>@GeneratedValue</classname> nor "
+"<literal><generator></literal> elements."
msgstr ""
"Si quiere que la aplicación asigne los identificadores, en contraposición a "
"que los genere Hibernate, puede utilizar el generador <literal>assigned</"
@@ -1201,6 +2694,7 @@
"elemento <literal><generator></literal>."
#. Tag: para
+#: basic_mapping.xml:1218
#, no-c-format
msgid ""
"The <literal>assigned</literal> generator makes Hibernate use "
@@ -1216,18 +2710,34 @@
"que usted defina <literal>Interceptor.isUnsaved()</literal>."
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "Claves primarias asignadas por disparadores"
#. Tag: para
+#: basic_mapping.xml:1228
#, no-c-format
-msgid "Hibernate does not generate DDL with triggers. It is for legacy schemas only."
+msgid ""
+"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
msgstr ""
"Hibernate no genera DDL con disparadores. Es para los esquemas heredados "
"sólamente."
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1233
#, no-c-format
msgid ""
"In the above example, there is a unique valued property named "
@@ -1241,11 +2751,91 @@
"literal>, cuyo valor es generado por un disparador."
#. Tag: title
+#: basic_mapping.xml:1241
#, no-c-format
+msgid "Identity copy (foreign generator)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1243
+#, no-c-format
+msgid ""
+"Finally, you can ask Hibernate to copy the identifier from another "
+"associated entity. In the Hibernate jargon, it is known as a foreign "
+"generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumn(name = \"person_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1250
+#, fuzzy, no-c-format
+msgid "Or alternatively"
+msgstr "Alternativas de metadatos"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id Integer id;\n"
+"\n"
+" @MapsId @OneToOne\n"
+" @JoinColumn(name = \"patient_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Person {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1254
+#, no-c-format
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, no-c-format
+msgid ""
+"<class name=\"MedicalHistory\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">patient</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
+">\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, no-c-format
msgid "Enhanced identifier generators"
msgstr "Generadores mejorados del identificador"
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
msgid ""
"Starting with release 3.2.3, there are 2 new generators which represent a re-"
@@ -1267,6 +2857,7 @@
"actuales y puede ser referenciados por FQN."
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
msgid ""
"The first of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1304,6 +2895,7 @@
"un número de parámetros de configuración:"
#. Tag: para
+#: basic_mapping.xml:1291
#, no-c-format
msgid ""
"<literal>sequence_name</literal> (optional, defaults to "
@@ -1315,6 +2907,7 @@
"a utilizar."
#. Tag: para
+#: basic_mapping.xml:1297
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional, defaults to <literal>1</"
@@ -1328,6 +2921,7 @@
"llama \"STARTS WITH\"."
#. Tag: para
+#: basic_mapping.xml:1304
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1341,6 +2935,7 @@
"a la cláusula que usualmente se llama \"INCREMENT BY\"."
#. Tag: para
+#: basic_mapping.xml:1312
#, no-c-format
msgid ""
"<literal>force_table_use</literal> (optional - defaults to <literal>false</"
@@ -1352,6 +2947,7 @@
"estructura de respaldo aunque puede que el dialecto soporte la secuencia?"
#. Tag: para
+#: basic_mapping.xml:1319
#, no-c-format
msgid ""
"<literal>value_column</literal> (optional - defaults to <literal>next_val</"
@@ -1364,17 +2960,17 @@
"valor."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1326
+#, fuzzy, no-c-format
msgid ""
"<literal>optimizer</literal> (optional - defaults to <literal>none</"
-"literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" /"
-">"
+"literal>): See"
msgstr ""
-"<literal>optimizer</literal> (opcional - por defecto es <literal>none</"
-"literal>): Consulte <xref linkend=\"mapping-declaration-id-enhanced-"
-"optimizers\" />"
+"<literal>cascade</literal> (opcional- por defecto es <literal>none</"
+"literal>): el estilo de cascada."
#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
msgid ""
"The second of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1400,6 +2996,7 @@
"un número de parámetros de configuración:"
#. Tag: para
+#: basic_mapping.xml:1345
#, no-c-format
msgid ""
"<literal>table_name</literal> (optional - defaults to "
@@ -1409,6 +3006,7 @@
"<literal>hibernate_sequences</literal>): el nombre de la tabla a utilizar."
#. Tag: para
+#: basic_mapping.xml:1351
#, no-c-format
msgid ""
"<literal>value_column_name</literal> (optional - defaults to "
@@ -1420,6 +3018,7 @@
"utiliza para mantener el valor."
#. Tag: para
+#: basic_mapping.xml:1357
#, no-c-format
msgid ""
"<literal>segment_column_name</literal> (optional - defaults to "
@@ -1433,6 +3032,7 @@
"identifica que valor de incremento utilizar."
#. Tag: para
+#: basic_mapping.xml:1365
#, no-c-format
msgid ""
"<literal>segment_value</literal> (optional - defaults to <literal>default</"
@@ -1444,6 +3044,7 @@
"desde el cual queremos sacar los valores de incremento para este generador."
#. Tag: para
+#: basic_mapping.xml:1372
#, no-c-format
msgid ""
"<literal>segment_value_length</literal> (optional - defaults to "
@@ -1455,6 +3056,7 @@
"tamaño de la columna a crear esta columna de llave de segmento."
#. Tag: para
+#: basic_mapping.xml:1378
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional - defaults to <literal>1</"
@@ -1464,6 +3066,7 @@
"literal>): El valor inicial a recuperar de la tabla."
#. Tag: para
+#: basic_mapping.xml:1384
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1474,29 +3077,32 @@
"tabla."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1390
+#, fuzzy, no-c-format
msgid ""
-"<literal>optimizer</literal> (optional - defaults to <literal></literal>): "
-"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+"<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): "
+"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
"<literal>optimizer</literal> (opcional - por defecto es <literal></"
"literal>): Consulte <xref linkend=\"mapping-declaration-id-enhanced-"
"optimizers\" />"
#. Tag: title
+#: basic_mapping.xml:1397
#, no-c-format
msgid "Identifier generator optimization"
msgstr "Optimización del generador del identificador"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1399
+#, fuzzy, no-c-format
msgid ""
"For identifier generators that store values in the database, it is "
"inefficient for them to hit the database on each and every call to generate "
"a new identifier value. Instead, you can group a bunch of them in memory and "
"only hit the database when you have exhausted your in-memory value group. "
"This is the role of the pluggable optimizers. Currently only the two "
-"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> "
+"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
"support this operation."
msgstr ""
"Para los generadores del identificador que almacenan valores en la base de "
@@ -1508,6 +3114,7 @@
"\"mapping-declaration-id-enhanced\" />) soportan esta operación."
#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
msgid ""
"<literal>none</literal> (generally this is the default if no optimizer was "
@@ -1519,6 +3126,7 @@
"accederá a la base de datos para toda petición."
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
msgid ""
"<literal>hilo</literal>: applies a hi/lo algorithm around the database "
@@ -1536,6 +3144,7 @@
"para definir un grupo \"hi value\"."
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
msgid ""
"<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this "
@@ -1554,306 +3163,202 @@
"la base de datos."
#. Tag: title
-#, no-c-format
-msgid "composite-id"
-msgstr "composite-id"
+#: basic_mapping.xml:1441
+#, fuzzy, no-c-format
+msgid "Partial identifier generation"
+msgstr "Generadores mejorados del identificador"
#. Tag: para
+#: basic_mapping.xml:1443
#, no-c-format
msgid ""
-"A table with a composite key can be mapped with multiple properties of the "
-"class as identifier properties. The <literal><composite-id></literal> "
-"element accepts <literal><key-property></literal> property mappings "
-"and <literal><key-many-to-one></literal> mappings as child elements."
+"Hibernate supports the automatic generation of some of the identifier "
+"properties. Simply use the <classname>@GeneratedValue</classname> annotation "
+"on one or several id properties."
msgstr ""
-"Una tabla con clave compuesta se puede mapear con múltiples propiedades de "
-"la clase como propiedades identificadoras. El elemento <literal><"
-"composite-id></literal> acepta los mapeos de propiedad <literal><key-"
-"property></literal> y los mapeos <literal><key-many-to-one></"
-"literal> como elementos hijos."
#. Tag: para
+#: basic_mapping.xml:1449
#, no-c-format
msgid ""
-"The persistent class <emphasis>must</emphasis> override <literal>equals()</"
-"literal> and <literal>hashCode()</literal> to implement composite identifier "
-"equality. It must also implement <literal>Serializable</literal>."
+"The Hibernate team has always felt such a construct as fundamentally wrong. "
+"Try hard to fix your data model before using this feature."
msgstr ""
-"La clase persistente <emphasis>tiene</emphasis> que sobrescribir "
-"<literal>equals()</literal> y <literal>hashCode()</literal> para implementar "
-"la igualdad del identificador compuesto. También tiene que implementar "
-"<literal>Serializable</literal>."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1454
#, no-c-format
msgid ""
-"Unfortunately, this approach means that a persistent object is its own "
-"identifier. There is no convenient \"handle\" other than the object itself. "
-"You must instantiate an instance of the persistent class itself and populate "
-"its identifier properties before you can <literal>load()</literal> the "
-"persistent state associated with a composite key. We call this approach an "
-"<emphasis>embedded</emphasis> composite identifier, and discourage it for "
-"serious applications."
+"@Entity\n"
+"public class CustomerInventory implements Serializable {\n"
+" @Id\n"
+" @TableGenerator(name = \"inventory\",\n"
+" table = \"U_SEQUENCES\",\n"
+" pkColumnName = \"S_ID\",\n"
+" valueColumnName = \"S_NEXTNUM\",\n"
+" pkColumnValue = \"inventory\",\n"
+" allocationSize = 1000)\n"
+" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
+"\")\n"
+" Integer id;\n"
+"\n"
+"\n"
+" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+" Customer customer;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @Id\n"
+" private int id;\n"
+"}"
msgstr ""
-"Desafortunadamente, este enfoque significa que un objeto persistente es su "
-"propio identificador. No existe otra \"asa\" conveniente más que el objeto "
-"mismo. Debe instanciar una instancia de la clase persistente y poblar sus "
-"propiedades identificadoras antes de que pueda <literal>load()</literal> el "
-"estado persistente asociado a una clave compuesta. Este enfoque lo "
-"denominamos un identificador compuesto <emphasis>incluído</emphasis> y no lo "
-"recomendamos para aplicaciones serias."
#. Tag: para
+#: basic_mapping.xml:1456
#, no-c-format
msgid ""
-"A second approach is what we call a <emphasis>mapped</emphasis> composite "
-"identifier, where the identifier properties named inside the <literal><"
-"composite-id></literal> element are duplicated on both the persistent "
-"class and a separate identifier class."
+"You can also generate properties inside an <classname>@EmbeddedId</"
+"classname> class."
msgstr ""
-"Un segundo enfoque es lo que denominamos un identificador compuesto "
-"<emphasis>mapeado</emphasis>, en donde las propiedades del identificador "
-"nombradas dentro del elemento <literal><composite-id></literal> son "
-"duplicadas tanto en la clase persistente como en la clase identificadora "
-"separada."
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:1462
#, no-c-format
-msgid ""
-"In this example, both the composite identifier class, <literal>MedicareId</"
-"literal>, and the entity class itself have properties named "
-"<literal>medicareNumber</literal> and <literal>dependent</literal>. The "
-"identifier class must override <literal>equals()</literal> and "
-"<literal>hashCode()</literal> and implement <literal>Serializable</literal>. "
-"The main disadvantage of this approach is code duplication."
+msgid "Optimistic locking properties (optional)"
msgstr ""
-"En este ejemplo, tanto la clase identificadora compuesta "
-"<literal>MedicareId</literal> como la clase de entidad misma tienen "
-"propiedades denominadas <literal>medicareNumber</literal> y "
-"<literal>dependent</literal>. La clase identificadora tiene que sobrescribir "
-"<literal>equals()</literal> y <literal>hashCode()</literal> e implementar "
-"<literal>Serializable</literal>. La desventaja principal de este enfoque es "
-"la duplicación de código."
#. Tag: para
+#: basic_mapping.xml:1464
#, no-c-format
-msgid "The following attributes are used to specify a mapped composite identifier:"
-msgstr ""
-"Los siguientes atributos se utilizan para especificar un identificador "
-"compuesto mapeado:"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>mapped</literal> (optional - defaults to <literal>false</literal>): "
-"indicates that a mapped composite identifier is used, and that the contained "
-"property mappings refer to both the entity class and the composite "
-"identifier class."
+"When using long transactions or conversations that span several database "
+"transactions, it is useful to store versioning data to ensure that if the "
+"same entity is updated by two conversations, the last to commit changes will "
+"be informed and not override the other conversation's work. It guarantees "
+"some isolation while still allowing for good scalability and works "
+"particularly well in read-often write-sometimes situations."
msgstr ""
-"<literal>mapped</literal> (opcional, por defecto es <literal>false</"
-"literal>): indica que se utiliza un identificador compuesto mapeado y que "
-"los mapeos de propiedad contenidos se refieren tanto a la clase de entidad "
-"como a la clase identificadora compuesta. "
#. Tag: para
+#: basic_mapping.xml:1472
#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - but required for a mapped composite "
-"identifier): the class used as a composite identifier."
+msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
-"<literal>class</literal> (opcional, pero requerida por un identificador "
-"compuesto mapeado): La clase se utiliza como un identificador compuesto. "
#. Tag: para
+#: basic_mapping.xml:1475
#, no-c-format
msgid ""
-"We will describe a third, even more convenient approach, where the composite "
-"identifier is implemented as a component class in <xref linkend=\"components-"
-"compositeid\" />. The attributes described below apply only to this "
-"alternative approach:"
+"A version or timestamp property should never be null for a detached "
+"instance. Hibernate will detect any instance with a null version or "
+"timestamp as transient, irrespective of what other <literal>unsaved-value</"
+"literal> strategies are specified. <emphasis>Declaring a nullable version or "
+"timestamp property is an easy way to avoid problems with transitive "
+"reattachment in Hibernate. It is especially useful for people using assigned "
+"identifiers or composite keys</emphasis>."
msgstr ""
-"Vamos a decribir un tercer enfoque, aún más práctico, en donde se implementa "
-"el identificador compuesto como una clase componente en <xref linkend="
-"\"components-compositeid\"/>. Los atributos descritos a continuación "
-"sólamente aplican a este enfoque alternativo:"
+"Una propiedad de versión o de sello de fecha nunca debe ser nula para una "
+"instancia separada. Hibernate detectará cualquier instancia con una versión "
+"o sello de fecha nulo como transitoria, sin importar qué otras estrategias "
+"<literal>unsaved-value</literal> se hayan especificado. <emphasis>El "
+"declarar una propiedad de versión o sello de fecha nulable es una forma "
+"fácil de evitar cualquier problema con la re-unión transitiva en Hibernate. "
+"Es especialmente útil para la gente que utiliza identificadores asignados o "
+"claves compuestas</emphasis>."
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>name</literal> (optional - required for this approach): a property "
-"of component type that holds the composite identifier. Please see chapter 9 "
-"for more information."
-msgstr ""
-"<literal>name</literal> (opcional, se necesita para este enfoque): Una "
-"propiedad de tipo componente que tiene el identificador compuesto. Consulte "
-"el capítulo 9 para obtener mayor información. "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate uses for accessing the property value."
-msgstr ""
-"<literal>access</literal> (opcional - por defecto es <literal>property</"
-"literal>): La estrategia que Hibernate utiliza para acceder al valor de la "
-"propiedad."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the component class used as a composite "
-"identifier. Please see the next section for more information."
-msgstr ""
-"<literal>class</literal> (opcional - por defecto es el tipo de propiedad "
-"determinado por la reflección): la clase componente utilizada como un "
-"identificador compuesto. Vea la siguiente sección para obtener mayor "
-"información."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The third approach, an <emphasis>identifier component</emphasis>, is "
-"recommended for almost all applications."
-msgstr ""
-"Este tercer enfoque, un <emphasis>componente identificador</emphasis> es el "
-"que recomendamos para casi todas las aplicaciones. "
-
#. Tag: title
+#: basic_mapping.xml:1485
#, no-c-format
-msgid "Discriminator"
-msgstr "Discriminador"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The <literal><discriminator></literal> element is required for "
-"polymorphic persistence using the table-per-class-hierarchy mapping "
-"strategy. It declares a discriminator column of the table. The discriminator "
-"column contains marker values that tell the persistence layer what subclass "
-"to instantiate for a particular row. A restricted set of types can be used: "
-"<literal>string</literal>, <literal>character</literal>, <literal>integer</"
-"literal>, <literal>byte</literal>, <literal>short</literal>, "
-"<literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</"
-"literal>."
+msgid "Version number"
msgstr ""
-"Se necesita el elemento <literal><discriminator></literal> para la "
-"persistencia polimórfica utilizando la estrategia de mapeo de tabla-por-"
-"jerarquía-de-clases. Declara una columna discriminadora de la tabla. La "
-"columna discriminidora contiene valores de marca que le dicen a la capa de "
-"persistencia qué subclase instanciar para una fila en particular. Se puede "
-"utilizar un conjunto restringido de tipos: <literal>string</literal>, "
-"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
-"literal>, <literal>short</literal>, <literal>boolean</literal>, "
-"<literal>yes_no</literal>, <literal>true_false</literal>."
#. Tag: para
+#: basic_mapping.xml:1487
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
-"the name of the discriminator column."
+"You can add optimistic locking capability to an entity using the "
+"<literal>@Version</literal> annotation:"
msgstr ""
-"<literal>column</literal> (opcional - por defecto es <literal>class</"
-"literal>) el nombre de la columna discriminadora. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1490
#, no-c-format
msgid ""
-"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
-"a name that indicates the Hibernate type"
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
msgstr ""
-"<literal>type</literal> (opcional - por defecto es <literal>string</"
-"literal>) un nombre que indica el tipo Hibernate. "
#. Tag: para
+#: basic_mapping.xml:1492
#, no-c-format
msgid ""
-"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
-"\"forces\" Hibernate to specify the allowed discriminator values, even when "
-"retrieving all instances of the root class."
+"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 ""
-"<literal>force</literal> (opcional - por defecto es <literal>false</"
-"literal>) \"fuerza\" a Hibernate para especificar los valores "
-"discriminadores permitidos incluso cuando se recuperan todas las instancias "
-"de la clase raíz. "
#. Tag: para
+#: basic_mapping.xml:1497
#, no-c-format
msgid ""
-"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
-"set this to <literal>false</literal> if your discriminator column is also "
-"part of a mapped composite identifier. It tells Hibernate not to include the "
-"column in SQL <literal>INSERTs</literal>."
+"The version column may be a numeric. Hibernate supports any kind of type "
+"provided that you define and implement the appropriate "
+"<classname>UserVersionType</classname>."
msgstr ""
-"<literal>insert</literal> (opcional - por defecto es <literal>true</"
-"literal>): establecido como <literal>false</literal> si su columna "
-"discriminadora también es parte de un identificador mapeado compuesto. Lle "
-"dice a Hibernate que no incluya la columna en los SQLs <literal>INSERT</"
-"literal>."
#. Tag: para
+#: basic_mapping.xml:1501
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
-"executed when a type has to be evaluated. It allows content-based "
-"discrimination."
+"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>LockModeType."
+"OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType."
+"PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
-"<literal>formula</literal> (opcional): una expresión SQL arbitraria que se "
-"ejecuta cuando se tenga que evaluar un tipo. Permite la discriminación con "
-"base en el contenido."
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
msgid ""
-"Actual values of the discriminator column are specified by the "
-"<literal>discriminator-value</literal> attribute of the <literal><"
-"class></literal> and <literal><subclass></literal> elements."
+"If the version number is generated by the database (via a trigger for "
+"example), make sure to use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"Los valores reales de la columna discriminadora están especificados por el "
-"atributo <literal>discriminator-value</literal> de los elementos "
-"<literal><class></literal> y <literal><subclass></literal>."
#. Tag: para
+#: basic_mapping.xml:1511
#, no-c-format
-msgid ""
-"The <literal>force</literal> attribute is only useful if the table contains "
-"rows with \"extra\" discriminator values that are not mapped to a persistent "
-"class. This will not usually be the case."
+msgid "To declare a version property in hbm.xml, use:"
msgstr ""
-"El atributo <literal>force</literal> es sólamente útil si la tabla contiene "
-"filas con valores discriminadores \"extra\" que no estén mapeados a una "
-"clase persistente. Generalmente este no es el caso."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1530
#, no-c-format
msgid ""
-"The <literal>formula</literal> attribute allows you to declare an arbitrary "
-"SQL expression that will be used to evaluate the type of a row. For example:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
msgstr ""
-"El atributo <literal>formula</literal> le permite declarar una expresión SQL "
-"arbitraria que será utilizada para evaluar el tipo de una fila. Por ejemplo: "
-#. Tag: title
-#, no-c-format
-msgid "Version (optional)"
-msgstr "Versión (opcional)"
-
#. Tag: para
+#: basic_mapping.xml:1534
#, no-c-format
msgid ""
-"The <literal><version></literal> element is optional and indicates "
-"that the table contains versioned data. This is particularly useful if you "
-"plan to use <emphasis>long transactions</emphasis>. See below for more "
-"information:"
-msgstr ""
-"El elemento <literal><version></literal> es opcional e indica que la "
-"tabla contiene datos versionados. Esto es particularmente útil si planea "
-"utilizar <emphasis>transacciones largas</emphasis>. Vea a continuación para "
-"obtener mayor información:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of the column holding the version number."
msgstr ""
@@ -1861,11 +3366,15 @@
"propiedad): El nombre de la columna que tiene el número de la versión."
#. Tag: para
+#: basic_mapping.xml:1540
#, no-c-format
-msgid "<literal>name</literal>: the name of a property of the persistent class."
-msgstr "<literal>name</literal>: El nombre de una propiedad de la clase persistente. "
+msgid ""
+"<literal>name</literal>: the name of a property of the persistent class."
+msgstr ""
+"<literal>name</literal>: El nombre de una propiedad de la clase persistente. "
#. Tag: para
+#: basic_mapping.xml:1545
#, no-c-format
msgid ""
"<literal>type</literal> (optional - defaults to <literal>integer</literal>): "
@@ -1875,6 +3384,7 @@
"literal>): El tipo del número de la versión. "
#. Tag: para
+#: basic_mapping.xml:1551
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -1885,6 +3395,7 @@
"propiedad. "
#. Tag: para
+#: basic_mapping.xml:1557
#, no-c-format
msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</"
@@ -1901,6 +3412,7 @@
"utilizar el valor de la propiedad identificadora."
#. Tag: para
+#: basic_mapping.xml:1567
#, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -1910,10 +3422,12 @@
msgstr ""
"<literal>generated</literal> (opcional - por defecto es <literal>never</"
"literal>): Especifica que este valor de la propiedad de la versión es "
-"generado por la base de datos. Vea la discusión de las <link linkend=\"mapping-generated"
-"\">propiedades generadas</link> para obtener mayor información."
+"generado por la base de datos. Vea la discusión de las <link linkend="
+"\"mapping-generated\">propiedades generadas</link> para obtener mayor "
+"información."
#. Tag: para
+#: basic_mapping.xml:1575
#, no-c-format
msgid ""
"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
@@ -1927,59 +3441,82 @@
"literal> si la columna de la base de datos se define con un valor "
"predeterminado de <literal>0</literal>."
+#. Tag: title
+#: basic_mapping.xml:1586
+#, fuzzy, no-c-format
+msgid "Timestamp"
+msgstr "Timestamp (opcional)"
+
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1588
+#, fuzzy, no-c-format
msgid ""
-"Version numbers can be of Hibernate type <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> or <literal>calendar</literal>."
+"Alternatively, you can use a timestamp. Timestamps are a less safe "
+"implementation of optimistic locking. However, sometimes the application "
+"might use the timestamps in other ways."
msgstr ""
-"Los números de versión pueden ser de tipo Hibernate <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> o <literal>calendar</literal>."
+"El elemento opcional <literal><timestamp></literal> indica que la "
+"tabla contiene datos con sellos de fecha. Esto brinda una alternativa al "
+"versionado. Los sellos de tiempo (timestamps) son por naturaleza una "
+"implementación menos segura del bloqueo optimista. Sin embargo, a veces la "
+"aplicación puede usar los sellos de fecha de otras maneras."
#. Tag: para
+#: basic_mapping.xml:1592
#, no-c-format
msgid ""
-"A version or timestamp property should never be null for a detached "
-"instance. Hibernate will detect any instance with a null version or "
-"timestamp as transient, irrespective of what other <literal>unsaved-value</"
-"literal> strategies are specified. <emphasis>Declaring a nullable version or "
-"timestamp property is an easy way to avoid problems with transitive "
-"reattachment in Hibernate. It is especially useful for people using assigned "
-"identifiers or composite keys</emphasis>."
+"Simply mark a property of type <classname>Date</classname> or "
+"<classname>Calendar</classname> as <classname>@Version</classname>."
msgstr ""
-"Una propiedad de versión o de sello de fecha nunca debe ser nula para una "
-"instancia separada. Hibernate detectará cualquier instancia con una versión "
-"o sello de fecha nulo como transitoria, sin importar qué otras estrategias "
-"<literal>unsaved-value</literal> se hayan especificado. <emphasis>El "
-"declarar una propiedad de versión o sello de fecha nulable es una forma "
-"fácil de evitar cualquier problema con la re-unión transitiva en Hibernate. "
-"Es especialmente útil para la gente que utiliza identificadores asignados o "
-"claves compuestas</emphasis>."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:1596
#, no-c-format
-msgid "Timestamp (optional)"
-msgstr "Timestamp (opcional)"
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" public Date getLastUpdate() { ... }\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1598
#, no-c-format
msgid ""
-"The optional <literal><timestamp></literal> element indicates that the "
-"table contains timestamped data. This provides an alternative to versioning. "
-"Timestamps are a less safe implementation of optimistic locking. However, "
-"sometimes the application might use the timestamps in other ways."
+"Like version numbers, the timestamp can be generated by the database instead "
+"of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"El elemento opcional <literal><timestamp></literal> indica que la "
-"tabla contiene datos con sellos de fecha. Esto brinda una alternativa al "
-"versionado. Los sellos de tiempo (timestamps) son por naturaleza una "
-"implementación menos segura del bloqueo optimista. Sin embargo, a veces la "
-"aplicación puede usar los sellos de fecha de otras maneras."
#. Tag: para
+#: basic_mapping.xml:1602
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr ""
+"Por ejemplo, si tenemos el siguiente mapeo de <literal><properties></"
+"literal>:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
#, no-c-format
msgid ""
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1624
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of a column holding the timestamp."
msgstr ""
@@ -1987,6 +3524,7 @@
"propiedad): El nombre de una columna que tiene el sello de fecha. "
#. Tag: para
+#: basic_mapping.xml:1630
#, no-c-format
msgid ""
"<literal>name</literal>: the name of a JavaBeans style property of Java type "
@@ -1998,8 +3536,21 @@
"persistente. "
#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380
+#: basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
#, no-c-format
msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the property value."
+msgstr ""
+"<literal>access</literal> (opcional - por defecto es <literal>property</"
+"literal>): La estrategia que Hibernate utiliza para acceder al valor de la "
+"propiedad."
+
+#. Tag: para
+#: basic_mapping.xml:1642
+#, no-c-format
+msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>null</"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
@@ -2014,6 +3565,7 @@
"propiedad identificadora."
#. Tag: para
+#: basic_mapping.xml:1652
#, no-c-format
msgid ""
"<literal>source</literal> (optional - defaults to <literal>vm</literal>): "
@@ -2036,6 +3588,7 @@
"debido a la falta de precisión (por ejemplo, Oracle 8)."
#. Tag: para
+#: basic_mapping.xml:1665
#, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2045,15 +3598,18 @@
msgstr ""
"<literal>generated</literal> (opcional - por defecto es <literal>never</"
"literal>): Especifica que este valor de la propiedad del sello de fecha en "
-"realidad es generado por la base de datos. Consulte la discusión de las <link linkend=\"mapping-"
-"generated\">propiedades generadas</link> para obtener mayor información."
+"realidad es generado por la base de datos. Consulte la discusión de las "
+"<link linkend=\"mapping-generated\">propiedades generadas</link> para "
+"obtener mayor información."
#. Tag: title
+#: basic_mapping.xml:1675
#, no-c-format
msgid "Note"
msgstr "Nota"
#. Tag: para
+#: basic_mapping.xml:1677
#, no-c-format
msgid ""
"<literal><Timestamp></literal> is equivalent to <literal><version "
@@ -2067,20 +3623,836 @@
"literal>."
#. Tag: title
+#: basic_mapping.xml:1686
#, no-c-format
msgid "Property"
msgstr "Propiedad"
#. Tag: para
+#: basic_mapping.xml:1688
#, no-c-format
msgid ""
+"You need to decide which property needs to be made persistent in a given "
+"entity. This differs slightly between the annotation driven metadata and the "
+"hbm.xml files."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1693
+#, no-c-format
+msgid "Property mapping with annotations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1695
+#, no-c-format
+msgid ""
+"In the annotations world, every non static non transient property (field or "
+"method depending on the access type) of an entity 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."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1702
+#, no-c-format
+msgid ""
+"The <literal>@Basic</literal> annotation allows you to declare the fetching "
+"strategy for a property. If set to <literal>LAZY</literal>, specifies that "
+"this property should be fetched lazily when the instance variable is first "
+"accessed. It requires build-time bytecode instrumentation, if your classes "
+"are not instrumented, property level lazy loading is silently ignored. The "
+"default is <literal>EAGER</literal>. You can also mark a property as not "
+"optional thanks to the <classname>@Basic.optional</classname> attribute. "
+"This will ensure that the underlying column are not nullable (if possible). "
+"Note that a better approach is to use the <classname>@NotNull</classname> "
+"annotation of the Bean Validation specification."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1715
+#, no-c-format
+msgid "Let's look at a few examples:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+"@Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property \n"
+"\n"
+"@Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1719
+#, 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 Hibernate. <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). The recommended alternative is to "
+"use the projection capability of JP-QL (Java Persistence Query Language) or "
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1732
+#, no-c-format
+msgid ""
+"JPA support property mapping of all basic types supported by Hibernate (all "
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> "
+"annotation as shown in the <literal>note</literal> property example."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1742
+#, no-c-format
+msgid ""
+"In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
+#, 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 <classname>Serializable</classname> type "
+"will be persisted in a Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
+#, 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
+#: basic_mapping.xml:1768
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1770
+#, no-c-format
+msgid ""
+"You can also manually specify a type using the <literal>@org.hibernate."
+"annotations.Type</literal> and some parameters if needed. <classname>@Type."
+"type</classname> could be:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
+#, no-c-format
+msgid ""
+"The name of a Hibernate basic type: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgstr ""
+"El nombre de un tipo básico de Hibernate: <literal>integer, string, "
+"character, date, timestamp, float, binary, serializable, object, blob</"
+"literal>, etc."
+
+#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
+#, no-c-format
+msgid ""
+"The name of a Java class with a default basic type: <literal>int, float, "
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal> etc."
+msgstr ""
+"El nombre de una clase Java con un tipo básico predeterminado: <literal>int, "
+"float, char, java.lang.String, java.util.Date, java.lang.Integer, java.sql."
+"Clob</literal>, etc."
+
+#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
+#, no-c-format
+msgid "The name of a serializable Java class."
+msgstr "El nombre de una clase Java serializable."
+
+#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
+#, no-c-format
+msgid ""
+"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
+"literal> etc."
+msgstr ""
+"El nombre declase de un tipo personalizado: <literal>com.illflow.type."
+"MyCustomType</literal> etc."
+
+#. Tag: para
+#: basic_mapping.xml:1798
+#, fuzzy, no-c-format
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4."
+msgstr ""
+"Si no especifica un tipo, Hibernate utilizará reflección sobre la propiedad "
+"mencionada para deducir el tipo Hibernate correcto. Hibernate intentará "
+"interpretar el nombre de la clase de retorno del getter de la propiedad "
+"utilizando las reglas 2, 3 y 4 en ese mismo orden. En algunos casos "
+"necesitará el atributo <literal>type</literal>. Por ejemplo, para distinguir "
+"entre <literal>Hibernate.DATE</literal> y <literal>Hibernate.TIMESTAMP</"
+"literal>, o especificar un tipo personalizado."
+
+#. Tag: para
+#: basic_mapping.xml:1803
+#, no-c-format
+msgid ""
+"<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when "
+"defined at the class level). If the type is used on a single entity, you can "
+"place the definition on the entity itself. Otherwise, it is recommended to "
+"place the definition at the package level. In the example below, when "
+"Hibernate encounters a property of class <literal>PhoneNumer</literal>, it "
+"delegates the persistence strategy to the custom mapping type "
+"<literal>PhoneNumberType</literal>. However, properties belonging to other "
+"classes, too, can delegate their persistence strategy to "
+"<literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</"
+"literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1819
+#, 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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+"@TypeDef(\n"
+" name = \"phoneNumber\",\n"
+" defaultForType = PhoneNumber.class,\n"
+" typeClass = PhoneNumberType.class\n"
+")\n"
+"\n"
+"@Entity\n"
+"public class ContactDetails {\n"
+" [...]\n"
+" private PhoneNumber localPhoneNumber;\n"
+" @Type(type=\"phoneNumber\")\n"
+" private OverseasPhoneNumber overseasPhoneNumber;\n"
+" [...]\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1826
+#, no-c-format
+msgid ""
+"The following example shows the usage of the <literal>parameters</literal> "
+"attribute to customize the TypeDef."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
+#, 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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+"@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
+#: basic_mapping.xml:1840
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1842
+#, no-c-format
+msgid ""
+"By default the access type of a class hierarchy is defined by the position "
+"of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> "
+"annotations. If these annotations are on a field, then only fields are "
+"considered for persistence and the state is accessed via the field. If there "
+"annotations are on a getter, then only the getters are considered for "
+"persistence and the state is accessed via the getter/setter. That works well "
+"in practice and is the recommended approach."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1850
+#, no-c-format
+msgid ""
+"The placement of annotations within a class hierarchy has to be consistent "
+"(either field or on property) to be able to determine the default access "
+"type. It is recommended to stick to one single annotation placement strategy "
+"throughout your whole application."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1857
+#, no-c-format
+msgid "However in some situations, you need to:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1861
+#, no-c-format
+msgid "force the access type of the entity hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1865
+#, no-c-format
+msgid "override the access type of a specific entity in the class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1870
+#, no-c-format
+msgid "override the access type of an embeddable type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid ""
+"The best use case is an embeddable class used by several entities that might "
+"not use the same access type. In this case it is better to force the access "
+"type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid ""
+"To force the access type on a given class, use the <classname>@Access</"
+"classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" @Embedded private Address address;\n"
+" public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class User {\n"
+" private Long id;\n"
+" @Id public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" private Address address;\n"
+" @Embedded public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"@Access(AcessType.PROPERTY)\n"
+"public class Address {\n"
+" private String street1;\n"
+" public String getStreet1() { return street1; }\n"
+" public void setStreet1() { this.street1 = street1; }\n"
+"\n"
+" private hashCode; //not persistent\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid ""
+"You can also override the access type of a single property while keeping the "
+"other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+" @Transient private String userId;\n"
+" @Transient private String orderId;\n"
+"\n"
+" @Access(AccessType.PROPERTY)\n"
+" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid ""
+"In this example, the default access type is <classname>FIELD</classname> "
+"except for the <literal>orderNumber</literal> property. Note that the "
+"corresponding field, if any must be marked as <classname>@Transient</"
+"classname> or <code>transient</code>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1896
+#, no-c-format
+msgid "@org.hibernate.annotations.AccessType"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1898
+#, no-c-format
+msgid ""
+"The annotation <classname>@org.hibernate.annotations.AccessType</classname> "
+"should be considered deprecated for FIELD and PROPERTY access. It is still "
+"useful however if you need to use a custom access type."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1907
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1909
+#, 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
+#: basic_mapping.xml:1914
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "<literal>assigned</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "<literal>string</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "<literal>hilo</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, fuzzy, 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 propiedad del "
+"identificador. s"
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal> (opcional): Activa la generación DDL de una "
+"restricción de unicidad para las columnas. Además, permite que ésta sea el "
+"objetivo de una <literal>property-ref</literal>. "
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, fuzzy, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable (default "
+"true)."
+msgstr ""
+"<literal>name</literal> (opcional): El nombre de la propiedad del "
+"identificador. s"
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column will be "
+"part of the insert statement (default true)"
+msgstr ""
+"<literal>name</literal> (opcional): El nombre de la propiedad del "
+"identificador. s"
+
+#. Tag: para
+#: basic_mapping.xml:2008
+#, fuzzy, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will be "
+"part of the update statement (default true)"
+msgstr ""
+"<literal>catalog</literal> (opcional): El nombre de un catálogo de la base "
+"de datos. "
+
+#. Tag: para
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL "
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default "
+"primary table)"
+msgstr ""
+"<literal>catalog</literal> (opcional): El nombre de un catálogo de la base "
+"de datos. "
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional): column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional): column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional): column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>Serializable</"
+"classname>, it is mapped as <classname>@Basic</classname> in a column "
+"holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>java.sql.Clob</"
+"classname> or <classname>java.sql.Blob</classname>, it is mapped as "
+"<classname>@Lob</classname> with the appropriate <classname>LobType</"
+"classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, no-c-format
+msgid ""
"The <literal><property></literal> element declares a persistent "
"JavaBean style property of the class."
msgstr ""
"El elemento <literal><property></literal> declara una propiedad "
"persistente estilo JavaBean de la clase. "
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, no-c-format
+msgid ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2129
#, no-c-format
msgid ""
"<literal>name</literal>: the name of the property, with an initial lowercase "
@@ -2090,6 +4462,7 @@
"minúscula."
#. Tag: para
+#: basic_mapping.xml:2134
#, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -2102,6 +4475,7 @@
"<literal><column></literal>."
#. Tag: para
+#: basic_mapping.xml:2146
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2119,6 +4493,7 @@
"la misma columna (o columnas) o por un disparador u otra aplicación."
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2130,6 +4505,7 @@
"computadas no tienen una columna mapeada propia."
#. Tag: para
+#: basic_mapping.xml:2169
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
@@ -2142,6 +4518,7 @@
"instrumentación de código byte en tiempo de compilación."
#. Tag: para
+#: basic_mapping.xml:2176
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2153,6 +4530,7 @@
"objetivo de una <literal>property-ref</literal>. "
#. Tag: para
+#: basic_mapping.xml:2183
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2162,6 +4540,7 @@
"restricción de nulabilidad para las columnas. "
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2176,6 +4555,7 @@
"desactualizada."
#. Tag: para
+#: basic_mapping.xml:2196
#, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2189,48 +4569,15 @@
"generated\">propiedades generadas</link> para obtener mayor información. "
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr "<emphasis>escribanombre</emphasis> puede ser:"
#. Tag: para
+#: basic_mapping.xml:2230
#, no-c-format
msgid ""
-"The name of a Hibernate basic type: <literal>integer, string, character, "
-"date, timestamp, float, binary, serializable, object, blob</literal> etc."
-msgstr ""
-"El nombre de un tipo básico de Hibernate: <literal>integer, string, "
-"character, date, timestamp, float, binary, serializable, object, blob</"
-"literal>, etc."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The name of a Java class with a default basic type: <literal>int, float, "
-"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
-"literal> etc."
-msgstr ""
-"El nombre de una clase Java con un tipo básico predeterminado: <literal>int, "
-"float, char, java.lang.String, java.util.Date, java.lang.Integer, java.sql."
-"Clob</literal>, etc."
-
-#. Tag: para
-#, no-c-format
-msgid "The name of a serializable Java class."
-msgstr "El nombre de una clase Java serializable."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
-"literal> etc."
-msgstr ""
-"El nombre declase de un tipo personalizado: <literal>com.illflow.type."
-"MyCustomType</literal> etc."
-
-#. Tag: para
-#, no-c-format
-msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
@@ -2248,6 +4595,7 @@
"literal>, o especificar un tipo personalizado."
#. Tag: para
+#: basic_mapping.xml:2239
#, no-c-format
msgid ""
"The <literal>access</literal> attribute allows you to control how Hibernate "
@@ -2268,6 +4616,7 @@
"literal>."
#. Tag: para
+#: basic_mapping.xml:2248
#, no-c-format
msgid ""
"A powerful feature is derived properties. These properties are by definition "
@@ -2281,7 +4630,20 @@
"una expresión SQL y ésta se traduce como una cláusula de subconsulta "
"<literal>SELECT</literal> en la consulta SQL que carga una instancia:"
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, no-c-format
+msgid ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2256
#, no-c-format
msgid ""
"You can reference the entity table by not declaring an alias on a particular "
@@ -2295,31 +4657,1816 @@
"</literal> si no quiere utilizar el atributo."
#. Tag: title
+#: basic_mapping.xml:2265
#, no-c-format
-msgid "Many-to-one"
-msgstr "Many-to-one"
+msgid "Embedded objects (aka components)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2267
+#, fuzzy, no-c-format
+msgid ""
+"Embeddable objects (or components) are objects whose properties are mapped "
+"to the same table as the owning entity's table. Components can, in turn, "
+"declare their own properties, components or collections"
+msgstr ""
+"El elemento <literal><component></literal> mapea propiedades de un "
+"objeto hijo a columnas de la tabla de la clase padre. Los componentes "
+"pueden, a su vez, declarar sus propias propiedades, componentes o "
+"colecciones. Vea a continuación los \"componentes\":"
+
+#. Tag: para
+#: basic_mapping.xml:2272
#, no-c-format
msgid ""
-"An ordinary association to another persistent class is declared using a "
-"<literal>many-to-one</literal> element. The relational model is a many-to-"
-"one association; a foreign key in one table is referencing the primary key "
-"column(s) of the target table."
+"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 ""
-"Una asociación ordinaria a otra clase persistente se declara utilizando el "
-"elemento <literal>many-to-one</literal>. El modelo relacional es una "
-"asociación muchos-a-uno; una clave foránea en una tabla referencia la "
-"columna (o columnas) de la clave principal de la tabla destino."
+#. Tag: programlisting
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
#, no-c-format
+msgid ""
+"An embeddable object inherits the access type of its owning entity (note "
+"that you can override that using the <literal>@Access</literal> annotation)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2290
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded "
+"objects of embedded objects is through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2305
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column = @Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
+"(name=\"nat_Iso2\") ),\n"
+" @AttributeOverride(name=\"nationality.name\", column = @Column"
+"(name=\"nat_CountryName\") )\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2307
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports something that is not explicitly supported by "
+"the JPA 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
+#: basic_mapping.xml:2313
+#, no-c-format
+msgid ""
+"You can also use association annotations in an embeddable object (ie "
+"<literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, "
+"<classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To "
+"override the association columns you can use <literal>@AssociationOverride</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2319
+#, 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 as several embedded objects "
+"would share the same set of columns. In plain JPA, you need to override at "
+"least one set of columns. Hibernate, however, allows you to enhance the "
+"default naming mechanism through the <classname>NamingStrategy</classname> "
+"interface. You can write a strategy that prevent name clashing in such a "
+"situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an "
+"example of this."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2329
+#, no-c-format
+msgid ""
+"If a property of the embedded object points back to the owning entity, "
+"annotate it with the <classname>@Parent</classname> annotation. Hibernate "
+"will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
+#, no-c-format
+msgid ""
+"<component\n"
+" name=\"propertyName\"\n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
+#, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr "<literal>name</literal>: El nombre de la propiedad. "
#. Tag: para
+#: basic_mapping.xml:2364
#, no-c-format
msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the component (child) class."
+msgstr ""
+"<literal>class</literal> (opcional - por defecto es el tipo de la propiedad "
+"determinado por reflección): El nombre de la clase del componente (hijo). "
+
+#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
+#, no-c-format
+msgid ""
+"<literal>insert</literal>: do the mapped columns appear in SQL "
+"<literal>INSERTs</literal>?"
+msgstr ""
+"<literal>insert</literal>: ¿Las columnas mapeadas aparacen en "
+"<literal>INSERTs</literal> SQL? "
+
+#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
+#, no-c-format
+msgid ""
+"<literal>update</literal>: do the mapped columns appear in SQL "
+"<literal>UPDATEs</literal>?"
+msgstr ""
+"<literal>update</literal>: ¿Las columnas mapeadas aparacen en "
+"<literal>UPDATEs</literal> SQL?"
+
+#. Tag: para
+#: basic_mapping.xml:2386
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this component should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal> (opcional - por defecto es <literal>false</"
+"literal>): Especifica que este componente debe ser recuperado perezosamente "
+"cuando se acceda a la variable de instancia por primera vez. Requiere "
+"instrumentación de código byte en tiempo de compilación."
+
+#. Tag: para
+#: basic_mapping.xml:2393
+#, no-c-format
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this component either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal> (opcional - por defecto es <literal>true</"
+"literal>): Especifica que las actualizaciones de este componente requieren o "
+"no la adquisición de un bloqueo optimista. Determina si debe ocurrir un "
+"incremento de versión cuando esta propiedad se encuentra desactualizada."
+
+#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that a unique constraint exists upon all mapped columns of the "
+"component."
+msgstr ""
+"<literal>unique</literal> (opcional - por defecto es <literal>false</"
+"literal>): Especifica que existe una restricción de unicidad sobre todas las "
+"columnas mapeadas del componente."
+
+#. Tag: para
+#: basic_mapping.xml:2408
+#, no-c-format
+msgid ""
+"The child <literal><property></literal> tags map properties of the "
+"child class to table columns."
+msgstr ""
+"Las etiquetas hijas <literal><property></literal> mapean propiedades "
+"de la clase hija a las columnas de la tabla."
+
+#. Tag: para
+#: basic_mapping.xml:2411
+#, no-c-format
+msgid ""
+"The <literal><component></literal> element allows a <literal><"
+"parent></literal> subelement that maps a property of the component class "
+"as a reference back to the containing entity."
+msgstr ""
+"El elemento <literal><component></literal> permite un subelemento "
+"<literal><parent></literal> que mapea una propiedad de la clase del "
+"componente como una referencia a la entidad contenedora."
+
+#. Tag: para
+#: basic_mapping.xml:2415
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><dynamic-component></literal> element allows a "
+"<literal>Map</literal> to be mapped as a component, where the property names "
+"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
+"more information. This feature is not supported in annotations."
+msgstr ""
+"El elemento <literal><dynamic-component></literal> permite que un "
+"<literal>Map</literal> sea mapeado como un componente, en donde los nombres "
+"de las propiedades se refieran a las claves del mapeo. Consulte <xref "
+"linkend=\"components-dynamic\" /> para obtener mayor información. "
+
+#. Tag: title
+#: basic_mapping.xml:2423
+#, no-c-format
+msgid "Inheritance strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2425
+#, no-c-format
+msgid ""
+"Java is a language supporting polymorphism: a class can inherit from "
+"another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2431
+#, no-c-format
+msgid ""
+"Single table per class hierarchy strategy: a single table hosts all the "
+"instances of a class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2436
+#, no-c-format
+msgid ""
+"Joined subclass strategy: one table per class and subclass is present and "
+"each table persist the properties specific to a given subclass. The state of "
+"the entity is then stored in its corresponding class table and all its "
+"superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2443
+#, no-c-format
+msgid ""
+"Table per class strategy: one table per concrete class and subclass is "
+"present and each table persist the properties of the class and its "
+"superclasses. The state of the entity is then stored entirely in the "
+"dedicated table for its class."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2453
+#, no-c-format
+msgid ""
+"With this approach the properties of all the subclasses in a given mapped "
+"class hierarchy are stored in a single table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2456
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass declares its own persistent properties and subclasses. Version "
+"and id properties are assumed to be inherited from the root class. Each "
+"subclass in a hierarchy must define a unique discriminator value. If this is "
+"not specified, the fully qualified Java class name is used."
+msgstr ""
+"Cada subclase debe declarar sus propias propiedades persistentes y "
+"subclases. Se asume que las propiedades <literal><version></literal> y "
+"<literal><id></literal> son heredadas de la clase raíz. Cada subclase "
+"en una jerarquía tiene que definir un <literal>discriminator-value</literal> "
+"único. Si no se especifica ninguno entonces se utiliza el nombre "
+"completamente calificado de clase Java."
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: basic_mapping.xml:2464
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
+"<literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+"La persistencia polimórfica requiere la declaración de cada subclase de la "
+"clase persistente raíz. Para la estrategia de mapeo tabla-por-jerarquía-de-"
+"clases, se utiliza la declaración <literal><subclass></literal>. Por "
+"ejemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, no-c-format
+msgid ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
+#, no-c-format
+msgid ""
+"<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr ""
+"<literal>name</literal>: El nombre de clase completamente calificado de la "
+"subclase. "
+
+#. Tag: para
+#: basic_mapping.xml:2488
+#, no-c-format
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses."
+msgstr ""
+"<literal>discriminator-value</literal> (opcional - por defecto es el nombre "
+"de la clase): Un valor que distingue subclases individuales. "
+
+#. Tag: para
+#: basic_mapping.xml:2494
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface used for "
+"lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (opcional): Especifica una clase o interfaz que se "
+"utiliza para proxies de inicialización perezosa."
+
+#. Tag: para
+#: basic_mapping.xml:2499
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (opcional, por defecto es <literal>true</literal>): "
+"El establecer <literal>lazy=\"false\"</literal> desactiva el uso de la "
+"recuperación perezosa. "
+
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, fuzzy, no-c-format
+msgid ""
+"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
+">."
+msgstr ""
+"Para obtener información acerca de los mapeos de herencias consulte <xref "
+"linkend=\"inheritance\" />."
+
+#. Tag: title
+#: basic_mapping.xml:2511
+#, no-c-format
+msgid "Discriminator"
+msgstr "Discriminador"
+
+#. Tag: para
+#: basic_mapping.xml:2513
+#, fuzzy, no-c-format
+msgid ""
+"Discriminators are required for polymorphic persistence using the table-per-"
+"class-hierarchy mapping strategy. It declares a discriminator column of the "
+"table. The discriminator column contains marker values that tell the "
+"persistence layer what subclass to instantiate for a particular row. A "
+"restricted set of types can be used: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+"Se necesita el elemento <literal><discriminator></literal> para la "
+"persistencia polimórfica utilizando la estrategia de mapeo de tabla-por-"
+"jerarquía-de-clases. Declara una columna discriminadora de la tabla. La "
+"columna discriminidora contiene valores de marca que le dicen a la capa de "
+"persistencia qué subclase instanciar para una fila en particular. Se puede "
+"utilizar un conjunto restringido de tipos: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2523
+#, no-c-format
+msgid ""
+"Use the <classname>@DiscriminatorColumn</classname> to define the "
+"discriminator column as well as the discriminator type. Alternatively, you "
+"can also use <classname>@DiscriminatorFormula</classname> to express in SQL "
+"what would be in a virtual discriminator column. This is particularly handy "
+"when the discriminator value can be extracted from one or more columns of "
+"the table. Both <classname>@DiscriminatorColumn</classname> and "
+"<classname>@DiscriminatorFormula</classname> are to be set on the root "
+"entity (once per persisted hierarchy)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2534
+#, no-c-format
+msgid ""
+"Finally, use <classname>@DiscriminatorValue</classname> on each class of the "
+"hierarchy to specify the value stored in the discriminator column for a "
+"given entity. If you do not set <classname>@DiscriminatorValue</classname> "
+"on a class, the fully qualified class name is used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2542
+#, no-c-format
+msgid ""
+"In hbm.xml, the <literal><discriminator></literal> element is used to "
+"define the discriminator column or formula:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, no-c-format
+msgid ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2563
+#, no-c-format
+msgid ""
+"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
+"the name of the discriminator column."
+msgstr ""
+"<literal>column</literal> (opcional - por defecto es <literal>class</"
+"literal>) el nombre de la columna discriminadora. "
+
+#. Tag: para
+#: basic_mapping.xml:2569
+#, no-c-format
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
+"a name that indicates the Hibernate type"
+msgstr ""
+"<literal>type</literal> (opcional - por defecto es <literal>string</"
+"literal>) un nombre que indica el tipo Hibernate. "
+
+#. Tag: para
+#: basic_mapping.xml:2575
+#, no-c-format
+msgid ""
+"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
+"\"forces\" Hibernate to specify the allowed discriminator values, even when "
+"retrieving all instances of the root class."
+msgstr ""
+"<literal>force</literal> (opcional - por defecto es <literal>false</"
+"literal>) \"fuerza\" a Hibernate para especificar los valores "
+"discriminadores permitidos incluso cuando se recuperan todas las instancias "
+"de la clase raíz. "
+
+#. Tag: para
+#: basic_mapping.xml:2582
+#, no-c-format
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"set this to <literal>false</literal> if your discriminator column is also "
+"part of a mapped composite identifier. It tells Hibernate not to include the "
+"column in SQL <literal>INSERTs</literal>."
+msgstr ""
+"<literal>insert</literal> (opcional - por defecto es <literal>true</"
+"literal>): establecido como <literal>false</literal> si su columna "
+"discriminadora también es parte de un identificador mapeado compuesto. Lle "
+"dice a Hibernate que no incluya la columna en los SQLs <literal>INSERT</"
+"literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2590
+#, no-c-format
+msgid ""
+"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
+"executed when a type has to be evaluated. It allows content-based "
+"discrimination."
+msgstr ""
+"<literal>formula</literal> (opcional): una expresión SQL arbitraria que se "
+"ejecuta cuando se tenga que evaluar un tipo. Permite la discriminación con "
+"base en el contenido."
+
+#. Tag: para
+#: basic_mapping.xml:2597
+#, no-c-format
+msgid ""
+"Actual values of the discriminator column are specified by the "
+"<literal>discriminator-value</literal> attribute of the <literal><"
+"class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+"Los valores reales de la columna discriminadora están especificados por el "
+"atributo <literal>discriminator-value</literal> de los elementos "
+"<literal><class></literal> y <literal><subclass></literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2602
+#, no-c-format
+msgid ""
+"The <literal>force</literal> attribute is only useful if the table contains "
+"rows with \"extra\" discriminator values that are not mapped to a persistent "
+"class. This will not usually be the case."
+msgstr ""
+"El atributo <literal>force</literal> es sólamente útil si la tabla contiene "
+"filas con valores discriminadores \"extra\" que no estén mapeados a una "
+"clase persistente. Generalmente este no es el caso."
+
+#. Tag: para
+#: basic_mapping.xml:2607
+#, no-c-format
+msgid ""
+"The <literal>formula</literal> attribute allows you to declare an arbitrary "
+"SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+"El atributo <literal>formula</literal> le permite declarar una expresión SQL "
+"arbitraria que será utilizada para evaluar el tipo de una fila. Por ejemplo: "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, no-c-format
+msgid ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, fuzzy, no-c-format
+msgid "Joined subclass strategy"
+msgstr "joined-subclass "
+
+#. Tag: para
+#: basic_mapping.xml:2618
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass can also be mapped to its own table. This is called the table-"
+"per-subclass mapping strategy. An inherited state is retrieved by joining "
+"with the table of the superclass. A discriminator column is not required for "
+"this mapping strategy. Each subclass must, however, declare a table column "
+"holding the object identifier. The primary key of this table is also a "
+"foreign key to the superclass table and described by the "
+"<classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></"
+"literal> element."
+msgstr ""
+"Se puede mapear cada subclase a su propia tabla. Esto se llama una "
+"estrategia de mapeo tabla-por-subclase. El estado heredado se recupera "
+"uniendo con la tabla de la superclase. Para hacer esto utilice elemento "
+"<literal><joined-subclass></literal>. Por ejemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
+#, no-c-format
+msgid ""
+"@Entity @Table(name=\"CATS\")\n"
+"@Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Cat implements Serializable { \n"
+" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+" String getId() { return id; }\n"
+"\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+"public class DomesticCat extends Cat { \n"
+" public String getName() { return name; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2631
+#, no-c-format
+msgid ""
+"The table name still defaults to the non qualified class name. Also if "
+"<classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / "
+"foreign key columns are assumed to have the same names as the primary key "
+"columns of the primary table of the superclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2638
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><joined-subclass></literal> element. For "
+"example:"
+msgstr ""
+"Puede declarar una clase persistente utilizando el elemento <literal>class</"
+"literal>. Por ejemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, no-c-format
+msgid ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
+#, no-c-format
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr "<literal>table</literal>: El nombre de tabla de la subclase. "
+
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface to use "
+"for lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (opcional): Especifica una clase o interfaz que se "
+"debe utilizar para proxies de inicialización perezosa. "
+
+#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (opcional, por defecto es <literal>true</literal>): "
+"El establecer <literal>lazy=\"false\"</literal> desactiva el uso de la "
+"recuperación perezosa. "
+
+#. Tag: para
+#: basic_mapping.xml:2679
+#, no-c-format
+msgid ""
+"Use the <literal><key></literal> element to declare the primary key / "
+"foreign key column. The mapping at the start of the chapter would then be re-"
+"written as:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2692
+#, fuzzy, no-c-format
+msgid ""
+"A third option is to map only the concrete classes of an inheritance "
+"hierarchy to tables. This is called the table-per-concrete-class strategy. "
+"Each table defines all persistent states of the class, including the "
+"inherited state. In Hibernate, it is not necessary to explicitly map such "
+"inheritance hierarchies. You can map each class as a separate entity root. "
+"However, if you wish use polymorphic associations (e.g. an association to "
+"the superclass of your hierarchy), you need to use the union subclass "
+"mapping."
+msgstr ""
+"Una tercera opción es mapear sólo las clases concretas de una jerarquía de "
+"herencia a tablas. Esta se llama la estrategia clase concreta por tabla). "
+"Cada tabla define todos los estados persistentes de la clase, incluyendo el "
+"estado heredado. En Hibernate, no es necesario mapear dichas jerarquías de "
+"herencia. Puede mapear cada clase con una declaración <literal><class>"
+"</literal> separada. Sin embargo, si desea utilizar asociaciones "
+"polimórficas (por ejemplo, una asociación a la superclase de su jerarquía), "
+"necesita utilizar el mapeo <literal><union-subclass></literal>. Por "
+"ejemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2703
+#, no-c-format
+msgid "Or in hbm.xml:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, no-c-format
+msgid ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid ""
+"No discriminator column or key column is required for this mapping strategy."
+msgstr ""
+"No se necesita una columna o una columna clave discriminadora para esta "
+"estrategia de mapeo."
+
+#. Tag: title
+#: basic_mapping.xml:2751
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2753
+#, 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>@MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
+#, 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
+#: basic_mapping.xml:2768
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as <literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2773
+#, no-c-format
+msgid ""
+"The default access type (field or methods) is used, unless you use the "
+"<literal>@Access</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2778
+#, 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
+#: basic_mapping.xml:2786
+#, 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
+#: basic_mapping.xml:2792
+#, 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
+#: basic_mapping.xml:2797
+#, 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
+#: basic_mapping.xml:2801
+#, 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( \n"
+" name=\"propulsion\", \n"
+" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+")\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2803
+#, 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
+#: basic_mapping.xml:2809
+#, 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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid ""
+"In hbm.xml, simply map the properties of the superclass in the <literal><"
+"class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2821
+#, no-c-format
+msgid "Mapping one entity to several tables"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2823
+#, no-c-format
+msgid ""
+"While not recommended for a fresh schema, some legacy databases force your "
+"to map a single entity on several tables."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2826
+#, no-c-format
+msgid ""
+"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>@JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2834
+#, 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
+#: basic_mapping.xml:2844
+#, no-c-format
+msgid ""
+"There is also additional tuning accessible via the <classname>@org.hibernate."
+"annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, fuzzy, 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 <classname>SELECT</classname> 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> (opcional - por defecto es <literal>join</"
+"literal>): Si se establece como <literal>join</literal>, por defecto, "
+"Hibernate utilizará una unión interior (inner join) para recuperar un "
+"<literal><join></literal> definido por una clase o sus superclases. "
+"Utilizará una unión externa (outer join) para un <literal><join></"
+"literal> definido por una subclase. Si se establece como <literal>select</"
+"literal>, entonces Hibernate utilizará una selección secuencial para un "
+"<literal><join></literal> definido en una subclase. Esto se publicará "
+"sólamente si una fila representa una instancia de la subclase. Las uniones "
+"interiores todavía serán utilizadas para recuperar un <literal><join></"
+"literal> definido por la clase y sus superclases."
+
+#. Tag: para
+#: basic_mapping.xml:2862
+#, fuzzy, 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> (opcional - por defecto es <literal>false</"
+"literal>): De activarse, Hibernate no tratará de insertar o actualizar las "
+"propiedades definidas por esta unión. "
+
+#. Tag: para
+#: basic_mapping.xml:2868
+#, fuzzy, 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> (opcional - por defecto es <literal>false</"
+"literal>): De activarse, Hibernate insertará una fila sólo si las "
+"propiedades definidas por esta unión son no-nulas. Siempre utilizará una "
+"unión externa para recuperar las propiedades."
+
+#. Tag: para
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid ""
+"Make sure to use the secondary table name in the <methodname>appliesto</"
+"methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTable(name=\"Cat1\")\n"
+"@org.hibernate.annotations.Table(\n"
+" appliesTo=\"Cat1\",\n"
+" fetch=FetchMode.SELECT,\n"
+" optional=true)\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
+msgstr ""
+"Por ejemplo, si tenemos el siguiente mapeo de <literal><properties></"
+"literal>:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, no-c-format
+msgid ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+"\n"
+" <key ... />\n"
+"\n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2907
+#, no-c-format
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr "<literal>table</literal>: El nombre de la tabla unida. "
+
+#. Tag: para
+#: basic_mapping.xml:2924
+#, no-c-format
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
+"if set to <literal>join</literal>, the default, Hibernate will use an inner "
+"join to retrieve a <literal><join></literal> defined by a class or its "
+"superclasses. It will use an outer join for a <literal><join></"
+"literal> defined by a subclass. If set to <literal>select</literal> then "
+"Hibernate will use a sequential select for a <literal><join></literal> "
+"defined on a subclass. This will be issued only if a row represents an "
+"instance of the subclass. Inner joins will still be used to retrieve a "
+"<literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+"<literal>fetch</literal> (opcional - por defecto es <literal>join</"
+"literal>): Si se establece como <literal>join</literal>, por defecto, "
+"Hibernate utilizará una unión interior (inner join) para recuperar un "
+"<literal><join></literal> definido por una clase o sus superclases. "
+"Utilizará una unión externa (outer join) para un <literal><join></"
+"literal> definido por una subclase. Si se establece como <literal>select</"
+"literal>, entonces Hibernate utilizará una selección secuencial para un "
+"<literal><join></literal> definido en una subclase. Esto se publicará "
+"sólamente si una fila representa una instancia de la subclase. Las uniones "
+"interiores todavía serán utilizadas para recuperar un <literal><join></"
+"literal> definido por la clase y sus superclases."
+
+#. Tag: para
+#: basic_mapping.xml:2939
+#, no-c-format
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will not insert or update the properties "
+"defined by this join."
+msgstr ""
+"<literal>inverse</literal> (opcional - por defecto es <literal>false</"
+"literal>): De activarse, Hibernate no tratará de insertar o actualizar las "
+"propiedades definidas por esta unión. "
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, no-c-format
+msgid ""
+"<literal>optional</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will insert a row only if the properties "
+"defined by this join are non-null. It will always use an outer join to "
+"retrieve the properties."
+msgstr ""
+"<literal>optional</literal> (opcional - por defecto es <literal>false</"
+"literal>): De activarse, Hibernate insertará una fila sólo si las "
+"propiedades definidas por esta unión son no-nulas. Siempre utilizará una "
+"unión externa para recuperar las propiedades."
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, no-c-format
+msgid ""
+"For example, address information for a person can be mapped to a separate "
+"table while preserving value type semantics for all properties:"
+msgstr ""
+"Por ejemplo, la información domiciliaria de una persona se puede mapear a "
+"una tabla separada, preservando a la vez la semántica de tipo de valor para "
+"todas las propiedades:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, no-c-format
+msgid ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, no-c-format
+msgid ""
+"This feature is often only useful for legacy data models. We recommend fewer "
+"tables than classes and a fine-grained domain model. However, it is useful "
+"for switching between inheritance mapping strategies in a single hierarchy, "
+"as explained later."
+msgstr ""
+"Con frecuencia, esta funcionalidad sólamente es útil para los modelos de "
+"datos heredados. Recomendamos menos tablas que clases y un modelo de dominio "
+"más detallado. Sin embargo, es útil para cambiar entre estrategias de mapeo "
+"de herencias en una misma jerarquía, como se explica más adelante."
+
+#. Tag: title
+#: basic_mapping.xml:2967
+#, no-c-format
+msgid "Mapping one to one and one to many associations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2969
+#, no-c-format
+msgid ""
+"To link one entity to an other, you need to map the association property as "
+"a to one association. In the relational model, you can either use a foreign "
+"key or an association table, or (a bit less common) share the same primary "
+"key value between the two entities."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2974
+#, no-c-format
+msgid ""
+"To mark an association, use either <classname>@ManyToOne</classname> or "
+"<classname>@OnetoOne</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2978
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
+#, no-c-format
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than nothing will propagate certain operations to the "
+"associated object. The meaningful values are divided into three categories."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2992
+#, no-c-format
+msgid ""
+"basic operations, which include: <literal>persist, merge, delete, save-"
+"update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2998
+#, fuzzy, no-c-format
+msgid ""
+"special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+"Las asociaciones ahora se especifican utilizando <literal>entity-name</"
+"literal> en lugar de <literal>class</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:3003
+#, no-c-format
+msgid ""
+"comma-separated combinations of operation names: <literal>cascade=\"persist,"
+"merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. "
+"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
+"that single valued many-to-one associations do not support orphan delete."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3012
+#, no-c-format
+msgid ""
+"By default, single point associations are eagerly fetched in JPA 2. You can "
+"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
+"LAZY) </classname>in which case Hibernate will proxy the association and "
+"load it when the state of the associated entity is reached. You can force "
+"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</"
+"classname>. In this case, the property is fetched lazily when the instance "
+"variable is first accessed. This requires build-time bytecode "
+"instrumentation. lazy=\"false\" specifies that the association will always "
+"be eagerly fetched."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid ""
+"With the default JPA options, single-ended associations are loaded with a "
+"subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used "
+"for <literal>EAGER</literal> associations. You can however adjust the "
+"fetching strategy, ie how data is fetched by using <literal>@Fetch</"
+"literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a "
+"select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, fuzzy, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr "asociaciones de clave foránea única"
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, fuzzy, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+"Una asociación uno-a-uno (one-to-one) a otra clase persistente se declara "
+"utilizando un elemento <literal>one-to-one</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:3041
+#, no-c-format
+msgid ""
+"<classname>@ManyToOne</classname> if several entities can point to the the "
+"target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3046
+#, no-c-format
+msgid ""
+"<classname>@OneToOne</classname> if only a single entity can point to the "
+"the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3051
+#, no-c-format
+msgid ""
+"and a foreign key in one table is referencing the primary key column(s) of "
+"the target table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3056
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default value"
+"(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"targetEntity=CompanyImpl.class )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3066
+#, no-c-format
+msgid ""
+"You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing "
+"the target entity table (through <literal>@JoinTable.inverseJoinColumns</"
+"literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3077
+#, no-c-format
+msgid ""
+"You can use a SQL fragment to simulate a physical join column using the "
+"<classname>@JoinColumnOrFormula</classname> / "
+"<classname>@JoinColumnOrformulas</classname> annotations (just like you can "
+"use a SQL fragment to simulate a property column via the "
+"<classname>@Formula</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" @ManyToOne\n"
+" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+" public Person getOwner() {\n"
+" return person;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid ""
+"You can mark an association as mandatory by using the "
+"<literal>optional=false</literal> attribute. We recommend to use Bean "
+"Validation's <classname>@NotNull</classname> annotation as a better "
+"alternative however. As a consequence, the foreign key column(s) will be "
+"marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid ""
+"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. 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."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3100
+#, no-c-format
+msgid "@NotFound annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when "
+"a given entity is deleted. In this case Hibernate generates a cascade delete "
+"constraint at the database level."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name using "
+"<literal>@ForeignKey</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3120
+#, fuzzy, no-c-format
+msgid "@ForeignKey annotation"
+msgstr "asociaciones de clave foránea única"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @ForeignKey(name=\"FK_PARENT\")\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3125
+#, no-c-format
+msgid ""
+"Sometimes, you want to link one entity to an other not by the target entity "
+"primary key but by a different unique key. You can achieve that by "
+"referencing the unique key column(s) in <methodname>@JoinColumn."
+"referenceColumnName</methodname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Person {\n"
+" @Id Integer personNumber;\n"
+" String firstName;\n"
+" @Column(name=\"I\")\n"
+" String initial;\n"
+" String lastName;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Home {\n"
+" @ManyToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+" })\n"
+" Person owner\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3132
+#, no-c-format
+msgid ""
+"This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3135
+#, no-c-format
+msgid ""
+"In hbm.xml, mapping an association is similar. The main difference is that a "
+"<classname>@OneToOne</classname> is mapped as <literal><many-to-one "
+"unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, no-c-format
+msgid ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional): the name of the foreign key column. "
"This can also be specified by nested <literal><column></literal> "
"element(s)."
@@ -2329,6 +6476,7 @@
"elementos anidados <literal><column></literal>. "
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, no-c-format
msgid ""
"<literal>class</literal> (optional - defaults to the property type "
@@ -2338,6 +6486,7 @@
"determinado por reflección): El nombre de la clase asociada. "
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional): specifies which operations should be "
@@ -2347,6 +6496,7 @@
"cascada desde el objeto padre hasta el objeto asociado. "
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional - defaults to <literal>select</literal>): "
@@ -2357,6 +6507,7 @@
"recuperación por selección secuencial."
#. Tag: para
+#: basic_mapping.xml:3209
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2375,6 +6526,7 @@
"otra aplicación."
#. Tag: para
+#: basic_mapping.xml:3219
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2386,6 +6538,7 @@
"especifica, se utiliza la llave principal de la clase asociada."
#. Tag: para
+#: basic_mapping.xml:3232
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2399,6 +6552,7 @@
"que la asociación sea de multiplicidad uno-a-uno."
#. Tag: para
+#: basic_mapping.xml:3240
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2408,6 +6562,7 @@
"restricción de nulabilidad para las columnas de clave foránea. "
#. Tag: para
+#: basic_mapping.xml:3254
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2426,6 +6581,7 @@
"siempre será recuperada tempranamente."
#. Tag: para
+#: basic_mapping.xml:3264
#, no-c-format
msgid ""
"<literal>not-found</literal> (optional - defaults to <literal>exception</"
@@ -2439,6 +6595,7 @@
"perdida como una asociación nula."
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, no-c-format
msgid ""
"<literal>entity-name</literal> (optional): the entity name of the associated "
@@ -2448,6 +6605,7 @@
"asociada. "
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2457,7 +6615,8 @@
"para una clave foránea <emphasis>computada</emphasis>."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3284
+#, fuzzy, no-c-format
msgid ""
"Setting a value of the <literal>cascade</literal> attribute to any "
"meaningful value other than <literal>none</literal> will propagate certain "
@@ -2467,7 +6626,7 @@
"second, special values: <literal>delete-orphan</literal>; and third,"
"<literal>all</literal> comma-separated combinations of operation names: "
"<literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,"
-"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> "
+"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> "
"for a full explanation. Note that single valued, many-to-one and one-to-one, "
"associations do not support orphan delete."
msgstr ""
@@ -2485,11 +6644,22 @@
"muchos-a-uno y uno-a-uno no soportan el borrado de huérfanos."
#. Tag: para
+#: basic_mapping.xml:3298
#, no-c-format
-msgid "Here is an example of a typical <literal>many-to-one</literal> declaration:"
-msgstr "Este es un ejemplo de una declaración típica <literal>muchos-a-uno</literal>:"
+msgid ""
+"Here is an example of a typical <literal>many-to-one</literal> declaration:"
+msgstr ""
+"Este es un ejemplo de una declaración típica <literal>muchos-a-uno</literal>:"
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, no-c-format
+msgid ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3303
#, no-c-format
msgid ""
"The <literal>property-ref</literal> attribute should only be used for "
@@ -2508,17 +6678,36 @@
"principal, el atributo <literal>unique</literal> controla la generación de "
"DDL de Hibernate con la herramienta SchemaExport."
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, no-c-format
+msgid ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3313
#, no-c-format
msgid "Then the mapping for <literal>OrderItem</literal> might use:"
msgstr "Entonces el mapeo para <literal>OrderItem</literal> puede utilizar:"
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, no-c-format
+msgid ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3318
#, no-c-format
msgid "This is not encouraged, however."
msgstr "Sin embargo, esto ciertamente no se aconseja. "
#. Tag: para
+#: basic_mapping.xml:3320
#, no-c-format
msgid ""
"If the referenced unique key comprises multiple properties of the associated "
@@ -2530,6 +6719,7 @@
"<literal><properties></literal>."
#. Tag: para
+#: basic_mapping.xml:3324
#, no-c-format
msgid ""
"If the referenced unique key is the property of a component, you can specify "
@@ -2538,23 +6728,100 @@
"Si la clave única referenciada es propiedad de un componente, usted puede "
"especificar una ruta de propiedad: "
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, no-c-format
+msgid ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3331
#, no-c-format
-msgid "One-to-one"
-msgstr "One-to-one"
+msgid "Sharing the primary key with the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3333
#, no-c-format
msgid ""
-"A one-to-one association to another persistent class is declared using a "
-"<literal>one-to-one</literal> element."
+"The second approach is to ensure an entity and its associated entity share "
+"the same primary key. In this case the primary key column is also a foreign "
+"key and there is no extra column. These associations are always one to one."
msgstr ""
-"Una asociación uno-a-uno (one-to-one) a otra clase persistente se declara "
-"utilizando un elemento <literal>one-to-one</literal>."
+#. Tag: title
+#: basic_mapping.xml:3339
+#, fuzzy, no-c-format
+msgid "One to One association"
+msgstr "asociaciones de clave foránea única"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @MapsId\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"} \n"
+"\n"
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
msgid ""
+"Many people got confused by these primary key based one to one associations. "
+"They can only be lazily loaded if Hibernate knows that the other side of the "
+"association is always present. To indicate to Hibernate that it is the case, "
+"use <classname>@OneToOne(optional=false)</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3352
+#, no-c-format
+msgid "In hbm.xml, use the following mapping."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3377
+#, no-c-format
+msgid ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3397
+#, no-c-format
+msgid ""
"<literal>constrained</literal> (optional): specifies that a foreign key "
"constraint on the primary key of the mapped table and references the table "
"of the associated class. This option affects the order in which <literal>save"
@@ -2570,6 +6837,7 @@
"de esquemas también lo utiliza."
#. Tag: para
+#: basic_mapping.xml:3413
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2581,6 +6849,7 @@
"especifica, se utiliza la clave principal de la clase asociada."
#. Tag: para
+#: basic_mapping.xml:3426
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): almost all one-to-one associations "
@@ -2596,6 +6865,7 @@
"hibernate.test.onetooneformula</literal>."
#. Tag: para
+#: basic_mapping.xml:3435
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2618,22 +6888,8 @@
"imposible e Hibernate recuperará tempranamente la asociación</emphasis>."
#. Tag: para
+#: basic_mapping.xml:3454
#, no-c-format
-msgid "There are two varieties of one-to-one associations:"
-msgstr "Existen dos variedades de asociaciones uno-a-uno: "
-
-#. Tag: para
-#, no-c-format
-msgid "primary key associations"
-msgstr "asociaciones de clave primaria"
-
-#. Tag: para
-#, no-c-format
-msgid "unique foreign key associations"
-msgstr "asociaciones de clave foránea única"
-
-#. Tag: para
-#, no-c-format
msgid ""
"Primary key associations do not need an extra table column. If two rows are "
"related by the association, then the two table rows share the same primary "
@@ -2647,6 +6903,7 @@
"de que se les asigne el mismo valor de identificador."
#. Tag: para
+#: basic_mapping.xml:3460
#, no-c-format
msgid ""
"For a primary key association, add the following mappings to "
@@ -2655,7 +6912,21 @@
"Para una asociación de clave principal, agregue los siguientes mapeos a "
"<literal>Employee</literal> y <literal>Person</literal> respectivamente:"
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, no-c-format
+msgid ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3468
#, no-c-format
msgid ""
"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
@@ -2667,7 +6938,25 @@
"generación de identificador de Hibernate denominada <literal>foreign</"
"literal>:"
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, no-c-format
+msgid ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3474
#, no-c-format
msgid ""
"A newly saved instance of <literal>Person</literal> is assigned the same "
@@ -2679,41 +6968,23 @@
"<literal>Employee</literal> referida por la propiedad <literal>employee</"
"literal> de esa <literal>Person</literal>."
-#. Tag: para
-#, no-c-format
-msgid ""
-"Alternatively, a foreign key with a unique constraint, from "
-"<literal>Employee</literal> to <literal>Person</literal>, can be expressed "
-"as:"
-msgstr ""
-"Opcionalmente, una clave foránea con una restricción de unicidad, desde "
-"<literal>Employee</literal> a <literal>Person</literal>, se puede expresar "
-"como:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"This association can be made bidirectional by adding the following to the "
-"<literal>Person</literal> mapping:"
-msgstr ""
-"Esta asociación puede hacerse bidireccional agregando lo siguiente al mapeo "
-"de <literal>Person</literal>:"
-
#. Tag: title
+#: basic_mapping.xml:3482
#, no-c-format
msgid "Natural-id"
msgstr "Natural-id"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3484
+#, fuzzy, no-c-format
msgid ""
"Although we recommend the use of surrogate keys as primary keys, you should "
"try to identify natural keys for all entities. A natural key is a property "
"or combination of properties that is unique and non-null. It is also "
-"immutable. Map the properties of the natural key inside the <literal><"
-"natural-id></literal> element. Hibernate will generate the necessary "
-"unique key and nullability constraints and, as a result, your mapping will "
-"be more self-documenting."
+"immutable. Map the properties of the natural key as <classname>@NaturalId</"
+"classname> or map them inside the <literal><natural-id></literal> "
+"element. Hibernate will generate the necessary unique key and nullability "
+"constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
"Aunque recomendamos el uso de claves delegadas como claves principales, debe "
"tratar de identificar claves naturales para todas las entidades. Una clave "
@@ -2723,9 +6994,57 @@
"restricciones de nulabilidad y de clave única necesarias y su mapeo será más "
"auto-documentado."
+#. Tag: programlisting
+#: basic_mapping.xml:3493
+#, 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
+#: basic_mapping.xml:3495
#, no-c-format
+msgid "Or in XML,"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3497
+#, no-c-format
msgid ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3499
+#, no-c-format
+msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
"<literal>hashCode()</literal> to compare the natural key properties of the "
"entity."
@@ -2735,6 +7054,7 @@
"de la entidad. "
#. Tag: para
+#: basic_mapping.xml:3503
#, no-c-format
msgid ""
"This mapping is not intended for use with entities that have natural primary "
@@ -2744,6 +7064,7 @@
"claves principales naturales."
#. Tag: para
+#: basic_mapping.xml:3508
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>false</"
@@ -2755,125 +7076,203 @@
"naturales son inmutables (constantes)."
#. Tag: title
-#, no-c-format
-msgid "Component and dynamic-component"
-msgstr "Componente y componente dinámico"
+#: basic_mapping.xml:3516
+#, fuzzy, no-c-format
+msgid "<title>Any</title>"
+msgstr "<literal>binary</literal>"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3518
+#, fuzzy, no-c-format
msgid ""
-"The <literal><component></literal> element maps properties of a child "
-"object to columns of the table of a parent class. Components can, in turn, "
-"declare their own properties, components or collections. See the \"Component"
-"\" examples below:"
+"There is one more type of property mapping. The <classname>@Any</classname> "
+"mapping defines a polymorphic association to classes from multiple tables. "
+"This type of mapping requires more than one column. The first column "
+"contains the type of the associated entity. The remaining columns contain "
+"the identifier. It is impossible to specify a foreign key constraint for "
+"this kind of association. This is not the usual way of mapping polymorphic "
+"associations and you should use this only in special cases. For example, for "
+"audit logs, user session data, etc."
msgstr ""
-"El elemento <literal><component></literal> mapea propiedades de un "
-"objeto hijo a columnas de la tabla de la clase padre. Los componentes "
-"pueden, a su vez, declarar sus propias propiedades, componentes o "
-"colecciones. Vea a continuación los \"componentes\":"
+"Hay un tipo más de mapeo de propiedad. El elemento de mapeo <literal><"
+"any></literal> define una asociación polimórfica a clases desde múltiples "
+"tablas. Este tipo de mapeo necesita más de una columna. La primera columna "
+"contiene el tipo de la entidad asociada. Las columnas restantes contienen el "
+"identificador. Es imposible especificar una restricción de clave foránea "
+"para este tipo de asociación. Esta no es la manera usual de mapear "
+"asociaciones polimórficas y sólamente debe usar esto en casos especiales. "
+"Por ejemplo, para registros de auditoría, datos de sesión de usuario, etc."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3528
+#, fuzzy, no-c-format
msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the name of the component (child) class."
+"The <classname>@Any</classname> 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. The <literal>metaType</"
+"literal> attribute allows the application to specify a custom type that maps "
+"database column values to persistent classes that have identifier properties "
+"of the type specified by <literal>idType</literal>. You must specify the "
+"mapping from values of the <literal>metaType</literal> to class names."
msgstr ""
-"<literal>class</literal> (opcional - por defecto es el tipo de la propiedad "
-"determinado por reflección): El nombre de la clase del componente (hijo). "
+"El atributo <literal>meta-type</literal> le permite especificar a la "
+"aplicación un tipo personalizado que mapea los valores de columnas de la "
+"base de datos a clases persistentes que tengan propiedades identificadoras "
+"del tipo especificado por <literal>id-type</literal>. Tiene que especificar "
+"el mapeo de valores del meta-tipo a nombres de clase."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3538
#, no-c-format
msgid ""
-"<literal>insert</literal>: do the mapped columns appear in SQL "
-"<literal>INSERTs</literal>?"
+"@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 ""
-"<literal>insert</literal>: ¿Las columnas mapeadas aparacen en "
-"<literal>INSERTs</literal> SQL? "
#. Tag: para
+#: basic_mapping.xml:3540
#, no-c-format
msgid ""
-"<literal>update</literal>: do the mapped columns appear in SQL "
-"<literal>UPDATEs</literal>?"
+"Note that <classname>@AnyDef</classname> can be mutualized and reused. It is "
+"recommended to place it as a package metadata in this case."
msgstr ""
-"<literal>update</literal>: ¿Las columnas mapeadas aparacen en "
-"<literal>UPDATEs</literal> SQL?"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3544
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that this component should be fetched lazily when the instance "
-"variable is first accessed. It requires build-time bytecode instrumentation."
+"//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 ""
-"<literal>lazy</literal> (opcional - por defecto es <literal>false</"
-"literal>): Especifica que este componente debe ser recuperado perezosamente "
-"cuando se acceda a la variable de instancia por primera vez. Requiere "
-"instrumentación de código byte en tiempo de compilación."
#. Tag: para
+#: basic_mapping.xml:3546
#, no-c-format
+msgid "The hbm.xml equivalent is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3548
+#, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this component either do or do not "
-"require acquisition of the optimistic lock. It determines if a version "
-"increment should occur when this property is dirty."
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
msgstr ""
-"<literal>optimistic-lock</literal> (opcional - por defecto es <literal>true</"
-"literal>): Especifica que las actualizaciones de este componente requieren o "
-"no la adquisición de un bloqueo optimista. Determina si debe ocurrir un "
-"incremento de versión cuando esta propiedad se encuentra desactualizada."
#. Tag: para
+#: basic_mapping.xml:3551
#, no-c-format
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3570
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that a unique constraint exists upon all mapped columns of the "
-"component."
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
msgstr ""
-"<literal>unique</literal> (opcional - por defecto es <literal>false</"
-"literal>): Especifica que existe una restricción de unicidad sobre todas las "
-"columnas mapeadas del componente."
#. Tag: para
+#: basic_mapping.xml:3574
#, no-c-format
+msgid "<literal>name</literal>: the property name."
+msgstr "<literal>name</literal>: el nombre de la propiedad."
+
+#. Tag: para
+#: basic_mapping.xml:3578
+#, no-c-format
+msgid "<literal>id-type</literal>: the identifier type."
+msgstr "<literal>id-type</literal>: el tipo del identificador."
+
+#. Tag: para
+#: basic_mapping.xml:3582
+#, no-c-format
msgid ""
-"The child <literal><property></literal> tags map properties of the "
-"child class to table columns."
+"<literal>meta-type</literal> (optional - defaults to <literal>string</"
+"literal>): any type that is allowed for a discriminator mapping."
msgstr ""
-"Las etiquetas hijas <literal><property></literal> mapean propiedades "
-"de la clase hija a las columnas de la tabla."
+"<literal>meta-type</literal> (opcional - por defecto es <literal>string</"
+"literal>): Cualquier tipo que se permita para un mapeo discriminador."
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
msgid ""
-"The <literal><component></literal> element allows a <literal><"
-"parent></literal> subelement that maps a property of the component class "
-"as a reference back to the containing entity."
+"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
+"the cascade style."
msgstr ""
-"El elemento <literal><component></literal> permite un subelemento "
-"<literal><parent></literal> que mapea una propiedad de la clase del "
-"componente como una referencia a la entidad contenedora."
+"<literal>cascade</literal> (opcional- por defecto es <literal>none</"
+"literal>): el estilo de cascada."
#. Tag: para
+#: basic_mapping.xml:3599
#, no-c-format
msgid ""
-"The <literal><dynamic-component></literal> element allows a "
-"<literal>Map</literal> to be mapped as a component, where the property names "
-"refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for "
-"more information."
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property either do or do not "
+"require acquisition of the optimistic lock. It defines whether a version "
+"increment should occur if this property is dirty."
msgstr ""
-"El elemento <literal><dynamic-component></literal> permite que un "
-"<literal>Map</literal> sea mapeado como un componente, en donde los nombres "
-"de las propiedades se refieran a las claves del mapeo. Consulte <xref "
-"linkend=\"components-dynamic\" /> para obtener mayor información. "
+"<literal>optimistic-lock</literal> (opcional - por defecto es <literal>true</"
+"literal>): Especifica si las actualizaciones de esta propiedad requieren o "
+"no de la adquisición del bloqueo optimista. Define si debe ocurrir un "
+"incremento de versión cuando esta propiedad está desactualizada."
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
msgid "Properties"
msgstr "Propiedades"
#. Tag: para
+#: basic_mapping.xml:3612
#, no-c-format
msgid ""
"The <literal><properties></literal> element allows the definition of a "
@@ -2889,7 +7288,26 @@
"es una forma práctica de definir una restricción de unicidad multicolumna. "
"Por ejemplo:"
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, no-c-format
+msgid ""
+"<properties\n"
+" name=\"logicalName\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3636
#, no-c-format
msgid ""
"<literal>name</literal>: the logical name of the grouping. It is "
@@ -2899,6 +7317,7 @@
"emphasis> es un nombre de propiedad."
#. Tag: para
+#: basic_mapping.xml:3651
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2912,6 +7331,7 @@
"incremento de versión cuando estas propiedades están desactualizadas."
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
msgid ""
"For example, if we have the following <literal><properties></literal> "
@@ -2920,7 +7340,25 @@
"Por ejemplo, si tenemos el siguiente mapeo de <literal><properties></"
"literal>:"
+#. Tag: programlisting
+#: basic_mapping.xml:3669
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+"\n"
+" ...\n"
+" <properties name=\"name\"\n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3671
#, no-c-format
msgid ""
"You might have some legacy data association that refers to this unique key "
@@ -2930,9 +7368,31 @@
"clave única de la tabla de <literal>Person</literal>, en lugar de la clave "
"principal:"
+#. Tag: programlisting
+#: basic_mapping.xml:3675
+#, no-c-format
+msgid ""
+"<many-to-one name=\"owner\"\n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3678
#, no-c-format
msgid ""
+"When using annotations as a mapping strategy, such construct is not "
+"necessary as the binding between a column and its related column on the "
+"associated table is done directly"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3685
+#, no-c-format
+msgid ""
"The use of this outside the context of mapping legacy data is not "
"recommended."
msgstr ""
@@ -2940,274 +7400,288 @@
"datos heredados. "
#. Tag: title
+#: basic_mapping.xml:3690
#, no-c-format
-msgid "Subclass"
-msgstr "Subclase"
+msgid "Some hbm.xml specificities"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3692
#, no-c-format
msgid ""
-"Polymorphic persistence requires the declaration of each subclass of the "
-"root persistent class. For the table-per-class-hierarchy mapping strategy, "
-"the <literal><subclass></literal> declaration is used. For example:"
+"The hbm.xml structure has some specificities naturally not present when "
+"using annotations, let's describe them briefly."
msgstr ""
-"La persistencia polimórfica requiere la declaración de cada subclase de la "
-"clase persistente raíz. Para la estrategia de mapeo tabla-por-jerarquía-de-"
-"clases, se utiliza la declaración <literal><subclass></literal>. Por "
-"ejemplo:"
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3696
#, no-c-format
-msgid "<literal>name</literal>: the fully qualified class name of the subclass."
-msgstr ""
-"<literal>name</literal>: El nombre de clase completamente calificado de la "
-"subclase. "
+msgid "Doctype"
+msgstr "Doctype"
#. Tag: para
+#: basic_mapping.xml:3698
#, no-c-format
msgid ""
-"<literal>discriminator-value</literal> (optional - defaults to the class "
-"name): a value that distinguishes individual subclasses."
+"All XML mappings should declare the doctype shown. The actual DTD can be "
+"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
+"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
+"will always look for the DTD in its classpath first. If you experience "
+"lookups of the DTD using an Internet connection, check the DTD declaration "
+"against the contents of your classpath."
msgstr ""
-"<literal>discriminator-value</literal> (opcional - por defecto es el nombre "
-"de la clase): Un valor que distingue subclases individuales. "
+"Todos los mapeos XML deben declarar el tipo de documento que se muestra. El "
+"DTD en sí se puede encontrar en la URL mencionada anteriormente, en el "
+"directorio <literal>hibernate-x.x.x/src/org/hibernate </literal>, o en "
+"<literal>hibernate3.jar</literal>. Hibernate siempre buscará el DTD primero "
+"en la ruta de clase. Si el DTD realiza búsquedas utilizando una conexión de "
+"Internet, verifique que su declaración DTD frente al contenido de su ruta de "
+"clase."
+#. Tag: title
+#: basic_mapping.xml:3707
+#, no-c-format
+msgid "EntityResolver"
+msgstr "EntityResolver"
+
#. Tag: para
+#: basic_mapping.xml:3709
#, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface used for "
-"lazy initializing proxies."
+"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
+"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
+"implementation with the SAXReader it uses to read in the xml files. This "
+"custom <literal>EntityResolver</literal> recognizes two different systemId "
+"namespaces:"
msgstr ""
-"<literal>proxy</literal> (opcional): Especifica una clase o interfaz que se "
-"utiliza para proxies de inicialización perezosa."
+"Hibernate tratará primero de resolver los DTDs en su ruta de clase. La "
+"manera en que lo hace es registrando una implementación <literal>org.xml.sax."
+"EntityResolver</literal> personalizada con el SAXReader que utiliza para "
+"leer los archivos xml. Este <literal>EntityResolver</literal> personalizado "
+"reconoce dos diferentes espacios de nombre del identificador del sistema."
#. Tag: para
+#: basic_mapping.xml:3718
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
+"encounters a systemId starting with <literal>http://hibernate.sourceforge."
+"net/</literal>. The resolver attempts to resolve these entities via the "
+"classloader which loaded the Hibernate classes."
msgstr ""
-"<literal>lazy</literal> (opcional, por defecto es <literal>true</literal>): "
-"El establecer <literal>lazy=\"false\"</literal> desactiva el uso de la "
-"recuperación perezosa. "
+"un <literal>hibernate namespace</literal> se reconoce cuando el resolvedor "
+"se encuentra con un identificador de sistema que inicia por <literal>http://"
+"hibernate.sourceforge.net/</literal>. El resolvedor intenta resolver estas "
+"entidades por medio del cargador de clases, el cual cargó las clases de "
+"Hibernate."
#. Tag: para
+#: basic_mapping.xml:3726
#, no-c-format
msgid ""
-"Each subclass declares its own persistent properties and subclasses. "
-"<literal><version></literal> and <literal><id></literal> "
-"properties are assumed to be inherited from the root class. Each subclass in "
-"a hierarchy must define a unique <literal>discriminator-value</literal>. If "
-"this is not specified, the fully qualified Java class name is used."
+"a <literal>user namespace</literal> is recognized whenever the resolver "
+"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
+"The resolver will attempt to resolve these entities via (1) the current "
+"thread context classloader and (2) the classloader which loaded the "
+"Hibernate classes."
msgstr ""
-"Cada subclase debe declarar sus propias propiedades persistentes y "
-"subclases. Se asume que las propiedades <literal><version></literal> y "
-"<literal><id></literal> son heredadas de la clase raíz. Cada subclase "
-"en una jerarquía tiene que definir un <literal>discriminator-value</literal> "
-"único. Si no se especifica ninguno entonces se utiliza el nombre "
-"completamente calificado de clase Java."
+"un <literal>user namespace</literal> se reconoce cuando el resolvedor se "
+"encuentra con un identificador del sistema utilizando un protocolo URL "
+"<literal>classpath://</literal>. El resolvedor intentará resolver estas "
+"entidades por medio de (1) el cargador de clase del contexto del hilo actual "
+"y (2) el cargador de clase, el cual cargó las clases de Hibernate."
#. Tag: para
+#: basic_mapping.xml:3735
#, no-c-format
-msgid ""
-"For information about inheritance mappings see <xref linkend=\"inheritance"
-"\" />."
+msgid "The following is an example of utilizing user namespacing:"
msgstr ""
-"Para obtener información acerca de los mapeos de herencias consulte <xref "
-"linkend=\"inheritance\" />."
+"Este es un ejemplo de la utilización de los espacios de nombre del usuario: "
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:3738
#, no-c-format
-msgid "Joined-subclass"
-msgstr "joined-subclass "
+msgid ""
+"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3740
#, no-c-format
msgid ""
-"Each subclass can also be mapped to its own table. This is called the table-"
-"per-subclass mapping strategy. An inherited state is retrieved by joining "
-"with the table of the superclass. To do this you use the <literal><joined-"
-"subclass></literal> element. For example:"
+"Where <literal>types.xml</literal> is a resource in the <literal>your."
+"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
+"custom\">typedef</link>."
msgstr ""
-"Se puede mapear cada subclase a su propia tabla. Esto se llama una "
-"estrategia de mapeo tabla-por-subclase. El estado heredado se recupera "
-"uniendo con la tabla de la superclase. Para hacer esto utilice elemento "
-"<literal><joined-subclass></literal>. Por ejemplo:"
+"En donde <literal>types.xml</literal> es un recurso en el paquete "
+"<literal>your.domain</literal> y comprende un <link linkend=\"mapping-types-"
+"custom\">typedef</link> personalizado."
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3747
#, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
-msgstr "<literal>table</literal>: El nombre de tabla de la subclase. "
+msgid "Hibernate-mapping"
+msgstr "Mapeo de Hibernate "
#. Tag: para
+#: basic_mapping.xml:3749
#, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface to use "
-"for lazy initializing proxies."
+"This element has several optional attributes. The <literal>schema</literal> "
+"and <literal>catalog</literal> attributes specify that tables referred to in "
+"this mapping belong to the named schema and/or catalog. If they are "
+"specified, tablenames will be qualified by the given schema and catalog "
+"names. If they are missing, tablenames will be unqualified. The "
+"<literal>default-cascade</literal> attribute specifies what cascade style "
+"should be assumed for properties and collections that do not specify a "
+"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
+"literal> attribute allows you to use unqualified class names in the query "
+"language."
msgstr ""
-"<literal>proxy</literal> (opcional): Especifica una clase o interfaz que se "
-"debe utilizar para proxies de inicialización perezosa. "
+"Este elemento tiene varios atributos opcionales. Los atributos "
+"<literal>schema</literal> y <literal>catalog</literal> especifican que las "
+"tablas a las que se refiere en este mapeo pertenecen al esquema y/o catálogo "
+"mencionado(s). De especificarse, los nombres de tablas serán calificados por "
+"el nombre del esquema y del catálogo dados. De omitirse, los nombres de las "
+"tablas no serán calificados. El atributo <literal>default-cascade</literal> "
+"especifica qué estilo de cascada se debe asumir para las propiedades y "
+"colecciones que no especifican un atributo <literal>cascade</literal>. Por "
+"defecto, el atributo <literal>auto-import</literal> nos permite utilizar "
+"nombres de clase sin calificar en el lenguaje de consulta."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3778
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
msgstr ""
-"<literal>lazy</literal> (opcional, por defecto es <literal>true</literal>): "
-"El establecer <literal>lazy=\"false\"</literal> desactiva el uso de la "
-"recuperación perezosa. "
#. Tag: para
+#: basic_mapping.xml:3782
#, no-c-format
-msgid ""
-"A discriminator column is not required for this mapping strategy. Each "
-"subclass must, however, declare a table column holding the object identifier "
-"using the <literal><key></literal> element. The mapping at the start "
-"of the chapter would then be re-written as:"
+msgid "<literal>schema</literal> (optional): the name of a database schema."
msgstr ""
-"No se necesita una columna discriminadora para esta estrategia de mapeo. Sin "
-"embargo, cada subclase debe declarar una columna de tabla que tenga el "
-"identificador del objeto utilizando el elemento <literal><key></"
-"literal>. El mapeo mencionado al comienzo del capítulo se reescribiría así:"
+"<literal>schema</literal> (opcional): El nombre de un esquema de la base de "
+"datos. "
-#. Tag: title
-#, no-c-format
-msgid "Union-subclass"
-msgstr "Union-subclass"
-
#. Tag: para
+#: basic_mapping.xml:3787
#, no-c-format
-msgid ""
-"A third option is to map only the concrete classes of an inheritance "
-"hierarchy to tables. This is called the table-per-concrete-class strategy. "
-"Each table defines all persistent states of the class, including the "
-"inherited state. In Hibernate, it is not necessary to explicitly map such "
-"inheritance hierarchies. You can map each class with a separate <literal><"
-"class></literal> declaration. However, if you wish use polymorphic "
-"associations (e.g. an association to the superclass of your hierarchy), you "
-"need to use the <literal><union-subclass></literal> mapping. For "
-"example:"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
msgstr ""
-"Una tercera opción es mapear sólo las clases concretas de una jerarquía de "
-"herencia a tablas. Esta se llama la estrategia clase concreta por tabla). "
-"Cada tabla define todos los estados persistentes de la clase, incluyendo el "
-"estado heredado. En Hibernate, no es necesario mapear dichas jerarquías de "
-"herencia. Puede mapear cada clase con una declaración <literal><class>"
-"</literal> separada. Sin embargo, si desea utilizar asociaciones "
-"polimórficas (por ejemplo, una asociación a la superclase de su jerarquía), "
-"necesita utilizar el mapeo <literal><union-subclass></literal>. Por "
-"ejemplo:"
+"<literal>catalog</literal> (opcional): El nombre de un catálogo de la base "
+"de datos. "
#. Tag: para
+#: basic_mapping.xml:3792
#, no-c-format
-msgid "No discriminator column or key column is required for this mapping strategy."
+msgid ""
+"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
+"literal>): a default cascade style."
msgstr ""
-"No se necesita una columna o una columna clave discriminadora para esta "
-"estrategia de mapeo."
+"<literal>default-cascade</literal> (opcional - por defecto es <literal>none</"
+"literal>): Un estilo de cascada por defecto. "
-#. Tag: title
-#, no-c-format
-msgid "Join"
-msgstr "Join"
-
#. Tag: para
+#: basic_mapping.xml:3797
#, no-c-format
msgid ""
-"Using the <literal><join></literal> element, it is possible to map "
-"properties of one class to several tables that have a one-to-one "
-"relationship. For example:"
+"<literal>default-access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing all properties. "
+"It can be a custom implementation of <literal>PropertyAccessor</literal>."
msgstr ""
-"Al utilizar el elemento <literal><join></literal>, es posible mapear "
-"las propiedades de una clase a varias tablas que tengan una relación uno-a-"
-"uno. Por ejemplo:"
+"<literal>default-access</literal> (opcional - por defecto es "
+"<literal>property</literal>): La estrategia que Hibernate debe utilizar para "
+"acceder a todas las propiedades. Puede ser una implementación personalizada "
+"de <literal>PropertyAccessor</literal>."
#. Tag: para
+#: basic_mapping.xml:3804
#, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
-msgstr "<literal>table</literal>: El nombre de la tabla unida. "
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"if set to <literal>join</literal>, the default, Hibernate will use an inner "
-"join to retrieve a <literal><join></literal> defined by a class or its "
-"superclasses. It will use an outer join for a <literal><join></"
-"literal> defined by a subclass. If set to <literal>select</literal> then "
-"Hibernate will use a sequential select for a <literal><join></literal> "
-"defined on a subclass. This will be issued only if a row represents an "
-"instance of the subclass. Inner joins will still be used to retrieve a "
-"<literal><join></literal> defined by the class and its superclasses."
+"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
+"literal>): the default value for unspecified <literal>lazy</literal> "
+"attributes of class and collection mappings."
msgstr ""
-"<literal>fetch</literal> (opcional - por defecto es <literal>join</"
-"literal>): Si se establece como <literal>join</literal>, por defecto, "
-"Hibernate utilizará una unión interior (inner join) para recuperar un "
-"<literal><join></literal> definido por una clase o sus superclases. "
-"Utilizará una unión externa (outer join) para un <literal><join></"
-"literal> definido por una subclase. Si se establece como <literal>select</"
-"literal>, entonces Hibernate utilizará una selección secuencial para un "
-"<literal><join></literal> definido en una subclase. Esto se publicará "
-"sólamente si una fila representa una instancia de la subclase. Las uniones "
-"interiores todavía serán utilizadas para recuperar un <literal><join></"
-"literal> definido por la clase y sus superclases."
+"<literal>default-lazy</literal> (opcional - por defecto es <literal>true</"
+"literal>): El valor por defecto para los atributos <literal>lazy</literal> "
+"no especificados de mapeos de clase y de colección."
#. Tag: para
+#: basic_mapping.xml:3811
#, no-c-format
msgid ""
-"<literal>inverse</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will not insert or update the properties "
-"defined by this join."
+"<literal>auto-import</literal> (optional - defaults to <literal>true</"
+"literal>): specifies whether we can use unqualified class names of classes "
+"in this mapping in the query language."
msgstr ""
-"<literal>inverse</literal> (opcional - por defecto es <literal>false</"
-"literal>): De activarse, Hibernate no tratará de insertar o actualizar las "
-"propiedades definidas por esta unión. "
+"<literal>auto-import</literal> (opcional - por defecto es <literal>true</"
+"literal>): Especifica si podemos utilizar nombres de clases no calificados "
+"de clases en este mapeo en el lenguaje de consulta."
#. Tag: para
+#: basic_mapping.xml:3818
#, no-c-format
msgid ""
-"<literal>optional</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will insert a row only if the properties "
-"defined by this join are non-null. It will always use an outer join to "
-"retrieve the properties."
+"<literal>package</literal> (optional): specifies a package prefix to use for "
+"unqualified class names in the mapping document."
msgstr ""
-"<literal>optional</literal> (opcional - por defecto es <literal>false</"
-"literal>): De activarse, Hibernate insertará una fila sólo si las "
-"propiedades definidas por esta unión son no-nulas. Siempre utilizará una "
-"unión externa para recuperar las propiedades."
+"<literal>package</literal> (opcional): Especifica un prefijo de paquete que "
+"se debe utilizar para los nombres de clase no calificados en el documento de "
+"mapeo."
#. Tag: para
+#: basic_mapping.xml:3825
#, no-c-format
msgid ""
-"For example, address information for a person can be mapped to a separate "
-"table while preserving value type semantics for all properties:"
+"If you have two persistent classes with the same unqualified name, you "
+"should set <literal>auto-import=\"false\"</literal>. An exception will "
+"result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
-"Por ejemplo, la información domiciliaria de una persona se puede mapear a "
-"una tabla separada, preservando a la vez la semántica de tipo de valor para "
-"todas las propiedades:"
+"Si tiene dos clases persistentes con el mismo nombre (sin calificar), debe "
+"establecer <literal>auto-import=\"false\"</literal>. Se presentará una "
+"excepción si usted intenta asignar dos clases al mismo nombre \"importado\"."
#. Tag: para
+#: basic_mapping.xml:3830
#, no-c-format
msgid ""
-"This feature is often only useful for legacy data models. We recommend fewer "
-"tables than classes and a fine-grained domain model. However, it is useful "
-"for switching between inheritance mapping strategies in a single hierarchy, "
-"as explained later."
+"The <literal>hibernate-mapping</literal> element allows you to nest several "
+"persistent <literal><class></literal> mappings, as shown above. It is, "
+"however, good practice (and expected by some tools) to map only a single "
+"persistent class, or a single class hierarchy, in one mapping file and name "
+"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
+"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
+"<literal>Animal.hbm.xml</literal>."
msgstr ""
-"Con frecuencia, esta funcionalidad sólamente es útil para los modelos de "
-"datos heredados. Recomendamos menos tablas que clases y un modelo de dominio "
-"más detallado. Sin embargo, es útil para cambiar entre estrategias de mapeo "
-"de herencias en una misma jerarquía, como se explica más adelante."
+"El elemento <literal>hibernate-mapping</literal> le permite anidar varios "
+"mapeos <literal><class></literal> persistentes, como se mostró "
+"anteriormente. Sin embargo, es una buena práctica (y algunas herramientas "
+"esperan) que mapee sólamente una clase persistente, o a una sóla jerarquía "
+"de clases, en un archivo de mapeo y nombrarlo como la superclase "
+"persistente. Por ejemplo, <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm."
+"xml</literal>, o si utiliza herencia, <literal>Animal.hbm.xml</literal>."
#. Tag: title
+#: basic_mapping.xml:3841
#, no-c-format
-msgid "Key"
-msgstr "Key"
+msgid "<title>Key</title>"
+msgstr ""
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3843
+#, fuzzy, no-c-format
msgid ""
-"The <literal><key></literal> element has featured a few times within "
+"The <literal><key></literal> element is featured a few times within "
"this guide. It appears anywhere the parent mapping element defines a join to "
"a new table that references the primary key of the original table. It also "
"defines the foreign key in the joined table:"
@@ -3217,7 +7691,22 @@
"defina una unión a una nueva tabla que referencie la clave principal de la "
"tabla original. También define la clave foránea en la tabla unida:"
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, no-c-format
+msgid ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3874
#, no-c-format
msgid ""
"<literal>on-delete</literal> (optional - defaults to <literal>noaction</"
@@ -3229,6 +7718,7 @@
"cascada activado a nivel de base de datos."
#. Tag: para
+#: basic_mapping.xml:3880
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): specifies that the foreign key "
@@ -3240,6 +7730,7 @@
"proporciona para los datos heredados."
#. Tag: para
+#: basic_mapping.xml:3886
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): specifies that the foreign key "
@@ -3251,6 +7742,7 @@
"también es parte de la clave principal."
#. Tag: para
+#: basic_mapping.xml:3892
#, no-c-format
msgid ""
"<literal>update</literal> (optional): specifies that the foreign key should "
@@ -3262,6 +7754,7 @@
"de la clave principal."
#. Tag: para
+#: basic_mapping.xml:3898
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): specifies that the foreign key should "
@@ -3273,6 +7766,7 @@
"es la clave principal."
#. Tag: para
+#: basic_mapping.xml:3905
#, no-c-format
msgid ""
"For systems where delete performance is important, we recommend that all "
@@ -3290,6 +7784,7 @@
"bloqueo optimista normal de Hibernate para datos versionados."
#. Tag: para
+#: basic_mapping.xml:3913
#, no-c-format
msgid ""
"The <literal>not-null</literal> and <literal>update</literal> attributes are "
@@ -3305,53 +7800,13 @@
"\"true\"></literal>. "
#. Tag: title
+#: basic_mapping.xml:3922
#, no-c-format
-msgid "Column and formula elements"
-msgstr "Los elementos columna y fórmula"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Mapping elements which accept a <literal>column</literal> attribute will "
-"alternatively accept a <literal><column></literal> subelement. "
-"Likewise, <literal><formula></literal> is an alternative to the "
-"<literal>formula</literal> attribute. For example:"
-msgstr ""
-"Los elementos de mapeo que acepten un atributo <literal>column</literal> "
-"aceptarán opcionalmente un subelemento <literal><column></literal>. De "
-"manera similar, <literal><formula></literal> es una alternativa al "
-"atributo <literal>formula</literal>. Por ejemplo:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Most of the attributes on <literal>column</literal> provide a means of "
-"tailoring the DDL during automatic schema generation. The <literal>read</"
-"literal> and <literal>write</literal> attributes allow you to specify custom "
-"SQL that Hibernate will use to access the column's value. For more on this, "
-"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
-"read and write expressions</link>."
-msgstr ""
-"La mayoría de los atributos en <literal>column</literal> proporcionan una manera de personalizar el DDL durante la generación del esquema automático. Los atributos <literal>read</"
-"literal> y <literal>write</literal> le permiten especificar SQL personalizado que Hibernate utilizará para acceder el valor de la columna. Para obtener mayor información sobre esto, consulte la discusión sobre <link linkend=\"mapping-column-read-and-write\">expresiones de lectura y escritura de columnas</link>."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The <literal>column</literal> and <literal>formula</literal> elements can "
-"even be combined within the same property or association mapping to express, "
-"for example, exotic join conditions."
-msgstr ""
-"Los elementos <literal>column</literal> y <literal>formula</literal> incluso "
-"se pueden combinar dentro del mismo mapeo de propiedad o asociación para "
-"expresar, por ejemplo, condiciones de unión exóticas."
-
-#. Tag: title
-#, no-c-format
msgid "Import"
msgstr "Import"
#. Tag: para
+#: basic_mapping.xml:3924
#, no-c-format
msgid ""
"If your application has two persistent classes with the same name, and you "
@@ -3366,14 +7821,33 @@
"lugar de depender de <literal>auto-import=\"true\"</literal>. Incluso puede "
"importar clases e interfaces que no estén mapeadas explícitamente:"
+#. Tag: programlisting
+#: basic_mapping.xml:3930
+#, no-c-format
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3939
+#, no-c-format
+msgid ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3943
#, no-c-format
-msgid "<literal>class</literal>: the fully qualified class name of any Java class."
+msgid ""
+"<literal>class</literal>: the fully qualified class name of any Java class."
msgstr ""
"<literal>class</literal>: El nombre de clase completamente calificado de "
"cualquier clase Java. "
#. Tag: para
+#: basic_mapping.xml:3948
#, no-c-format
msgid ""
"<literal>rename</literal> (optional - defaults to the unqualified class "
@@ -3382,99 +7856,114 @@
"<literal>rename</literal> (opcional - por defecto es el nombre de clase sin "
"calificar): Un nombre que se puede utilizar en el lenguaje de consulta."
+#. Tag: para
+#: basic_mapping.xml:3956
+#, no-c-format
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3962
#, no-c-format
-msgid "Any"
-msgstr "Any"
+msgid "Column and formula elements"
+msgstr "Los elementos columna y fórmula"
#. Tag: para
+#: basic_mapping.xml:3964
#, no-c-format
msgid ""
-"There is one more type of property mapping. The <literal><any></"
-"literal> mapping element defines a polymorphic association to classes from "
-"multiple tables. This type of mapping requires more than one column. The "
-"first column contains the type of the associated entity. The remaining "
-"columns contain the identifier. It is impossible to specify a foreign key "
-"constraint for this kind of association. This is not the usual way of "
-"mapping polymorphic associations and you should use this only in special "
-"cases. For example, for audit logs, user session data, etc."
+"Mapping elements which accept a <literal>column</literal> attribute will "
+"alternatively accept a <literal><column></literal> subelement. "
+"Likewise, <literal><formula></literal> is an alternative to the "
+"<literal>formula</literal> attribute. For example:"
msgstr ""
-"Hay un tipo más de mapeo de propiedad. El elemento de mapeo <literal><"
-"any></literal> define una asociación polimórfica a clases desde múltiples "
-"tablas. Este tipo de mapeo necesita más de una columna. La primera columna "
-"contiene el tipo de la entidad asociada. Las columnas restantes contienen el "
-"identificador. Es imposible especificar una restricción de clave foránea "
-"para este tipo de asociación. Esta no es la manera usual de mapear "
-"asociaciones polimórficas y sólamente debe usar esto en casos especiales. "
-"Por ejemplo, para registros de auditoría, datos de sesión de usuario, etc."
+"Los elementos de mapeo que acepten un atributo <literal>column</literal> "
+"aceptarán opcionalmente un subelemento <literal><column></literal>. De "
+"manera similar, <literal><formula></literal> es una alternativa al "
+"atributo <literal>formula</literal>. Por ejemplo:"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3970
#, no-c-format
msgid ""
-"The <literal>meta-type</literal> attribute allows the application to specify "
-"a custom type that maps database column values to persistent classes that "
-"have identifier properties of the type specified by <literal>id-type</"
-"literal>. You must specify the mapping from values of the meta-type to class "
-"names."
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"\n"
+" read=\"SQL expression\"\n"
+" write=\"SQL expression\"/>"
msgstr ""
-"El atributo <literal>meta-type</literal> le permite especificar a la "
-"aplicación un tipo personalizado que mapea los valores de columnas de la "
-"base de datos a clases persistentes que tengan propiedades identificadoras "
-"del tipo especificado por <literal>id-type</literal>. Tiene que especificar "
-"el mapeo de valores del meta-tipo a nombres de clase."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3972
#, no-c-format
-msgid "<literal>name</literal>: the property name."
-msgstr "<literal>name</literal>: el nombre de la propiedad."
+msgid "<formula>SQL expression</formula>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "<literal>id-type</literal>: the identifier type."
-msgstr "<literal>id-type</literal>: el tipo del identificador."
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>meta-type</literal> (optional - defaults to <literal>string</"
-"literal>): any type that is allowed for a discriminator mapping."
+"Most of the attributes on <literal>column</literal> provide a means of "
+"tailoring the DDL during automatic schema generation. The <literal>read</"
+"literal> and <literal>write</literal> attributes allow you to specify custom "
+"SQL that Hibernate will use to access the column's value. For more on this, "
+"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
+"read and write expressions</link>."
msgstr ""
-"<literal>meta-type</literal> (opcional - por defecto es <literal>string</"
-"literal>): Cualquier tipo que se permita para un mapeo discriminador."
+"La mayoría de los atributos en <literal>column</literal> proporcionan una "
+"manera de personalizar el DDL durante la generación del esquema automático. "
+"Los atributos <literal>read</literal> y <literal>write</literal> le permiten "
+"especificar SQL personalizado que Hibernate utilizará para acceder el valor "
+"de la columna. Para obtener mayor información sobre esto, consulte la "
+"discusión sobre <link linkend=\"mapping-column-read-and-write\">expresiones "
+"de lectura y escritura de columnas</link>."
#. Tag: para
+#: basic_mapping.xml:3982
#, no-c-format
msgid ""
-"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
-"the cascade style."
+"The <literal>column</literal> and <literal>formula</literal> elements can "
+"even be combined within the same property or association mapping to express, "
+"for example, exotic join conditions."
msgstr ""
-"<literal>cascade</literal> (opcional- por defecto es <literal>none</"
-"literal>): el estilo de cascada."
+"Los elementos <literal>column</literal> y <literal>formula</literal> incluso "
+"se pueden combinar dentro del mismo mapeo de propiedad o asociación para "
+"expresar, por ejemplo, condiciones de unión exóticas."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3986
#, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this property either do or do not "
-"require acquisition of the optimistic lock. It defines whether a version "
-"increment should occur if this property is dirty."
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
msgstr ""
-"<literal>optimistic-lock</literal> (opcional - por defecto es <literal>true</"
-"literal>): Especifica si las actualizaciones de esta propiedad requieren o "
-"no de la adquisición del bloqueo optimista. Define si debe ocurrir un "
-"incremento de versión cuando esta propiedad está desactualizada."
#. Tag: title
+#: basic_mapping.xml:3992
#, no-c-format
msgid "Hibernate types"
msgstr "Tipos de Hibernate "
#. Tag: title
+#: basic_mapping.xml:3995
#, no-c-format
msgid "Entities and values"
msgstr "Entidades y Valores"
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
msgid ""
"In relation to the persistence service, Java language-level objects are "
@@ -3484,6 +7973,7 @@
"Java se clasifican en dos grupos:"
#. Tag: para
+#: basic_mapping.xml:4000
#, no-c-format
msgid ""
"An <emphasis>entity</emphasis> exists independently of any other objects "
@@ -3508,6 +7998,7 @@
"versionadas."
#. Tag: para
+#: basic_mapping.xml:4010
#, no-c-format
msgid ""
"An entity's persistent state consists of references to other entities and "
@@ -3531,6 +8022,7 @@
"por lo que dos entidades o colleciones no los pueden compartir."
#. Tag: para
+#: basic_mapping.xml:4020
#, no-c-format
msgid ""
"Until now, we have been using the term \"persistent class\" to refer to "
@@ -3560,11 +8052,14 @@
"un tipo de valor."
#. Tag: para
+#: basic_mapping.xml:4033
#, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
-msgstr "Volveremos a revisar ambos conceptos a lo largo de este manual de referencia."
+msgstr ""
+"Volveremos a revisar ambos conceptos a lo largo de este manual de referencia."
#. Tag: para
+#: basic_mapping.xml:4036
#, no-c-format
msgid ""
"The challenge is to map the Java type system, and the developers' definition "
@@ -3591,6 +8086,7 @@
"estrategias de conversión personalizadas."
#. Tag: para
+#: basic_mapping.xml:4049
#, no-c-format
msgid ""
"With the exception of collections, all built-in Hibernate types support null "
@@ -3600,11 +8096,13 @@
"excepción de las colecciones."
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
msgid "Basic value types"
msgstr "Tipos de valores básicos"
#. Tag: para
+#: basic_mapping.xml:4056
#, no-c-format
msgid ""
"The built-in <emphasis>basic mapping types</emphasis> can be roughly "
@@ -3613,16 +8111,18 @@
"Los <emphasis>tipos de mapeo básicos</emphasis> incorporados se pueden "
"categorizar así:"
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4059
+#, fuzzy, no-c-format
msgid ""
-"<literal>integer, long, short, float, double, character, byte, boolean, "
-"yes_no, true_false</literal>"
+"integer, long, short, float, double, character, byte, boolean, yes_no, "
+"true_false"
msgstr ""
"<literal>integer, long, short, float, double, character, byte, boolean, "
"yes_no, true_false</literal>"
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
msgid ""
"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
@@ -3635,12 +8135,14 @@
"y <literal>true_false</literal> son codificaciones alternativas a "
"<literal>boolean</literal> de Java o <literal>java.lang.Boolean</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4073
#, no-c-format
-msgid "<literal>string</literal>"
-msgstr "<literal>string</literal>"
+msgid "string"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</"
@@ -3649,12 +8151,14 @@
"Un mapeo del tipo <literal>java.lang.String</literal> a <literal>VARCHAR</"
"literal> (u Oracle <literal>VAARCHAR2</literal>)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4083
+#, fuzzy, no-c-format
+msgid "date, time, timestamp"
msgstr "<literal>date, time, timestamp</literal>"
#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Date</literal> and its subclasses to "
@@ -3665,12 +8169,14 @@
"tipos SQL <literal>DATE</literal>, <literal>TIME</literal> y "
"<literal>TIMESTAMP</literal> (o equivalente)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4094
+#, fuzzy, no-c-format
+msgid "calendar, calendar_date"
msgstr "<literal>calendar, calendar_date</literal>"
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Calendar</literal> to SQL types "
@@ -3679,12 +8185,14 @@
"Mapeos de tipo desde <literal>java.util.Date</literal> y tipos SQL "
"<literal>TIMESTAMP</literal> y <literal>DATE</literal> (o equivalente)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4104
+#, fuzzy, no-c-format
+msgid "big_decimal, big_integer"
msgstr "<literal>big_decimal, big_integer</literal>"
#. Tag: para
+#: basic_mapping.xml:4107
#, no-c-format
msgid ""
"Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java."
@@ -3695,12 +8203,14 @@
"math.BigInteger</literal> a <literal>NUMERIC</literal> (o <literal>NUMBER</"
"literal> de Oracle)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4115
+#, fuzzy, no-c-format
+msgid "locale, timezone, currency"
msgstr "<literal>locale, timezone, currency</literal>"
#. Tag: para
+#: basic_mapping.xml:4118
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Locale</literal>, <literal>java.util."
@@ -3717,12 +8227,14 @@
"mapeadas a sus códigos ISO. Las instancias de <literal>TimeZone</literal> "
"son mapeadas a sus <literal>ID</literal>."
-#. Tag: term
-#, no-c-format
-msgid "<literal>class</literal>"
-msgstr "<literal>class</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4131
+#, fuzzy, no-c-format
+msgid "class"
+msgstr "Clase"
#. Tag: para
+#: basic_mapping.xml:4134
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</"
@@ -3733,22 +8245,26 @@
"literal> (o <literal>VARCHAR2</literal> de Oracle). Una <literal>Class</"
"literal> es mapeada a su nombre completamente calificado."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4142
#, no-c-format
-msgid "<literal>binary</literal>"
-msgstr "<literal>binary</literal>"
+msgid "binary"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4145
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr "Mapea arreglos de bytes a un tipo binario SQL apropiado."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4150
#, no-c-format
-msgid "<literal>text</literal>"
-msgstr "<literal>text</literal>"
+msgid "text"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4153
#, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</"
@@ -3757,12 +8273,14 @@
"Mapea cadenas largas de Java al tipo SQL <literal>CLOB</literal> o "
"<literal>TEXT</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4159
#, no-c-format
-msgid "<literal>serializable</literal>"
-msgstr "<literal>serializable</literal>"
+msgid "serializable"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4162
#, no-c-format
msgid ""
"Maps serializable Java types to an appropriate SQL binary type. You can also "
@@ -3774,12 +8292,14 @@
"nombre de una clase o interfaz serializable Java que no sea por defecto un "
"tipo básico. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4171
#, no-c-format
-msgid "<literal>clob, blob</literal>"
-msgstr "<literal>clob, blob</literal>"
+msgid "clob, blob"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4174
#, no-c-format
msgid ""
"Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and "
@@ -3793,16 +8313,18 @@
"fuera de una transacción. Además, el soporte del controlador suele ser malo "
"e inconsistente."
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4184
+#, fuzzy, no-c-format
msgid ""
-"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
-"imm_serializable, imm_binary</literal>"
+"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary"
msgstr ""
"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary</literal>"
#. Tag: para
+#: basic_mapping.xml:4188
#, no-c-format
msgid ""
"Type mappings for what are considered mutable Java types. This is where "
@@ -3822,6 +8344,7 @@
"tiene que asignar un objeto nuevo, no idéntico, a la propiedad."
#. Tag: para
+#: basic_mapping.xml:4200
#, no-c-format
msgid ""
"Unique identifiers of entities and collections can be of any basic type "
@@ -3835,6 +8358,7 @@
"están permitidos, a continuación encontrará mayor información."
#. Tag: para
+#: basic_mapping.xml:4205
#, no-c-format
msgid ""
"The basic value types have corresponding <literal>Type</literal> constants "
@@ -3848,11 +8372,13 @@
"<literal>string</literal>."
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
msgid "Custom value types"
msgstr "Tipos de valor personalizados"
#. Tag: para
+#: basic_mapping.xml:4214
#, no-c-format
msgid ""
"It is relatively easy for developers to create their own value types. For "
@@ -3877,6 +8403,7 @@
"literal>."
#. Tag: para
+#: basic_mapping.xml:4225
#, no-c-format
msgid ""
"To implement a custom type, implement either <literal>org.hibernate."
@@ -3891,7 +8418,19 @@
"calificado del tipo. Revise <literal>org.hibernate.test.DoubleStringType</"
"literal> para ver qué clases de cosas son posibles. "
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, no-c-format
+msgid ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4234
#, no-c-format
msgid ""
"Notice the use of <literal><column></literal> tags to map a property "
@@ -3901,6 +8440,7 @@
"una propiedad a múltiples columnas."
#. Tag: para
+#: basic_mapping.xml:4237
#, no-c-format
msgid ""
"The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</"
@@ -3914,6 +8454,7 @@
"especializados."
#. Tag: para
+#: basic_mapping.xml:4243
#, no-c-format
msgid ""
"You can even supply parameters to a <literal>UserType</literal> in the "
@@ -3929,7 +8470,19 @@
"personalizado, puede utilizar el elemento <literal><type></literal> en "
"sus archivos de mapeo. "
+#. Tag: programlisting
+#: basic_mapping.xml:4250
+#, no-c-format
+msgid ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4252
#, no-c-format
msgid ""
"The <literal>UserType</literal> can now retrieve the value for the parameter "
@@ -3941,6 +8494,7 @@
"literal> que se le pasa."
#. Tag: para
+#: basic_mapping.xml:4256
#, no-c-format
msgid ""
"If you regularly use a certain <literal>UserType</literal>, it is useful to "
@@ -3955,7 +8509,24 @@
"nombre a un tipo personalizado y también pueden contener una lista de "
"valores predeterminados de parámetros si el tipo se encuentra parametrizado."
+#. Tag: programlisting
+#: basic_mapping.xml:4262
+#, no-c-format
+msgid ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:4264
+#, no-c-format
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4266
#, no-c-format
msgid ""
"It is also possible to override the parameters supplied in a typedef on a "
@@ -3966,6 +8537,7 @@
"propiedad."
#. Tag: para
+#: basic_mapping.xml:4270
#, no-c-format
msgid ""
"Even though Hibernate's rich range of built-in types and support for "
@@ -3989,11 +8561,13 @@
"valores monetarios."
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
msgid "Mapping a class more than once"
msgstr "Mapeo de una clase más de una vez"
#. Tag: para
+#: basic_mapping.xml:4285
#, no-c-format
msgid ""
"It is possible to provide more than one mapping for a particular persistent "
@@ -4011,7 +8585,31 @@
"objetos persistentes, al escribir consultas, o al mapear asociaciones a la "
"entidad mencionada."
+#. Tag: programlisting
+#: basic_mapping.xml:4293
+#, no-c-format
+msgid ""
+"<class name=\"Contract\" table=\"Contracts\"\n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\"\n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\"\n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\"\n"
+" column=\"currentContractId\"\n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4295
#, no-c-format
msgid ""
"Associations are now specified using <literal>entity-name</literal> instead "
@@ -4020,12 +8618,20 @@
"Las asociaciones ahora se especifican utilizando <literal>entity-name</"
"literal> en lugar de <literal>class</literal>."
+#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
+#, no-c-format
+msgid "This feature is not supported in Annotations"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
msgid "SQL quoted identifiers"
msgstr "Identificadores SQL en comillas"
#. Tag: para
+#: basic_mapping.xml:4306
#, no-c-format
msgid ""
"You can force Hibernate to quote an identifier in the generated SQL by "
@@ -4040,101 +8646,32 @@
"comillas para el <literal>Dialect</literal> SQL. Usualmente comillas dobles, "
"a excepción de corchetes para SQL Server y comillas sencillas para MySQL."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:4312
#, no-c-format
-msgid "Metadata alternatives"
-msgstr "Alternativas de metadatos"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"XML does not suit all users so there are some alternative ways to define O/R "
-"mapping metadata in Hibernate."
+"@Entity @Table(name=\"`Line Item`\")\n"
+"class LineItem {\n"
+" @id @Column(name=\"`Item Id`\") Integer id;\n"
+" @Column(name=\"`Item #`\") int itemNumber\n"
+"}\n"
+"\n"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"XML no es para todo el mundo, así que hay algunas formas opcionales de "
-"definir metadatos de mapeo O/R en Hibernate."
#. Tag: title
+#: basic_mapping.xml:4316
#, no-c-format
-msgid "Using XDoclet markup"
-msgstr "Utilización de marcado de XDoclet"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Many Hibernate users prefer to embed mapping information directly in "
-"sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover "
-"this approach in this reference guide since it is considered part of "
-"XDoclet. However, we include the following example of the <literal>Cat</"
-"literal> class with XDoclet mappings:"
-msgstr ""
-"Muchos usuarios de Hibernate prefieren incluir la información de mapeo "
-"directamente en el código fuente usando las <literal>@hibernate.tags</"
-"literal> XDoclet. No abordaremos este enfoque en este manual de referencia "
-"ya que se considera como parte de XDoclet. Sin embargo, incluímos el "
-"siguiente ejemplo de la clase <literal>Cat</literal> con los mapeos XDoclet:"
-
-#. Tag: para
-#, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr ""
-"Para obtener más ejemplos de XDoclet e Hibernate consulte el sitio web de "
-"Hibernate. "
-
-#. Tag: title
-#, no-c-format
-msgid "Using JDK 5.0 Annotations"
-msgstr "Utlización de Anotaciones JDK 5.0"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"JDK 5.0 introduced XDoclet-style annotations at the language level that are "
-"type-safe and checked at compile time. This mechanism is more powerful than "
-"XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, "
-"for example, supports auto-completion and syntax highlighting of JDK 5.0 "
-"annotations. The new revision of the EJB specification (JSR-220) uses JDK "
-"5.0 annotations as the primary metadata mechanism for entity beans. "
-"Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the "
-"persistence API). Support for mapping metadata is available via the "
-"<emphasis>Hibernate Annotations</emphasis> package as a separate download. "
-"Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
-msgstr ""
-"JDK 5.0 introdujo anotaciones del estilo XDoclet a nivel del lenguaje con "
-"chequeo seguro de tipos en tiempo de compilación. Este mecanismo es más "
-"potente que las anotaciones XDoclet y es mejor soportado por herramientas e "
-"IDEs. IntelliJ IDEA, por ejemplo, soporta auto-completación además de "
-"resalte de sintaxis de las anotaciones JDK 5.0. La nueva revisión de la "
-"especificación de EJB (JSR-220) utiliza anotaciones JDK 5.0 como el "
-"mecanismo principal de metadatos para beans de entidad. Hibernate3 "
-"implementa el <literal>EntityManager</literal> del JSR-220 (la API de "
-"persistencia). El soporte para metadatos de mapeo está disponible por medio "
-"del paquete <emphasis>Anotaciones de Hibernate</emphasis>, como una descarga "
-"separada. Tanto los metadatos de EJB3 (JSR-220) como de Hibernate3 se "
-"encuentran soportados."
-
-#. Tag: para
-#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
-msgstr "Este es un ejemplo de una clase POJO anotada como un bean de entidad EJB:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Support for JDK 5.0 Annotations (and JSR-220) is currently under "
-"development. Please refer to the Hibernate Annotations module for more "
-"details."
-msgstr ""
-"El soporte para las anotaciones JDK 5.0 (y JSR-220) todavía se encuentra en "
-"progreso. Para obtener más información consulte al módulo de anotaciones de "
-"Hibernate."
-
-#. Tag: title
-#, no-c-format
msgid "Generated properties"
msgstr "Propiedades generadas"
#. Tag: para
+#: basic_mapping.xml:4318
#, no-c-format
msgid ""
"Generated properties are properties that have their values generated by the "
@@ -4155,6 +8692,7 @@
"emite un select para recuperar los valores generados."
#. Tag: para
+#: basic_mapping.xml:4327
#, no-c-format
msgid ""
"Properties marked as generated must additionally be non-insertable and non-"
@@ -4164,11 +8702,13 @@
"can be marked as generated."
msgstr ""
"Las propiedades marcadas como generadas tienen que ser además no insertables "
-"y no actualizables. Sólamente las <link linkend=\"mapping-declaration-version\">versiones</"
-"link>, <link linkend=\"mapping-declaration-timestamp\">sellos de fecha</link>, "
-"y <link linkend=\"mapping-declaration-property\">propiedades simples</link> se pueden marcar como generadas."
+"y no actualizables. Sólamente las <link linkend=\"mapping-declaration-version"
+"\">versiones</link>, <link linkend=\"mapping-declaration-timestamp\">sellos "
+"de fecha</link>, y <link linkend=\"mapping-declaration-property"
+"\">propiedades simples</link> se pueden marcar como generadas."
#. Tag: para
+#: basic_mapping.xml:4334
#, no-c-format
msgid ""
"<literal>never</literal> (the default): the given property value is not "
@@ -4178,6 +8718,7 @@
"generado dentro de la base de datos."
#. Tag: para
+#: basic_mapping.xml:4337
#, no-c-format
msgid ""
"<literal>insert</literal>: the given property value is generated on insert, "
@@ -4190,12 +8731,13 @@
"<literal>insert</literal>: el valor dado de la propiedad es generado en "
"insert, pero no es regenerado en las actualizaciones posteriores. Las "
"propiedades como fecha-creada (created-date) se encuentran dentro de esta "
-"categoría. Aunque las propiedades <link linkend=\"mapping-declaration-"
-"version\">versión</link> y <link linkend=\"mapping-declaration-timestamp"
-"\">sello de fecha</link> se pueden marcar "
-"como generadas, esta opción no se encuentra disponible."
+"categoría. Aunque las propiedades <link linkend=\"mapping-declaration-version"
+"\">versión</link> y <link linkend=\"mapping-declaration-timestamp\">sello de "
+"fecha</link> se pueden marcar como generadas, esta opción no se encuentra "
+"disponible."
#. Tag: para
+#: basic_mapping.xml:4344
#, no-c-format
msgid ""
"<literal>always</literal>: the property value is generated both on insert "
@@ -4204,61 +8746,95 @@
"<literal>always</literal>: el valor de la propiedad es generado tanto en "
"insert como en update."
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr "Expresiones de lectura y escritura de columnas"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:4354
+#, fuzzy, no-c-format
msgid ""
"Hibernate allows you to customize the SQL it uses to read and write the "
"values of columns mapped to <link linkend=\"mapping-declaration-property"
"\">simple properties</link>. For example, if your database provides a set of "
"data encryption functions, you can invoke them for individual columns like "
-"this: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"this:"
msgstr ""
-"Hibernate le permite personalizar el SQL que utiliza para leer y escribir los valores de las columnas mapeadas a las <link linkend=\"mapping-declaration-property"
-"\">propiedades simples</link>. Por ejemplo, si su base de datos brinda un grupo de funciones de codificación de "
-"datos, puede invocarlas para columnas individuales como esto: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"Hibernate le permite personalizar el SQL que utiliza para leer y escribir "
+"los valores de las columnas mapeadas a las <link linkend=\"mapping-"
+"declaration-property\">propiedades simples</link>. Por ejemplo, si su base "
+"de datos brinda un grupo de funciones de codificación de datos, puede "
+"invocarlas para columnas individuales como esto: <programlisting role=\"XML"
+"\"><property name=\"creditCardNumber\"> <column name="
+"\"credit_card_num\" read=\"decrypt(credit_card_num)\" write=\"encrypt(?)\"/"
+"> </property></programlisting>"
+#. Tag: programlisting
+#: basic_mapping.xml:4359
+#, no-c-format
+msgid ""
+"<property name=\"creditCardNumber\">\n"
+" <column \n"
+" name=\"credit_card_num\"\n"
+" read=\"decrypt(credit_card_num)\"\n"
+" write=\"encrypt(?)\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
msgid ""
"Hibernate applies the custom expressions automatically whenever the property "
"is referenced in a query. This functionality is similar to a derived-"
"property <literal>formula</literal> with two differences:"
-msgstr "Hibernate aplica las expresiones personalizadas de manera automática cuando la propiedad se referencia en una petición. Esta funcionalidad es similar a una propiedad derivada <literal>formula</literal> con dos diferencias:"
+msgstr ""
+"Hibernate aplica las expresiones personalizadas de manera automática cuando "
+"la propiedad se referencia en una petición. Esta funcionalidad es similar a "
+"una propiedad derivada <literal>formula</literal> con dos diferencias:"
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
msgid ""
"The property is backed by one or more columns that are exported as part of "
"automatic schema generation."
-msgstr "Esta propiedad está respaldada por una o más columnas que se exportan como parte de la generación automática del esquema. "
+msgstr ""
+"Esta propiedad está respaldada por una o más columnas que se exportan como "
+"parte de la generación automática del esquema. "
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr "La propiedad es de lectura y escritura no de sólo lectura. "
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
msgid ""
"The <literal>write</literal> expression, if specified, must contain exactly "
"one '?' placeholder for the value."
-msgstr "Si se especifica la expresión <literal>write</literal> debe contener exactamente un parémetro de sustitución '?' para el valor."
+msgstr ""
+"Si se especifica la expresión <literal>write</literal> debe contener "
+"exactamente un parémetro de sustitución '?' para el valor."
#. Tag: title
+#: basic_mapping.xml:4384
#, no-c-format
msgid "Auxiliary database objects"
msgstr "Objetos de bases de datos auxiliares"
#. Tag: para
+#: basic_mapping.xml:4386
#, no-c-format
msgid ""
"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
@@ -4282,6 +8858,7 @@
"bases de datos auxiliares:"
#. Tag: para
+#: basic_mapping.xml:4396
#, no-c-format
msgid ""
"The first mode is to explicitly list the CREATE and DROP commands in the "
@@ -4290,7 +8867,21 @@
"El primer modo es para numerar explícitamente los comandos CREATE y DROP en "
"el archivo de mapeo: "
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4401
#, no-c-format
msgid ""
"The second mode is to supply a custom class that constructs the CREATE and "
@@ -4301,7 +8892,20 @@
"los comandos CREATE y DROP. Esta clase personalizada tiene que implementar "
"la interfaz <literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal>."
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4408
#, no-c-format
msgid ""
"Additionally, these database objects can be optionally scoped so that they "
@@ -4311,3 +8915,394 @@
"manera opcional de forma que aplique sólamente cuando se utilicen ciertos "
"dialectos. "
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
+">\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#~ msgid ""
+#~ "Use of <literal>select-before-update</literal> will usually decrease "
+#~ "performance. It is useful to prevent a database update trigger being "
+#~ "called unnecessarily if you reattach a graph of detached instances to a "
+#~ "<literal>Session</literal>."
+#~ msgstr ""
+#~ "El uso de <literal>select-before-update</literal> disminuirá el "
+#~ "rendimiento. Es muy útil prevenir que se llame innecesariamente a un "
+#~ "disparador de actualización de la base de datos al volver a unir un "
+#~ "gráfico de instancias separadas a una <literal>Session</literal>."
+
+#~ msgid "Generator"
+#~ msgstr "Generador"
+
+#~ msgid "<literal>increment</literal>"
+#~ msgstr "<literal>increment</literal>"
+
+#~ msgid "<literal>identity</literal>"
+#~ msgstr "<literal>identity</literal>"
+
+#~ msgid "<literal>sequence</literal>"
+#~ msgstr "<literal>sequence</literal>"
+
+#~ msgid "<literal>seqhilo</literal>"
+#~ msgstr "<literal>seqhilo</literal>"
+
+#~ msgid "<literal>uuid</literal>"
+#~ msgstr "<literal>uuid</literal>"
+
+#~ msgid ""
+#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
+#~ "are unique within a network (the IP address is used). The UUID is encoded "
+#~ "as a string of 32 hexadecimal digits in length."
+#~ msgstr ""
+#~ "utiliza un algoritmo UUID de 128 bits para generar identificadores de "
+#~ "tipo cadena, únicos dentro de una red (se utiliza la direccón IP). El "
+#~ "UUID se codifica como una cadena hexadecimal de 32 dígitos de largo."
+
+#~ msgid "<literal>guid</literal>"
+#~ msgstr "<literal>guid</literal>"
+
+#~ msgid "<literal>native</literal>"
+#~ msgstr "<literal>native</literal>"
+
+#~ msgid "<literal>select</literal>"
+#~ msgstr "<literal>select</literal>"
+
+#~ msgid "<literal>foreign</literal>"
+#~ msgstr "<literal>foreign</literal>"
+
+#~ msgid ""
+#~ "<literal>optimizer</literal> (optional - defaults to <literal>none</"
+#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
+#~ msgstr ""
+#~ "<literal>optimizer</literal> (opcional - por defecto es <literal>none</"
+#~ "literal>): Consulte <xref linkend=\"mapping-declaration-id-enhanced-"
+#~ "optimizers\" />"
+
+#~ msgid "composite-id"
+#~ msgstr "composite-id"
+
+#~ msgid ""
+#~ "A table with a composite key can be mapped with multiple properties of "
+#~ "the class as identifier properties. The <literal><composite-id></"
+#~ "literal> element accepts <literal><key-property></literal> property "
+#~ "mappings and <literal><key-many-to-one></literal> mappings as child "
+#~ "elements."
+#~ msgstr ""
+#~ "Una tabla con clave compuesta se puede mapear con múltiples propiedades "
+#~ "de la clase como propiedades identificadoras. El elemento <literal><"
+#~ "composite-id></literal> acepta los mapeos de propiedad <literal><"
+#~ "key-property></literal> y los mapeos <literal><key-many-to-one></"
+#~ "literal> como elementos hijos."
+
+#~ msgid ""
+#~ "The persistent class <emphasis>must</emphasis> override <literal>equals()"
+#~ "</literal> and <literal>hashCode()</literal> to implement composite "
+#~ "identifier equality. It must also implement <literal>Serializable</"
+#~ "literal>."
+#~ msgstr ""
+#~ "La clase persistente <emphasis>tiene</emphasis> que sobrescribir "
+#~ "<literal>equals()</literal> y <literal>hashCode()</literal> para "
+#~ "implementar la igualdad del identificador compuesto. También tiene que "
+#~ "implementar <literal>Serializable</literal>."
+
+#~ msgid ""
+#~ "Unfortunately, this approach means that a persistent object is its own "
+#~ "identifier. There is no convenient \"handle\" other than the object "
+#~ "itself. You must instantiate an instance of the persistent class itself "
+#~ "and populate its identifier properties before you can <literal>load()</"
+#~ "literal> the persistent state associated with a composite key. We call "
+#~ "this approach an <emphasis>embedded</emphasis> composite identifier, and "
+#~ "discourage it for serious applications."
+#~ msgstr ""
+#~ "Desafortunadamente, este enfoque significa que un objeto persistente es "
+#~ "su propio identificador. No existe otra \"asa\" conveniente más que el "
+#~ "objeto mismo. Debe instanciar una instancia de la clase persistente y "
+#~ "poblar sus propiedades identificadoras antes de que pueda <literal>load()"
+#~ "</literal> el estado persistente asociado a una clave compuesta. Este "
+#~ "enfoque lo denominamos un identificador compuesto <emphasis>incluído</"
+#~ "emphasis> y no lo recomendamos para aplicaciones serias."
+
+#~ msgid ""
+#~ "A second approach is what we call a <emphasis>mapped</emphasis> composite "
+#~ "identifier, where the identifier properties named inside the <literal><"
+#~ "composite-id></literal> element are duplicated on both the persistent "
+#~ "class and a separate identifier class."
+#~ msgstr ""
+#~ "Un segundo enfoque es lo que denominamos un identificador compuesto "
+#~ "<emphasis>mapeado</emphasis>, en donde las propiedades del identificador "
+#~ "nombradas dentro del elemento <literal><composite-id></literal> son "
+#~ "duplicadas tanto en la clase persistente como en la clase identificadora "
+#~ "separada."
+
+#~ msgid ""
+#~ "In this example, both the composite identifier class, "
+#~ "<literal>MedicareId</literal>, and the entity class itself have "
+#~ "properties named <literal>medicareNumber</literal> and "
+#~ "<literal>dependent</literal>. The identifier class must override "
+#~ "<literal>equals()</literal> and <literal>hashCode()</literal> and "
+#~ "implement <literal>Serializable</literal>. The main disadvantage of this "
+#~ "approach is code duplication."
+#~ msgstr ""
+#~ "En este ejemplo, tanto la clase identificadora compuesta "
+#~ "<literal>MedicareId</literal> como la clase de entidad misma tienen "
+#~ "propiedades denominadas <literal>medicareNumber</literal> y "
+#~ "<literal>dependent</literal>. La clase identificadora tiene que "
+#~ "sobrescribir <literal>equals()</literal> y <literal>hashCode()</literal> "
+#~ "e implementar <literal>Serializable</literal>. La desventaja principal de "
+#~ "este enfoque es la duplicación de código."
+
+#~ msgid ""
+#~ "The following attributes are used to specify a mapped composite "
+#~ "identifier:"
+#~ msgstr ""
+#~ "Los siguientes atributos se utilizan para especificar un identificador "
+#~ "compuesto mapeado:"
+
+#~ msgid ""
+#~ "<literal>mapped</literal> (optional - defaults to <literal>false</"
+#~ "literal>): indicates that a mapped composite identifier is used, and that "
+#~ "the contained property mappings refer to both the entity class and the "
+#~ "composite identifier class."
+#~ msgstr ""
+#~ "<literal>mapped</literal> (opcional, por defecto es <literal>false</"
+#~ "literal>): indica que se utiliza un identificador compuesto mapeado y que "
+#~ "los mapeos de propiedad contenidos se refieren tanto a la clase de "
+#~ "entidad como a la clase identificadora compuesta. "
+
+#~ msgid ""
+#~ "<literal>class</literal> (optional - but required for a mapped composite "
+#~ "identifier): the class used as a composite identifier."
+#~ msgstr ""
+#~ "<literal>class</literal> (opcional, pero requerida por un identificador "
+#~ "compuesto mapeado): La clase se utiliza como un identificador compuesto. "
+
+#~ msgid ""
+#~ "We will describe a third, even more convenient approach, where the "
+#~ "composite identifier is implemented as a component class in <xref linkend="
+#~ "\"components-compositeid\" />. The attributes described below apply only "
+#~ "to this alternative approach:"
+#~ msgstr ""
+#~ "Vamos a decribir un tercer enfoque, aún más práctico, en donde se "
+#~ "implementa el identificador compuesto como una clase componente en <xref "
+#~ "linkend=\"components-compositeid\"/>. Los atributos descritos a "
+#~ "continuación sólamente aplican a este enfoque alternativo:"
+
+#~ msgid ""
+#~ "<literal>name</literal> (optional - required for this approach): a "
+#~ "property of component type that holds the composite identifier. Please "
+#~ "see chapter 9 for more information."
+#~ msgstr ""
+#~ "<literal>name</literal> (opcional, se necesita para este enfoque): Una "
+#~ "propiedad de tipo componente que tiene el identificador compuesto. "
+#~ "Consulte el capítulo 9 para obtener mayor información. "
+
+#~ msgid ""
+#~ "<literal>class</literal> (optional - defaults to the property type "
+#~ "determined by reflection): the component class used as a composite "
+#~ "identifier. Please see the next section for more information."
+#~ msgstr ""
+#~ "<literal>class</literal> (opcional - por defecto es el tipo de propiedad "
+#~ "determinado por la reflección): la clase componente utilizada como un "
+#~ "identificador compuesto. Vea la siguiente sección para obtener mayor "
+#~ "información."
+
+#~ msgid ""
+#~ "The third approach, an <emphasis>identifier component</emphasis>, is "
+#~ "recommended for almost all applications."
+#~ msgstr ""
+#~ "Este tercer enfoque, un <emphasis>componente identificador</emphasis> es "
+#~ "el que recomendamos para casi todas las aplicaciones. "
+
+#~ msgid "Version (optional)"
+#~ msgstr "Versión (opcional)"
+
+#~ msgid ""
+#~ "The <literal><version></literal> element is optional and indicates "
+#~ "that the table contains versioned data. This is particularly useful if "
+#~ "you plan to use <emphasis>long transactions</emphasis>. See below for "
+#~ "more information:"
+#~ msgstr ""
+#~ "El elemento <literal><version></literal> es opcional e indica que "
+#~ "la tabla contiene datos versionados. Esto es particularmente útil si "
+#~ "planea utilizar <emphasis>transacciones largas</emphasis>. Vea a "
+#~ "continuación para obtener mayor información:"
+
+#~ msgid ""
+#~ "Version numbers can be of Hibernate type <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> or <literal>calendar</literal>."
+#~ msgstr ""
+#~ "Los números de versión pueden ser de tipo Hibernate <literal>long</"
+#~ "literal>, <literal>integer</literal>, <literal>short</literal>, "
+#~ "<literal>timestamp</literal> o <literal>calendar</literal>."
+
+#~ msgid "Many-to-one"
+#~ msgstr "Many-to-one"
+
+#~ msgid ""
+#~ "An ordinary association to another persistent class is declared using a "
+#~ "<literal>many-to-one</literal> element. The relational model is a many-to-"
+#~ "one association; a foreign key in one table is referencing the primary "
+#~ "key column(s) of the target table."
+#~ msgstr ""
+#~ "Una asociación ordinaria a otra clase persistente se declara utilizando "
+#~ "el elemento <literal>many-to-one</literal>. El modelo relacional es una "
+#~ "asociación muchos-a-uno; una clave foránea en una tabla referencia la "
+#~ "columna (o columnas) de la clave principal de la tabla destino."
+
+#~ msgid "One-to-one"
+#~ msgstr "One-to-one"
+
+#~ msgid "There are two varieties of one-to-one associations:"
+#~ msgstr "Existen dos variedades de asociaciones uno-a-uno: "
+
+#~ msgid "primary key associations"
+#~ msgstr "asociaciones de clave primaria"
+
+#~ msgid ""
+#~ "Alternatively, a foreign key with a unique constraint, from "
+#~ "<literal>Employee</literal> to <literal>Person</literal>, can be "
+#~ "expressed as:"
+#~ msgstr ""
+#~ "Opcionalmente, una clave foránea con una restricción de unicidad, desde "
+#~ "<literal>Employee</literal> a <literal>Person</literal>, se puede "
+#~ "expresar como:"
+
+#~ msgid ""
+#~ "This association can be made bidirectional by adding the following to the "
+#~ "<literal>Person</literal> mapping:"
+#~ msgstr ""
+#~ "Esta asociación puede hacerse bidireccional agregando lo siguiente al "
+#~ "mapeo de <literal>Person</literal>:"
+
+#~ msgid "Component and dynamic-component"
+#~ msgstr "Componente y componente dinámico"
+
+#~ msgid "Subclass"
+#~ msgstr "Subclase"
+
+#~ msgid ""
+#~ "A discriminator column is not required for this mapping strategy. Each "
+#~ "subclass must, however, declare a table column holding the object "
+#~ "identifier using the <literal><key></literal> element. The mapping "
+#~ "at the start of the chapter would then be re-written as:"
+#~ msgstr ""
+#~ "No se necesita una columna discriminadora para esta estrategia de mapeo. "
+#~ "Sin embargo, cada subclase debe declarar una columna de tabla que tenga "
+#~ "el identificador del objeto utilizando el elemento <literal><key></"
+#~ "literal>. El mapeo mencionado al comienzo del capítulo se reescribiría "
+#~ "así:"
+
+#~ msgid "Union-subclass"
+#~ msgstr "Union-subclass"
+
+#~ msgid "Join"
+#~ msgstr "Join"
+
+#~ msgid ""
+#~ "Using the <literal><join></literal> element, it is possible to map "
+#~ "properties of one class to several tables that have a one-to-one "
+#~ "relationship. For example:"
+#~ msgstr ""
+#~ "Al utilizar el elemento <literal><join></literal>, es posible "
+#~ "mapear las propiedades de una clase a varias tablas que tengan una "
+#~ "relación uno-a-uno. Por ejemplo:"
+
+#~ msgid "Key"
+#~ msgstr "Key"
+
+#~ msgid "Any"
+#~ msgstr "Any"
+
+#~ msgid "<literal>class</literal>"
+#~ msgstr "<literal>class</literal>"
+
+#~ msgid "<literal>text</literal>"
+#~ msgstr "<literal>text</literal>"
+
+#~ msgid "<literal>clob, blob</literal>"
+#~ msgstr "<literal>clob, blob</literal>"
+
+#~ msgid ""
+#~ "XML does not suit all users so there are some alternative ways to define "
+#~ "O/R mapping metadata in Hibernate."
+#~ msgstr ""
+#~ "XML no es para todo el mundo, así que hay algunas formas opcionales de "
+#~ "definir metadatos de mapeo O/R en Hibernate."
+
+#~ msgid "Using XDoclet markup"
+#~ msgstr "Utilización de marcado de XDoclet"
+
+#~ msgid ""
+#~ "Many Hibernate users prefer to embed mapping information directly in "
+#~ "sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not "
+#~ "cover this approach in this reference guide since it is considered part "
+#~ "of XDoclet. However, we include the following example of the "
+#~ "<literal>Cat</literal> class with XDoclet mappings:"
+#~ msgstr ""
+#~ "Muchos usuarios de Hibernate prefieren incluir la información de mapeo "
+#~ "directamente en el código fuente usando las <literal>@hibernate.tags</"
+#~ "literal> XDoclet. No abordaremos este enfoque en este manual de "
+#~ "referencia ya que se considera como parte de XDoclet. Sin embargo, "
+#~ "incluímos el siguiente ejemplo de la clase <literal>Cat</literal> con los "
+#~ "mapeos XDoclet:"
+
+#~ msgid ""
+#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
+#~ msgstr ""
+#~ "Para obtener más ejemplos de XDoclet e Hibernate consulte el sitio web de "
+#~ "Hibernate. "
+
+#~ msgid "Using JDK 5.0 Annotations"
+#~ msgstr "Utlización de Anotaciones JDK 5.0"
+
+#~ msgid ""
+#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
+#~ "are type-safe and checked at compile time. This mechanism is more "
+#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
+#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
+#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
+#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
+#~ "mechanism for entity beans. Hibernate3 implements the "
+#~ "<literal>EntityManager</literal> of JSR-220 (the persistence API). "
+#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
+#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
+#~ "220) and Hibernate3 metadata is supported."
+#~ msgstr ""
+#~ "JDK 5.0 introdujo anotaciones del estilo XDoclet a nivel del lenguaje con "
+#~ "chequeo seguro de tipos en tiempo de compilación. Este mecanismo es más "
+#~ "potente que las anotaciones XDoclet y es mejor soportado por herramientas "
+#~ "e IDEs. IntelliJ IDEA, por ejemplo, soporta auto-completación además de "
+#~ "resalte de sintaxis de las anotaciones JDK 5.0. La nueva revisión de la "
+#~ "especificación de EJB (JSR-220) utiliza anotaciones JDK 5.0 como el "
+#~ "mecanismo principal de metadatos para beans de entidad. Hibernate3 "
+#~ "implementa el <literal>EntityManager</literal> del JSR-220 (la API de "
+#~ "persistencia). El soporte para metadatos de mapeo está disponible por "
+#~ "medio del paquete <emphasis>Anotaciones de Hibernate</emphasis>, como una "
+#~ "descarga separada. Tanto los metadatos de EJB3 (JSR-220) como de "
+#~ "Hibernate3 se encuentran soportados."
+
+#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+#~ msgstr ""
+#~ "Este es un ejemplo de una clase POJO anotada como un bean de entidad EJB:"
+
+#~ msgid ""
+#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
+#~ "development. Please refer to the Hibernate Annotations module for more "
+#~ "details."
+#~ msgstr ""
+#~ "El soporte para las anotaciones JDK 5.0 (y JSR-220) todavía se encuentra "
+#~ "en progreso. Para obtener más información consulte al módulo de "
+#~ "anotaciones de Hibernate."
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/collection_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/collection_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/collection_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: collection_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 10:27+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,33 +24,52 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: collection_mapping.xml:31
#, no-c-format
msgid "Collection mapping"
msgstr "Mapeos de colección "
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr "Colecciones persistentes"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:36
+#, fuzzy, no-c-format
msgid ""
-"Hibernate requires that persistent collection-valued fields be declared as "
-"an interface type. For example:"
+"Naturally Hibernate also allows to persist collections. These persistent "
+"collections can contain almost any other Hibernate type, including: basic "
+"types, custom types, components and references to other entities. The "
+"distinction between value and reference semantics is in this context very "
+"important. An object in a collection might be handled with \"value\" "
+"semantics (its life cycle fully depends on the collection owner), or it "
+"might be a reference to another entity with its own life cycle. In the "
+"latter case, only the \"link\" between the two objects is considered to be a "
+"state held by the collection."
msgstr ""
-"Hibernate requiere que los campos valuados en colección persistente se "
-"declaren como un tipo de interfaz. Por ejemplo:"
+"Las colecciones pueden contener casi cualquier tipo de Hibernate, "
+"incluyendo: los tipos básicos, personalizados, componentes y referencias a "
+"otras entidades. Esta es una diferencia importante. Un objeto en una "
+"colección puede ser manejado con una semántica de \"valor\" (su ciclo de "
+"vida depende completamente del propietario de la colección) o podría ser una "
+"referencia a otra entidad, con su propio ciclo de vida. En el último caso, "
+"sólamente el \"enlace\" entre los dos objetos se considera como un estado "
+"mantenido por la colección."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:46
+#, fuzzy, no-c-format
msgid ""
-"The actual interface might be <literal>java.util.Set</literal>, "
+"As a requirement persistent collection-valued fields must be declared as an "
+"interface type (see <xref linkend=\"example.collection.mapping.annotations\"/"
+">). The actual interface might be <literal>java.util.Set</literal>, "
"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
"<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, "
"<literal>java.util.SortedMap</literal> or anything you like (\"anything you "
"like\" means you will have to write an implementation of <literal>org."
-"hibernate.usertype.UserCollectionType</literal>.)"
+"hibernate.usertype.UserCollectionType</literal>)."
msgstr ""
"La interfaz real puede ser <literal>java.util.Set</literal>, <literal>java."
"util.Collection</literal>, <literal>java.util.List</literal>, <literal>java."
@@ -60,15 +79,17 @@
"hibernate.usertype.UserCollectionType</literal>)."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:57
+#, fuzzy, no-c-format
msgid ""
-"Notice how the instance variable was initialized with an instance of "
-"<literal>HashSet</literal>. This is the best way to initialize collection "
+"Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the "
+"instance variable <literal>parts</literal> was initialized with an instance "
+"of <literal>HashSet</literal>. This is the best way to initialize collection "
"valued properties of newly instantiated (non-persistent) instances. When you "
-"make the instance persistent, by calling <literal>persist()</literal> for "
-"example, Hibernate will actually replace the <literal>HashSet</literal> with "
-"an instance of Hibernate's own implementation of <literal>Set</literal>. Be "
-"aware of the following errors:"
+"make the instance persistent, by calling <literal>persist()</literal>, "
+"Hibernate will actually replace the <literal>HashSet</literal> with an "
+"instance of Hibernate's own implementation of <literal>Set</literal>. Be "
+"aware of the following error:"
msgstr ""
"Note cómo se inicializó la variable de instancia con una instancia de "
"<literal>HashSet</literal>. Esta es la mejor forma de inicializar las "
@@ -78,7 +99,30 @@
"<literal>HashSet</literal> con una instancia de una implementación de "
"<literal>Set</literal> propia de Hibernate. Observe los siguientes errores:"
+#. Tag: title
+#: collection_mapping.xml:68
+#, no-c-format
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:73
#, no-c-format
msgid ""
"The persistent collections injected by Hibernate behave like "
@@ -92,6 +136,7 @@
"dependiendo del tipo de interfaz. "
#. Tag: para
+#: collection_mapping.xml:78
#, no-c-format
msgid ""
"Collections instances have the usual behavior of value types. They are "
@@ -114,66 +159,347 @@
"y una colección vacía."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:89
+#, fuzzy, no-c-format
msgid ""
"Use persistent collections the same way you use ordinary Java collections. "
-"However, please ensure you understand the semantics of bidirectional "
-"associations (these are discussed later)."
+"However, ensure you understand the semantics of bidirectional associations "
+"(see <xref linkend=\"collections-bidirectional\"/>)."
msgstr ""
"Utilice las colecciones persistentes de la misma forma en que utiliza "
"colecciones de Java ordinarias. Sin embargo, asegúrese de que entiende la "
"semántica de las asociaciones bidireccionales (se discuten más adelante)."
#. Tag: title
+#: collection_mapping.xml:97
+#, fuzzy, no-c-format
+msgid "How to map collections"
+msgstr "Colecciones ordenadas"
+
+#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "Collection mappings"
-msgstr "Mapeos de colección"
+msgid ""
+"Using annotations you can map <classname>Collection</classname>s, "
+"<classname>List</classname>s, <classname>Map</classname>s and "
+"<classname>Set</classname>s of associated entities using @OneToMany and "
+"@ManyToMany. For collections of a basic or embeddable type use "
+"@ElementCollection. In the simplest case a collection mapping looks like "
+"this:"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinColumn(name=\"PART_ID\")\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:112
#, no-c-format
msgid ""
-"There are quite a range of mappings that can be generated for collections "
-"that cover many common relational models. We suggest you experiment with the "
-"schema generation tool so that you understand how various mapping "
-"declarations translate to database tables."
+"Product describes a unidirectional relationship with Part using the join "
+"column PART_ID. In this unidirectional one to many scenario you can also use "
+"a join table as seen in <xref linkend=\"example-one-to-many-with-join-table"
+"\"/>."
msgstr ""
-"Hay bastantes rangos de mapeos que se pueden generar para colecciones que "
-"cubren muchos modelos relacionales comúnes. Le recomendamos que experimente "
-"con la herramienta de generación de esquemas para comprender cómo se "
-"traducen varias declaraciones de mapeo a tablas de bases de datos."
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"PRODUCT_PARTS\",\n"
+" joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+" )\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:124
#, no-c-format
msgid ""
-"The Hibernate mapping element used for mapping a collection depends upon the "
-"type of interface. For example, a <literal><set></literal> element is "
-"used for mapping properties of type <literal>Set</literal>."
+"Without describing any physical mapping (no <classname>@JoinColumn</"
+"classname> or <classname>@JoinTable</classname>), a unidirectional one to "
+"many with join table is used. The table name is the concatenation of the "
+"owner table name, _, and the other side table name. The foreign key name(s) "
+"referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:135
+#, fuzzy, no-c-format
+msgid ""
+"Lets have a look now how collections are mapped using Hibernate mapping "
+"files. In this case the first step is to chose the right mapping element. It "
+"depends on the type of interface. For example, a <literal><set></"
+"literal> element is used for mapping properties of type <literal>Set</"
+"literal>."
+msgstr ""
"El elemento de mapeo de Hibernate usado para mapear una colección depende "
"del tipo de la interfaz. Por ejemplo, un elemento <literal><set></"
"literal> se utiliza para mapear propiedades de tipo <literal>Set</literal>. "
+#. Tag: title
+#: collection_mapping.xml:142
+#, no-c-format
+msgid "Mapping a Set using <set>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, no-c-format
+msgid ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:147
+#, fuzzy, no-c-format
+msgid ""
+"In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many "
+"association</emphasis> links the <literal>Product</literal> and "
+"<literal>Part</literal> entities. This association requires the existence of "
+"a foreign key column and possibly an index column to the <literal>Part</"
+"literal> table. This mapping loses certain semantics of normal Java "
+"collections:"
+msgstr ""
+"Una asociación de <literal>Product</literal> a <literal>Part</literal> "
+"requiere la existencia de una columna clave foránea y posiblemente una "
+"columna índice a la tabla <literal>Part</literal>. Una etiqueta <literal><"
+"one-to-many></literal> indica que ésta es una asociación uno-a-muchos."
+
+#. Tag: para
+#: collection_mapping.xml:156
#, no-c-format
msgid ""
-"Apart from <literal><set></literal>, there is also <literal><"
-"list></literal>, <literal><map></literal>, <literal><bag></"
-"literal>, <literal><array></literal> and <literal><primitive-"
-"array></literal> mapping elements. The <literal><map></literal> "
-"element is representative:"
+"An instance of the contained entity class cannot belong to more than one "
+"instance of the collection."
msgstr ""
+"Una instancia de la clase entidad contenida no puede pertenecer a más de una "
+"instancia de la colección. "
+
+#. Tag: para
+#: collection_mapping.xml:161
+#, no-c-format
+msgid ""
+"An instance of the contained entity class cannot appear at more than one "
+"value of the collection index."
+msgstr ""
+"Una instancia de la clase entidad contenida no puede aparecer en más de un "
+"valor del índice de colección. "
+
+#. Tag: para
+#: collection_mapping.xml:166
+#, no-c-format
+msgid ""
+"Looking closer at the used <literal><one-to-many></literal> tag we see "
+"that it has the following options."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, no-c-format
+msgid ""
+"<one-to-many\n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:185
+#, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr "<literal>class</literal> (requerido): El nombre de la clase asociada. "
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, no-c-format
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how cached identifiers that reference missing rows will "
+"be handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal> (opcional - por defecto es <literal>exception</"
+"literal>): Especifica cómo serán manejados los identificadores en caché que "
+"referencien filas perdidas. <literal>ignore</literal> tratará una fila "
+"perdida como una asociación nula."
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class, as an alternative to <literal>class</literal>."
+msgstr ""
+"<literal>entity-name</literal> (opcional): El nombre de entidad de la clase "
+"asociada como una alternativa para <literal>class</literal>. "
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, no-c-format
+msgid ""
+"The <literal><one-to-many></literal> element does not need to declare "
+"any columns. Nor is it necessary to specify the <literal>table</literal> "
+"name anywhere."
+msgstr ""
+"El elemento <literal><one-to-many></literal> no necesita declarar "
+"ninguna columna. Ni es necesario especificar el nombre de <literal>table</"
+"literal> en ningún sitio."
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, fuzzy, no-c-format
+msgid ""
+"If the foreign key column of a <literal><one-to-many></literal> "
+"association is declared <literal>NOT NULL</literal>, you must declare the "
+"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
+"or <emphasis>use a bidirectional association</emphasis> with the collection "
+"mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend="
+"\"collections-bidirectional\"/>."
+msgstr ""
+"Si la columna de la clave foránea de una asociación <literal><one-to-"
+"many></literal> se declara <literal>NOT NULL</literal>, debe declarar el "
+"mapeo de <literal><key></literal><literal>not-null=\"true\"</literal> "
+"o <emphasis> utilizar una asociación bidireccional</emphasis> con el mapeo "
+"de colección marcado <literal>inverse=\"true\"</literal>. Vea la discusión "
+"sobre asociaciones bidireccionales más adelante en este capítulo para "
+"obtener mayor información."
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, fuzzy, no-c-format
+msgid ""
+"Apart from the <literal><set> </literal>tag as shown in <xref linkend="
+"\"example.collections.set\"/>, there is also <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> and <literal><primitive-array></"
+"literal> mapping elements. The <literal><map></literal> element is "
+"representative:"
+msgstr ""
"Aparte de <literal><set></literal>, existen además los elementos de "
"mapeo <literal><list></literal>, <literal><map></literal>, "
"<literal><bag></literal>, <literal><array></literal> y "
"<literal><primitive-array></literal>. El elemento <literal><map>"
"</literal> es representativo:"
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, no-c-format
+msgid ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:266
#, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr "<literal>name</literal>: el nombre de la propiedad de colección"
#. Tag: para
+#: collection_mapping.xml:270
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to property name): the name of "
@@ -184,6 +510,7 @@
"asociaciones uno-a-muchos."
#. Tag: para
+#: collection_mapping.xml:276
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): the name of a table schema to override "
@@ -193,6 +520,7 @@
"sobrescribir el esquema declarado en el elemento raíz"
#. Tag: para
+#: collection_mapping.xml:281
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
@@ -208,6 +536,7 @@
"inicializan la colección. Esto es apropiado para colecciones grandes."
#. Tag: para
+#: collection_mapping.xml:290
#, no-c-format
msgid ""
"<literal>inverse</literal> (optional - defaults to <literal>false</"
@@ -219,6 +548,7 @@
"asociación bidireccional."
#. Tag: para
+#: collection_mapping.xml:296
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional - defaults to <literal>none</literal>): "
@@ -228,6 +558,7 @@
"literal>): habilita operaciones en cascada para entidades hijas."
#. Tag: para
+#: collection_mapping.xml:302
#, no-c-format
msgid ""
"<literal>sort</literal> (optional): specifies a sorted collection with "
@@ -237,12 +568,13 @@
"ordenamiento <literal>natural</literal>, o una clase comparadora dada."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:308
+#, fuzzy, no-c-format
msgid ""
-"<literal>order-by</literal> (optional, JDK1.4 only): specifies a table "
-"column or columns that define the iteration order of the <literal>Map</"
-"literal>, <literal>Set</literal> or bag, together with an optional "
-"<literal>asc</literal> or <literal>desc</literal>."
+"<literal>order-by</literal> (optional): specifies a table column or columns "
+"that define the iteration order of the <literal>Map</literal>, <literal>Set</"
+"literal> or bag, together with an optional <literal>asc</literal> or "
+"<literal>desc</literal>."
msgstr ""
"<literal>order-by</literal> (opcional, sólamente en JDK1.4): especifica una "
"columna de tabla o columnas que definen el orden de iteración del "
@@ -250,6 +582,7 @@
"<literal>asc</literal> o <literal>desc</literal> opcional."
#. Tag: para
+#: collection_mapping.xml:316
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -263,6 +596,7 @@
"subconjunto de los datos disponibles."
#. Tag: para
+#: collection_mapping.xml:324
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional, defaults to <literal>select</literal>): "
@@ -275,6 +609,7 @@
"secuencial."
#. Tag: para
+#: collection_mapping.xml:331
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): "
@@ -285,6 +620,7 @@
"instancias de esta colección."
#. Tag: para
+#: collection_mapping.xml:337
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -296,6 +632,7 @@
"propiedad de colección."
#. Tag: para
+#: collection_mapping.xml:343
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -309,6 +646,7 @@
"muchos, es posible que quiera deshabilitar esta opción."
#. Tag: para
+#: collection_mapping.xml:351
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -321,19 +659,31 @@
"la colección nunca cambian. En algunos casos, esto permite una pequeña "
"optimización de rendimiento."
+#. Tag: para
+#: collection_mapping.xml:360
+#, no-c-format
+msgid ""
+"After exploring the basic mapping of collections in the preceding paragraphs "
+"we will now focus details like physical mapping considerations, indexed "
+"collections and collections of value types."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr "Claves foráneas de colección"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:367
+#, fuzzy, no-c-format
msgid ""
-"Collection instances are distinguished in the database by the foreign key of "
-"the entity that owns the collection. This foreign key is referred to as the "
-"<emphasis>collection key column</emphasis>, or columns, of the collection "
-"table. The collection key column is mapped by the <literal><key></"
-"literal> element."
+"On the database level collection instances are distinguished by the foreign "
+"key of the entity that owns the collection. This foreign key is referred to "
+"as the <emphasis>collection key column</emphasis>, or columns, of the "
+"collection table. The collection key column is mapped by the "
+"<literal>@JoinColumn</literal> annotation respectively the <literal><"
+"key></literal> XML element."
msgstr ""
"Las instancias de colección se distinguen en la base de datos por la clave "
"foránea de la entidad que posee la colección. Se hace referencia a esta "
@@ -342,12 +692,12 @@
"literal> mapea la columna clave de la colección."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:374
+#, fuzzy, no-c-format
msgid ""
"There can be a nullability constraint on the foreign key column. For most "
"collections, this is implied. For unidirectional one-to-many associations, "
-"the foreign key column is nullable by default, so you may need to specify "
-"<literal>not-null=\"true\"</literal>."
+"the foreign key column is nullable by default, so you may need to specify"
msgstr ""
"Puede haber una restricción de nulabilidad sobre la columna de clave "
"foránea. Para la mayoría de las colecciones, esto es implícito. Para "
@@ -355,167 +705,290 @@
"nulable por defecto, de modo que puede que necesite especificar <literal>not-"
"null=\"true\"</literal>."
+#. Tag: programlisting
+#: collection_mapping.xml:379
+#, no-c-format
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:381
#, no-c-format
-msgid "The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
+msgid "<para>or</para>"
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:383
+#, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:385
+#, fuzzy, no-c-format
+msgid ""
+"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In "
+"XML this can be expressed via:"
+msgstr ""
"La restricción de clave foránea puede utilizar <literal>ON DELETE CASCADE</"
"literal>."
+#. Tag: programlisting
+#: collection_mapping.xml:388
+#, no-c-format
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:390
#, no-c-format
msgid ""
-"See the previous chapter for a full definition of the <literal><key></"
-"literal> element."
+"In annotations the Hibernate specific annotation @OnDelete has to be used."
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:393
+#, no-c-format
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:395
+#, fuzzy, no-c-format
+msgid ""
+"See <xref lang=\"\" linkend=\"section.key\"/> for more information about the "
+"<literal><key></literal> element."
+msgstr ""
"Vea el capítulo anterior para obtener una definición completa del elemento "
"<literal><key></literal>."
#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
-msgid "Collection elements"
-msgstr "Elementos de collección"
+msgid "Indexed collections"
+msgstr "Colecciones indexadas"
#. Tag: para
+#: collection_mapping.xml:402
#, no-c-format
msgid ""
-"Collections can contain almost any other Hibernate type, including: basic "
-"types, custom types, components and references to other entities. This is an "
-"important distinction. An object in a collection might be handled with "
-"\"value\" semantics (its life cycle fully depends on the collection owner), "
-"or it might be a reference to another entity with its own life cycle. In the "
-"latter case, only the \"link\" between the two objects is considered to be a "
-"state held by the collection."
+"In the following paragraphs we have a closer at the indexed collections "
+"<classname>List</classname> and <classname>Map</classname> how the their "
+"index can be mapped in Hibernate."
msgstr ""
-"Las colecciones pueden contener casi cualquier tipo de Hibernate, "
-"incluyendo: los tipos básicos, personalizados, componentes y referencias a "
-"otras entidades. Esta es una diferencia importante. Un objeto en una "
-"colección puede ser manejado con una semántica de \"valor\" (su ciclo de "
-"vida depende completamente del propietario de la colección) o podría ser una "
-"referencia a otra entidad, con su propio ciclo de vida. En el último caso, "
-"sólamente el \"enlace\" entre los dos objetos se considera como un estado "
-"mantenido por la colección."
+#. Tag: title
+#: collection_mapping.xml:407
+#, no-c-format
+msgid "Lists"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
+msgid "Lists can be mapped in two different ways:"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:413
+#, no-c-format
+msgid "as ordered lists, where the order is not materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:418
+#, no-c-format
+msgid "as indexed lists, where the order is materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:423
+#, no-c-format
msgid ""
-"The contained type is referred to as the <emphasis>collection element type</"
-"emphasis>. Collection elements are mapped by <literal><element></"
-"literal> or <literal><composite-element></literal>, or in the case of "
-"entity references, with <literal><one-to-many></literal> or "
-"<literal><many-to-many></literal>. The first two map elements with "
-"value semantics, the next two are used to map entity associations."
+"To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> "
+"to your property. This annotation takes as parameter a list of comma "
+"separated properties (of the target entity) and orders the collection "
+"accordingly (eg <code>firstname asc, age desc</code>), if the string is "
+"empty, the collection will be ordered by the primary key of the target "
+"entity."
msgstr ""
-"Se hace referencia al tipo contenido como el <emphasis>tipo de elemento de "
-"la colección</emphasis>. Los elementos de colección son mapeados por "
-"<literal><element></literal> o <literal><composite-element></"
-"literal>, o en el caso de referencias de entidades, con <literal><one-to-"
-"many></literal> o <literal><many-to-many></literal>. Las dos "
-"primeras mapean elementos con semántica de valor, los dos siguientes se "
-"utilizan para mapear asociaciones de entidades."
#. Tag: title
+#: collection_mapping.xml:432
#, no-c-format
-msgid "Indexed collections"
-msgstr "Colecciones indexadas"
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:434
#, no-c-format
msgid ""
-"All collection mappings, except those with set and bag semantics, need an "
-"<emphasis>index column</emphasis> in the collection table. An index column "
-"is a column that maps to an array index, or <literal>List</literal> index, "
-"or <literal>Map</literal> key. The index of a <literal>Map</literal> may be "
-"of any basic type, mapped with <literal><map-key></literal>. It can be "
-"an entity reference mapped with <literal><map-key-many-to-many></"
-"literal>, or it can be a composite type mapped with <literal><composite-"
-"map-key></literal>. The index of an array or list is always of type "
-"<literal>integer</literal> and is mapped using the <literal><list-"
-"index></literal> element. The mapped column contains sequential integers "
-"that are numbered from zero by default."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderBy(\"number\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"Todos los mapeos de colección, excepto aquellos con semántica de set o bag, "
-"necesitan una <emphasis>columna índice</emphasis> en la tabla de colección. "
-"Una columna índice es una columna que mapea a un índice de array o índice de "
-"<literal>List</literal> o llave de <literal>Map</literal>. El índice de un "
-"<literal>Map</literal> puede ser de cualquier tipo básico, mapeado con "
-"<literal><map-key></literal>. Puede ser una referencia de entidad "
-"mapeada con <literal><map-key-many-to-many></literal>, o puede ser un "
-"tipo compuesto mapeado con <literal><composite-map-key></literal>. El "
-"índice de un array o lista es siempre de tipo <literal>integer</literal> y "
-"se mapea utilizando el elemento <literal><list-index></literal>. La "
-"columna mapeada contiene enteros secuenciales numerados desde cero, por "
-"defecto."
#. Tag: para
+#: collection_mapping.xml:437
#, no-c-format
msgid ""
-"<literal>column_name</literal> (required): the name of the column holding "
-"the collection index values."
+"To store the index value in a dedicated column, use the <classname>@javax."
+"persistence.OrderColumn</classname> annotation on your property. This "
+"annotations describes the column name and attributes of the column keeping "
+"the index value. This column is hosted on the table containing the "
+"association foreign key. If the column name is not specified, the default is "
+"the name of the referencing property, followed by underscore, followed by "
+"<literal>ORDER</literal> (in the following example, it would be "
+"<literal>orders_ORDER</literal>)."
msgstr ""
-"<literal>column_name</literal> (requerido): el nombre de la columna que "
-"tiene los valores del índice de la colección."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:448
#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
msgid ""
-"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
-"value of the index column that corresponds to the first element of the list "
-"or array."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderColumn(name=\"orders_index\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|--------------| |----------|\n"
+"| Order | | Customer |\n"
+"|--------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"| orders_order |\n"
+"|--------------|"
msgstr ""
-"<literal>base</literal> (opcional - por defecto es <literal>0</literal>): el "
-"valor de la columna índice que corresponde al primer elemento de la lista o "
-"el array."
#. Tag: para
+#: collection_mapping.xml:455
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection index values."
+"We recommend you to convert <classname>the legacy @org.hibernate.annotations."
+"IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless "
+"you are making use of the base property. The <literal>base</literal> "
+"property lets you define the index value of the first element (aka as base "
+"index). The usual value is <literal>0</literal> or <literal>1</literal>. The "
+"default is 0 like in Java."
msgstr ""
-"<literal>column</literal> (opcional): el nombre de la columna que tiene los "
-"valores del índice de colecciones."
#. Tag: para
+#: collection_mapping.xml:464
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
-"key of the map."
+"Looking again at the Hibernate mapping file equivalent, the index of an "
+"array or list is always of type <literal>integer</literal> and is mapped "
+"using the <literal><list-index></literal> element. The mapped column "
+"contains sequential integers that are numbered from zero by default."
msgstr ""
-"<literal>formula</literal> (opcional): una fórmula SQL que se usa para "
-"evaluar la clave del mapa."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:471
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
-msgstr "<literal>type</literal> (requerido): el tipo de las claves del mapa."
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:481
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the foreign key column for "
-"the collection index values."
+"<list-index\n"
+" column=\"column_name\"\n"
+" base=\"0|1|...\"/>"
msgstr ""
-"<literal>column</literal> (opcional): el nombre de la columna de la clave "
-"foránea para los valores del índice de la colección."
#. Tag: para
+#: collection_mapping.xml:485
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
-"foreign key of the map key."
+"<literal>column_name</literal> (required): the name of the column holding "
+"the collection index values."
msgstr ""
-"<literal>formula</literal> (opcional): una fórmula SQ utilizada para evaluar "
-"la clave foránea de la clave de mapeos."
+"<literal>column_name</literal> (requerido): el nombre de la columna que "
+"tiene los valores del índice de la colección."
#. Tag: para
+#: collection_mapping.xml:490
#, no-c-format
-msgid "<literal>class</literal> (required): the entity class used as the map key."
+msgid ""
+"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
+"value of the index column that corresponds to the first element of the list "
+"or array."
msgstr ""
-"<literal>class</literal> (requerido): La clase de entidad que se usa como la "
-"clave mapeada. "
+"<literal>base</literal> (opcional - por defecto es <literal>0</literal>): el "
+"valor de la columna índice que corresponde al primer elemento de la lista o "
+"el array."
#. Tag: para
+#: collection_mapping.xml:498
#, no-c-format
msgid ""
"If your table does not have an index column, and you still wish to use "
@@ -531,310 +1004,590 @@
"ordenado o clasificado de manera opcional."
#. Tag: title
+#: collection_mapping.xml:506
#, no-c-format
-msgid "Collections of values and many-to-many associations"
-msgstr "Colecciones de valores y asociaciones muchos-a-muchos"
+msgid "Maps"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:508
#, no-c-format
msgid ""
-"Any collection of values or many-to-many associations requires a dedicated "
-"<emphasis>collection table</emphasis> with a foreign key column or columns, "
-"<emphasis>collection element column</emphasis> or columns, and possibly an "
-"index column or columns."
+"The question with <classname>Map</classname>s is where the key value is "
+"stored. There are everal options. Maps can borrow their keys from one of the "
+"associated entity properties or have dedicated columns to store an explicit "
+"key."
msgstr ""
-"Cualquier colección de valores o asociación muchos-a-muchos requiere una "
-"<emphasis>tabla de colección</emphasis> dedicada con una columna o columnas "
-"de clave foránea, <emphasis>columna de elemento de colección</emphasis> o "
-"columnas y posiblemente una columna o columnas índices."
#. Tag: para
+#: collection_mapping.xml:513
#, no-c-format
msgid ""
-"For a collection of values use the <literal><element></literal> tag. "
-"For example:"
+"To use one of the target entity property as a key of the map, use "
+"<literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</"
+"literal> is a property name in the target entity. When using "
+"<literal>@MapKey</literal> without the name attribuate, 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, "
+"because the map key 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."
msgstr ""
-"Para una colección de valores utilice la etiqueta <literal><element></"
-"literal>. Por ejemplo:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:525
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection element values."
+"Use of target entity property as map key via <classname>@MapKey</classname>"
msgstr ""
-"<literal>column</literal> (opcional): el nombre de la columna que tiene los "
-"valores de los elementos de la colección."
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:528
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @MapKey(name=\"number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> order) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"<literal>formula</literal> (opcional): una fórmula SQL utilizada para "
-"evaluar el elemento."
#. Tag: para
+#: collection_mapping.xml:531
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
-msgstr "<literal>type</literal> (requerido): el tipo del elemento de colección."
+msgid ""
+"Alternatively the map key is mapped to a dedicated column or columns. In "
+"order to customize the mapping use one of the following annotations:"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:537
#, no-c-format
msgid ""
-"A <emphasis>many-to-many association</emphasis> is specified using the "
-"<literal><many-to-many></literal> element."
+"@<classname>MapKeyColumn</classname> if the map key is a basic type. If you "
+"don't specify the column name, the name of the property followed by "
+"underscore followed by <literal>KEY</literal> is used (for example "
+"<literal>orders_KEY</literal>)."
msgstr ""
-"Una <emphasis>asociación muchos-a-muchos</emphasis> se especifica usando el "
-"elemento <literal><many-to-many></literal>."
#. Tag: para
+#: collection_mapping.xml:544
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the element foreign key "
-"column."
+"<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</"
+"classname> if the map key type is respectively an enum or a <classname>Date</"
+"classname>."
msgstr ""
-"<literal>column</literal> (opcional): el nombre de la columna de clave "
-"foránea elemento."
#. Tag: para
+#: collection_mapping.xml:550
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element foreign key value."
+"<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</"
+"classname> if the map key type is another entity."
msgstr ""
-"<literal>formula</literal> (opcional): una fórmula SQL utilizada para "
-"evaluar el valor de la clave foránea elemento."
#. Tag: para
+#: collection_mapping.xml:555
#, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
-msgstr "<literal>class</literal> (requerido): El nombre de la clase asociada. "
+msgid ""
+"<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</"
+"classname> when the map key is a embeddable object. Use <literal>key.</"
+"literal> as a prefix for your embeddable object property names."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:562
#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"enables outer-join or sequential select fetching for this association. This "
-"is a special case; for full eager fetching in a single <literal>SELECT</"
-"literal> of an entity and its many-to-many relationships to other entities, "
-"you would enable <literal>join</literal> fetching,not only of the collection "
-"itself, but also with this attribute on the <literal><many-to-many></"
-"literal> nested element."
+"You can also use <classname>@MapKeyClass</classname> to define the type of "
+"the key if you don't use generics."
msgstr ""
-"<literal>fetch</literal> (opcional - por defecto es <literal>join</"
-"literal>): habilita la búsqueda de selects secuenciales o de unión externa "
-"para esta asociación. Este es un caso especial; para búsqueda temprana "
-"completa en un solo <literal>SELECT</literal> de una entidad y sus "
-"relaciones muchos-a-muchos con otras entidades, habilitaría la búsqueda "
-"<literal>join</literal>,no solo de la colección misma, si no también con "
-"este atributo en el elemento anidado <literal><many-to-many></literal>."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:566
#, no-c-format
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional): enables the DDL generation of a unique "
-"constraint for the foreign-key column. This makes the association "
-"multiplicity effectively one-to-many."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+" @MapKeyColumn(name=\"orders_number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> orders) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------| |---------------|\n"
+"| Order | | Customer | | Cust_Order |\n"
+"|-------------| |----------| |---------------|\n"
+"| id | | id | | customer_id |\n"
+"| number | |----------| | order_id |\n"
+"| customer_id | | orders_number |\n"
+"|-------------| |---------------|"
msgstr ""
-"<literal>unique</literal> (opcional): habilita la generación DDL de una "
-"restricción única para la columna de la clave foránea. Esto hace la "
-"multiplicidad de la asociación efectivamente uno-a-muchos."
#. Tag: para
+#: collection_mapping.xml:573
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how foreign keys that reference missing rows will be "
-"handled: <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</"
+"classname> to the new standard approach described above"
msgstr ""
-"<literal>not-found</literal> (opcional - por defecto es <literal>exception</"
-"literal>): Especifica cómo serán manejadas las claves foráneas que hacen "
-"referencia a filas que falten: <literal>ignore</literal> tratará una fila "
-"que falte como una asociación nula."
#. Tag: para
+#: collection_mapping.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files there exists equivalent concepts to the "
+"descibed annotations. You have to use <literal><map-key></literal>, "
+"<literal><map-key-many-to-many></literal> and <literal><composite-"
+"map-key></literal>. <literal><map-key></literal> is used for any "
+"basic type, <literal><map-key-many-to-many></literal> for an entity "
+"reference and <literal><composite-map-key></literal> for a composite "
+"type."
+msgstr ""
+"Aparte de <literal><set></literal>, existen además los elementos de "
+"mapeo <literal><list></literal>, <literal><map></literal>, "
+"<literal><bag></literal>, <literal><array></literal> y "
+"<literal><primitive-array></literal>. El elemento <literal><map>"
+"</literal> es representativo:"
+
+#. Tag: title
+#: collection_mapping.xml:590
#, no-c-format
+msgid "map-key xml mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
msgid ""
-"<literal>entity-name</literal> (optional): the entity name of the associated "
-"class, as an alternative to <literal>class</literal>."
+"<map-key\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"type_name\"\n"
+" node=\"@attribute-name\"\n"
+" length=\"N\"/>"
msgstr ""
-"<literal>entity-name</literal> (opcional): El nombre de entidad de la clase "
-"asociada como una alternativa para <literal>class</literal>. "
#. Tag: para
+#: collection_mapping.xml:605
#, no-c-format
msgid ""
-"<literal>property-ref</literal> (optional): the name of a property of the "
-"associated class that is joined to this foreign key. If not specified, the "
-"primary key of the associated class is used."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection index values."
msgstr ""
-"<literal>property-ref</literal> (opcional): el nombre de una propiedad de la "
-"clase asociada que está unida a esta clave foránea. Si no se especifica "
-"entonces se utiliza la clave principal de la clase asociada."
+"<literal>column</literal> (opcional): el nombre de la columna que tiene los "
+"valores del índice de colecciones."
#. Tag: para
+#: collection_mapping.xml:610
#, no-c-format
-msgid "Here are some examples."
-msgstr "Aquí tiene algunos ejemplos:"
+msgid ""
+"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
+"key of the map."
+msgstr ""
+"<literal>formula</literal> (opcional): una fórmula SQL que se usa para "
+"evaluar la clave del mapa."
#. Tag: para
+#: collection_mapping.xml:615
#, no-c-format
-msgid "A set of strings:"
-msgstr "Un grupo de cadenas:"
+msgid "<literal>type</literal> (required): the type of the map keys."
+msgstr "<literal>type</literal> (requerido): el tipo de las claves del mapa."
+#. Tag: title
+#: collection_mapping.xml:623
+#, fuzzy, no-c-format
+msgid "map-key-many-to-many"
+msgstr "muchos-a-muchos"
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
+#, no-c-format
+msgid ""
+"<map-key-many-to-many\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" class=\"ClassName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:638
#, no-c-format
msgid ""
-"A bag containing integers with an iteration order determined by the "
-"<literal>order-by</literal> attribute:"
+"<literal>column</literal> (optional): the name of the foreign key column for "
+"the collection index values."
msgstr ""
-"Un bag que contiene enteros con un orden de iteración determinado por el "
-"atributo <literal>order-by</literal>:"
+"<literal>column</literal> (opcional): el nombre de la columna de la clave "
+"foránea para los valores del índice de la colección."
#. Tag: para
+#: collection_mapping.xml:643
#, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
-msgstr "Una lista de entidades, en este caso, una asociación muchos-a-muchos:"
+msgid ""
+"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
+"foreign key of the map key."
+msgstr ""
+"<literal>formula</literal> (opcional): una fórmula SQ utilizada para evaluar "
+"la clave foránea de la clave de mapeos."
#. Tag: para
+#: collection_mapping.xml:648
#, no-c-format
-msgid "A map from string indices to dates:"
-msgstr "Un mapeo de índices de cadenas a fechas:"
+msgid ""
+"<literal>class</literal> (required): the entity class used as the map key."
+msgstr ""
+"<literal>class</literal> (requerido): La clase de entidad que se usa como la "
+"clave mapeada. "
+#. Tag: title
+#: collection_mapping.xml:658
+#, fuzzy, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr "Colecciones de valores y asociaciones muchos-a-muchos"
+
#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
-msgstr "Una lista de componentes (se discuten en el siguiente capítulo):"
+msgid ""
+"In some situations you don't need to associate two entities but simply "
+"create a collection of basic types or embeddable objects. Use the "
+"<classname>@ElementCollection</classname> for this case."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:665
#, no-c-format
-msgid "One-to-many associations"
-msgstr "Asociaciones uno-a-muchos"
+msgid ""
+"Collection of basic types mapped via <classname>@ElementCollection</"
+"classname>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @Column(name=\"nickname\")\n"
+" public Set<String> getNicknames() { ... } \n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:671
#, no-c-format
msgid ""
-"A <emphasis>one-to-many association</emphasis> links the tables of two "
-"classes via a foreign key with no intervening collection table. This mapping "
-"loses certain semantics of normal Java collections:"
+"The collection table holding the collection data is set using the "
+"<classname>@CollectionTable</classname> annotation. If omitted the "
+"collection table name defaults to the concatenation of the name of the "
+"containing entity and the name of the collection attribute, separated by an "
+"underscore. In our example, it would be <literal>User_nicknames</literal>."
msgstr ""
-"Una <emphasis>asociación uno-a-muchos</emphasis> enlaza las tablas de dos "
-"clases por medio de una clave foránea, sin intervención de tabla de "
-"colección alguna. Este mapeo pierde cierta semántica de colecciones Java "
-"normales: "
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot belong to more than one "
-"instance of the collection."
+"The column holding the basic type is set using the <classname>@Column</"
+"classname> annotation. If omitted, the column name defaults to the property "
+"name: in our example, it would be <literal>nicknames</literal>."
msgstr ""
-"Una instancia de la clase entidad contenida no puede pertenecer a más de una "
-"instancia de la colección. "
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot appear at more than one "
-"value of the collection index."
+"But you are not limited to basic types, the collection type can be any "
+"embeddable object. To override the columns of the embeddable object in the "
+"collection table, use the <classname>@AttributeOverride</classname> "
+"annotation."
msgstr ""
-"Una instancia de la clase entidad contenida no puede aparecer en más de un "
-"valor del índice de colección. "
+#. Tag: title
+#: collection_mapping.xml:689
+#, no-c-format
+msgid "@ElementCollection for embeddable objects"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:691
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street"
+"\"))\n"
+" })\n"
+" public Set<Address> getAddresses() { ... } \n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" public String getStreet1() {...}\n"
+" [...]\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:694
#, no-c-format
+msgid "Such an embeddable object cannot contains a collection itself."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:698
+#, no-c-format
msgid ""
-"An association from <literal>Product</literal> to <literal>Part</literal> "
-"requires the existence of a foreign key column and possibly an index column "
-"to the <literal>Part</literal> table. A <literal><one-to-many></"
-"literal> tag indicates that this is a one-to-many association."
+"in <classname>@AttributeOverride</classname>, you must use the "
+"<literal>value.</literal> prefix to override properties of the embeddable "
+"object used in the map value and the <literal>key.</literal> prefix to "
+"override properties of the embeddable object used in the map key."
msgstr ""
-"Una asociación de <literal>Product</literal> a <literal>Part</literal> "
-"requiere la existencia de una columna clave foránea y posiblemente una "
-"columna índice a la tabla <literal>Part</literal>. Una etiqueta <literal><"
-"one-to-many></literal> indica que ésta es una asociación uno-a-muchos."
+#. Tag: programlisting
+#: collection_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" @ElementCollection\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"key.street1\", column=@Column(name="
+"\"fld_street\")),\n"
+" @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note"
+"\"))\n"
+" })\n"
+" public Map<Address,Rating> getFavHomes() { ... }"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:708
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how cached identifiers that reference missing rows will "
-"be handled. <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"CollectionOfElements</classname> to the new <classname>@ElementCollection</"
+"classname> annotation."
msgstr ""
-"<literal>not-found</literal> (opcional - por defecto es <literal>exception</"
-"literal>): Especifica cómo serán manejados los identificadores en caché que "
-"referencien filas perdidas. <literal>ignore</literal> tratará una fila "
-"perdida como una asociación nula."
#. Tag: para
+#: collection_mapping.xml:714
+#, fuzzy, no-c-format
+msgid ""
+"Using the mapping file approach a collection of values is mapped using the "
+"<literal><element></literal> tag. For example:"
+msgstr ""
+"Para una colección de valores utilice la etiqueta <literal><element></"
+"literal>. Por ejemplo:"
+
+#. Tag: title
+#: collection_mapping.xml:718
#, no-c-format
+msgid "<element> tag for collection values using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
msgid ""
-"The <literal><one-to-many></literal> element does not need to declare "
-"any columns. Nor is it necessary to specify the <literal>table</literal> "
-"name anywhere."
+"<element\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"typename\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
msgstr ""
-"El elemento <literal><one-to-many></literal> no necesita declarar "
-"ninguna columna. Ni es necesario especificar el nombre de <literal>table</"
-"literal> en ningún sitio."
#. Tag: para
+#: collection_mapping.xml:734
#, no-c-format
msgid ""
-"If the foreign key column of a <literal><one-to-many></literal> "
-"association is declared <literal>NOT NULL</literal>, you must declare the "
-"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
-"or <emphasis>use a bidirectional association</emphasis> with the collection "
-"mapping marked <literal>inverse=\"true\"</literal>. See the discussion of "
-"bidirectional associations later in this chapter for more information."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection element values."
msgstr ""
-"Si la columna de la clave foránea de una asociación <literal><one-to-"
-"many></literal> se declara <literal>NOT NULL</literal>, debe declarar el "
-"mapeo de <literal><key></literal><literal>not-null=\"true\"</literal> "
-"o <emphasis> utilizar una asociación bidireccional</emphasis> con el mapeo "
-"de colección marcado <literal>inverse=\"true\"</literal>. Vea la discusión "
-"sobre asociaciones bidireccionales más adelante en este capítulo para "
-"obtener mayor información."
+"<literal>column</literal> (opcional): el nombre de la columna que tiene los "
+"valores de los elementos de la colección."
#. Tag: para
+#: collection_mapping.xml:739
#, no-c-format
msgid ""
-"The following example shows a map of <literal>Part</literal> entities by "
-"name, where <literal>partName</literal> is a persistent property of "
-"<literal>Part</literal>. Notice the use of a formula-based index:"
+"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
+"element."
msgstr ""
-"El siguiente ejemplo muestra un mapeo de entidades <literal>Part</literal> "
-"por nombre, en donde <literal>partName</literal> es una propiedad "
-"persistente de <literal>Part</literal>. Observe el uso de un índice basado "
-"en fórmula:"
+"<literal>formula</literal> (opcional): una fórmula SQL utilizada para "
+"evaluar el elemento."
+#. Tag: para
+#: collection_mapping.xml:744
+#, no-c-format
+msgid "<literal>type</literal> (required): the type of the collection element."
+msgstr ""
+"<literal>type</literal> (requerido): el tipo del elemento de colección."
+
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr "Mapeos de colección avanzados"
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr "Colecciones ordenadas"
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
msgid ""
"Hibernate supports collections implementing <literal>java.util.SortedMap</"
-"literal> and <literal>java.util.SortedSet</literal>. You must specify a "
-"comparator in the mapping file:"
+"literal> and <literal>java.util.SortedSet</literal>. With annotations you "
+"declare a sort comparator using <literal>@Sort</literal>. You chose between "
+"the comparator types unsorted, natural or custom. If you want to use your "
+"own comparator implementation, you'll also have to specify 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 ""
-"Hibernate soporta colecciones implementando <literal>java.util.SortedMap</"
-"literal> y <literal>java.util.SortedSet</literal>. Tiene que especificar un "
-"comparador en el archivo de mapeo:"
+#. Tag: title
+#: collection_mapping.xml:770
+#, fuzzy, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr "Colecciones ordenadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+"@JoinColumn(name=\"CUST_ID\")\n"
+"@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+"public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
msgid ""
+"Using Hibernate mapping files you specify a comparator in the mapping file "
+"with <literal><sort></literal>:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:779
+#, fuzzy, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr "Colecciones ordenadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, no-c-format
+msgid ""
+"<set name=\"aliases\"\n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:784
+#, no-c-format
+msgid ""
"Allowed values of the <literal>sort</literal> attribute are "
"<literal>unsorted</literal>, <literal>natural</literal> and the name of a "
"class implementing <literal>java.util.Comparator</literal>."
@@ -844,6 +1597,7 @@
"clase que implemente <literal>java.util.Comparator</literal>."
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
msgid ""
"Sorted collections actually behave like <literal>java.util.TreeSet</literal> "
@@ -853,14 +1607,15 @@
"TreeSet</literal> o <literal>java.util.TreeMap</literal>."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:794
+#, fuzzy, no-c-format
msgid ""
"If you want the database itself to order the collection elements, use the "
"<literal>order-by</literal> attribute of <literal>set</literal>, "
"<literal>bag</literal> or <literal>map</literal> mappings. This solution is "
-"only available under JDK 1.4 or higher and is implemented using "
-"<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This "
-"performs the ordering in the SQL query and not in the memory."
+"implemented using <literal>LinkedHashSet</literal> or "
+"<literal>LinkedHashMap</literal> and performs the ordering in the SQL query "
+"and not in the memory."
msgstr ""
"Si quiere que la misma base de datos ordene los elementos de la colección, "
"utilice el atributo <literal>order-by</literal> de los mapeos <literal>set</"
@@ -870,11 +1625,36 @@
"literal>. Este realiza la ordenación en la consulta SQL y no en memoria."
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, no-c-format
+msgid ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr "Nota"
#. Tag: para
+#: collection_mapping.xml:810
#, no-c-format
msgid ""
"The value of the <literal>order-by</literal> attribute is an SQL ordering, "
@@ -884,6 +1664,7 @@
"una ordenación HQL."
#. Tag: para
+#: collection_mapping.xml:814
#, no-c-format
msgid ""
"Associations can even be sorted by arbitrary criteria at runtime using a "
@@ -894,11 +1675,27 @@
"colección:"
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, no-c-format
+msgid ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr "Asociaciones bidireccionales"
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
msgid ""
"A <emphasis>bidirectional association</emphasis> allows navigation from both "
@@ -910,49 +1707,403 @@
"asociación bidireccional:"
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr "uno-a-muchos"
#. Tag: para
+#: collection_mapping.xml:834
#, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr "conjunto o bag valorados en un lado, monovaluados en el otro"
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr "muchos-a-muchos"
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr "set o bag valorados en ambos extremos"
#. Tag: para
+#: collection_mapping.xml:848
#, no-c-format
msgid ""
-"You can specify a bidirectional many-to-many association by mapping two many-"
-"to-many associations to the same database table and declaring one end as "
-"<emphasis>inverse</emphasis>. You cannot select an indexed collection."
+"Often there exists a many to one association which is the owner side of a "
+"bidirectional relationship. The corresponding one to many association is in "
+"this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:854
+#, no-c-format
+msgid "Bidirectional one to many with many to one side as association owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:860
+#, no-c-format
+msgid ""
+"<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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:865
+#, no-c-format
+msgid ""
+"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 not optimized and will produce additional UPDATE "
+"statements."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:872
+#, fuzzy, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr "Asociaciones bidireccionales con colecciones indexadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:878
+#, fuzzy, no-c-format
+msgid ""
+"How does the mappping of a bidirectional mapping look like in Hibernate "
+"mapping xml? There you define a bidirectional one-to-many association by "
+"mapping a one-to-many association to the same table column(s) as a many-to-"
+"one association and declaring the many-valued end <literal>inverse=\"true\"</"
+"literal>."
+msgstr ""
+"Puede definir una asociación bidireccional uno-a-muchos mapeando una "
+"asociación uno-a-muchos a la misma columna (o columnas) de tabla como una "
+"asociación muchos-a-uno y declarando el extremo multivaluado "
+"<literal>inverse=\"true\"</literal>."
+
+#. Tag: title
+#: collection_mapping.xml:885
+#, no-c-format
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:890
+#, no-c-format
+msgid ""
+"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
+"does not affect the operation of cascades as these are orthogonal concepts."
+msgstr ""
+"Mapear un extremo de una asociación con <literal>inverse=\"true\"</literal> "
+"no afecta la operación de cascadas ay que éstos son conceptos ortogonales."
+
+#. Tag: para
+#: collection_mapping.xml:894
+#, no-c-format
+msgid ""
+"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):"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:903
+#, no-c-format
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:910
+#, no-c-format
+msgid ""
+"In this example <classname>@JoinTable</classname> defines a <literal>name</"
+"literal>, an array of join columns, 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\"). 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:919
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:938
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:955
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:961
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:966
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files you can map a bidirectional many-to-many "
+"association by mapping two many-to-many associations to the same database "
+"table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
"Puede especificar una asociación bidireccional muchos-a-muchos simplemente "
"mapeando dos asociaciones muchos-a-muchos a la misma tabla de base de datos "
"y declarando un extremo como <emphasis>inverso</emphasis> (cuál de ellos, "
"usted escoge, pero no puede ser una colección indexada)."
#. Tag: para
+#: collection_mapping.xml:970
#, no-c-format
+msgid "You cannot select an indexed collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:973
+#, fuzzy, no-c-format
msgid ""
-"Here is an example of a bidirectional many-to-many association that "
-"illustrates how each category can have many items and each item can be in "
-"many categories:"
+"shows a bidirectional many-to-many association that illustrates how each "
+"category can have many items and each item can be in many categories:"
msgstr ""
"He aquí un ejemplo de una asociación bidireccional muchos-a-muchos que "
"ilustra la manera en que cada categoría puede tener muchos ítems y cada ítem "
"puede estar en muchas categorías:"
+#. Tag: title
+#: collection_mapping.xml:979
+#, no-c-format
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, no-c-format
+msgid ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:984
#, no-c-format
msgid ""
"Changes made only to the inverse end of the association are <emphasis>not</"
@@ -968,49 +2119,52 @@
"piensa en el modelo de objetos de Java y cómo creamos una relación muchos-a-"
"muchos en Java:"
-#. Tag: para
-#, no-c-format
-msgid ""
-"The non-inverse side is used to save the in-memory representation to the "
-"database."
-msgstr ""
-"El lado no-inverso se utiliza para guardar la representación en memoria a la "
-"base de datos."
+#. Tag: title
+#: collection_mapping.xml:992
+#, fuzzy, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr "Colecciones de valores y asociaciones muchos-a-muchos"
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:995
#, no-c-format
msgid ""
-"You can define a bidirectional one-to-many association by mapping a one-to-"
-"many association to the same table column(s) as a many-to-one association "
-"and declaring the many-valued end <literal>inverse=\"true\"</literal>."
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
msgstr ""
-"Puede definir una asociación bidireccional uno-a-muchos mapeando una "
-"asociación uno-a-muchos a la misma columna (o columnas) de tabla como una "
-"asociación muchos-a-uno y declarando el extremo multivaluado "
-"<literal>inverse=\"true\"</literal>."
#. Tag: para
+#: collection_mapping.xml:998
#, no-c-format
msgid ""
-"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
-"does not affect the operation of cascades as these are orthogonal concepts."
+"The non-inverse side is used to save the in-memory representation to the "
+"database."
msgstr ""
-"Mapear un extremo de una asociación con <literal>inverse=\"true\"</literal> "
-"no afecta la operación de cascadas ay que éstos son conceptos ortogonales."
+"El lado no-inverso se utiliza para guardar la representación en memoria a la "
+"base de datos."
#. Tag: title
+#: collection_mapping.xml:1003
#, no-c-format
msgid "Bidirectional associations with indexed collections"
msgstr "Asociaciones bidireccionales con colecciones indexadas"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1005
+#, fuzzy, no-c-format
msgid ""
-"A bidirectional association where one end is represented as a <literal><"
-"list></literal> or <literal><map></literal>, requires special "
-"consideration. If there is a property of the child class that maps to the "
-"index column you can use <literal>inverse=\"true\"</literal> on the "
-"collection mapping:"
+"There are some additional considerations for bidirectional mappings with "
+"indexed collections (where one end is represented as a <literal><list>"
+"</literal> or <literal><map></literal>) when using Hibernate mapping "
+"files. If there is a property of the child class that maps to the index "
+"column you can use <literal>inverse=\"true\"</literal> on the collection "
+"mapping:"
msgstr ""
"Requiere especial atención una asociación bidireccional en donde un extremo "
"esté representado como una <literal><list></literal> o <literal><"
@@ -1018,7 +2172,41 @@
"columna índice, puede utilizar <literal>inverse=\"true\"</literal> en el "
"mapeo de la colección:"
+#. Tag: title
+#: collection_mapping.xml:1013
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr "Asociaciones bidireccionales con colecciones indexadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1018
#, no-c-format
msgid ""
"If there is no such property on the child class, the association cannot be "
@@ -1033,7 +2221,42 @@
"este caso, no puede mapear la colección con <literal>inverse=\"true\"</"
"literal>. En cambio, puede usar el siguiente mapeo:"
+#. Tag: title
+#: collection_mapping.xml:1026
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr "Asociaciones bidireccionales con colecciones indexadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1032
#, no-c-format
msgid ""
"Note that in this mapping, the collection-valued end of the association is "
@@ -1043,11 +2266,13 @@
"responsable de las actualizaciones de la clave foránea. "
#. Tag: title
+#: collection_mapping.xml:1037
#, no-c-format
msgid "Ternary associations"
msgstr "Asociaciones ternarias"
#. Tag: para
+#: collection_mapping.xml:1039
#, no-c-format
msgid ""
"There are three possible approaches to mapping a ternary association. One "
@@ -1056,40 +2281,64 @@
"Hay tres enfoques posibles para mapear una asociación ternaria. Una es "
"utilizar un <literal>Map</literal> con una asociación como su índice: "
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1044
+#, fuzzy, no-c-format
+msgid "Ternary association mapping"
+msgstr "Asociaciones ternarias"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1046
#, no-c-format
msgid ""
-"A second approach is to remodel the association as an entity class. This is "
-"the most common approach."
+"@Entity\n"
+"public class Company {\n"
+" @Id \n"
+" int id;\n"
+" ...\n"
+" @OneToMany // unidirectional\n"
+" @MapKeyJoinColumn(name=\"employee_id\")\n"
+" Map<Employee, Contract> contracts;\n"
+"}\n"
+"\n"
+"// or\n"
+"\n"
+"<map name=\"contracts\">\n"
+" <key column=\"employer_id\" not-null=\"true\"/>\n"
+" <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+" <one-to-many class=\"Contract\"/>\n"
+"</map>"
msgstr ""
-"Un segundo enfoque es remodelar la asociación como una clase de entidad. "
-"Este es el enfoque más común."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1049
+#, fuzzy, no-c-format
msgid ""
-"A final alternative is to use composite elements, which will be discussed "
-"later."
+"A second approach is to remodel the association as an entity class. This is "
+"the most common approach. A final alternative is to use composite elements, "
+"which will be discussed later."
msgstr ""
-"La última opción es utilizar elementos compuestos que discutiremos más "
-"adelante."
+"Un segundo enfoque es remodelar la asociación como una clase de entidad. "
+"Este es el enfoque más común."
-#. Tag: title
-#, no-c-format
-msgid "<literal>Using an <idbag></literal>"
+#. Tag: literal
+#: collection_mapping.xml:1055
+#, fuzzy, no-c-format
+msgid "Using an <idbag>"
msgstr "<literal>Utilización de un <idbag></literal>"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1057
+#, fuzzy, no-c-format
msgid ""
"The majority of the many-to-many associations and collections of values "
"shown previously all map to tables with composite keys, even though it has "
-"been have suggested that entities should have synthetic identifiers "
-"(surrogate keys). A pure association table does not seem to benefit much "
-"from a surrogate key, although a collection of composite values "
-"<emphasis>might</emphasis>. It is for this reason that Hibernate provides a "
-"feature that allows you to map many-to-many associations and collections of "
-"values to a table with a surrogate key."
+"been suggested that entities should have synthetic identifiers (surrogate "
+"keys). A pure association table does not seem to benefit much from a "
+"surrogate key, although a collection of composite values <emphasis>might</"
+"emphasis>. For this reason Hibernate provides a feature that allows you to "
+"map many-to-many associations and collections of values to a table with a "
+"surrogate key."
msgstr ""
"La mayoría de las asociaciones muchos-a-muchos y las colecciones de valores "
"que hemos mostrado hasta ahora mapean a tablas con claves compuestas, aunque "
@@ -1101,6 +2350,7 @@
"y colecciones de valores a una tabla con una llave sustituta."
#. Tag: para
+#: collection_mapping.xml:1066
#, no-c-format
msgid ""
"The <literal><idbag></literal> element lets you map a <literal>List</"
@@ -1110,7 +2360,22 @@
"<literal>List</literal> (o <literal>Collection</literal>) con semántica de "
"bag. Por ejemplo:"
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, no-c-format
+msgid ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1072
#, no-c-format
msgid ""
"An <literal><idbag></literal> has a synthetic id generator, just like "
@@ -1125,6 +2390,7 @@
"particular."
#. Tag: para
+#: collection_mapping.xml:1077
#, no-c-format
msgid ""
"The update performance of an <literal><idbag></literal> supersedes a "
@@ -1138,6 +2404,7 @@
"borrarlas individualmente, al igual que si fuese una lista, mapa o conjunto."
#. Tag: para
+#: collection_mapping.xml:1082
#, no-c-format
msgid ""
"In the current implementation, the <literal>native</literal> identifier "
@@ -1149,23 +2416,59 @@
"colecciones <literal><idbag></literal>."
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr "Ejemplos de colección"
#. Tag: para
+#: collection_mapping.xml:1105
#, no-c-format
msgid "This section covers collection examples."
msgstr "Esta sección cubre los ejemplos de colección. "
#. Tag: para
+#: collection_mapping.xml:1107
#, no-c-format
-msgid "The following class has a collection of <literal>Child</literal> instances:"
+msgid ""
+"The following class has a collection of <literal>Child</literal> instances:"
msgstr ""
"La siguiente clase tiene una colección de instancias <literal>Child</"
"literal>:"
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid ""
+"Example classes <classname>Parent</classname> and <classname>Child</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" private long id;\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" private long id;\n"
+" private String name\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, no-c-format
msgid ""
"If each child has, at most, one parent, the most natural mapping is a one-to-"
@@ -1174,12 +2477,103 @@
"Si cada hijo tiene como mucho un padre, el mapeo más natural es una "
"asociación uno-a-muchos:"
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr "Esto mapea a las siguientes definiciones de tabla:"
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid ""
+"Table definitions for unidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
msgid ""
"If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-"
@@ -1188,47 +2582,519 @@
"Si el padre es <emphasis>requerido</emphasis>, utilice una asociación "
"bidireccional uno-a-muchos:"
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+" \n"
+" @ManyToOne\n"
+" private Parent parent;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr "Observe la restricción <literal>NOT NULL</literal>:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1164
#, no-c-format
msgid ""
-"Alternatively, if this association must be unidirectional you can declare "
-"the <literal>NOT NULL</literal> constraint on the <literal><key></"
-"literal> mapping:"
+"Table definitions for bidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1171
+#, fuzzy, no-c-format
+msgid ""
+"Alternatively, if this association must be unidirectional you can enforce "
+"the <literal>NOT NULL</literal> constraint."
+msgstr ""
"Opcionalmente, si esta asociación debe ser unidireccional, puede declarar la "
"restricción <literal>NOT NULL</literal> en el mapeo de <literal><key></"
"literal>:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1175
#, no-c-format
msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(optional=false)\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1188
+#, fuzzy, no-c-format
+msgid ""
"On the other hand, if a child has multiple parents, a many-to-many "
-"association is appropriate:"
+"association is appropriate."
msgstr ""
"Por otro lado, si un hijo tiene múltiples padres, una asociación muchos-a-"
"muchos es apropiada:"
+#. Tag: title
+#: collection_mapping.xml:1192
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using "
+"annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @ManyToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using mapping "
+"files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr "Definiciones de tabla:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1208
#, no-c-format
+msgid "Table definitions for many to many releationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, no-c-format
msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1213
+#, fuzzy, no-c-format
+msgid ""
"For more examples and a complete explanation of a parent/child relationship "
-"mapping, see <xref linkend=\"example-parentchild\" /> for more information."
+"mapping, see <xref linkend=\"example-parentchild\"/> for more information. "
+"Even more complex association mappings are covered in the next chapter."
msgstr ""
"Para ver más ejemplos y encontrar una explicación completa sobre el mapeo de "
"relaciones padre/hijo, consulte el <xref linkend=\"example-parentchild\" />."
-#. Tag: para
-#, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
-msgstr "En el próximo capítulo abordaremos los mapeos de asociaciones más complejas."
+#~ msgid ""
+#~ "Hibernate requires that persistent collection-valued fields be declared "
+#~ "as an interface type. For example:"
+#~ msgstr ""
+#~ "Hibernate requiere que los campos valuados en colección persistente se "
+#~ "declaren como un tipo de interfaz. Por ejemplo:"
+#~ msgid "Collection mappings"
+#~ msgstr "Mapeos de colección"
+
+#~ msgid ""
+#~ "There are quite a range of mappings that can be generated for collections "
+#~ "that cover many common relational models. We suggest you experiment with "
+#~ "the schema generation tool so that you understand how various mapping "
+#~ "declarations translate to database tables."
+#~ msgstr ""
+#~ "Hay bastantes rangos de mapeos que se pueden generar para colecciones que "
+#~ "cubren muchos modelos relacionales comúnes. Le recomendamos que "
+#~ "experimente con la herramienta de generación de esquemas para comprender "
+#~ "cómo se traducen varias declaraciones de mapeo a tablas de bases de datos."
+
+#~ msgid "Collection elements"
+#~ msgstr "Elementos de collección"
+
+#~ msgid ""
+#~ "The contained type is referred to as the <emphasis>collection element "
+#~ "type</emphasis>. Collection elements are mapped by <literal><"
+#~ "element></literal> or <literal><composite-element></literal>, or "
+#~ "in the case of entity references, with <literal><one-to-many></"
+#~ "literal> or <literal><many-to-many></literal>. The first two map "
+#~ "elements with value semantics, the next two are used to map entity "
+#~ "associations."
+#~ msgstr ""
+#~ "Se hace referencia al tipo contenido como el <emphasis>tipo de elemento "
+#~ "de la colección</emphasis>. Los elementos de colección son mapeados por "
+#~ "<literal><element></literal> o <literal><composite-element></"
+#~ "literal>, o en el caso de referencias de entidades, con <literal><one-"
+#~ "to-many></literal> o <literal><many-to-many></literal>. Las dos "
+#~ "primeras mapean elementos con semántica de valor, los dos siguientes se "
+#~ "utilizan para mapear asociaciones de entidades."
+
+#~ msgid ""
+#~ "All collection mappings, except those with set and bag semantics, need an "
+#~ "<emphasis>index column</emphasis> in the collection table. An index "
+#~ "column is a column that maps to an array index, or <literal>List</"
+#~ "literal> index, or <literal>Map</literal> key. The index of a "
+#~ "<literal>Map</literal> may be of any basic type, mapped with <literal><"
+#~ "map-key></literal>. It can be an entity reference mapped with "
+#~ "<literal><map-key-many-to-many></literal>, or it can be a composite "
+#~ "type mapped with <literal><composite-map-key></literal>. The index "
+#~ "of an array or list is always of type <literal>integer</literal> and is "
+#~ "mapped using the <literal><list-index></literal> element. The "
+#~ "mapped column contains sequential integers that are numbered from zero by "
+#~ "default."
+#~ msgstr ""
+#~ "Todos los mapeos de colección, excepto aquellos con semántica de set o "
+#~ "bag, necesitan una <emphasis>columna índice</emphasis> en la tabla de "
+#~ "colección. Una columna índice es una columna que mapea a un índice de "
+#~ "array o índice de <literal>List</literal> o llave de <literal>Map</"
+#~ "literal>. El índice de un <literal>Map</literal> puede ser de cualquier "
+#~ "tipo básico, mapeado con <literal><map-key></literal>. Puede ser "
+#~ "una referencia de entidad mapeada con <literal><map-key-many-to-"
+#~ "many></literal>, o puede ser un tipo compuesto mapeado con "
+#~ "<literal><composite-map-key></literal>. El índice de un array o "
+#~ "lista es siempre de tipo <literal>integer</literal> y se mapea utilizando "
+#~ "el elemento <literal><list-index></literal>. La columna mapeada "
+#~ "contiene enteros secuenciales numerados desde cero, por defecto."
+
+#~ msgid ""
+#~ "Any collection of values or many-to-many associations requires a "
+#~ "dedicated <emphasis>collection table</emphasis> with a foreign key column "
+#~ "or columns, <emphasis>collection element column</emphasis> or columns, "
+#~ "and possibly an index column or columns."
+#~ msgstr ""
+#~ "Cualquier colección de valores o asociación muchos-a-muchos requiere una "
+#~ "<emphasis>tabla de colección</emphasis> dedicada con una columna o "
+#~ "columnas de clave foránea, <emphasis>columna de elemento de colección</"
+#~ "emphasis> o columnas y posiblemente una columna o columnas índices."
+
+#~ msgid ""
+#~ "A <emphasis>many-to-many association</emphasis> is specified using the "
+#~ "<literal><many-to-many></literal> element."
+#~ msgstr ""
+#~ "Una <emphasis>asociación muchos-a-muchos</emphasis> se especifica usando "
+#~ "el elemento <literal><many-to-many></literal>."
+
+#~ msgid ""
+#~ "<literal>column</literal> (optional): the name of the element foreign key "
+#~ "column."
+#~ msgstr ""
+#~ "<literal>column</literal> (opcional): el nombre de la columna de clave "
+#~ "foránea elemento."
+
+#~ msgid ""
+#~ "<literal>formula</literal> (optional): an SQL formula used to evaluate "
+#~ "the element foreign key value."
+#~ msgstr ""
+#~ "<literal>formula</literal> (opcional): una fórmula SQL utilizada para "
+#~ "evaluar el valor de la clave foránea elemento."
+
+#~ msgid ""
+#~ "<literal>fetch</literal> (optional - defaults to <literal>join</"
+#~ "literal>): enables outer-join or sequential select fetching for this "
+#~ "association. This is a special case; for full eager fetching in a single "
+#~ "<literal>SELECT</literal> of an entity and its many-to-many relationships "
+#~ "to other entities, you would enable <literal>join</literal> fetching,not "
+#~ "only of the collection itself, but also with this attribute on the "
+#~ "<literal><many-to-many></literal> nested element."
+#~ msgstr ""
+#~ "<literal>fetch</literal> (opcional - por defecto es <literal>join</"
+#~ "literal>): habilita la búsqueda de selects secuenciales o de unión "
+#~ "externa para esta asociación. Este es un caso especial; para búsqueda "
+#~ "temprana completa en un solo <literal>SELECT</literal> de una entidad y "
+#~ "sus relaciones muchos-a-muchos con otras entidades, habilitaría la "
+#~ "búsqueda <literal>join</literal>,no solo de la colección misma, si no "
+#~ "también con este atributo en el elemento anidado <literal><many-to-"
+#~ "many></literal>."
+
+#~ msgid ""
+#~ "<literal>unique</literal> (optional): enables the DDL generation of a "
+#~ "unique constraint for the foreign-key column. This makes the association "
+#~ "multiplicity effectively one-to-many."
+#~ msgstr ""
+#~ "<literal>unique</literal> (opcional): habilita la generación DDL de una "
+#~ "restricción única para la columna de la clave foránea. Esto hace la "
+#~ "multiplicidad de la asociación efectivamente uno-a-muchos."
+
+#~ msgid ""
+#~ "<literal>not-found</literal> (optional - defaults to <literal>exception</"
+#~ "literal>): specifies how foreign keys that reference missing rows will be "
+#~ "handled: <literal>ignore</literal> will treat a missing row as a null "
+#~ "association."
+#~ msgstr ""
+#~ "<literal>not-found</literal> (opcional - por defecto es "
+#~ "<literal>exception</literal>): Especifica cómo serán manejadas las claves "
+#~ "foráneas que hacen referencia a filas que falten: <literal>ignore</"
+#~ "literal> tratará una fila que falte como una asociación nula."
+
+#~ msgid ""
+#~ "<literal>property-ref</literal> (optional): the name of a property of the "
+#~ "associated class that is joined to this foreign key. If not specified, "
+#~ "the primary key of the associated class is used."
+#~ msgstr ""
+#~ "<literal>property-ref</literal> (opcional): el nombre de una propiedad de "
+#~ "la clase asociada que está unida a esta clave foránea. Si no se "
+#~ "especifica entonces se utiliza la clave principal de la clase asociada."
+
+#~ msgid "Here are some examples."
+#~ msgstr "Aquí tiene algunos ejemplos:"
+
+#~ msgid "A set of strings:"
+#~ msgstr "Un grupo de cadenas:"
+
+#~ msgid ""
+#~ "A bag containing integers with an iteration order determined by the "
+#~ "<literal>order-by</literal> attribute:"
+#~ msgstr ""
+#~ "Un bag que contiene enteros con un orden de iteración determinado por el "
+#~ "atributo <literal>order-by</literal>:"
+
+#~ msgid "An array of entities, in this case, a many-to-many association:"
+#~ msgstr ""
+#~ "Una lista de entidades, en este caso, una asociación muchos-a-muchos:"
+
+#~ msgid "A map from string indices to dates:"
+#~ msgstr "Un mapeo de índices de cadenas a fechas:"
+
+#~ msgid "A list of components (this is discussed in the next chapter):"
+#~ msgstr "Una lista de componentes (se discuten en el siguiente capítulo):"
+
+#~ msgid "One-to-many associations"
+#~ msgstr "Asociaciones uno-a-muchos"
+
+#~ msgid ""
+#~ "A <emphasis>one-to-many association</emphasis> links the tables of two "
+#~ "classes via a foreign key with no intervening collection table. This "
+#~ "mapping loses certain semantics of normal Java collections:"
+#~ msgstr ""
+#~ "Una <emphasis>asociación uno-a-muchos</emphasis> enlaza las tablas de dos "
+#~ "clases por medio de una clave foránea, sin intervención de tabla de "
+#~ "colección alguna. Este mapeo pierde cierta semántica de colecciones Java "
+#~ "normales: "
+
+#~ msgid ""
+#~ "The following example shows a map of <literal>Part</literal> entities by "
+#~ "name, where <literal>partName</literal> is a persistent property of "
+#~ "<literal>Part</literal>. Notice the use of a formula-based index:"
+#~ msgstr ""
+#~ "El siguiente ejemplo muestra un mapeo de entidades <literal>Part</"
+#~ "literal> por nombre, en donde <literal>partName</literal> es una "
+#~ "propiedad persistente de <literal>Part</literal>. Observe el uso de un "
+#~ "índice basado en fórmula:"
+
+#~ msgid ""
+#~ "Hibernate supports collections implementing <literal>java.util.SortedMap</"
+#~ "literal> and <literal>java.util.SortedSet</literal>. You must specify a "
+#~ "comparator in the mapping file:"
+#~ msgstr ""
+#~ "Hibernate soporta colecciones implementando <literal>java.util.SortedMap</"
+#~ "literal> y <literal>java.util.SortedSet</literal>. Tiene que especificar "
+#~ "un comparador en el archivo de mapeo:"
+
+#~ msgid ""
+#~ "A final alternative is to use composite elements, which will be discussed "
+#~ "later."
+#~ msgstr ""
+#~ "La última opción es utilizar elementos compuestos que discutiremos más "
+#~ "adelante."
+
+#~ msgid ""
+#~ "Even more complex association mappings are covered in the next chapter."
+#~ msgstr ""
+#~ "En el próximo capítulo abordaremos los mapeos de asociaciones más "
+#~ "complejas."
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/configuration.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/configuration.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/configuration.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: configuration\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 11:05+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,11 +24,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr "Configuración"
#. Tag: para
+#: configuration.xml:33
#, no-c-format
msgid ""
"Hibernate is designed to operate in many different environments and, as "
@@ -47,11 +49,13 @@
"necesidades."
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr "Configuración programática"
#. Tag: para
+#: configuration.xml:43
#, no-c-format
msgid ""
"An instance of <classname>org.hibernate.cfg.Configuration</classname> "
@@ -68,6 +72,7 @@
"varios archivos de mapeo XML."
#. Tag: para
+#: configuration.xml:51
#, no-c-format
msgid ""
"You can obtain a <classname>org.hibernate.cfg.Configuration</classname> "
@@ -80,7 +85,17 @@
"mapeo XML. Si los archivos de mapeo están en la ruta de clase, utilice "
"<literal>addResource()</literal>. Por ejemplo:"
+#. Tag: programlisting
+#: configuration.xml:57
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:59
#, no-c-format
msgid ""
"An alternative way is to specify the mapped class and allow Hibernate to "
@@ -89,7 +104,17 @@
"Una manera opcional es especificar la clase mapeada y dejar que Hibernate "
"encuentre el documento de mapeo por usted:"
+#. Tag: programlisting
+#: configuration.xml:62
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:64
#, no-c-format
msgid ""
"Hibernate will then search for mapping files named <filename>/org/hibernate/"
@@ -103,6 +128,7 @@
"nombre de archivo establecido manualmente."
#. Tag: para
+#: configuration.xml:69
#, no-c-format
msgid ""
"A <classname>org.hibernate.cfg.Configuration</classname> also allows you to "
@@ -111,7 +137,22 @@
"Una <classname>org.hibernate.cfg.Configuration</classname> también le "
"permite especificar las propiedades de configuración. Por ejemplo:"
+#. Tag: programlisting
+#: configuration.xml:72
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:74
#, no-c-format
msgid ""
"This is not the only way to pass configuration properties to Hibernate. Some "
@@ -121,6 +162,7 @@
"Hibernate. Algunas opciones incluyen:"
#. Tag: para
+#: configuration.xml:79
#, no-c-format
msgid ""
"Pass an instance of <classname>java.util.Properties</classname> to "
@@ -130,6 +172,7 @@
"<literal>Configuration.setProperties()</literal>."
#. Tag: para
+#: configuration.xml:84
#, no-c-format
msgid ""
"Place a file named <filename>hibernate.properties</filename> in a root "
@@ -139,6 +182,7 @@
"directorio raíz de la ruta de clase."
#. Tag: para
+#: configuration.xml:89
#, no-c-format
msgid ""
"Set <literal>System</literal> properties using <literal>java -"
@@ -148,6 +192,7 @@
"Dproperty=value</literal>."
#. Tag: para
+#: configuration.xml:94
#, no-c-format
msgid ""
"Include <literal><property></literal> elements in <literal>hibernate."
@@ -157,6 +202,7 @@
"<literal>hibernate.cfg.xml</literal> (esto se discute más adelante)."
#. Tag: para
+#: configuration.xml:99
#, no-c-format
msgid ""
"If you want to get started quickly<filename>hibernate.properties</filename> "
@@ -166,6 +212,7 @@
"el enfoque más fácil."
#. Tag: para
+#: configuration.xml:103
#, no-c-format
msgid ""
"The <classname>org.hibernate.cfg.Configuration</classname> is intended as a "
@@ -177,11 +224,13 @@
"<literal>SessionFactory</literal>."
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr "Obtención de una SessionFactory"
#. Tag: para
+#: configuration.xml:111
#, no-c-format
msgid ""
"When all mappings have been parsed by the <classname>org.hibernate.cfg."
@@ -189,28 +238,38 @@
"<interfacename>org.hibernate.Session</interfacename> instances. This factory "
"is intended to be shared by all application threads:"
msgstr ""
-"Cuando la <classname>org.hibernate.cfg."
-"Configuration</classname> ha "
+"Cuando la <classname>org.hibernate.cfg.Configuration</classname> ha "
"analizado sintácticamente todos los mapeos, la aplicación tiene que obtener "
-"una fábrica para las instancias <interfacename>org.hibernate.Session</interfacename>. Esta fábrica está concebida para que todos los hilos de la "
+"una fábrica para las instancias <interfacename>org.hibernate.Session</"
+"interfacename>. Esta fábrica está concebida para que todos los hilos de la "
"aplicación la compartan:"
+#. Tag: programlisting
+#: configuration.xml:117
+#, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:119
#, no-c-format
msgid ""
"Hibernate does allow your application to instantiate more than one "
"<interfacename>org.hibernate.SessionFactory</interfacename>. This is useful "
"if you are using more than one database."
msgstr ""
-"Hibernate permite que su aplicación instancie más de una <interfacename>org.hibernate.SessionFactory</interfacename>. Esto es útil si está utilizando "
+"Hibernate permite que su aplicación instancie más de una <interfacename>org."
+"hibernate.SessionFactory</interfacename>. Esto es útil si está utilizando "
"más de una base de datos."
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr "Conexiones JDBC"
#. Tag: para
+#: configuration.xml:127
#, no-c-format
msgid ""
"It is advisable to have the <interfacename>org.hibernate.SessionFactory</"
@@ -223,7 +282,14 @@
"este enfoque, el abrir una <interfacename>org.hibernate.Session</"
"interfacename> es tan simple como:"
+#. Tag: programlisting
+#: configuration.xml:133
+#, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:135
#, no-c-format
msgid ""
"Once you start a task that requires access to the database, a JDBC "
@@ -233,6 +299,7 @@
"datos, se obtendrá una conexión JDBC del pool."
#. Tag: para
+#: configuration.xml:138
#, no-c-format
msgid ""
"Before you can do this, you first need to pass some JDBC connection "
@@ -248,6 +315,7 @@
"importantes para la conexión JDBC."
#. Tag: para
+#: configuration.xml:144
#, no-c-format
msgid ""
"Hibernate will obtain and pool connections using <classname>java.sql."
@@ -258,71 +326,89 @@
"propiedades:"
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr "Propiedades JDBC de Hibernate"
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327
+#: configuration.xml:495 configuration.xml:657 configuration.xml:753
+#: configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr "Nombre de la propiedad"
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329
+#: configuration.xml:497 configuration.xml:659 configuration.xml:755
+#: configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr "Propósito"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+#. Tag: property
+#: configuration.xml:166
+#, fuzzy, no-c-format
+msgid "hibernate.connection.driver_class"
msgstr "<property>hibernate.connection.driver_class</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:168
+#, fuzzy, no-c-format
+msgid "JDBC driver class"
msgstr "<emphasis>clase del controlador JDBC</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+#. Tag: property
+#: configuration.xml:172
+#, fuzzy, no-c-format
+msgid "hibernate.connection.url"
msgstr "<property>hibernate.connection.url</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:174
#, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
-msgstr "<emphasis>URL JDBC</emphasis>"
+msgid "JDBC URL"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.username</property>"
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
+#, fuzzy, no-c-format
+msgid "hibernate.connection.username"
msgstr "<property>hibernate.connection.username</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:180
#, no-c-format
-msgid "<emphasis>database user</emphasis>"
-msgstr "<emphasis>usuario de la base de datos</emphasis>"
+msgid "database user"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.password</property>"
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
+#, fuzzy, no-c-format
+msgid "hibernate.connection.password"
msgstr "<property>hibernate.connection.password</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>database user password</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:186
+#, fuzzy, no-c-format
+msgid "database user password"
msgstr "<emphasis>contraseña del usuario de la base de datos</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+#. Tag: property
+#: configuration.xml:190
+#, fuzzy, no-c-format
+msgid "hibernate.connection.pool_size"
msgstr "<property>hibernate.connection.pool_size</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:192
+#, fuzzy, no-c-format
+msgid "maximum number of pooled connections"
msgstr "<emphasis>número máximo de conexiones en pools</emphasis>"
#. Tag: para
+#: configuration.xml:199
#, no-c-format
msgid ""
"Hibernate's own connection pooling algorithm is, however, quite rudimentary. "
@@ -343,6 +429,7 @@
"Hibernate. Por ejemplo, es posible utilizar C3P0."
#. Tag: para
+#: configuration.xml:208
#, no-c-format
msgid ""
"C3P0 is an open source JDBC connection pool distributed along with Hibernate "
@@ -362,6 +449,7 @@
"obtener más información."
#. Tag: para
+#: configuration.xml:216
#, no-c-format
msgid ""
"The following is an example <filename>hibernate.properties</filename> file "
@@ -370,7 +458,23 @@
"Aquí hay un archivo <literal>hibernate.properties</literal> de ejemplo para "
"c3p0:"
+#. Tag: programlisting
+#: configuration.xml:219
+#, no-c-format
+msgid ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:221
#, no-c-format
msgid ""
"For use inside an application server, you should almost always configure "
@@ -385,36 +489,43 @@
"siguientes propiedades:"
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr "Propiedades de la Fuente de Datos de Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+#. Tag: property
+#: configuration.xml:244
+#, fuzzy, no-c-format
+msgid "hibernate.connection.datasource"
msgstr "<property>hibernate.connection.datasource</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:246
+#, fuzzy, no-c-format
+msgid "datasource JNDI name"
msgstr "<emphasis>nombre JNDI de la fuente de datos</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+#. Tag: property
+#: configuration.xml:250
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.url"
msgstr "<property>hibernate.jndi.url</property>"
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr "<emphasis>URL del proveedor JNDI</emphasis> (opcional)"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+#. Tag: property
+#: configuration.xml:257
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.class"
msgstr "<property>hibernate.jndi.class</property>"
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
msgid ""
"<emphasis>class of the JNDI <literal>InitialContextFactory</literal></"
@@ -424,16 +535,20 @@
"(opcional)"
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr "<emphasis>usuario de la base de datos</emphasis> (opcional)"
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
-msgstr "<emphasis>contraseña del usuario de la base de datos</emphasis> (opcional)"
+msgstr ""
+"<emphasis>contraseña del usuario de la base de datos</emphasis> (opcional)"
#. Tag: para
+#: configuration.xml:280
#, no-c-format
msgid ""
"Here is an example <filename>hibernate.properties</filename> file for an "
@@ -442,7 +557,20 @@
"He aquí un archivo <literal>hibernate.properties</literal> de ejemplo para "
"una fuente de datos JNDI provisto por un servidor de aplicaciones:"
+#. Tag: programlisting
+#: configuration.xml:283
+#, no-c-format
+msgid ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
msgid ""
"JDBC connections obtained from a JNDI datasource will automatically "
@@ -453,6 +581,7 @@
"administradas por el contenedor."
#. Tag: para
+#: configuration.xml:289
#, no-c-format
msgid ""
"Arbitrary connection properties can be given by prepending "
@@ -467,6 +596,7 @@
"property>."
#. Tag: para
+#: configuration.xml:294
#, no-c-format
msgid ""
"You can define your own plugin strategy for obtaining JDBC connections by "
@@ -482,11 +612,13 @@
"provider_class</property>."
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr "Parámetros de configuración opcionales"
#. Tag: para
+#: configuration.xml:304
#, no-c-format
msgid ""
"There are a number of other properties that control the behavior of "
@@ -496,6 +628,7 @@
"de ejecución. Todas son opcionales y tienen valores razonables por defecto. "
#. Tag: para
+#: configuration.xml:309
#, no-c-format
msgid ""
"<emphasis>Some of these properties are \"system-level\" only.</emphasis> "
@@ -503,23 +636,26 @@
"literal> or <filename>hibernate.properties</filename>. They "
"<emphasis>cannot</emphasis> be set by the other techniques described above."
msgstr ""
-"<emphasis>Algunas de estas propiedades se encuentran a \"nivel del sistema sólamente\".</emphasis> "
-"Las propiedades a nivel del sistema sólamente se pueden establecer por medio "
-"de <literal>java -Dproperty=value</"
-"literal> o <filename>hibernate.properties</filename>. <emphasis>No</emphasis> se pueden establecer por medio de las "
-"técnicas descritas anteriormente."
+"<emphasis>Algunas de estas propiedades se encuentran a \"nivel del sistema "
+"sólamente\".</emphasis> Las propiedades a nivel del sistema sólamente se "
+"pueden establecer por medio de <literal>java -Dproperty=value</literal> o "
+"<filename>hibernate.properties</filename>. <emphasis>No</emphasis> se pueden "
+"establecer por medio de las técnicas descritas anteriormente."
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr "Propiedades de Configuración de Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.dialect</property>"
+#. Tag: property
+#: configuration.xml:335
+#, fuzzy, no-c-format
+msgid "hibernate.dialect"
msgstr "<property>hibernate.dialect</property>"
#. Tag: entry
+#: configuration.xml:337
#, no-c-format
msgid ""
"The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</"
@@ -531,6 +667,7 @@
"para una base de datos relacional en particular. "
#. Tag: para
+#: configuration.xml:340
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of."
@@ -540,6 +677,7 @@
"Dialect</literal>"
#. Tag: para
+#: configuration.xml:341
#, no-c-format
msgid ""
"In most cases Hibernate will actually be able to choose the correct "
@@ -551,12 +689,14 @@
"con base en los <literal>JDBC metadata</literal> que el controlador JDBC "
"retorna."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+#. Tag: property
+#: configuration.xml:349
+#, fuzzy, no-c-format
+msgid "hibernate.show_sql"
msgstr "<property>hibernate.show_sql</property>"
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
msgid ""
"Write all SQL statements to console. This is an alternative to setting the "
@@ -568,6 +708,11 @@
"literal> a <literal>debug</literal>."
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426
+#: configuration.xml:435 configuration.xml:443 configuration.xml:453
+#: configuration.xml:468 configuration.xml:525 configuration.xml:545
+#: configuration.xml:555 configuration.xml:598 configuration.xml:797
+#: configuration.xml:808 configuration.xml:904
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
@@ -576,22 +721,26 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
"<literal>false</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+#. Tag: property
+#: configuration.xml:359
+#, fuzzy, no-c-format
+msgid "hibernate.format_sql"
msgstr "<property>hibernate.format_sql</property>"
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr "Imprime el SQL en el registro y la consola."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+#. Tag: property
+#: configuration.xml:367
+#, fuzzy, no-c-format
+msgid "hibernate.default_schema"
msgstr "<property>hibernate.default_schema</property>"
#. Tag: entry
+#: configuration.xml:369
#, no-c-format
msgid ""
"Qualify unqualified table names with the given schema/tablespace in "
@@ -601,33 +750,44 @@
"dado en el SQL generado. "
#. Tag: para
+#: configuration.xml:370
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
-msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+#. Tag: property
+#: configuration.xml:376
+#, fuzzy, no-c-format
+msgid "hibernate.default_catalog"
msgstr "<property>hibernate.default_catalog</property>"
#. Tag: entry
+#: configuration.xml:378
#, no-c-format
-msgid "Qualifies unqualified table names with the given catalog in generated SQL."
+msgid ""
+"Qualifies unqualified table names with the given catalog in generated SQL."
msgstr ""
"Califica los nombres de tabla sin calificar con el catálogo dado en el SQL "
"generado."
#. Tag: para
+#: configuration.xml:379
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
-msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+#. Tag: property
+#: configuration.xml:384
+#, fuzzy, no-c-format
+msgid "hibernate.session_factory_name"
msgstr "<property>hibernate.session_factory_name</property>"
#. Tag: entry
+#: configuration.xml:386
#, no-c-format
msgid ""
"The <interfacename>org.hibernate.SessionFactory</interfacename> will be "
@@ -637,6 +797,7 @@
"interfacename> a este nombre en JNDI después de que se ha creado."
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
@@ -645,12 +806,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+#. Tag: property
+#: configuration.xml:394
+#, fuzzy, no-c-format
+msgid "hibernate.max_fetch_depth"
msgstr "<property>hibernate.max_fetch_depth</property>"
#. Tag: entry
+#: configuration.xml:396
#, no-c-format
msgid ""
"Sets a maximum \"depth\" for the outer join fetch tree for single-ended "
@@ -663,6 +826,7 @@
"externa predeterminada."
#. Tag: para
+#: configuration.xml:398
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -671,12 +835,14 @@
"<emphasis role=\"strong\">ej.</emphasis> los valores recomendados entre "
"<literal>0</literal> y <literal>3</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+#. Tag: property
+#: configuration.xml:404
+#, fuzzy, no-c-format
+msgid "hibernate.default_batch_fetch_size"
msgstr "<property>hibernate.default_batch_fetch_size</property>"
#. Tag: entry
+#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr ""
@@ -684,6 +850,7 @@
"de Hibernate."
#. Tag: para
+#: configuration.xml:407
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</"
@@ -692,12 +859,14 @@
"<emphasis role=\"strong\">ej.</emphasis> valores recomendados <literal>4</"
"literal>, <literal>8</literal>, <literal>16</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+#. Tag: property
+#: configuration.xml:413
+#, fuzzy, no-c-format
+msgid "hibernate.default_entity_mode"
msgstr "<property>hibernate.default_entity_mode</property>"
#. Tag: entry
+#: configuration.xml:415
#, no-c-format
msgid ""
"Sets a default mode for entity representation for all sessions opened from "
@@ -707,6 +876,7 @@
"las sesiones abiertas desde esta <literal>SessionFactory</literal> "
#. Tag: para
+#: configuration.xml:416
#, no-c-format
msgid ""
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
@@ -715,12 +885,14 @@
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+#. Tag: property
+#: configuration.xml:422
+#, fuzzy, no-c-format
+msgid "hibernate.order_updates"
msgstr "<property>hibernate.order_updates</property>"
#. Tag: entry
+#: configuration.xml:424
#, no-c-format
msgid ""
"Forces Hibernate to order SQL updates by the primary key value of the items "
@@ -731,24 +903,29 @@
"clave principal de los items a actualizar. Esto resultará en menos bloqueos "
"de transacción en sistemas altamente concurrentes."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
-msgstr "<property>hibernate.generate_statistics</property>"
+#. Tag: property
+#: configuration.xml:432
+#, fuzzy, no-c-format
+msgid "hibernate.generate_statistics"
+msgstr "Estadísticas de Hibernate"
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
-msgid "If enabled, Hibernate will collect statistics useful for performance tuning."
+msgid ""
+"If enabled, Hibernate will collect statistics useful for performance tuning."
msgstr ""
"De habilitarse, Hibernate colectará estadísticas útiles para la afinación de "
"rendimiento. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+#. Tag: property
+#: configuration.xml:440
+#, fuzzy, no-c-format
+msgid "hibernate.use_identifier_rollback"
msgstr "<property>hibernate.use_identifier_rollback</property>"
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
msgid ""
"If enabled, generated identifier properties will be reset to default values "
@@ -757,12 +934,14 @@
"De habilitarse, cuando se borren los objetos las propiedades identificadoras "
"generadas se resetearán a losvalores establecidos por defecto."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
+#. Tag: property
+#: configuration.xml:449
+#, fuzzy, no-c-format
+msgid "hibernate.use_sql_comments"
msgstr "<property>hibernate.use_sql_comments</property>"
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
msgid ""
"If turned on, Hibernate will generate comments inside the SQL, for easier "
@@ -771,17 +950,51 @@
"De activarse, Hibernate generará comentarios dentro del SQL, para una "
"depuración más fácil, por defecto es <literal>false</literal>."
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:460
+#, no-c-format
+msgid ""
+"Setting is relevant when using <classname>@GeneratedValue</classname>. It "
+"indicates whether or not the new <classname>IdentifierGenerator</classname> "
+"implementations are used for <classname>javax.persistence.GenerationType."
+"AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</"
+"classname> and <classname>javax.persistence.GenerationType.SEQUENCE</"
+"classname>. Default to <literal>false</literal> to keep backward "
+"compatibility."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid ""
+"We recommend all new projects which make use of to use "
+"<classname>@GeneratedValue</classname> to also set <code>hibernate.id."
+"new_generator_mappings=true</code> as the new generators are more efficient "
+"and closer to the JPA 2 specification semantic. However they are not "
+"backward compatible with existing databases (if a sequence or a table is "
+"used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr "Propiedades de JDBC y Conexiones de Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+#. Tag: property
+#: configuration.xml:503
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.fetch_size"
msgstr "<property>hibernate.jdbc.fetch_size</property>"
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
msgid ""
"A non-zero value determines the JDBC fetch size (calls <literal>Statement."
@@ -790,12 +1003,14 @@
"Un valor distinto de cero que determina el tamaño de recuperación de JDBC "
"(llama a <literal>Statement.setFetchSize()</literal>)."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+#. Tag: property
+#: configuration.xml:510
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_size"
msgstr "<property>hibernate.jdbc.batch_size</property>"
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr ""
@@ -803,6 +1018,7 @@
"en lote de JDBC2. "
#. Tag: para
+#: configuration.xml:513
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -811,16 +1027,18 @@
"<emphasis role=\"strong\">ej.</emphasis> valores recomendados entre "
"<literal>5</literal> y <literal>30</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+#. Tag: property
+#: configuration.xml:519
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr "<property>hibernate.jdbc.batch_versioned_data</property>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:521
+#, fuzzy, no-c-format
msgid ""
"Set this property to <literal>true</literal> if your JDBC driver returns "
-"correct row counts from <literal>executeBatch()</literal>. Iit is usually "
+"correct row counts from <literal>executeBatch()</literal>. It is usually "
"safe to turn this option on. Hibernate will then use batched DML for "
"automatically versioned data. Defaults to <literal>false</literal>."
msgstr ""
@@ -830,12 +1048,14 @@
"para versionar automáticamente los datos. Por defecto es <literal>false</"
"literal>."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+#. Tag: property
+#: configuration.xml:531
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.factory_class"
msgstr "<property>hibernate.jdbc.factory_class</property>"
#. Tag: entry
+#: configuration.xml:533
#, no-c-format
msgid ""
"Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. "
@@ -846,6 +1066,7 @@
"de configuración. "
#. Tag: para
+#: configuration.xml:535
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -854,12 +1075,14 @@
"<emphasis role=\"strong\">eg.</emphasis> <literal>classname.of."
"BatcherFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+#. Tag: property
+#: configuration.xml:541
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr "<property>hibernate.jdbc.use_scrollable_resultset</property>"
#. Tag: entry
+#: configuration.xml:543
#, no-c-format
msgid ""
"Enables use of JDBC2 scrollable resultsets by Hibernate. This property is "
@@ -871,12 +1094,14 @@
"JDBC provistas por el usuario. En el caso contrario Hibernate utiliza los "
"metadatos de conexión."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+#. Tag: property
+#: configuration.xml:551
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr "<property>hibernate.jdbc.use_streams_for_binary</property>"
#. Tag: entry
+#: configuration.xml:553
#, no-c-format
msgid ""
"Use streams when writing/reading <literal>binary</literal> or "
@@ -887,12 +1112,14 @@
"<literal>serializable</literal> a/desde JDBC. <emphasis>Propiedad a nivel de "
"sistema</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+#. Tag: property
+#: configuration.xml:561
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr "<property>hibernate.jdbc.use_get_generated_keys</property>"
#. Tag: entry
+#: configuration.xml:563
#, no-c-format
msgid ""
"Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> "
@@ -909,16 +1136,21 @@
"controlador utilizando los metadatos de conexión."
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687
+#: configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
-msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+#. Tag: property
+#: configuration.xml:574
+#, fuzzy, no-c-format
+msgid "hibernate.connection.provider_class"
msgstr "<property>hibernate.connection.provider_class</property>"
#. Tag: entry
+#: configuration.xml:576
#, no-c-format
msgid ""
"The classname of a custom <interfacename>org.hibernate.connection."
@@ -930,6 +1162,7 @@
"JDBC a Hibernate. "
#. Tag: para
+#: configuration.xml:578
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -938,12 +1171,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
"ConnectionProvider</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+#. Tag: property
+#: configuration.xml:584
+#, fuzzy, no-c-format
+msgid "hibernate.connection.isolation"
msgstr "<property>hibernate.connection.isolation</property>"
#. Tag: entry
+#: configuration.xml:586
#, no-c-format
msgid ""
"Sets the JDBC transaction isolation level. Check <interfacename>java.sql."
@@ -958,28 +1193,34 @@
"adicionales y no estándares."
#. Tag: para
+#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
-msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+#. Tag: property
+#: configuration.xml:595
+#, fuzzy, no-c-format
+msgid "hibernate.connection.autocommit"
msgstr "<property>hibernate.connection.autocommit</property>"
#. Tag: entry
+#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr ""
"Habilita un guardado automático (autocommit) para las conexiones JDBC en "
"pool (no se recomienda)."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+#. Tag: property
+#: configuration.xml:603
+#, fuzzy, no-c-format
+msgid "hibernate.connection.release_mode"
msgstr "<property>hibernate.connection.release_mode</property>"
#. Tag: entry
+#: configuration.xml:605
#, no-c-format
msgid ""
"Specifies when Hibernate should release JDBC connections. By default, a JDBC "
@@ -1004,6 +1245,7 @@
"estrategia JDBC de transacción. "
#. Tag: para
+#: configuration.xml:615
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) "
@@ -1015,15 +1257,15 @@
"<literal>after_statement</literal>"
#. Tag: para
-#, no-c-format
+#: configuration.xml:618
+#, fuzzy, no-c-format
msgid ""
"This setting only affects <literal>Session</literal>s returned from "
"<literal>SessionFactory.openSession</literal>. For <literal>Session</"
"literal>s obtained through <literal>SessionFactory.getCurrentSession</"
"literal>, the <literal>CurrentSessionContext</literal> implementation "
"configured for use controls the connection release mode for those "
-"<literal>Session</literal>s. See <xref linkend=\"architecture-current-session"
-"\" />"
+"<literal>Session</literal>s. See"
msgstr ""
"Esta configuración sólamente afecta las <literal>Session</literal>es "
"retornadas desde <literal>SessionFactory.openSession</literal>. Para las "
@@ -1034,6 +1276,7 @@
"literal>es. Consulte <xref linkend=\"architecture-current-session\" />."
#. Tag: entry
+#: configuration.xml:630
#, no-c-format
msgid ""
"<property>hibernate.connection.</property><emphasis><propertyName></"
@@ -1043,6 +1286,7 @@
"emphasis>"
#. Tag: entry
+#: configuration.xml:632
#, no-c-format
msgid ""
"Pass the JDBC property <emphasis><propertyName></emphasis> to "
@@ -1052,11 +1296,15 @@
"<literal>DriverManager.getConnection()</literal>."
#. Tag: entry
+#: configuration.xml:638
#, no-c-format
-msgid "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
-msgstr "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
+msgid ""
+"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
+msgstr ""
+"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
#. Tag: entry
+#: configuration.xml:640
#, no-c-format
msgid ""
"Pass the property <emphasis><propertyName></emphasis> to the JNDI "
@@ -1066,21 +1314,26 @@
"<literal>InitialContextFactory</literal> JNDI."
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr "Propiedades de Caché de Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+#. Tag: literal
+#: configuration.xml:665
+#, fuzzy, no-c-format
+msgid "hibernate.cache.provider_class"
msgstr "<literal>hibernate.cache.provider_class</literal>"
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
-msgstr "El nombre de clase de un <literal>CacheProvider</literal> personalizado."
+msgstr ""
+"El nombre de clase de un <literal>CacheProvider</literal> personalizado."
#. Tag: para
+#: configuration.xml:668
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1089,12 +1342,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
"CacheProvider</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+#. Tag: literal
+#: configuration.xml:673
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_minimal_puts"
msgstr "<literal>hibernate.cache.use_minimal_puts</literal>"
#. Tag: entry
+#: configuration.xml:675
#, no-c-format
msgid ""
"Optimizes second-level cache operation to minimize writes, at the cost of "
@@ -1106,24 +1361,29 @@
"cachés en clúster y en Hibernate3, está habilitado por defecto para "
"implementaciones de caché en clúster. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+#. Tag: literal
+#: configuration.xml:684
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache"
msgstr "<literal>hibernate.cache.use_query_cache</literal>"
#. Tag: entry
+#: configuration.xml:686
#, no-c-format
-msgid "Enables the query cache. Individual queries still have to be set cachable."
+msgid ""
+"Enables the query cache. Individual queries still have to be set cachable."
msgstr ""
"Habilita el caché de consultas. Las consultas individuales todavía tienen "
"que establecerse con cachés. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+#. Tag: literal
+#: configuration.xml:692
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_second_level_cache"
msgstr "<literal>hibernate.cache.use_second_level_cache</literal>"
#. Tag: entry
+#: configuration.xml:694
#, no-c-format
msgid ""
"Can be used to completely disable the second level cache, which is enabled "
@@ -1134,12 +1394,14 @@
"que está habilitado por defecto para clases que especifican un mapeo "
"<literal><cache></literal>. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+#. Tag: literal
+#: configuration.xml:702
+#, fuzzy, no-c-format
+msgid "hibernate.cache.query_cache_factory"
msgstr "<literal>hibernate.cache.query_cache_factory</literal>"
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
msgid ""
"The classname of a custom <literal>QueryCache</literal> interface, defaults "
@@ -1150,6 +1412,7 @@
"incorporado."
#. Tag: para
+#: configuration.xml:706
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
@@ -1158,12 +1421,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+#. Tag: literal
+#: configuration.xml:712
+#, fuzzy, no-c-format
+msgid "hibernate.cache.region_prefix"
msgstr "<literal>hibernate.cache.region_prefix</literal>"
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr ""
@@ -1171,16 +1436,19 @@
"segundo nivel."
#. Tag: para
+#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+#. Tag: literal
+#: configuration.xml:720
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_structured_entries"
msgstr "<literal>hibernate.cache.use_structured_entries</literal>"
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
msgid ""
"Forces Hibernate to store data in the second-level cache in a more human-"
@@ -1189,17 +1457,36 @@
"Obliga a Hibernate a almacenar los datos en el caché de segundo nivel en un "
"formato más amigable para personas."
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid ""
+"Setting used to give the name of the default <classname>org.hibernate."
+"annotations.CacheConcurrencyStrategy</classname> to use when either "
+"<classname>@Cacheable</classname> or <classname>@Cache</classname> is used. "
+"<code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr "Propiedades de Transacción de Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:761
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.factory_class"
msgstr "<literal>hibernate.transaction.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
msgid ""
"The classname of a <literal>TransactionFactory</literal> to use with "
@@ -1211,6 +1498,7 @@
"<literal>JDBCTransactionFactory</literal>)."
#. Tag: para
+#: configuration.xml:765
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1219,12 +1507,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
"TransactionFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+#. Tag: literal
+#: configuration.xml:771
+#, fuzzy, no-c-format
+msgid "jta.UserTransaction"
msgstr "<literal>jta.UserTransaction</literal>"
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
msgid ""
"A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the "
@@ -1234,12 +1524,14 @@
"obtener la <literal>UserTransaction</literal> de JTA del servidor de "
"aplicaciones. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+#. Tag: literal
+#: configuration.xml:781
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.manager_lookup_class"
msgstr "<literal>hibernate.transaction.manager_lookup_class</literal>"
#. Tag: entry
+#: configuration.xml:783
#, no-c-format
msgid ""
"The classname of a <literal>TransactionManagerLookup</literal>. It is "
@@ -1251,6 +1543,7 @@
"un generador alto/bajo en un entorno JTA."
#. Tag: para
+#: configuration.xml:786
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1259,17 +1552,19 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
"TransactionManagerLookup</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+#. Tag: literal
+#: configuration.xml:792
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.flush_before_completion"
msgstr "<literal>hibernate.transaction.flush_before_completion</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:794
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically flushed during the before "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Si está habilitado, la sesión se vaciará automáticamente durante la fase "
@@ -1277,17 +1572,19 @@
"del contexto de sesión automático e incorporado. Consulte <xref linkend="
"\"architecture-current-session\" />."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+#. Tag: literal
+#: configuration.xml:803
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.auto_close_session"
msgstr "<literal>hibernate.transaction.auto_close_session</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:805
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically closed during the after "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Si se habilita, la sesión se cerrará automáticamente durante la fase "
@@ -1296,21 +1593,24 @@
"\"architecture-current-session\" />."
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr "Propiedades Misceláneas"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+#. Tag: literal
+#: configuration.xml:834
+#, fuzzy, no-c-format
+msgid "hibernate.current_session_context_class"
msgstr "<literal>hibernate.current_session_context_class</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:836
+#, fuzzy, no-c-format
msgid ""
"Supply a custom strategy for the scoping of the \"current\" "
"<literal>Session</literal>. See <xref linkend=\"architecture-current-session"
-"\" /> for more information about the built-in strategies."
+"\"/> for more information about the built-in strategies."
msgstr ""
"Proporciona una estrategia personalizada para el alcance de la "
"<literal>Session</literal> \"actual\". Consulte <xref linkend=\"architecture-"
@@ -1318,6 +1618,7 @@
"incorporadas. "
#. Tag: para
+#: configuration.xml:839
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | "
@@ -1328,17 +1629,20 @@
"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
"Class</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:846
+#, fuzzy, no-c-format
+msgid "hibernate.query.factory_class"
msgstr "<literal>hibernate.query.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr "Elige la implementación de análisis sintáctico HQL."
#. Tag: para
+#: configuration.xml:848
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast."
@@ -1349,12 +1653,14 @@
"ASTQueryTranslatorFactory</literal> o <literal>org.hibernate.hql.classic."
"ClassicQueryTranslatorFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
+#. Tag: literal
+#: configuration.xml:857
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions"
msgstr "<literal>hibernate.query.substitutions</literal>"
#. Tag: entry
+#: configuration.xml:859
#, no-c-format
msgid ""
"Is used to map from tokens in Hibernate queries to SQL tokens (tokens might "
@@ -1364,6 +1670,7 @@
"(por ejemplo, los tokens pueden ser nombres de función o literales). "
#. Tag: para
+#: configuration.xml:861
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
@@ -1372,12 +1679,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
"hqlFunction=SQLFUNC</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+#. Tag: literal
+#: configuration.xml:867
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.auto"
msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
#. Tag: entry
+#: configuration.xml:869
#, no-c-format
msgid ""
"Automatically validates or exports schema DDL to the database when the "
@@ -1391,6 +1700,7 @@
"<literal>SessionFactory</literal> se cierre explícitamente."
#. Tag: para
+#: configuration.xml:873
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | "
@@ -1401,12 +1711,49 @@
"<literal>update</literal> | <literal>create</literal> | <literal>create-"
"drop</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:880
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.import_file"
+msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
+
+#. Tag: para
+#: configuration.xml:882
#, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+msgid ""
+"Comma-separated names of the optional files containing SQL DML statements "
+"executed during the <classname>SessionFactory</classname> creation. This is "
+"useful for testing or demoing: by adding INSERT statements for example you "
+"can populate your database with a minimal set of data when it is deployed."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:887
+#, no-c-format
+msgid ""
+"File order matters, the statements of a give file are executed before the "
+"statements of the following files. These statements are only executed if the "
+"schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to "
+"<literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:892
+#, fuzzy, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
+
+#. Tag: literal
+#: configuration.xml:898
+#, fuzzy, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
msgstr "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
#. Tag: entry
+#: configuration.xml:900
#, no-c-format
msgid ""
"Enables the use of CGLIB instead of runtime reflection (System-level "
@@ -1421,11 +1768,13 @@
"xml</literal>."
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr "Dialectos de SQL"
#. Tag: para
+#: configuration.xml:915
#, no-c-format
msgid ""
"Always set the <literal>hibernate.dialect</literal> property to the correct "
@@ -1442,256 +1791,307 @@
"manualmente."
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr "Dialectos SQL de Hibernate(<literal>hibernate.dialect</literal>)"
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr "RDBMS"
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr "Dialecto"
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
-msgstr "DB2"
+msgid "<entry>DB2</entry>"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:943
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr "<literal>org.hibernate.dialect.DB2Dialect</literal>"
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr "DB2 AS/400"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:949
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr "DB2 OS390"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:955
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr "PostgreSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:961
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr "MySQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:967
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr "<literal>org.hibernate.dialect.MySQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr "MySQL con InnoDB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:973
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr "MySQL con MyISAM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+#. Tag: literal
+#: configuration.xml:979
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr "Oracle (cualquier versión)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+#. Tag: literal
+#: configuration.xml:985
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.OracleDialect"
msgstr "<literal>org.hibernate.dialect.OracleDialect</literal>"
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr "Oracle 9i"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+#. Tag: literal
+#: configuration.xml:991
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr "Oracle 10g"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+#. Tag: literal
+#: configuration.xml:997
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr "Sybase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1003
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr "<literal>org.hibernate.dialect.SybaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr "Sybase Anywhere"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1009
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr "Microsoft SQL Server"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1015
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr "SAP DB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1021
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr "Informix"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1027
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InformixDialect"
msgstr "<literal>org.hibernate.dialect.InformixDialect</literal>"
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr "HypersonicSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1033
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr "<literal>org.hibernate.dialect.HSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr "Ingres"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1039
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.IngresDialect"
msgstr "<literal>org.hibernate.dialect.IngresDialect</literal>"
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr "Progress"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1045
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr "<literal>org.hibernate.dialect.ProgressDialect</literal>"
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr "Mckoi SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1051
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr "<literal>org.hibernate.dialect.MckoiDialect</literal>"
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr "Interbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1057
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr "Pointbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1063
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr "FrontBase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1069
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr "Firebird"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1075
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr "Recuperación por Unión Externa - Outer Join Fetching"
#. Tag: para
+#: configuration.xml:1085
#, no-c-format
msgid ""
"If your database supports ANSI, Oracle or Sybase style outer joins, "
@@ -1710,6 +2110,7 @@
"muchos y uno-a-uno sea recuperado en un sólo <literal>SELECT</literal> SQL."
#. Tag: para
+#: configuration.xml:1094
#, no-c-format
msgid ""
"Outer join fetching can be disabled <emphasis>globally</emphasis> by setting "
@@ -1726,18 +2127,21 @@
"con <literal>fetch=\"join\"</literal>."
#. Tag: para
-#, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+#: configuration.xml:1100
+#, fuzzy, no-c-format
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr ""
"Consulte <xref linkend=\"performance-fetching\" /> para obtener más "
"información."
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr "Flujos Binarios"
#. Tag: para
+#: configuration.xml:1107
#, no-c-format
msgid ""
"Oracle limits the size of <literal>byte</literal> arrays that can be passed "
@@ -1753,16 +2157,18 @@
"<emphasis>Esta es una configuración a nivel de sistema sólamente.</emphasis>"
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr "Caché de segundo nivel y de lectura"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1118
+#, fuzzy, no-c-format
msgid ""
"The properties prefixed by <literal>hibernate.cache</literal> allow you to "
"use a process or cluster scoped second-level cache system with Hibernate. "
-"See the <xref linkend=\"performance-cache\" /> for more information."
+"See the <xref linkend=\"performance-cache\"/> for more information."
msgstr ""
"Las propiedades prefijadas por <literal>hibernate.cache</literal> le "
"permiten utilizar un sistema de caché de segundo nivel en el ámbito de un "
@@ -1770,11 +2176,13 @@
"> para obtener más detalles."
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr "Sustitución de Lenguaje de Consulta"
#. Tag: para
+#: configuration.xml:1127
#, no-c-format
msgid ""
"You can define new Hibernate query tokens using <literal>hibernate.query."
@@ -1783,7 +2191,14 @@
"Puede definir nuevos tokens de consulta de Hibernate utilizando "
"<literal>hibernate.query.substitutions</literal>. Por ejemplo:"
+#. Tag: programlisting
+#: configuration.xml:1130
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr "<literal>hibernate.query.substitutions</literal>"
+
#. Tag: para
+#: configuration.xml:1132
#, no-c-format
msgid ""
"This would cause the tokens <literal>true</literal> and <literal>false</"
@@ -1792,17 +2207,28 @@
"Esto causaría que los tokens <literal>true</literal> y <literal>false</"
"literal> sean traducidos a literales enteros en el SQL generado."
+#. Tag: programlisting
+#: configuration.xml:1136
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr "<literal>hibernate.query.substitutions</literal>"
+
#. Tag: para
+#: configuration.xml:1138
#, no-c-format
-msgid "This would allow you to rename the SQL <literal>LOWER</literal> function."
-msgstr "Esto le permitiría renombrar la función <literal>LOWER</literal> de SQL."
+msgid ""
+"This would allow you to rename the SQL <literal>LOWER</literal> function."
+msgstr ""
+"Esto le permitiría renombrar la función <literal>LOWER</literal> de SQL."
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr "Estadísticas de Hibernate"
#. Tag: para
+#: configuration.xml:1145
#, no-c-format
msgid ""
"If you enable <literal>hibernate.generate_statistics</literal>, Hibernate "
@@ -1819,11 +2245,13 @@
"stats</literal> para obtener más información."
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr "Registros de mensajes (Logging)"
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
msgid ""
"Hibernate utilizes <ulink url=\"http://www.slf4j.org/\">Simple Logging "
@@ -1854,6 +2282,7 @@
"literal>."
#. Tag: para
+#: configuration.xml:1171
#, no-c-format
msgid ""
"It is recommended that you familiarize yourself with Hibernate's log "
@@ -1869,56 +2298,67 @@
"registro más interesantes son las siguientes: "
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr "Categorías de Registro de Hibernate"
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr "Categoría"
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr "Función"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
+#. Tag: literal
+#: configuration.xml:1195
+#, fuzzy, no-c-format
+msgid "org.hibernate.SQL"
msgstr "<literal>org.hibernate.SQL</literal>"
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr "Registra todas las declaraciones DML de SQL a medida que se ejecutan"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
+#. Tag: literal
+#: configuration.xml:1201
+#, fuzzy, no-c-format
+msgid "org.hibernate.type"
msgstr "<literal>org.hibernate.type</literal>"
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr "Registra todos los parámetros JDBC"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+#. Tag: literal
+#: configuration.xml:1207
+#, fuzzy, no-c-format
+msgid "org.hibernate.tool.hbm2ddl"
msgstr "<literal>org.hibernate.tool.hbm2ddl</literal>"
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr "Registra todas las declaraciones DDL de SQL a medida que se ejecutan"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
+#. Tag: literal
+#: configuration.xml:1213
+#, fuzzy, no-c-format
+msgid "org.hibernate.pretty"
msgstr "<literal>org.hibernate.pretty</literal>"
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
msgid ""
"Log the state of all entities (max 20 entities) associated with the session "
@@ -1927,62 +2367,74 @@
"Registra el estado de todas las entidades (máximo 20 entidades) asociadas "
"con la sesión en tiempo de limpieza (flush)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
+#. Tag: literal
+#: configuration.xml:1220
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache"
msgstr "<literal>org.hibernate.cache</literal>"
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr "Registra toda la actividad del caché de segundo nivel"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+#. Tag: literal
+#: configuration.xml:1226
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction"
msgstr "<literal>org.hibernate.transaction</literal>"
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr "Registra la actividad relacionada con la transacción"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
+#. Tag: literal
+#: configuration.xml:1232
+#, fuzzy, no-c-format
+msgid "org.hibernate.jdbc"
msgstr "<literal>org.hibernate.jdbc</literal>"
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr "Registra toda adquisición de recursos JDBC"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+#. Tag: literal
+#: configuration.xml:1238
+#, fuzzy, no-c-format
+msgid "org.hibernate.hql.ast.AST"
msgstr "<literal>org.hibernate.hql.ast.AST</literal>"
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr "Regista los ASTs de HQL y SQL, durante análisis de consultas."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
+#. Tag: literal
+#: configuration.xml:1244
+#, fuzzy, no-c-format
+msgid "org.hibernate.secure"
msgstr "<literal>org.hibernate.secure</literal>"
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr "Registra todas las peticiones de autorización JAAS"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1250
#, no-c-format
-msgid "<literal>org.hibernate</literal>"
-msgstr "<literal>org.hibernate</literal>"
+msgid "org.hibernate"
+msgstr ""
#. Tag: entry
+#: configuration.xml:1252
#, no-c-format
msgid ""
"Log everything. This is a lot of information but it is useful for "
@@ -1992,6 +2444,7 @@
"problemas"
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
msgid ""
"When developing applications with Hibernate, you should almost always work "
@@ -2005,11 +2458,13 @@
"literal> habilitada."
#. Tag: title
+#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr "Implementación de una <literal>NamingStrategy</literal>"
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
msgid ""
"The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you "
@@ -2020,6 +2475,7 @@
"los elementos del esquema."
#. Tag: para
+#: configuration.xml:1272
#, no-c-format
msgid ""
"You can provide rules for automatically generating database identifiers from "
@@ -2038,6 +2494,7 @@
"bastante mínima."
#. Tag: para
+#: configuration.xml:1279
#, no-c-format
msgid ""
"You can specify a different strategy by calling <literal>Configuration."
@@ -2046,7 +2503,19 @@
"Puede especificar una estrategia diferente llamando a <literal>Configuration."
"setNamingStrategy()</literal> antes de agregar los mapeos:"
+#. Tag: programlisting
+#: configuration.xml:1283
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
msgid ""
"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in "
@@ -2057,11 +2526,13 @@
"aplicaciones."
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr "Archivo de configuración XML"
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
msgid ""
"An alternative approach to configuration is to specify a full configuration "
@@ -2076,6 +2547,7 @@
"sobrescribir propiedades."
#. Tag: para
+#: configuration.xml:1299
#, no-c-format
msgid ""
"The XML configuration file is by default expected to be in the root of your "
@@ -2084,7 +2556,53 @@
"El archivo de configuración XML por defecto se espera en la raíz de su "
"<literal>CLASSPATH</literal>. Este es un ejemplo:"
+#. Tag: programlisting
+#: configuration.xml:1302
+#, no-c-format
+msgid ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1304
#, no-c-format
msgid ""
"The advantage of this approach is the externalization of the mapping file "
@@ -2102,21 +2620,42 @@
"los beneficios de utilizar la sintaxis XML que mencionados anteriormente."
#. Tag: para
+#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr "Con la configuración XML, iniciar Hibernate es tan simple como:"
+#. Tag: programlisting
+#: configuration.xml:1314
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
-msgstr "Puede seleccionar un fichero de configuración XML diferente utilizando:"
+msgstr ""
+"Puede seleccionar un fichero de configuración XML diferente utilizando:"
+#. Tag: programlisting
+#: configuration.xml:1318
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr "Integración con Servidores de Aplicaciones J2EE"
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr ""
@@ -2124,6 +2663,7 @@
"J2EE:"
#. Tag: para
+#: configuration.xml:1329
#, no-c-format
msgid ""
"<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC "
@@ -2146,6 +2686,7 @@
"literal> de Hibernate para mantener portátil su código."
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
msgid ""
"<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its "
@@ -2155,6 +2696,7 @@
"sus <literal>SessionFactory</literal> a JNDI después del inicio."
#. Tag: para
+#: configuration.xml:1350
#, no-c-format
msgid ""
"<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</"
@@ -2174,6 +2716,7 @@
"(CMT) o programática (BMT/UserTransaction)."
#. Tag: para
+#: configuration.xml:1362
#, no-c-format
msgid ""
"<emphasis>JMX deployment:</emphasis> if you have a JMX capable application "
@@ -2194,6 +2737,7 @@
"de que Hibernate inicie, etc)."
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
msgid ""
"Depending on your environment, you might have to set the configuration "
@@ -2206,11 +2750,13 @@
"conexión\"."
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr "Configuración de la estrategia de transacción"
#. Tag: para
+#: configuration.xml:1381
#, no-c-format
msgid ""
"The Hibernate <literal>Session</literal> API is independent of any "
@@ -2229,6 +2775,7 @@
"<literal>UserTransaction</literal> cuando sea necesario."
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
msgid ""
"To keep your code portable between these two (and other) environments we "
@@ -2246,26 +2793,31 @@
"literal> de Hibernate."
#. Tag: para
+#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr "Existen tres opciones estándares o incorporadas:"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1401
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr "delega a transacciones de bases de datos (JDBC) (por defecto)"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1409
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1412
#, no-c-format
msgid ""
"delegates to container-managed transactions if an existing transaction is "
@@ -2277,17 +2829,20 @@
"de bean de sesión EJB). De otra manera, se inicia una nueva transacción y se "
"utilizan las transacciones administradas por bean."
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1420
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr "delega a transacciones JTA administradas por el contenedor"
#. Tag: para
+#: configuration.xml:1428
#, no-c-format
msgid ""
"You can also define your own transaction strategies (for a CORBA transaction "
@@ -2297,6 +2852,7 @@
"para un servicio de transacción CORBA)."
#. Tag: para
+#: configuration.xml:1431
#, no-c-format
msgid ""
"Some features in Hibernate (i.e., the second level cache, Contextual "
@@ -2314,134 +2870,163 @@
"no estandariza un sólo mecanismo:"
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr "TransactionManagers de JTA"
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr "Transaction Factory"
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr "Servidor de Aplicaciones"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1456
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr "JBoss"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1462
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr "Weblogic"
-#. Tag: entry
-#, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
-"literal>"
+#. Tag: literal
+#: configuration.xml:1468
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr "WebSphere"
-#. Tag: entry
-#, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
-"literal>"
+#. Tag: literal
+#: configuration.xml:1474
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr ""
"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr "WebSphere 6"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1480
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr "Orion"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1486
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr "Resin"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1492
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr "JOTM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1498
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr "JOnAS"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1504
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr "JRun4"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1510
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr "Borland ES"
#. Tag: title
+#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr "<literal>SessionFactory</literal> enlazado a JNDI"
#. Tag: para
+#: configuration.xml:1522
#, no-c-format
msgid ""
"A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the "
@@ -2456,6 +3041,7 @@
"utilizan el mismo registro."
#. Tag: para
+#: configuration.xml:1528
#, no-c-format
msgid ""
"If you wish to have the <literal>SessionFactory</literal> bound to a JNDI "
@@ -2474,6 +3060,7 @@
"lectura por defecto (por ejemplo, en Tomcat)."
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
msgid ""
"When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will "
@@ -2487,6 +3074,7 @@
"especifican, se utilizará el <literal>InitialContext</literal> por defecto."
#. Tag: para
+#: configuration.xml:1542
#, no-c-format
msgid ""
"Hibernate will automatically place the <literal>SessionFactory</literal> in "
@@ -2504,6 +3092,7 @@
"mayor detalle)."
#. Tag: para
+#: configuration.xml:1550
#, no-c-format
msgid ""
"If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other "
@@ -2515,7 +3104,8 @@
"utilizando una búsqueda JNDI."
#. Tag: para
-#, no-c-format
+#: configuration.xml:1554
+#, fuzzy, no-c-format
msgid ""
"It is recommended that you bind the <literal>SessionFactory</literal> to "
"JNDI in a managed environment and use a <literal>static</literal> singleton "
@@ -2523,7 +3113,7 @@
"recommend to hide the actual lookup code for a <literal>SessionFactory</"
"literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory"
"()</literal>. Note that such a class is also a convenient way to startup "
-"Hibernate—see chapter 1."
+"Hibernate—see chapter 1."
msgstr ""
"Le recomendamos que vincule el <literal>SessionFactory</literal> a JNDI en "
"un entorno administrado y que de otra manera, use un singleton "
@@ -2534,22 +3124,24 @@
"también es una manera práctica de iniciar Hibernate— vea el capítulo 1."
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr "Administración de contexto de Sesión Actual con JTA"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1567
+#, fuzzy, no-c-format
msgid ""
"The easiest way to handle <literal>Sessions</literal> and transactions is "
"Hibernate's automatic \"current\" <literal>Session</literal> management. For "
"a discussion of contextual sessions see <xref linkend=\"architecture-current-"
-"session\" />. Using the <literal>\"jta\"</literal> session context, if there "
+"session\"/>. Using the <literal>\"jta\"</literal> session context, if there "
"is no Hibernate <literal>Session</literal> associated with the current JTA "
"transaction, one will be started and associated with that JTA transaction "
"the first time you call <literal>sessionFactory.getCurrentSession()</"
"literal>. The <literal>Session</literal>s retrieved via "
-"<literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> "
+"<literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> "
"context are set to automatically flush before the transaction completes, "
"close after the transaction completes, and aggressively release JDBC "
"connections after each statement. This allows the <literal>Session</"
@@ -2584,11 +3176,13 @@
"con CTM."
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr "Despliegue JMX"
#. Tag: para
+#: configuration.xml:1592
#, no-c-format
msgid ""
"The line <literal>cfg.buildSessionFactory()</literal> still has to be "
@@ -2604,6 +3198,7 @@
"desplegar Hibernate como un <emphasis>servicio administrado</emphasis>."
#. Tag: para
+#: configuration.xml:1598
#, no-c-format
msgid ""
"Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</"
@@ -2617,7 +3212,64 @@
"vendedor. He aquí un ejemplo de <literal>jboss-service.xml</literal> para "
"JBoss 4.0.x: "
+#. Tag: programlisting
+#: configuration.xml:1604
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1606
#, no-c-format
msgid ""
"This file is deployed in a directory called <literal>META-INF</literal> and "
@@ -2641,3 +3293,17 @@
"apagarlo). Consulte la documentación de JBoss AS para obtener más "
"información sobre el servicio JMX y la implementación de EJB."
+#~ msgid "<emphasis>JDBC URL</emphasis>"
+#~ msgstr "<emphasis>URL JDBC</emphasis>"
+
+#~ msgid "<emphasis>database user</emphasis>"
+#~ msgstr "<emphasis>usuario de la base de datos</emphasis>"
+
+#~ msgid "<property>hibernate.generate_statistics</property>"
+#~ msgstr "<property>hibernate.generate_statistics</property>"
+
+#~ msgid "DB2"
+#~ msgstr "DB2"
+
+#~ msgid "<literal>org.hibernate</literal>"
+#~ msgstr "<literal>org.hibernate</literal>"
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/filters.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/filters.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/filters.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: filters\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:35\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-11-11 08:28+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,11 +24,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr "Filtración de datos"
#. Tag: para
+#: filters.xml:33
#, no-c-format
msgid ""
"Hibernate3 provides an innovative new approach to handling data with "
@@ -42,11 +44,13 @@
"deshabilitado para una sesión de Hibernate especifica."
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr "Filtros de Hibernate"
#. Tag: para
+#: filters.xml:41
#, no-c-format
msgid ""
"Hibernate3 has the ability to pre-define filter criteria and attach those "
@@ -69,9 +73,95 @@
"parametrizados dentro de la aplicación."
#. Tag: para
+#: filters.xml:50
#, no-c-format
msgid ""
-"In order to use filters, they must first be defined and then attached to the "
+"Using annotatons filters are defined via <literal>@org.hibernate.annotations."
+"FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</"
+"literal>. A filter definition has a <methodname>name()</methodname> 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 "
+"<methodname>defaultCondition()</methodname> parameter for a given "
+"<literal>@FilterDef</literal> to set the default condition to use when none "
+"are defined in each individual <literal>@Filter</literal>. "
+"<literal>@FilterDef</literal>(s) can be defined at the class or package "
+"level."
+msgstr ""
+
+#. Tag: para
+#: filters.xml:63
+#, 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. The connection between "
+"<classname>@FilterName</classname> and <classname>@Filter</classname> is a "
+"matching name."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
+#, 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 want "
+"to target the association table, use the <literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid ""
+"Using <classname>@FilterJoinTable</classname> for filterting on the "
+"association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files for defining filters the situtation is very "
+"similar. The filters must first be defined and then attached to the "
"appropriate mapping elements. To define a filter, use the <literal><"
"filter-def/></literal> element within a <literal><hibernate-mapping/"
"></literal> element:"
@@ -81,22 +171,58 @@
"elemento <literal><filter-def/></literal> dentro de un elemento "
"<literal><hibernate-mapping/></literal>:"
-#. Tag: para
+#. Tag: title
+#: filters.xml:97
#, no-c-format
-msgid "This filter can then be attached to a class:"
-msgstr "Luego este filtro se puede adjuntar a una clase:"
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
+#. Tag: programlisting
+#: filters.xml:100
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"This filter can then be attached to a class or collection (or, to both or "
+"multiples of each at the same time):"
+msgstr "O incluso a ambos o múltiples de cada uno al mismo tiempo."
+
+#. Tag: title
+#: filters.xml:107
#, no-c-format
-msgid "Or, to a collection:"
-msgstr "O a una colección:"
+msgid ""
+"Attaching a filter to a class or collection using <literal><filter></"
+"literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: filters.xml:110
#, no-c-format
-msgid "Or, to both or multiples of each at the same time."
-msgstr "O incluso a ambos o múltiples de cada uno al mismo tiempo."
+msgid ""
+"<class name=\"myClass\" ...>\n"
+" ...\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+"\n"
+" <set ...>\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+" </set> \n"
+"</class>"
+msgstr ""
#. Tag: para
+#: filters.xml:113
#, no-c-format
msgid ""
"The methods on <literal>Session</literal> are: <literal>enableFilter(String "
@@ -117,7 +243,18 @@
"instancia de la interfaz <literal>Filter</literal>. Si se utiliza el filtro "
"simple definido anteriormente, esto se vería así:"
+#. Tag: programlisting
+#: filters.xml:123
+#, fuzzy, no-c-format
+msgid ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+msgstr ""
+"<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", "
+"\"some-value\");]]>"
+
#. Tag: para
+#: filters.xml:125
#, no-c-format
msgid ""
"Methods on the org.hibernate.Filter interface do allow the method-chaining "
@@ -127,6 +264,7 @@
"de métodos, lo cual es bastante común en gran parte de Hibernate."
#. Tag: para
+#: filters.xml:128
#, no-c-format
msgid ""
"The following is a full example, using temporal data with an effective "
@@ -135,7 +273,79 @@
"Este es un ejemplo completo, utilizando datos temporales con un patrón "
"efectivo de fechas de registro: "
+#. Tag: programlisting
+#: filters.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department\"/"
+">\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column=\"eff_start_dt"
+"\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt\"/"
+">\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>]]>"
+
#. Tag: para
+#: filters.xml:133
#, no-c-format
msgid ""
"In order to ensure that you are provided with currently effective records, "
@@ -145,7 +355,29 @@
"actualmente, habilite el filtro en la sesión antes de recuperar los datos de "
"los empleados:"
+#. Tag: programlisting
+#: filters.xml:137
+#, fuzzy, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+msgstr ""
+"<![CDATA[Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();\n"
+"]]>"
+
#. Tag: para
+#: filters.xml:139
#, no-c-format
msgid ""
"Even though a salary constraint was mentioned explicitly on the results in "
@@ -159,6 +391,7 @@
"millón de dólares."
#. Tag: para
+#: filters.xml:144
#, no-c-format
msgid ""
"If you want to use filters with outer joining, either through HQL or load "
@@ -173,6 +406,7 @@
"columna(s) después del operador."
#. Tag: para
+#: filters.xml:149
#, no-c-format
msgid ""
"After being defined, a filter might be attached to multiple entities and/or "
@@ -187,7 +421,20 @@
"<literal><filter-def/></literal> le permite definir una condición por "
"defecto, ya sea como atributo o como CDATA:"
+#. Tag: programlisting
+#: filters.xml:155
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</filter-"
+"def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:157
#, no-c-format
msgid ""
"This default condition will be used whenever the filter is attached to "
@@ -200,15 +447,12 @@
"condición especifica como parte del anexo del filtro, el cual substituye la "
"condición por defecto en ese caso en particular."
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
+#~ msgid "This filter can then be attached to a class:"
+#~ msgstr "Luego este filtro se puede adjuntar a una clase:"
+#~ msgid "Or, to a collection:"
+#~ msgstr "O a una colección:"
+
#~ msgid ""
#~ "<![CDATA[<class name=\"myClass\" ...>\n"
#~ " ...\n"
@@ -232,107 +476,3 @@
#~ " <filter name=\"myFilter\" condition=\":myFilterParam = "
#~ "MY_FILTERED_COLUMN\"/>\n"
#~ "</set>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-#~ msgstr ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/performance.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/performance.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/performance.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: performance\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-17 10:28+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,16 +24,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "Mejoramiento del rendimiento"
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "Estrategias de recuperación"
#. Tag: para
+#: performance.xml:36
#, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve "
@@ -48,11 +51,13 @@
"particular o una petición <literal>Criteria</literal>."
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 define las siguientes estrategias de recuperación:"
#. Tag: para
+#: performance.xml:46
#, no-c-format
msgid ""
"<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated "
@@ -64,6 +69,7 @@
"literal>, utilizando un <literal>OUTER JOIN</literal>."
#. Tag: para
+#: performance.xml:53
#, no-c-format
msgid ""
"<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is "
@@ -78,6 +84,7 @@
"selección sólo será ejecutada cuando acceda a la asociación."
#. Tag: para
+#: performance.xml:61
#, no-c-format
msgid ""
"<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> "
@@ -94,6 +101,7 @@
"se ejecutará cuando acceda a la asociación."
#. Tag: para
+#: performance.xml:70
#, no-c-format
msgid ""
"<emphasis>Batch fetching</emphasis>: an optimization strategy for select "
@@ -107,11 +115,13 @@
"una lista de claves principales o de claves foráneas."
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "Hibernate también distingue entre:"
#. Tag: para
+#: performance.xml:81
#, no-c-format
msgid ""
"<emphasis>Immediate fetching</emphasis>: an association, collection or "
@@ -121,6 +131,7 @@
"atributo se recupera inmediatamente cuando se carga el dueño."
#. Tag: para
+#: performance.xml:87
#, no-c-format
msgid ""
"<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when "
@@ -132,6 +143,7 @@
"es el valor predeterminado para las colecciones."
#. Tag: para
+#: performance.xml:93
#, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements "
@@ -146,6 +158,7 @@
"grandes."
#. Tag: para
+#: performance.xml:101
#, no-c-format
msgid ""
"<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched "
@@ -157,6 +170,7 @@
"sobre el objeto asociado."
#. Tag: para
+#: performance.xml:107
#, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is "
@@ -175,6 +189,7 @@
"y se necesita muy raramente."
#. Tag: para
+#: performance.xml:117
#, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued "
@@ -187,6 +202,7 @@
"estimado de construcción y se necesita muy raramente."
#. Tag: para
+#: performance.xml:124
#, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when</emphasis> is the "
@@ -204,11 +220,13 @@
"separada de una clase en particular."
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "Trabajo con asociaciones perezosas"
#. Tag: para
+#: performance.xml:134
#, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
@@ -221,6 +239,7 @@
"las asociaciones en la mayoría de las aplicaciones."
#. Tag: para
+#: performance.xml:138
#, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate "
@@ -233,6 +252,7 @@
"nivel más detallado."
#. Tag: para
+#: performance.xml:142
#, no-c-format
msgid ""
"Please be aware that access to a lazy association outside of the context of "
@@ -241,7 +261,25 @@
"Note que el acceder a una asociación perezosa fuera del contexto de una "
"sesión de Hibernate abierta resultará en una excepción. Por ejemplo:"
+#. Tag: programlisting
+#: performance.xml:146
+#, no-c-format
+msgid ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+
#. Tag: para
+#: performance.xml:148
#, no-c-format
msgid ""
"Since the permissions collection was not initialized when the "
@@ -257,6 +295,7 @@
"a justo antes de que se guarde la transacción."
#. Tag: para
+#: performance.xml:155
#, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
@@ -274,6 +313,7 @@
"base de datos entera en toda transacción."
#. Tag: para
+#: performance.xml:162
#, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
@@ -290,11 +330,13 @@
"colecciones."
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "Afinación de las estrategias de recuperación"
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
@@ -304,7 +346,25 @@
"vulnerable a problemas de selección N+1, de modo que puede que queramos "
"habilitar la recuperación por unión (join fetching) en el documento de mapeo:"
+#. Tag: programlisting
+#: performance.xml:176
+#, no-c-format
+msgid ""
+"<set name=\"permissions\"\n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:178
+#, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch</literal> strategy defined in the mapping document "
@@ -314,6 +374,7 @@
"mapeo afecta a:"
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr ""
@@ -321,6 +382,7 @@
"literal>"
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr ""
@@ -328,17 +390,20 @@
"asociación (recuperación perezosa)"
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr "las consultas de <literal>Criteria</literal>"
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr ""
"las consultas HQL si se utiliza la recuperación <literal>subselect</literal>"
#. Tag: para
+#: performance.xml:204
#, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
@@ -351,6 +416,7 @@
"una consulta HQL en particular."
#. Tag: para
+#: performance.xml:209
#, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
@@ -369,6 +435,7 @@
"<literal>setFetchMode(FetchMode.JOIN)</literal>."
#. Tag: para
+#: performance.xml:216
#, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get()</literal> "
@@ -379,7 +446,18 @@
"</literal> o <literal>load()</literal>; utilice una consulta "
"<literal>Criteria</literal>. Por ejemplo:"
+#. Tag: programlisting
+#: performance.xml:220
+#, no-c-format
+msgid ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:222
#, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
@@ -389,6 +467,7 @@
"un \"plan de recuperación\"."
#. Tag: para
+#: performance.xml:225
#, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
@@ -398,11 +477,13 @@
"es usar el caché de segundo nivel."
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "Proxies de asociaciones de un sólo extremo"
#. Tag: para
+#: performance.xml:232
#, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
@@ -421,6 +502,7 @@
"ejecución por medio de la biblioteca CGLIB)."
#. Tag: para
+#: performance.xml:239
#, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
@@ -432,6 +514,7 @@
"asociaciones <literal>muchos-a-uno</literal> y <literal>uno-a-uno</literal>."
#. Tag: para
+#: performance.xml:244
#, no-c-format
msgid ""
"The mapping file may declare an interface to use as the proxy interface for "
@@ -448,6 +531,7 @@
"persistentes</emphasis>."
#. Tag: para
+#: performance.xml:251
#, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
@@ -456,7 +540,20 @@
"Hay problemas potenciales que se deben tener en cuenta al extender este "
"enfoque a las clases polimórficas. Por ejemplo:"
+#. Tag: programlisting
+#: performance.xml:254
+#, no-c-format
+msgid ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat</literal> will never be castable to "
@@ -467,12 +564,39 @@
"cast a <literal>DomesticCat</literal>, incluso aunque la instancia "
"subyacente sea una instancia de <literal>DomesticCat</literal>:"
+#. Tag: programlisting
+#: performance.xml:260
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr "Segundo, es posible romper el proxy <literal>==</literal>:"
+#. Tag: programlisting
+#: performance.xml:265
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+msgstr ""
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
@@ -483,7 +607,16 @@
"tenemos ahora dos referencias a objetos proxy diferentes, la instancia "
"subyacente será aún el mismo objeto:"
+#. Tag: programlisting
+#: performance.xml:271
+#, no-c-format
+msgid ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+
#. Tag: para
+#: performance.xml:273
#, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or "
@@ -493,6 +626,7 @@
"literal> o una clase con algún método <literal>final</literal>."
#. Tag: para
+#: performance.xml:276
#, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
@@ -506,6 +640,7 @@
"proxy es una subclase real de la clase persistente. "
#. Tag: para
+#: performance.xml:281
#, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
@@ -524,7 +659,20 @@
"literal> y <literal>DomesticCatImpl</literal> implementa la interfaz "
"<literal>DomesticCat</literal>. Por ejemplo:"
+#. Tag: programlisting
+#: performance.xml:289
+#, no-c-format
+msgid ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:291
#, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat</literal> and "
@@ -535,17 +683,30 @@
"<literal>DomesticCat</literal> pueden ser retornadas por <literal>load()</"
"literal> o <literal>iterate()</literal>."
+#. Tag: programlisting
+#: performance.xml:295
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr "Nota"
#. Tag: para
+#: performance.xml:300
#, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr "<literal>list()</literal> usualmente no retorna proxies."
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
@@ -557,6 +718,7 @@
"<literal>CatImpl</literal>."
#. Tag: para
+#: performance.xml:308
#, no-c-format
msgid ""
"Certain operations do <emphasis>not</emphasis> require proxy initialization:"
@@ -565,6 +727,7 @@
"proxies:"
#. Tag: para
+#: performance.xml:313
#, no-c-format
msgid ""
"<literal>equals()</literal>: if the persistent class does not override "
@@ -574,6 +737,7 @@
"<literal>equals()</literal> "
#. Tag: para
+#: performance.xml:318
#, no-c-format
msgid ""
"<literal>hashCode()</literal>: if the persistent class does not override "
@@ -583,11 +747,13 @@
"<literal>hashCode()</literal> "
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "El método getter del identificador"
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()</"
@@ -597,6 +763,7 @@
"()</literal> o <literal>hashCode()</literal>."
#. Tag: para
+#: performance.xml:330
#, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default "
@@ -611,11 +778,13 @@
"las operaciones resultarán en una inicialización de proxies inmediata."
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "Inicialización de colecciones y proxies"
#. Tag: para
+#: performance.xml:340
#, no-c-format
msgid ""
"A <literal>LazyInitializationException</literal> will be thrown by Hibernate "
@@ -629,6 +798,7 @@
"colección o que tiene la referencia al proxy esté en el estado separado."
#. Tag: para
+#: performance.xml:346
#, no-c-format
msgid ""
"Sometimes a proxy or collection needs to be initialized before closing the "
@@ -644,6 +814,7 @@
"del código y no es conveniente para el código genérico."
#. Tag: para
+#: performance.xml:353
#, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize()</literal> and "
@@ -664,6 +835,7 @@
"colección de gatitos. "
#. Tag: para
+#: performance.xml:362
#, no-c-format
msgid ""
"Another option is to keep the <literal>Session</literal> open until all "
@@ -683,6 +855,7 @@
"inicializa una colección. Existen dos formas básicas para abordar este tema: "
#. Tag: para
+#: performance.xml:372
#, no-c-format
msgid ""
"In a web-based application, a servlet filter can be used to close the "
@@ -707,6 +880,7 @@
"ejemplos de este patrón \"Open Session in View\" (sesión abierta en vista). "
#. Tag: para
+#: performance.xml:385
#, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
@@ -736,6 +910,7 @@
"Sesión</emphasis>."
#. Tag: para
+#: performance.xml:401
#, no-c-format
msgid ""
"You can also attach a previously loaded object to a new <literal>Session</"
@@ -751,6 +926,7 @@
"automáticamente ya que introduciría semánticas de transacción improvisadas."
#. Tag: para
+#: performance.xml:410
#, no-c-format
msgid ""
"Sometimes you do not want to initialize a large collection, but still need "
@@ -762,6 +938,7 @@
"de los datos."
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid ""
"You can use a collection filter to get the size of a collection without "
@@ -770,7 +947,16 @@
"Puede utilizar un filtro de colecciones para obtener el tamaño de una "
"colección sin inicializarla:"
+#. Tag: programlisting
+#: performance.xml:417
+#, no-c-format
+msgid ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+msgstr ""
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid ""
"The <literal>createFilter()</literal> method is also used to efficiently "
@@ -781,12 +967,22 @@
"recuperar eficientemente subconjuntos de una colección sin necesidad de "
"inicializar toda la colección:"
+#. Tag: programlisting
+#: performance.xml:423
+#, no-c-format
+msgid ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "Utilización de recuperación de lotes"
#. Tag: para
+#: performance.xml:429
#, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
@@ -801,6 +997,7 @@
"clase y a nivel de colección."
#. Tag: para
+#: performance.xml:434
#, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
@@ -826,7 +1023,14 @@
"especificando un <literal>batch-size</literal> en el mapeo de "
"<literal>Person</literal>:"
+#. Tag: programlisting
+#: performance.xml:447
+#, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:449
#, no-c-format
msgid ""
"Hibernate will now execute only three queries: the pattern is 10, 10, 5."
@@ -834,6 +1038,7 @@
"Hibernate ahora ejecutará sólamente tres consultas: el patrón es 10, 10, 5."
#. Tag: para
+#: performance.xml:452
#, no-c-format
msgid ""
"You can also enable batch fetching of collections. For example, if each "
@@ -853,7 +1058,19 @@
"<literal>cats</literal> en el mapeo de <literal>Person</literal>, Hibernate "
"puede recuperar por adelantado las colecciones: "
+#. Tag: programlisting
+#: performance.xml:461
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:463
#, no-c-format
msgid ""
"With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 "
@@ -867,6 +1084,7 @@
"<literal>Session</literal> en particular."
#. Tag: para
+#: performance.xml:468
#, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
@@ -881,11 +1099,13 @@
"árboles que sean de lectura en la mayoría de los casos."
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "Utilización de la recuperación por subselección"
#. Tag: para
+#: performance.xml:477
#, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
@@ -898,19 +1118,21 @@
"lotes, sin carga fragmentaria. "
#. Tag: title
+#: performance.xml:486
#, no-c-format
msgid "Fetch profiles"
msgstr "Perfiles de recuperación"
#. Tag: para
-#, no-c-format
+#: performance.xml:488
+#, fuzzy, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
"is through something called a fetch profile, which is a named configuration "
"associated with the <interfacename>org.hibernate.SessionFactory</"
"interfacename> but enabled, by name, on the <interfacename>org.hibernate."
"Session</interfacename>. Once enabled on a <interfacename>org.hibernate."
-"Session</interfacename>, the fetch profile wull be in affect for that "
+"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session</interfacename> until it is explicitly "
"disabled."
msgstr ""
@@ -924,25 +1146,118 @@
"interfacename> hasta que se deshabilite explícitamente."
#. Tag: para
-#, no-c-format
+#: performance.xml:498
+#, fuzzy, no-c-format
msgid ""
-"So what does that mean? Well lets explain that by way of an example. Say we "
-"have the following mappings:"
+"So what does that mean? Well lets explain that by way of an example which "
+"show the different available approaches to configure a fetch profile:"
msgstr ""
"¿Entonces qué significa? Vamos a explicarlo por medio de un ejemplo. Digamos "
"que tenemos los siguientes mapeos:"
-#. Tag: para
+#. Tag: title
+#: performance.xml:503
#, no-c-format
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
msgid ""
+"@Entity\n"
+"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+" @FetchProfile.FetchOverride(entity = Customer.class, association = "
+"\"orders\", mode = FetchMode.JOIN)\n"
+"})\n"
+"public class Customer {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" private long customerNumber;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Order> orders;\n"
+"\n"
+" // standard getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
+">\n"
+" </fetch-profile>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch association=\"orders\" style=\"join\"/>\n"
+" </fetch-profile>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:525
+#, fuzzy, no-c-format
+msgid ""
"Now normally when you get a reference to a particular customer, that "
"customer's set of orders will be lazy meaning we will not yet have loaded "
"those orders from the database. Normally this is a good thing. Now lets say "
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
-"to use a fetch profile to achieve that. Just add the following to your "
-"mapping:"
+"to use a fetch profile to achieve that. The following code will load both "
+"the customer <emphasis>and</emphasis>their orders:"
msgstr ""
"Ahora normalmente cuando reciba una referencia a un cliente en particular, "
"el grupo de pedidos será perezoso lo que significa que aún no habremos "
@@ -953,21 +1268,35 @@
"otra opción es utilizar un perfi de recuperación para lograr esto. "
"Simplemente agregue lo siguiente a su mapeo:"
-#. Tag: para
+#. Tag: title
+#: performance.xml:536
#, no-c-format
-msgid "or even:"
-msgstr "o incluso:"
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
+msgstr ""
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFetchProfile( \"customer-with-orders\" ); // name matches "
+"from mapping\n"
+"Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
msgid ""
-"Now the following code will actually load both the customer <emphasis>and "
-"their orders</emphasis>:"
+"<classname>@FetchProfile </classname>definitions are global and it does not "
+"matter on which class you place them. You can place the "
+"<classname>@FetchProfile</classname> annotation either onto a class or "
+"package (package-info.java). In order to define multiple fetch profiles for "
+"the same class or package <classname>@FetchProfiles</classname> can be used."
msgstr ""
-"Ahora el siguiente código de hecho cargará el cliente <emphasis>y sus "
-"órdenes</emphasis>:"
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
@@ -980,11 +1309,13 @@
"ulink> para obtener mayores detalles."
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "Utilización de la recuperación perezosa de propiedades"
#. Tag: para
+#: performance.xml:560
#, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
@@ -1005,6 +1336,7 @@
"cientos de columnas y el modelo de datos no puede ser mejorado."
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy</literal> attribute "
@@ -1013,7 +1345,24 @@
"Para habilitar la carga perezosa de propiedades, establezca el atributo "
"<literal>lazy</literal> en sus mapeos de propiedades:"
+#. Tag: programlisting
+#: performance.xml:571
+#, no-c-format
+msgid ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:573
#, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
@@ -1026,12 +1375,35 @@
"recuperación inmediata."
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr ""
"Para la instrumentación del código byte, utilice la siguiente tarea Ant:"
+#. Tag: programlisting
+#: performance.xml:579
+#, no-c-format
+msgid ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:581
#, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
@@ -1046,6 +1418,7 @@
"preferida."
#. Tag: para
+#: performance.xml:586
#, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
@@ -1055,11 +1428,13 @@
"<literal>fetch all properties</literal> en HQL."
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "El Caché de Segundo Nivel"
#. Tag: para
+#: performance.xml:594
#, no-c-format
msgid ""
"A Hibernate <literal>Session</literal> is a transaction-level cache of "
@@ -1080,15 +1455,17 @@
"expiren regularmente."
#. Tag: para
-#, no-c-format
+#: performance.xml:602
+#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property <literal>hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
-"integrations with the open-source cache providers that are listed below. You "
-"can also implement your own and plug it in as outlined above. Note that "
-"versions prior to 3.2 use EhCache as the default cache provider."
+"integrations with the open-source cache providers that are listed in <xref "
+"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
+"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
+"the default cache provider."
msgstr ""
"Tiene la opción de decirle a Hibernate cual implementación de caché utilizar "
"al especificar el nombre de una clase que implemente <literal>org.hibernate."
@@ -1100,157 +1477,398 @@
"por defecto utilizan EhCache como proveedor de caché."
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "Proveedores de Caché"
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "Caché"
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "Clase del Provedor"
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "Tipo"
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "Clúster Seguro"
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "Caché de Consultas Soportado"
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Hashtable (no fue pensado para la utilización en producción)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:644
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "memoria"
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674
+#: performance.xml:992 performance.xml:994 performance.xml:996
+#: performance.xml:1004 performance.xml:1006 performance.xml:1008
+#: performance.xml:1016 performance.xml:1018 performance.xml:1020
+#: performance.xml:1028 performance.xml:1030 performance.xml:1040
+#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
-msgstr "si"
+msgid "<entry>yes</entry>"
+msgstr ""
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:656
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr "<literal>org.hibernate.cache.EhCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "memoria, disco"
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:668
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr "<literal>org.hibernate.cache.OSCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:680
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "en clúster (ip multicast)"
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "sí (invalidación en clúster)"
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr "JBoss Cache 1.x"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:692
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "en clúster (ip multicast), transaccional"
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "sí (replicación)"
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "sí (requiere sincronización de reloj)"
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr "JBoss Cache 2"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+#. Tag: literal
+#: performance.xml:704
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
#. Tag: entry
+#: performance.xml:708
#, no-c-format
msgid "yes (replication or invalidation)"
msgstr "sí (replicación o invalidación)"
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "Mapeos de caché"
#. Tag: para
+#: performance.xml:719
#, no-c-format
msgid ""
-"The <literal><cache></literal> element of a class or collection "
-"mapping has the following form:"
+"As we have done in previous chapters we are looking at the two different "
+"possibiltites to configure caching. First configuration via annotations and "
+"then via Hibernate mapping files."
msgstr ""
-"El elemento <literal><cache></literal> de un mapeo de clase o "
-"colección tiene la siguiente forma:"
#. Tag: para
+#: performance.xml:723
#, no-c-format
msgid ""
+"By default, entities are not part of the second level cache and we recommend "
+"you to stick to this setting. However, you can override this by setting the "
+"<literal>shared-cache-mode</literal> element in your <filename>persistence."
+"xml</filename> file or by using the <literal>javax.persistence.sharedCache."
+"mode </literal>property in your configuration. The following values are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid ""
+"<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): "
+"entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid ""
+"<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly "
+"marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid ""
+"<literal>ALL</literal>: all entities are always cached even if marked as non "
+"cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid ""
+"<literal>NONE</literal>: no entity are cached even if marked as cacheable. "
+"This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid ""
+"The cache concurrency strategy used by default can be set globaly via the "
+"<literal>hibernate.cache.default_cache_concurrency_strategy</literal> "
+"configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, fuzzy, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr "las consultas de <literal>Criteria</literal>"
+
+#. Tag: literal
+#: performance.xml:765
+#, fuzzy, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr "las consultas de <literal>Criteria</literal>"
+
+#. Tag: literal
+#: performance.xml:769
+#, fuzzy, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr "nonstrict-read-write"
+
+#. Tag: literal
+#: performance.xml:773
+#, fuzzy, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr "las consultas de <literal>Criteria</literal>"
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid ""
+"It is recommended to define the cache concurrency strategy per entity rather "
+"than using a global one. Use the <classname>@org.hibernate.annotations."
+"Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid ""
+"Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+"@Entity \n"
+"@Cacheable\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid ""
+"Hibernate also let's you cache the content of a collection or the "
+"identifiers if the collection contains other entities. Use the "
+"<classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, fuzzy, no-c-format
+msgid "Caching collections using annotations"
+msgstr "Inicialización de colecciones y proxies"
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+"@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: para
+#: performance.xml:802
+#, no-c-format
+msgid ""
+"shows the<literal> @org.hibernate.annotations.Cache</literal> annotations "
+"with its attributes. It allows you to define the caching strategy and region "
+"of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid ""
+"Let's now take a look at Hibernate mapping files. There the <literal><"
+"cache></literal> element of a class or collection mapping is used to "
+"configure the second level cache. Looking at <xref linkend=\"example-"
+"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, no-c-format
+msgid ""
+"<cache\n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
+msgid ""
"<literal>usage</literal> (required) specifies the caching strategy: "
"<literal>transactional</literal>, <literal>read-write</literal>, "
"<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
@@ -1260,6 +1878,7 @@
"<literal>nonstrict-read-write</literal> o <literal>read-only</literal>"
#. Tag: para
+#: performance.xml:874
#, no-c-format
msgid ""
"<literal>region</literal> (optional: defaults to the class or collection "
@@ -1270,6 +1889,7 @@
"nivel."
#. Tag: para
+#: performance.xml:880
#, no-c-format
msgid ""
"<literal>include</literal> (optional: defaults to <literal>all</literal>) "
@@ -1283,31 +1903,31 @@
"cuando se habilita la recuperación perezoza a nivel de atributos."
#. Tag: para
-#, no-c-format
+#: performance.xml:890
+#, fuzzy, no-c-format
msgid ""
-"Alternatively, you can specify <literal><class-cache></literal> and "
-"<literal><collection-cache></literal> elements in <literal>hibernate."
-"cfg.xml</literal>."
+"Alternatively to <literal><cache></literal>, you can use <literal><"
+"class-cache></literal> and <literal><collection-cache></literal> "
+"elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
"Opcionalmente, puede especificar los elementos <literal><class-cache></"
"literal> y <literal><collection-cache></literal> en <literal>hibernate."
"cfg.xml</literal>."
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid ""
-"The <literal>usage</literal> attribute specifies a <emphasis>cache "
-"concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
-"El atributo <literal>usage</literal> especifica una <emphasis>estrategia de "
-"concurrencia al caché</emphasis>."
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr "Estrategia: sólo lectura"
#. Tag: para
+#: performance.xml:902
#, no-c-format
msgid ""
"If your application needs to read, but not modify, instances of a persistent "
@@ -1321,11 +1941,13 @@
"segura para utilizar en un clúster."
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "Estrategia: lectura/escritura (read/write)"
#. Tag: para
+#: performance.xml:911
#, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write</literal> "
@@ -1354,11 +1976,13 @@
"soportan bloqueos."
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr "Estrategia: lectura/escritura no estricta"
#. Tag: para
+#: performance.xml:929
#, no-c-format
msgid ""
"If the application only occasionally needs to update data (i.e. if it is "
@@ -1381,11 +2005,13 @@
"literal>."
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "Estrategia: transaccional"
#. Tag: para
+#: performance.xml:943
#, no-c-format
msgid ""
"The <literal>transactional</literal> cache strategy provides support for "
@@ -1399,11 +2025,13 @@
"<literal>hibernate.transaction.manager_lookup_class</literal>."
#. Tag: title
+#: performance.xml:950
#, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "Compatibilidad de proveedor de caché/estrategia de concurrencia"
#. Tag: para
+#: performance.xml:953
#, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
@@ -1412,6 +2040,7 @@
"concurrencia al caché. "
#. Tag: para
+#: performance.xml:957
#, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
@@ -1421,36 +2050,43 @@
"estrategias de concurrencia."
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr "Soporte a Estrategia de Concurrencia a Caché"
#. Tag: entry
+#: performance.xml:978
#, no-c-format
-msgid "read-only"
-msgstr "read-only"
+msgid "<entry>read-only</entry>"
+msgstr ""
#. Tag: entry
-#, no-c-format
-msgid "nonstrict-read-write"
+#: performance.xml:980
+#, fuzzy, no-c-format
+msgid "<entry>nonstrict-read-write</entry>"
msgstr "nonstrict-read-write"
#. Tag: entry
+#: performance.xml:982
#, no-c-format
-msgid "read-write"
-msgstr "read-write"
+msgid "<entry>read-write</entry>"
+msgstr ""
#. Tag: entry
-#, no-c-format
-msgid "transactional"
+#: performance.xml:984
+#, fuzzy, no-c-format
+msgid "<entry>transactional</entry>"
msgstr "transactional"
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "Gestión de cachés"
#. Tag: para
+#: performance.xml:1069
#, no-c-format
msgid ""
"Whenever you pass an object to <literal>save()</literal>, <literal>update()</"
@@ -1468,6 +2104,7 @@
"literal>."
#. Tag: para
+#: performance.xml:1076
#, no-c-format
msgid ""
"When <literal>flush()</literal> is subsequently called, the state of that "
@@ -1484,7 +2121,29 @@
"()</literal> para quitar el objeto y sus colecciones del caché de primer "
"nivel. "
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid ""
+"Explcitly evicting a cached instance from the first level cache using "
+"<methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, no-c-format
+msgid ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session</literal> also provides a <literal>contains()</literal> "
@@ -1495,6 +2154,7 @@
"sesión."
#. Tag: para
+#: performance.xml:1094
#, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear()</"
@@ -1504,6 +2164,7 @@
"<literal>Session.clear()</literal>. "
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
@@ -1514,7 +2175,28 @@
"<literal>SessionFactory</literal> para explusar el estado en caché de una "
"instancia, clase entera, instancia de colección o rol entero de colección."
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid ""
+"Second-level cache eviction via <methodname>SessionFactoty.evict() </"
+"methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, no-c-format
+msgid ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1110
#, no-c-format
msgid ""
"The <literal>CacheMode</literal> controls how a particular session interacts "
@@ -1524,6 +2206,7 @@
"sesión en particular con el caché de segundo nivel:"
#. Tag: para
+#: performance.xml:1115
#, no-c-format
msgid ""
"<literal>CacheMode.NORMAL</literal>: will read items from and write items to "
@@ -1533,6 +2216,7 @@
"el caché del segundo nivel"
#. Tag: para
+#: performance.xml:1120
#, no-c-format
msgid ""
"<literal>CacheMode.GET</literal>: will read items from the second-level "
@@ -1542,6 +2226,7 @@
"escribe al caché de segundo nivel excepto cuando actualiza datos"
#. Tag: para
+#: performance.xml:1126
#, no-c-format
msgid ""
"<literal>CacheMode.PUT</literal>: will write items to the second-level "
@@ -1551,6 +2236,7 @@
"No lee del caché de segundo nivel"
#. Tag: para
+#: performance.xml:1131
#, no-c-format
msgid ""
"<literal>CacheMode.REFRESH</literal>: will write items to the second-level "
@@ -1565,6 +2251,7 @@
"base de datos"
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
@@ -1573,7 +2260,27 @@
"Para navegar por los contenidos de una región de caché de segundo nivel o de "
"consultas, use la API de <literal>Statistics</literal>:"
+#. Tag: title
+#: performance.xml:1143
+#, fuzzy, no-c-format
+msgid ""
+"Browsing the second-level cache entries via the <classname>Statistics</"
+"classname> API"
+msgstr ""
+"Para navegar por los contenidos de una región de caché de segundo nivel o de "
+"consultas, use la API de <literal>Statistics</literal>:"
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, no-c-format
+msgid ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1149
#, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
@@ -1584,11 +2291,27 @@
"para humanos: "
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, no-c-format
+msgid ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr "El Caché de Consultas"
#. Tag: para
+#: performance.xml:1162
#, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
@@ -1599,11 +2322,13 @@
"mismos parámetros."
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr "Habilitación del caché de peticiones"
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
@@ -1625,12 +2350,20 @@
"el caché de los resultados de una petición por defecto. Para utilizar el "
"caché de peticiones primero necesita habilitar el caché de peticiones:"
+#. Tag: programlisting
+#: performance.xml:1177
+#, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr "Esta configuración crea dos nuevas regiones de caché:"
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the "
@@ -1640,6 +2373,7 @@
"resultados de la petición en caché"
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding "
@@ -1652,10 +2386,11 @@
"desde el caché de peticiones."
#. Tag: para
+#: performance.xml:1194
#, fuzzy, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
-"timeouts is is very important that the cache timeout of the underlying cache "
+"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
@@ -1670,6 +2405,7 @@
"apropiado una política de expiración de caché LRU. "
#. Tag: para
+#: performance.xml:1203
#, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
@@ -1688,6 +2424,7 @@
"existentes en caché o que agregue sus resultados al caché cuando se ejecuta."
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
@@ -1704,11 +2441,13 @@
"petición (así como con el caché de colección). "
#. Tag: title
+#: performance.xml:1221
#, no-c-format
msgid "Query cache regions"
msgstr "Regiones de caché de consultas"
#. Tag: para
+#: performance.xml:1223
#, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
@@ -1720,7 +2459,21 @@
"una consulta en particular llamando a <literal>Query.setCacheRegion()</"
"literal>."
+#. Tag: programlisting
+#: performance.xml:1227
+#, no-c-format
+msgid ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1229
#, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
@@ -1745,11 +2498,13 @@
"evictQueries()</literal>."
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "Comprensión del rendimiento de Colecciones"
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
@@ -1761,31 +2516,37 @@
"colecciones en tiempo de ejecución. "
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "Taxonomía"
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "Hibernate define tres tipos básicos de colecciones:"
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "colecciones de valores"
#. Tag: para
+#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr "Asociaciones uno-a-muchos "
#. Tag: para
+#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr "Aociaciones muchos-a-muchos"
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
@@ -1803,21 +2564,25 @@
"Esto sugiere la siguiente clasificación:"
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "colecciones indexadas"
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "conjuntos (sets)"
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "bolsas (bags)"
#. Tag: para
+#: performance.xml:1288
#, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
@@ -1834,6 +2599,7 @@
"Hibernate intenta actualizarla o borrarla."
#. Tag: para
+#: performance.xml:1295
#, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key></literal> and "
@@ -1858,6 +2624,7 @@
"todas las columnas como <literal>not-null=\"true\"</literal>."
#. Tag: para
+#: performance.xml:1306
#, no-c-format
msgid ""
"<literal><idbag></literal> mappings define a surrogate key, so they "
@@ -1868,6 +2635,7 @@
"mejor caso."
#. Tag: para
+#: performance.xml:1309
#, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
@@ -1884,6 +2652,7 @@
"Esto puede ser muy ineficiente."
#. Tag: para
+#: performance.xml:1316
#, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
@@ -1897,6 +2666,7 @@
"\"localiza\" filas individuales de la colección."
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
@@ -1905,6 +2675,7 @@
"actualizar"
#. Tag: para
+#: performance.xml:1326
#, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
@@ -1916,6 +2687,7 @@
"quitar y actualizar elementos."
#. Tag: para
+#: performance.xml:1330
#, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
@@ -1936,6 +2708,7 @@
"asociaciones uno a muchos."
#. Tag: para
+#: performance.xml:1338
#, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
@@ -1952,6 +2725,7 @@
"el modelo relacional."
#. Tag: para
+#: performance.xml:1344
#, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
@@ -1968,11 +2742,13 @@
"las colecciones simplemente no se aplican."
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr "Los Bags y las listas son las colecciones inversas más eficientes"
#. Tag: para
+#: performance.xml:1354
#, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
@@ -1994,12 +2770,25 @@
"un bag o <literal>List</literal> (no como un <literal>Set</literal>). Esto "
"puede hacer el siguiente código común mucho más rápido:"
+#. Tag: programlisting
+#: performance.xml:1365
+#, no-c-format
+msgid ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "Borrado de un sólo tiro"
#. Tag: para
+#: performance.xml:1371
#, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
@@ -2014,6 +2803,7 @@
"<literal>DELETE</literal>."
#. Tag: para
+#: performance.xml:1377
#, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
@@ -2027,6 +2817,7 @@
"colección sea un bag. Esto ciertamente es deseable."
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
@@ -2036,11 +2827,13 @@
"añadimos tres elementos nuevos. Hay dos formas posibles de proceder"
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr "borrar dieciocho filas una a una y luego insertar tres filas"
#. Tag: para
+#: performance.xml:1394
#, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE</literal> and insert "
@@ -2050,6 +2843,7 @@
"insertar todos los cinco elementos actuales uno por uno"
#. Tag: para
+#: performance.xml:1400
#, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
@@ -2061,6 +2855,7 @@
"comportamiento podría confundir a disparadores de la base de datos, etc."
#. Tag: para
+#: performance.xml:1404
#, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
@@ -2073,6 +2868,7 @@
"todos los elementos actuales."
#. Tag: para
+#: performance.xml:1409
#, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
@@ -2082,11 +2878,13 @@
"<literal>inverse=\"true\"</literal>."
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "Control del rendimiento"
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
@@ -2100,11 +2898,13 @@
"<literal>SessionFactory</literal>."
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "Control de una SessionFactory"
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory</literal> metrics in two ways. Your "
@@ -2117,6 +2917,7 @@
"por sí mismo."
#. Tag: para
+#: performance.xml:1430
#, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
@@ -2129,7 +2930,38 @@
"para todas sus <literal>SessionFactory</literal> o una por fábrica. Véa el "
"siguiente código para ver ejemplos de configuración minimalistas:"
+#. Tag: programlisting
+#: performance.xml:1435
+#, no-c-format
+msgid ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, no-c-format
+msgid ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1439
#, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
@@ -2139,6 +2971,7 @@
"literal>"
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics</literal> "
@@ -2148,6 +2981,7 @@
"generate_statistics</literal> como <literal>false</literal>"
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> "
@@ -2158,6 +2992,7 @@
"literal>"
#. Tag: para
+#: performance.xml:1458
#, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear()</"
@@ -2170,11 +3005,13 @@
"literal>. "
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "Métricas"
#. Tag: para
+#: performance.xml:1466
#, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
@@ -2188,6 +3025,7 @@
"<literal>Statistics</literal>, en tres categorías:"
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid ""
"Metrics related to the general <literal>Session</literal> usage, such as "
@@ -2197,6 +3035,7 @@
"tales como número de sesiones abiertas, conexiones JDBC recuperadas, etc,"
#. Tag: para
+#: performance.xml:1479
#, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
@@ -2206,6 +3045,7 @@
"como un todo (también conocidas como métricas globales)."
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
@@ -2215,6 +3055,7 @@
"región de caché en particular."
#. Tag: para
+#: performance.xml:1489
#, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
@@ -2230,6 +3071,7 @@
"algunas plataformas esto podría tener incluso una exactitud de 10 segundos."
#. Tag: para
+#: performance.xml:1495
#, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
@@ -2253,7 +3095,30 @@
"literal> para obtener más información. El siguiente código es un ejemplo "
"sencillo:"
+#. Tag: programlisting
+#: performance.xml:1506
+#, no-c-format
+msgid ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1508
#, no-c-format
msgid ""
"You can work on all entities, collections, queries and region caches, by "
@@ -2268,3 +3133,36 @@
"<literal>getQueries()</literal>, <literal>getEntityNames()</literal>, "
"<literal>getCollectionRoleNames()</literal> y "
"<literal>getSecondLevelCacheRegionNames()</literal>."
+
+#~ msgid "or even:"
+#~ msgstr "o incluso:"
+
+#~ msgid ""
+#~ "Now the following code will actually load both the customer <emphasis>and "
+#~ "their orders</emphasis>:"
+#~ msgstr ""
+#~ "Ahora el siguiente código de hecho cargará el cliente <emphasis>y sus "
+#~ "órdenes</emphasis>:"
+
+#~ msgid "yes"
+#~ msgstr "si"
+
+#~ msgid ""
+#~ "The <literal><cache></literal> element of a class or collection "
+#~ "mapping has the following form:"
+#~ msgstr ""
+#~ "El elemento <literal><cache></literal> de un mapeo de clase o "
+#~ "colección tiene la siguiente forma:"
+
+#~ msgid ""
+#~ "The <literal>usage</literal> attribute specifies a <emphasis>cache "
+#~ "concurrency strategy</emphasis>."
+#~ msgstr ""
+#~ "El atributo <literal>usage</literal> especifica una <emphasis>estrategia "
+#~ "de concurrencia al caché</emphasis>."
+
+#~ msgid "read-only"
+#~ msgstr "read-only"
+
+#~ msgid "read-write"
+#~ msgstr "read-write"
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/persistent_classes.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/persistent_classes.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/persistent_classes.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: persistent_classes\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 11:10+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,18 +24,20 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "Clases persistentes"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:34
+#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
-"application). Not all instances of a persistent class are considered to be "
-"in the persistent state. For example, an instance can instead be transient "
-"or detached."
+"application). The term \"persistent\" here means that the classes are able "
+"to be persisted, not that they are in the persistent state (see <xref "
+"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"Las clases presistentes son clases en una aplicación que implementan las "
"entidades del problema empresarial (por ejemplo, Customer y Order en una "
@@ -44,13 +46,15 @@
"ejemplo, una instancia puede ser transitoria o separada."
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:41
+#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
-"these rules are hard requirements. Indeed, Hibernate3 assumes very little "
+"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
-"in other ways (using trees of <literal>Map</literal> instances, for example)."
+"in other ways (using trees of <interfacename>java.util.Map</interfacename> "
+"instances, for example)."
msgstr ""
"Hibernate funciona mejor si estas clases siguen algunas reglas simples, "
"también conocidas como el modelo de programación POJO (Plain Old Java "
@@ -60,20 +64,103 @@
"ejemplo, utilizando árboles de instancias de <literal>Map</literal>)."
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "Ejemplo simple de POJO"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
#, no-c-format
+msgid "Simple POJO representing a cat"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:53
+#, no-c-format
msgid ""
-"Most Java applications require a persistent class representing felines. For "
-"example:"
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+"private Long id; // identifier\n"
+"\n"
+"private Date birthdate;\n"
+"private Color color;\n"
+"private char sex;\n"
+"private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+"\n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() );\n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
msgstr ""
-"La mayoría de aplicaciones Java requieren una clase persistente que "
-"represente a los felinos. Por ejemplo:"
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
@@ -83,19 +170,21 @@
"reglas principales de las clases persistentes. "
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "Implemente un constructor sin argumentos"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:64
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> has a no-argument constructor. All persistent classes "
-"must have a default constructor (which can be non-public) so that Hibernate "
-"can instantiate them using <literal>Constructor.newInstance()</literal>. It "
-"is recommended that you have a default constructor with at least "
-"<emphasis>package</emphasis> visibility for runtime proxy generation in "
-"Hibernate."
+"<classname>Cat</classname> has a no-argument constructor. All persistent "
+"classes must have a default constructor (which can be non-public) so that "
+"Hibernate can instantiate them using <literal><classname>java.lang.reflect."
+"Constructor</classname>.newInstance()</literal>. It is recommended that this "
+"constructor be defined with at least <emphasis>package</emphasis> visibility "
+"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat</literal> tiene un contructor sin argumentos. Todas las clases "
"persistentes deben tener un constructor predeterminado (el cual puede ser no-"
@@ -105,116 +194,146 @@
"emphasis> para la generación de proxies en tiempo de ejecución en Hibernate."
#. Tag: title
-#, no-c-format
-msgid "Provide an identifier property (optional)"
+#: persistent_classes.xml:74
+#, fuzzy, no-c-format
+msgid "Provide an identifier property"
msgstr "Proporcione una propiedad identificadora (opcional)"
#. Tag: para
+#: persistent_classes.xml:77
#, no-c-format
msgid ""
-"<literal>Cat</literal> has a property called <literal>id</literal>. This "
-"property maps to the primary key column of a database table. The property "
-"might have been called anything, and its type might have been any primitive "
-"type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or "
-"<literal>java.util.Date</literal>. If your legacy database table has "
-"composite keys, you can use a user-defined class with properties of these "
-"types (see the section on composite identifiers later in the chapter.)"
+"Historically this was considered option. While still not (yet) enforced, "
+"this should be considered a deprecated feature as it will be completely "
+"required to provide a identifier property in an upcoming release."
msgstr ""
-"<literal>Cat</literal> tiene una propiedad llamada <literal>id</literal>. "
-"Esta propiedad mapea a la columna de la llave principal de la tabla de la "
-"base de datos. La propiedad podría llamarse de cualquier manera y su tipo "
-"podría haber sido cualquier tipo primitivo, cualquier tipo de \"wrapper\" "
-"primitivo, <literal>java.lang.String</literal> o <literal>java.util.Date</"
-"literal>. Si su tabla de base de datos heredada tiene claves compuestas, "
-"puede utilizar una clase definida por el usuario con propiedades de estos "
-"tipos (vea la sección sobre identificadores compuestos más adelante en este "
-"capítulo)."
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
msgid ""
-"The identifier property is strictly optional. You can leave them off and let "
-"Hibernate keep track of object identifiers internally. We do not recommend "
-"this, however."
+"<classname>Cat</classname> has a property named <literal>id</literal>. This "
+"property maps to the primary key column(s) of the underlying database table. "
+"The type of the identifier property can be any \"basic\" type (see <xref "
+"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
+"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
-"La propiedad identificadora es estrictamente opcional. Puede olvidarla y "
-"dejar que Hibernate siga internamente la pista de los identificadores del "
-"objeto. Sin embargo, no recomendamos que esto suceda."
#. Tag: para
+#: persistent_classes.xml:92
#, no-c-format
msgid ""
-"In fact, some functionality is available only to classes that declare an "
-"identifier property:"
+"Identifiers do not necessarily need to identify column(s) in the database "
+"physically defined as a primary key. They should just identify columns that "
+"can be used to uniquely identify rows in the underlying table."
msgstr ""
-"De hecho, algunas funcionalidades se encuentran disponibles sólamente para "
-"clases que declaran una propiedad identificadora: "
#. Tag: para
+#: persistent_classes.xml:99
#, no-c-format
msgid ""
-"Transitive reattachment for detached objects (cascade update or cascade "
-"merge) - see <xref linkend=\"objectstate-transitive\" />"
+"We recommend that you declare consistently-named identifier properties on "
+"persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr ""
-"Reasociación transitiva de objetos separados (actualizaciones o fusiones en "
-"cascada) - consulte <xref linkend=\"objectstate-transitive\" />"
+"Le recomendamos que declare propiedades identificadoras nombradas-"
+"consistentemente en clases persistentes. y que utilice un tipo nulable (por "
+"ejemplo, no primitivo)."
+#. Tag: title
+#: persistent_classes.xml:107
+#, fuzzy, no-c-format
+msgid "Prefer non-final classes (semi-optional)"
+msgstr "Prefiera las clases no finales (opcional)"
+
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
-msgstr "<literal>Session.saveOrUpdate()</literal>"
+msgid ""
+"A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), "
+"depends upon the persistent class being either non-final, or the "
+"implementation of an interface that declares all public methods. You can "
+"persist <literal>final</literal> classes that do not implement an interface "
+"with Hibernate; you will not, however, be able to use proxies for lazy "
+"association fetching which will ultimately limit your options for "
+"performance tuning. To persist a <literal>final</literal> class which does "
+"not implement a \"full\" interface you must disable proxy generation. See "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
+"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
+"ann\"/>."
+msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:121
#, no-c-format
-msgid "<literal>Session.merge()</literal>"
-msgstr "<literal>Session.merge()</literal>"
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:122
#, no-c-format
-msgid ""
-"We recommend that you declare consistently-named identifier properties on "
-"persistent classes and that you use a nullable (i.e., non-primitive) type."
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
msgstr ""
-"Le recomendamos que declare propiedades identificadoras nombradas-"
-"consistentemente en clases persistentes. y que utilice un tipo nulable (por "
-"ejemplo, no primitivo)."
#. Tag: title
+#: persistent_classes.xml:126
#, no-c-format
-msgid "Prefer non-final classes (optional)"
-msgstr "Prefiera las clases no finales (opcional)"
+msgid "Disabling proxies in annotations"
+msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:127
+#, no-c-format
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:130
#, no-c-format
msgid ""
-"A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon "
-"the persistent class being either non-final, or the implementation of an "
-"interface that declares all public methods."
+"If the <literal>final</literal> class does implement a proper interface, you "
+"could alternatively tell Hibernate to use the interface instead when "
+"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
+"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
+"final-example-proxy-interface-ann\"/>."
msgstr ""
-"Un aspecto central de Hibernate, los <emphasis>proxies</emphasis>, dependen "
-"de que las clases persistentes sean no finales o de la implementación de una "
-"interfaz que declare todos los métodos públicos."
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:139
#, no-c-format
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:144
+#, no-c-format
+msgid "Proxying an interface in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:145
+#, no-c-format
msgid ""
-"You can persist <literal>final</literal> classes that do not implement an "
-"interface with Hibernate. You will not, however, be able to use proxies for "
-"lazy association fetching which will ultimately limit your options for "
-"performance tuning."
+"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
+"ICat { ... }]]>"
msgstr ""
-"Con Hibernate puede persistir las clases <literal>final</literal>es que no "
-"implementen una interfaz. Sin embargo, no podrá utilizar proxies para "
-"recuperación perezosa de asociaciones, lo cual limitará sus opciones para "
-"afinar el rendimiento."
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:148
+#, fuzzy, no-c-format
msgid ""
-"You should also avoid declaring <literal>public final</literal> methods on "
-"the non-final classes. If you want to use a class with a <literal>public "
-"final</literal> method, you must explicitly disable proxying by setting "
-"<literal>lazy=\"false\"</literal>."
+"You should also avoid declaring <literal>public final</literal> methods as "
+"this will again limit the ability to generate <emphasis>proxies</emphasis> "
+"from this class. If you want to use a class with <literal>public final</"
+"literal> methods, you must explicitly disable proxying. Again, see <xref "
+"linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/"
+">."
msgstr ""
"También debe evitar el declarar métodos <literal>public final</literal> en "
"las clases no-finales. Si quiere utilizar una clase con un método "
@@ -222,6 +341,7 @@
"proxies estableciendo <literal>lazy=\"false\"</literal>."
#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr ""
@@ -229,9 +349,10 @@
"(opcional)"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:160
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> declares accessor methods for all its persistent "
+"<classname>Cat</classname> declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
@@ -249,22 +370,26 @@
"acceso directo a campos para propiedades específicas."
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:169
+#, fuzzy, no-c-format
msgid ""
-"Properties need <emphasis>not</emphasis> be declared public - Hibernate can "
-"persist a property with a default, <literal>protected</literal> or "
-"<literal>private</literal> get / set pair."
+"Properties need <emphasis>not</emphasis> be declared public. Hibernate can "
+"persist a property declared with <literal>package</literal>, "
+"<literal>protected</literal> or <literal>private</literal> visibility as "
+"well."
msgstr ""
"<emphasis>No</emphasis> es necesario declarar públicas las propiedades. "
"Hibernate puede persistir una propiedad con un par get / set "
"<literal>protected</literal> o <literal>private</literal>."
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "Implementación de herencia"
#. Tag: para
+#: persistent_classes.xml:180
#, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
@@ -274,12 +399,34 @@
"Hereda su propiedad identificadora de la superclase <literal>Cat</literal>. "
"Por ejemplo:"
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:188
#, no-c-format
-msgid "Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
-msgstr "Implementando <literal>equals()</literal> y <literal>hashCode()</literal>"
+msgid ""
+"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
+msgstr ""
+"Implementando <literal>equals()</literal> y <literal>hashCode()</literal>"
#. Tag: para
+#: persistent_classes.xml:191
#, no-c-format
msgid ""
"You have to override the <literal>equals()</literal> and <literal>hashCode()"
@@ -289,6 +436,7 @@
"<literal>hashCode()</literal> si:"
#. Tag: para
+#: persistent_classes.xml:196
#, no-c-format
msgid ""
"intend to put instances of persistent classes in a <literal>Set</literal> "
@@ -300,11 +448,13 @@
"<emphasis>y</emphasis>"
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "piensa utilizar reasociación de instancias separadas."
#. Tag: para
+#: persistent_classes.xml:206
#, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
@@ -321,6 +471,7 @@
"para <literal>Set</literal>s."
#. Tag: para
+#: persistent_classes.xml:212
#, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()</literal>/"
@@ -356,6 +507,7 @@
"de Java de identidad de objeto e igualdad."
#. Tag: para
+#: persistent_classes.xml:228
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
@@ -373,37 +525,72 @@
"instancia en el mundo real (una clave candidata <emphasis>natural</"
"emphasis>):"
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:235
#, no-c-format
msgid ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:237
+#, fuzzy, no-c-format
+msgid ""
"A business key does not have to be as solid as a database primary key "
-"candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable "
+"candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable "
"or unique properties are usually good candidates for a business key."
msgstr ""
"Una clave empresarial no tiene que ser tan sólida como una clave principal "
-"candidata (consulte la <xref linkend=\"transactions-basics-identity\" />). Las propiedades inmutables o únicas usualmente son "
-"buenas candidatas para una clave empresarial."
+"candidata (consulte la <xref linkend=\"transactions-basics-identity\" />). "
+"Las propiedades inmutables o únicas usualmente son buenas candidatas para "
+"una clave empresarial."
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr "Modelos dinámicos"
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr "Nota"
-#. Tag: para
-#, no-c-format
+#. Tag: emphasis
+#: persistent_classes.xml:249
+#, fuzzy, no-c-format
msgid ""
-"<emphasis>The following features are currently considered experimental and "
-"may change in the near future.</emphasis>"
+"The following features are currently considered experimental and may change "
+"in the near future."
msgstr ""
-"<emphasis>Las siguientes funcionalidades se consideran como "
-"experimentales actualmente y es posible que cambien pronto.</emphasis>"
+"<emphasis>Las siguientes funcionalidades se consideran como experimentales "
+"actualmente y es posible que cambien pronto.</emphasis>"
#. Tag: para
+#: persistent_classes.xml:253
#, no-c-format
msgid ""
"Persistent entities do not necessarily have to be represented as POJO "
@@ -420,19 +607,22 @@
"enfoque, sólamente archivos de mapeo. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:259
+#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactory</"
"literal> using the <literal>default_entity_mode</literal> configuration "
-"option (see <xref linkend=\"configuration-optional-properties\" />)."
+"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"Por defecto, Hibernate funciona en modo POJO normal. Puede establecer un "
"modo de representación de entidad predeterminado para una "
"<literal>SessionFactory</literal> en particular utilizando la opción de "
-"configuración <literal>default_entity_mode</literal> (consulte <xref linkend=\"configuration-optional-properties\" />)."
+"configuración <literal>default_entity_mode</literal> (consulte <xref linkend="
+"\"configuration-optional-properties\" />)."
#. Tag: para
+#: persistent_classes.xml:265
#, no-c-format
msgid ""
"The following examples demonstrate the representation using <literal>Map</"
@@ -444,7 +634,47 @@
"declararse un <literal>entity-name</literal> en lugar de, o además de un "
"nombre de clase:"
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:272
#, no-c-format
msgid ""
"Even though associations are declared using target class names, the target "
@@ -455,6 +685,7 @@
"lugar de un POJO."
#. Tag: para
+#: persistent_classes.xml:276
#, no-c-format
msgid ""
"After setting the default entity mode to <literal>dynamic-map</literal> for "
@@ -466,7 +697,34 @@
"puede trabajar en tiempo de ejecución con <literal>Map</literal>eos de "
"<literal>Map</literal>eos: "
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, no-c-format
+msgid ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:283
#, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
@@ -485,6 +743,7 @@
"apropiada del modelo de dominio más adelante."
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session</"
@@ -493,7 +752,25 @@
"Los modos de representación de entidad se pueden establecer por "
"<literal>Session</literal>:"
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, no-c-format
+msgid ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:295
#, no-c-format
msgid ""
"Please note that the call to <literal>getSession()</literal> using an "
@@ -515,31 +792,35 @@
"de la transacción y de la conexión a la unidad de trabajo primaria. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:304
+#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
-"<xref linkend=\"xml\" />."
+"<xref linkend=\"xml\"/>."
msgstr ""
"Puede encontrar más información sobre las capacidades de representación de "
"XML en <xref linkend=\"xml\" />."
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizers"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:312
+#, fuzzy, no-c-format
msgid ""
-"<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO "
-"through its constructor. It also knows how to access the POJO properties "
-"using the defined property accessors."
+"<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-"
+"interfaces are responsible for managing a particular representation of a "
+"piece of data given that representation's <classname>org.hibernate."
+"EntityMode</classname>. If a given piece of data is thought of as a data "
+"structure, then a tuplizer is the thing that knows how to create such a data "
+"structure, how to extract values from such a data structure and how to "
+"inject values into such a data structure. For example, for the POJO entity "
+"mode, the corresponding tuplizer knows how create the POJO through its "
+"constructor. It also knows how to access the POJO properties using the "
+"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer</literal> y sus subinterfaces son las "
"responsables de administrar una representación en particular de un dato, "
@@ -552,35 +833,45 @@
"POJO utilizando los accesores de propiedad definidos. "
#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
+msgid "There are two (high-level) types of Tuplizers:"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:326
+#, no-c-format
msgid ""
-"There are two high-level types of Tuplizers, represented by the <literal>org."
-"hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate."
-"tuple.component.ComponentTuplizer</literal> interfaces. "
-"<literal>EntityTuplizer</literal>s are responsible for managing the above "
-"mentioned contracts in regards to entities, while "
-"<literal>ComponentTuplizer</literal>s do the same for components."
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"which is responsible for managing the above mentioned contracts in regards "
+"to entities"
msgstr ""
-"Hay dos tipos altos de niveles de Tuplizers, representados por las "
-"interfaces <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> y "
-"<literal>org.hibernate.tuple.component.ComponentTuplizer</literal>. Los "
-"<literal>EntityTuplizer</literal>s son los responsables de administrar los "
-"contratos mencionados anteriormente en relación con las entidades mientras "
-"que los <literal>ComponentTuplizer</literal>s hacen lo mismo para los "
-"componentes."
#. Tag: para
+#: persistent_classes.xml:332
#, no-c-format
msgid ""
-"Users can also plug in their own tuplizers. Perhaps you require that a "
-"<literal>java.util.Map</literal> implementation other than <literal>java."
-"util.HashMap</literal> be used while in the dynamic-map entity-mode. Or "
-"perhaps you need to define a different proxy generation strategy than the "
-"one used by default. Both would be achieved by defining a custom tuplizer "
-"implementation. Tuplizer definitions are attached to the entity or component "
-"mapping they are meant to manage. Going back to the example of our customer "
-"entity:"
+"<interfacename>org.hibernate.tuple.component.ComponentTuplizer</"
+"interfacename> which does the same for components"
msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:340
+#, fuzzy, no-c-format
+msgid ""
+"Users can also plug in their own tuplizers. Perhaps you require that "
+"<interfacename>java.util.Map</interfacename> implementation other than "
+"<classname>java.util.HashMap</classname> be used while in the dynamic-map "
+"entity-mode. Or perhaps you need to define a different proxy generation "
+"strategy than the one used by default. Both would be achieved by defining a "
+"custom tuplizer implementation. Tuplizer definitions are attached to the "
+"entity or component mapping they are meant to manage. Going back to the "
+"example of our <classname>Customer</classname> entity, <xref linkend="
+"\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom "
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
+"\"/> shows how to do the same in <literal>hbm.xml</literal>"
+msgstr ""
"Los usuarios también pueden enchufar sus propios tuplizers. Tal vez necesite "
"que una implementación <literal>java.util.Map</literal> diferente de "
"<literal>java.util.HashMap</literal> se utilice en el modo de entidad de "
@@ -592,26 +883,83 @@
"de cliente:"
#. Tag: title
+#: persistent_classes.xml:353
#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class entity-name=\"Customer\">\n"
+" <!--\n"
+" Override the dynamic-map entity-mode\n"
+" tuplizer for the customer entity\n"
+" -->\n"
+" <tuplizer entity-mode=\"dynamic-map\"\n"
+" class=\"CustomMapTuplizerImpl\"/>\n"
+"\n"
+" <id name=\"id\" type=\"long\" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <!-- other properties -->\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
+#, no-c-format
msgid "EntityNameResolvers"
msgstr "EntityNameResolvers"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:365
+#, fuzzy, no-c-format
msgid ""
-"The <interfacename>org.hibernate.EntityNameResolver</interfacename> "
-"interface is a contract for resolving the entity name of a given entity "
-"instance. The interface defines a single method "
-"<methodname>resolveEntityName</methodname> which is passed the entity "
-"instance and is expected to return the appropriate entity name (null is "
-"allowed and would indicate that the resolver does not know how to resolve "
-"the entity name of the given entity instance). Generally speaking, an "
-"<interfacename>org.hibernate.EntityNameResolver</interfacename> is going to "
-"be most useful in the case of dynamic models. One example might be using "
-"proxied interfaces as your domain model. The hibernate test suite has an "
-"example of this exact style of usage under the <package>org.hibernate.test."
-"dynamicentity.tuplizer2</package>. Here is some of the code from that "
-"package for illustration."
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> is a "
+"contract for resolving the entity name of a given entity instance. The "
+"interface defines a single method <methodname>resolveEntityName</methodname> "
+"which is passed the entity instance and is expected to return the "
+"appropriate entity name (null is allowed and would indicate that the "
+"resolver does not know how to resolve the entity name of the given entity "
+"instance). Generally speaking, an <interfacename>org.hibernate."
+"EntityNameResolver</interfacename> is going to be most useful in the case of "
+"dynamic models. One example might be using proxied interfaces as your domain "
+"model. The hibernate test suite has an example of this exact style of usage "
+"under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. "
+"Here is some of the code from that package for illustration."
msgstr ""
"La interfaz <interfacename>org.hibernate.EntityNameResolver</interfacename> "
"es un contrato para resolver el nombre de la entidad de una instancia de "
@@ -627,7 +975,138 @@
"hibernate.test.dynamicentity.tuplizer2</package>. Aquí está algo del código "
"de ese paquete para su ilustración."
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, no-c-format
+msgid ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an\n"
+" * interface as the domain model and simply store persistent state in an "
+"internal\n"
+" * Map. This is an extremely trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" *\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names\n"
+" * should be resolved. Since this particular impl can handle resolution for "
+"all of our\n"
+" * entities we want to take advantage of the fact that SessionFactoryImpl "
+"keeps these\n"
+" * in a Set so that we only ever have one instance registered. Why? Well, "
+"when it\n"
+" * comes time to resolve an entity name, Hibernate must iterate over all the "
+"registered\n"
+" * resolvers. So keeping that number down helps that process be as speedy "
+"as possible.\n"
+" * Hence the equals and hashCode implementations as is\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ..."
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
msgid ""
"In order to register an <interfacename>org.hibernate.EntityNameResolver</"
@@ -637,17 +1116,19 @@
"interfacename> los usuarios deben:"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:383
+#, fuzzy, no-c-format
msgid ""
-"Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link>, implementing the <methodname>getEntityNameResolvers</methodname> "
-"method."
+"Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers"
+"\"/>), implementing the <methodname>getEntityNameResolvers</methodname> "
+"method"
msgstr ""
"Implementar un <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link> personalizado, implementando el método <methodname>getEntityNameResolvers</"
-"methodname>."
+"link> personalizado, implementando el método "
+"<methodname>getEntityNameResolvers</methodname>."
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</"
@@ -660,3 +1141,94 @@
"hibernate.SessionFactory</interfacename>) usando el método "
"<methodname>registerEntityNameResolver</methodname>."
+#~ msgid ""
+#~ "Most Java applications require a persistent class representing felines. "
+#~ "For example:"
+#~ msgstr ""
+#~ "La mayoría de aplicaciones Java requieren una clase persistente que "
+#~ "represente a los felinos. Por ejemplo:"
+
+#~ msgid ""
+#~ "<literal>Cat</literal> has a property called <literal>id</literal>. This "
+#~ "property maps to the primary key column of a database table. The property "
+#~ "might have been called anything, and its type might have been any "
+#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
+#~ "String</literal> or <literal>java.util.Date</literal>. If your legacy "
+#~ "database table has composite keys, you can use a user-defined class with "
+#~ "properties of these types (see the section on composite identifiers later "
+#~ "in the chapter.)"
+#~ msgstr ""
+#~ "<literal>Cat</literal> tiene una propiedad llamada <literal>id</literal>. "
+#~ "Esta propiedad mapea a la columna de la llave principal de la tabla de la "
+#~ "base de datos. La propiedad podría llamarse de cualquier manera y su tipo "
+#~ "podría haber sido cualquier tipo primitivo, cualquier tipo de \"wrapper\" "
+#~ "primitivo, <literal>java.lang.String</literal> o <literal>java.util.Date</"
+#~ "literal>. Si su tabla de base de datos heredada tiene claves compuestas, "
+#~ "puede utilizar una clase definida por el usuario con propiedades de estos "
+#~ "tipos (vea la sección sobre identificadores compuestos más adelante en "
+#~ "este capítulo)."
+
+#~ msgid ""
+#~ "The identifier property is strictly optional. You can leave them off and "
+#~ "let Hibernate keep track of object identifiers internally. We do not "
+#~ "recommend this, however."
+#~ msgstr ""
+#~ "La propiedad identificadora es estrictamente opcional. Puede olvidarla y "
+#~ "dejar que Hibernate siga internamente la pista de los identificadores del "
+#~ "objeto. Sin embargo, no recomendamos que esto suceda."
+
+#~ msgid ""
+#~ "In fact, some functionality is available only to classes that declare an "
+#~ "identifier property:"
+#~ msgstr ""
+#~ "De hecho, algunas funcionalidades se encuentran disponibles sólamente "
+#~ "para clases que declaran una propiedad identificadora: "
+
+#~ msgid ""
+#~ "Transitive reattachment for detached objects (cascade update or cascade "
+#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
+#~ msgstr ""
+#~ "Reasociación transitiva de objetos separados (actualizaciones o fusiones "
+#~ "en cascada) - consulte <xref linkend=\"objectstate-transitive\" />"
+
+#~ msgid "<literal>Session.saveOrUpdate()</literal>"
+#~ msgstr "<literal>Session.saveOrUpdate()</literal>"
+
+#~ msgid "<literal>Session.merge()</literal>"
+#~ msgstr "<literal>Session.merge()</literal>"
+
+#~ msgid ""
+#~ "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends "
+#~ "upon the persistent class being either non-final, or the implementation "
+#~ "of an interface that declares all public methods."
+#~ msgstr ""
+#~ "Un aspecto central de Hibernate, los <emphasis>proxies</emphasis>, "
+#~ "dependen de que las clases persistentes sean no finales o de la "
+#~ "implementación de una interfaz que declare todos los métodos públicos."
+
+#~ msgid ""
+#~ "You can persist <literal>final</literal> classes that do not implement an "
+#~ "interface with Hibernate. You will not, however, be able to use proxies "
+#~ "for lazy association fetching which will ultimately limit your options "
+#~ "for performance tuning."
+#~ msgstr ""
+#~ "Con Hibernate puede persistir las clases <literal>final</literal>es que "
+#~ "no implementen una interfaz. Sin embargo, no podrá utilizar proxies para "
+#~ "recuperación perezosa de asociaciones, lo cual limitará sus opciones para "
+#~ "afinar el rendimiento."
+
+#~ msgid ""
+#~ "There are two high-level types of Tuplizers, represented by the "
+#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal> "
+#~ "interfaces. <literal>EntityTuplizer</literal>s are responsible for "
+#~ "managing the above mentioned contracts in regards to entities, while "
+#~ "<literal>ComponentTuplizer</literal>s do the same for components."
+#~ msgstr ""
+#~ "Hay dos tipos altos de niveles de Tuplizers, representados por las "
+#~ "interfaces <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> y "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal>. Los "
+#~ "<literal>EntityTuplizer</literal>s son los responsables de administrar "
+#~ "los contratos mencionados anteriormente en relación con las entidades "
+#~ "mientras que los <literal>ComponentTuplizer</literal>s hacen lo mismo "
+#~ "para los componentes."
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/preface.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/preface.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -15,7 +15,7 @@
msgstr ""
"Project-Id-Version: preface\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 15:31+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -25,31 +25,60 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr "Prefacio"
#. Tag: para
-#, no-c-format
+#: preface.xml:35
+#, fuzzy, no-c-format
msgid ""
-"Working with object-oriented software and a relational database can be "
-"cumbersome and time consuming in today's enterprise environments. Hibernate "
-"is an Object/Relational Mapping tool for Java environments. The term Object/"
-"Relational Mapping (ORM) refers to the technique of mapping a data "
-"representation from an object model to a relational data model with a SQL-"
-"based schema."
+"Working with both Object-Oriented software and Relational Databases can be "
+"cumbersome and time consuming. Development costs are significantly higher "
+"due to a paradigm mismatch between how data is represented in objects versus "
+"relational databases. Hibernate is an Object/Relational Mapping solution for "
+"Java environments. The term Object/Relational Mapping refers to the "
+"technique of mapping a data representation from an object model to a "
+"relational data model with a SQL-based schema; see <ulink url=\"http://en."
+"wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/"
+"Object-relational_mapping</ulink> for a discussion."
msgstr ""
"El trabajar con software orientado a objetos y con una base de datos "
"relacional puede llegar a ser engorroso y puede llegar a tomar bastante "
"tiempo en los entornos empresariales de hoy en día. Hibernate es una "
-"herramienta de mapeo objeto/relacional para entornos Java. El término de mapeo "
-"objeto/relacional (ORM) se refiere a la técnica de mapear una representación "
-"de datos desde un modelo de objeto a un modelo de datos relacionales con un "
-"esquema basado en SQL."
+"herramienta de mapeo objeto/relacional para entornos Java. El término de "
+"mapeo objeto/relacional (ORM) se refiere a la técnica de mapear una "
+"representación de datos desde un modelo de objeto a un modelo de datos "
+"relacionales con un esquema basado en SQL."
#. Tag: para
+#: preface.xml:46
#, no-c-format
msgid ""
+"While having a strong background in SQL is not required to use Hibernate, "
+"having a basic understanding of the concepts can greatly help you understand "
+"Hibernate more fully and quickly. Probably the single best background is an "
+"understanding of data modeling principles. You might want to consider these "
+"resources as a good starting point:"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:54
+#, no-c-format
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:59
+#, no-c-format
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
+
+#. Tag: para
+#: preface.xml:66
+#, no-c-format
+msgid ""
"Hibernate not only takes care of the mapping from Java classes to database "
"tables (and from Java data types to SQL data types), but also provides data "
"query and retrieval facilities. It can also significantly reduce development "
@@ -62,17 +91,29 @@
"se tomaría con el manejo de datos de forma manual en SQL y JDBC."
#. Tag: para
+#: preface.xml:72
#, no-c-format
msgid ""
-"Hibernate's goal is to relieve the developer from 95 percent of common data "
-"persistence related programming tasks. Hibernate may not be the best "
-"solution for data-centric applications that only use stored-procedures to "
-"implement the business logic in the database, it is most useful with object-"
-"oriented domain models and business logic in the Java-based middle-tier. "
-"However, Hibernate can certainly help you to remove or encapsulate vendor-"
-"specific SQL code and will help with the common task of result set "
-"translation from a tabular representation to a graph of objects."
+"Hibernate’s design goal is to relieve the developer from 95% of common data "
+"persistence-related programming tasks by eliminating the need for manual, "
+"hand-crafted data processing using SQL and JDBC. However, unlike many other "
+"persistence solutions, Hibernate does not hide the power of SQL from you and "
+"guarantees that your investment in relational technology and knowledge is as "
+"valid as always."
msgstr ""
+
+#. Tag: para
+#: preface.xml:79
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate may not be the best solution for data-centric applications that "
+"only use stored-procedures to implement the business logic in the database, "
+"it is most useful with object-oriented domain models and business logic in "
+"the Java-based middle-tier. However, Hibernate can certainly help you to "
+"remove or encapsulate vendor-specific SQL code and will help with the common "
+"task of result set translation from a tabular representation to a graph of "
+"objects."
+msgstr ""
"La meta de Hibernate es aliviar el trabajo del desarrollador en 95% de la "
"persistencia de datos comunes relacionados con tareas de programación. Es "
"posible que Hibernate no sea la mejor solución para aquellas aplicaciones "
@@ -85,6 +126,7 @@
"una representación tabular a un grafo de objetos."
#. Tag: para
+#: preface.xml:88
#, no-c-format
msgid ""
"If you are new to Hibernate and Object/Relational Mapping or even Java, "
@@ -94,26 +136,30 @@
"inclusive en Java por favor siga los siguientes pasos:"
#. Tag: para
-#, no-c-format
+#: preface.xml:95
+#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step "
+"Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step "
"instructions. The source code for the tutorial is included in the "
"distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
"Consulte el <xref linkend=\"tutorial\"/>, el cual es un tutorial con "
"instrucciones paso por paso. El código fuente para el tutorial se encuentra "
-"incluído en la distribución en el directorio <literal>doc/reference/tutorial/</literal>. "
+"incluído en la distribución en el directorio <literal>doc/reference/tutorial/"
+"</literal>. "
#. Tag: para
-#, no-c-format
+#: preface.xml:103
+#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"architecture\" /> to understand the environments where "
+"Read <xref linkend=\"architecture\"/> to understand the environments where "
"Hibernate can be used."
msgstr ""
"Consulte el <xref linkend=\"architecture\" /> para comprender los entornos "
"en donde se puede utilizar Hibernate."
#. Tag: para
+#: preface.xml:109
#, no-c-format
msgid ""
"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
@@ -132,21 +178,25 @@
"Windows, escriba <literal>build eg</literal>."
#. Tag: para
-#, no-c-format
+#: preface.xml:120
+#, fuzzy, no-c-format
msgid ""
"Use this reference documentation as your primary source of information. "
"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
"more help with application design, or if you prefer a step-by-step tutorial. "
-"Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download "
-"the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+"Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and "
+"download the example application from <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>."
msgstr ""
"Utilice esta documentación de referencia como su fuente principal de "
-"información. Considere el leer <biblioref linkend=\"biblio-JPwH\"></biblioref> si necesita más ayuda con el "
-"diseño de la aplicación o si prefiere un tutorial paso por paso. También "
-"visite <ulink url=\"http://caveatemptor.hibernate.org\" /> y descargue la aplicación "
-"de ejemplo de <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+"información. Considere el leer <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref> si necesita más ayuda con el diseño de la aplicación o si "
+"prefiere un tutorial paso por paso. También visite <ulink url=\"http://"
+"caveatemptor.hibernate.org\" /> y descargue la aplicación de ejemplo de "
+"<biblioref linkend=\"biblio-JPwH\"></biblioref>."
#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr ""
@@ -154,6 +204,7 @@
"frecuentes."
#. Tag: para
+#: preface.xml:135
#, no-c-format
msgid ""
"Links to third party demos, examples, and tutorials are maintained on the "
@@ -163,6 +214,7 @@
"terceros, ejemplos y tutoriales."
#. Tag: para
+#: preface.xml:141
#, no-c-format
msgid ""
"The Community Area on the Hibernate website is a good resource for design "
@@ -174,33 +226,93 @@
"JBoss AS, Struts, EJB, etc)."
#. Tag: para
+#: preface.xml:149
#, no-c-format
msgid ""
-"If you have questions, use the user forum linked on the Hibernate website. "
-"We also provide a JIRA issue tracking system for bug reports and feature "
-"requests. If you are interested in the development of Hibernate, join the "
-"developer mailing list. If you are interested in translating this "
-"documentation into your language, contact us on the developer mailing list."
+"There are a number of ways to become involved in the Hibernate community, "
+"including"
msgstr ""
-"Si tiene alguna pregunta, diríjase al sitio web de Hibernate en donde "
-"encontrará un enlace al foro de usuarios. También proporcionamos un sistema "
-"de localización para reportes de errores JIRA y solicitud de funciones. Si "
-"está interesado en el desarrollo de Hibernate, únase a la lista de correo de "
-"los desarrolladores. Si le interesa traducir esta documentación a su propio "
-"idioma, contáctenos en la lista de correo de los desarrolladores."
#. Tag: para
+#: preface.xml:153
#, no-c-format
msgid ""
-"Commercial development support, production support, and training for "
-"Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
-"SupportTraining/). Hibernate is a Professional Open Source project and a "
-"critical component of the JBoss Enterprise Middleware System (JEMS) suite of "
-"products."
+"Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/"
+"issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
msgstr ""
-"JBoss Inc. proporciona soporte para desarrollo comercial, soporte para "
-"producción y entrenamiento (vea http://www.hibernate.org/SupportTraining/). "
-"Hibernate es un proyecto de Código Abierto Profesional y es un componente "
-"crítico de la suite de productos de JBoss Enterprise Middleware System "
-"(JEMS)."
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid ""
+"Trying your hand at fixing some bugs or implementing enhancements. Again, "
+"see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate."
+"org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid ""
+"<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/"
+"community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid ""
+"There are forums for users to ask questions and receive help from the "
+"community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid ""
+"There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat"
+"\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid ""
+"Helping improve or translate this documentation. Contact us on the developer "
+"mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
+
+#~ msgid ""
+#~ "If you have questions, use the user forum linked on the Hibernate "
+#~ "website. We also provide a JIRA issue tracking system for bug reports and "
+#~ "feature requests. If you are interested in the development of Hibernate, "
+#~ "join the developer mailing list. If you are interested in translating "
+#~ "this documentation into your language, contact us on the developer "
+#~ "mailing list."
+#~ msgstr ""
+#~ "Si tiene alguna pregunta, diríjase al sitio web de Hibernate en donde "
+#~ "encontrará un enlace al foro de usuarios. También proporcionamos un "
+#~ "sistema de localización para reportes de errores JIRA y solicitud de "
+#~ "funciones. Si está interesado en el desarrollo de Hibernate, únase a la "
+#~ "lista de correo de los desarrolladores. Si le interesa traducir esta "
+#~ "documentación a su propio idioma, contáctenos en la lista de correo de "
+#~ "los desarrolladores."
+
+#~ msgid ""
+#~ "Commercial development support, production support, and training for "
+#~ "Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
+#~ "SupportTraining/). Hibernate is a Professional Open Source project and a "
+#~ "critical component of the JBoss Enterprise Middleware System (JEMS) suite "
+#~ "of products."
+#~ msgstr ""
+#~ "JBoss Inc. proporciona soporte para desarrollo comercial, soporte para "
+#~ "producción y entrenamiento (vea http://www.hibernate.org/"
+#~ "SupportTraining/). Hibernate es un proyecto de Código Abierto Profesional "
+#~ "y es un componente crítico de la suite de productos de JBoss Enterprise "
+#~ "Middleware System (JEMS)."
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/query_sql.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/query_sql.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/query_sql.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: query_sql\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-17 12:28+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,11 +24,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr "SQL Nativo"
#. Tag: para
+#: query_sql.xml:33
#, no-c-format
msgid ""
"You can also express queries in the native SQL dialect of your database. "
@@ -44,6 +46,7 @@
"migración limpia desde una aplicación basada en SQL/JDBC a Hibernate."
#. Tag: para
+#: query_sql.xml:39
#, no-c-format
msgid ""
"Hibernate3 allows you to specify handwritten SQL, including stored "
@@ -54,11 +57,13 @@
"y load."
#. Tag: title
+#: query_sql.xml:43
#, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr "Uso de una <literal>SQLQuery</literal>"
#. Tag: para
+#: query_sql.xml:45
#, no-c-format
msgid ""
"Execution of native SQL queries is controlled via the <literal>SQLQuery</"
@@ -72,18 +77,29 @@
"esta API para consultas."
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr "Consultas escalares"
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr ""
"La consulta SQL más básica es para obtener a una lista de escalares "
"(valores)."
+#. Tag: programlisting
+#: query_sql.xml:56
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:58
#, no-c-format
msgid ""
"These will return a List of Object arrays (Object[]) with scalar values for "
@@ -96,6 +112,7 @@
"escalares retornados."
#. Tag: para
+#: query_sql.xml:63
#, no-c-format
msgid ""
"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or "
@@ -106,22 +123,36 @@
"<literal>ResultSetMetadata</literal> o simplemente para ser más explícito en "
"lo que se devuelve se puede utilizar <literal>addScalar()</literal>:"
+#. Tag: programlisting
+#: query_sql.xml:67
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr "Se especifica esta consulta:"
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr "la cadena de consulta SQL"
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr "las columnas y tipos que se devuelven"
#. Tag: para
+#: query_sql.xml:81
#, no-c-format
msgid ""
"This will return Object arrays, but now it will not use "
@@ -139,6 +170,7 @@
"<literal>*</literal> y pueda devolver más de las tres columnas enumeradas."
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
msgid ""
"It is possible to leave out the type information for all or some of the "
@@ -147,7 +179,18 @@
"Es posible dejar afuera la información de tipo para todos o algunos de los "
"escalares."
+#. Tag: programlisting
+#: query_sql.xml:92
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:94
#, no-c-format
msgid ""
"This is essentially the same query as before, but now "
@@ -160,6 +203,7 @@
"explícitamente."
#. Tag: para
+#: query_sql.xml:99
#, no-c-format
msgid ""
"How the java.sql.Types returned from ResultSetMetaData is mapped to "
@@ -174,11 +218,13 @@
"literal> en el dialecto."
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr "Consultas de entidades"
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
msgid ""
"The above queries were all about returning scalar values, basically "
@@ -191,12 +237,23 @@
"siguiente muestra como obtener los objetos entidades desde una consulta sql "
"nativa por medio de <literal>addEntity()</literal>."
+#. Tag: programlisting
+#: query_sql.xml:114
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr "la entidad devuelta por la consulta"
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
msgid ""
"Assuming that Cat is mapped as a class with the columns ID, NAME and "
@@ -208,6 +265,7 @@
"en donde cada elemento es una entidad Cat."
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
msgid ""
"If the entity is mapped with a <literal>many-to-one</literal> to another "
@@ -225,17 +283,28 @@
"explícitos así como lo muestra el siguiente ejemplo para una <literal>many-"
"to-one</literal> a un <literal>Dog</literal>:"
+#. Tag: programlisting
+#: query_sql.xml:140
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr "Esto permitirá que cat.getDog() funcione apropiadamente."
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr "Manejo de asociaciones y colecciones"
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
msgid ""
"It is possible to eagerly join in the <literal>Dog</literal> to avoid the "
@@ -248,7 +317,18 @@
"medio del método <literal>addJoin()</literal>, el cual le permite unirse en "
"una asociación o colección."
+#. Tag: programlisting
+#: query_sql.xml:153
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:155
#, no-c-format
msgid ""
"In this example, the returned <literal>Cat</literal>'s will have their "
@@ -266,7 +346,18 @@
"<literal>Cat</literal> tuviese en lugar un <literal>Dog</literal> uno-a-"
"muchos."
+#. Tag: programlisting
+#: query_sql.xml:163
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:165
#, no-c-format
msgid ""
"At this stage you are reaching the limits of what is possible with native "
@@ -281,11 +372,13 @@
"suficientes los nombres de las columnas/alias predeterminados."
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr "Devolución de entidades múltiples"
#. Tag: para
+#: query_sql.xml:175
#, no-c-format
msgid ""
"Until now, the result set column names are assumed to be the same as the "
@@ -300,6 +393,7 @@
"aparecer en más de una tabla."
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
msgid ""
"Column alias injection is needed in the following query (which most likely "
@@ -308,7 +402,18 @@
"Se necesita una inyección de alias en las columnas en la siguiente consulta "
"(que con mucha probabilidad fallará):"
+#. Tag: programlisting
+#: query_sql.xml:183
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:185
#, no-c-format
msgid ""
"The query was intended to return two Cat instances per row: a cat and its "
@@ -327,11 +432,24 @@
"los mapeos (\"IDENTIFICACION\" y \"NOMBRE\")."
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
-msgstr "La siguiente forma no es vulnerable a la duplicación de nombres de columnas:"
+msgstr ""
+"La siguiente forma no es vulnerable a la duplicación de nombres de columnas:"
+#. Tag: programlisting
+#: query_sql.xml:195
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
msgid ""
"the SQL query string, with placeholders for Hibernate to inject column "
@@ -341,11 +459,13 @@
"inserte alias de columnas"
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr "las entidades devueltas por la consulta"
#. Tag: para
+#: query_sql.xml:210
#, no-c-format
msgid ""
"The {cat.*} and {mother.*} notation used above is a shorthand for \"all "
@@ -365,12 +485,28 @@
"tabla diferente (cat_log) a la declarada en los meta datos de mapeo. "
"Inclusive puede utilizar los alias de propiedad en la cláusula where."
+#. Tag: programlisting
+#: query_sql.xml:219
+#, no-c-format
+msgid ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr "Referencias de propiedad y alias"
#. Tag: para
+#: query_sql.xml:224
#, no-c-format
msgid ""
"In most cases the above alias injection is needed. For queries relating to "
@@ -385,6 +521,7 @@
"apropiados."
#. Tag: para
+#: query_sql.xml:229
#, no-c-format
msgid ""
"The following table shows the different ways you can use the alias "
@@ -398,180 +535,213 @@
"se utilice."
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr "Nombres con inyección alias"
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr "Descripción"
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr "Sintaxis"
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr "Ejemplo"
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr "Una propiedad simple"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+#. Tag: literal
+#: query_sql.xml:258
+#, fuzzy, no-c-format
+msgid "{[aliasname].[propertyname]"
msgstr "<literal>{[aliasname].[propertyname]</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
+#. Tag: literal
+#: query_sql.xml:260
+#, fuzzy, no-c-format
+msgid "A_NAME as {item.name}"
msgstr "<literal>A_NAME as {item.name}</literal>"
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr "Una propiedad compuesta"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+#. Tag: literal
+#: query_sql.xml:266
+#, fuzzy, no-c-format
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid ""
-"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
-"literal>"
+#. Tag: literal
+#: query_sql.xml:268
+#, fuzzy, no-c-format
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
msgstr ""
"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
"literal>"
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr "Discriminador de una entidad"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
+#. Tag: literal
+#: query_sql.xml:275
+#, fuzzy, no-c-format
+msgid "{[aliasname].class}"
msgstr "<literal>{[aliasname].class}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
+#. Tag: literal
+#: query_sql.xml:277
+#, fuzzy, no-c-format
+msgid "DISC as {item.class}"
msgstr "<literal>DISC as {item.class}</literal>"
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr "Todas las propiedades de una entidad"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
+#, fuzzy, no-c-format
+msgid "{[aliasname].*}"
msgstr "<literal>{[aliasname].*}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:285
#, no-c-format
-msgid "<literal>{item.*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{item.*}"
+msgstr ""
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr "Una clave de colección"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
+#. Tag: literal
+#: query_sql.xml:291
+#, fuzzy, no-c-format
+msgid "{[aliasname].key}"
msgstr "<literal>{[aliasname].key}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
+#. Tag: literal
+#: query_sql.xml:293
+#, fuzzy, no-c-format
+msgid "ORGID as {coll.key}"
msgstr "<literal>ORGID as {coll.key}</literal>"
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr "La identificación -id- de una colección"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
+#. Tag: literal
+#: query_sql.xml:299
+#, fuzzy, no-c-format
+msgid "{[aliasname].id}"
msgstr "<literal>{[aliasname].id}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
+#. Tag: literal
+#: query_sql.xml:301
+#, fuzzy, no-c-format
+msgid "EMPID as {coll.id}"
msgstr "<literal>EMPID as {coll.id}</literal>"
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr "El elemento de una colección"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
+#. Tag: literal
+#: query_sql.xml:307
+#, fuzzy, no-c-format
+msgid "{[aliasname].element}"
msgstr "<literal>{[aliasname].element}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
+#. Tag: literal
+#: query_sql.xml:309
+#, fuzzy, no-c-format
+msgid "XID as {coll.element}"
msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry
+#: query_sql.xml:313
#, no-c-format
msgid "property of the element in the collection"
msgstr "propiedad del elemento en la colección "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+#. Tag: literal
+#: query_sql.xml:315
+#, fuzzy, no-c-format
+msgid "{[aliasname].element.[propertyname]}"
msgstr "<literal>{[aliasname].element.[propertyname]}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
+#. Tag: literal
+#: query_sql.xml:317
+#, fuzzy, no-c-format
+msgid "NAME as {coll.element.name}"
msgstr "<literal>NAME as {coll.element.name}</literal>"
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr "Todas las propiedades del elemeto en la colección"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:323
+#, fuzzy, no-c-format
+msgid "{[aliasname].element.*}"
msgstr "<literal>{[aliasname].element.*}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:325
+#, fuzzy, no-c-format
+msgid "{coll.element.*}"
msgstr "<literal>{coll.element.*}</literal>"
#. Tag: entry
+#: query_sql.xml:329
#, no-c-format
msgid "All properties of the collection"
msgstr "Todas las propiedades de la colección "
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:333
#, no-c-format
-msgid "<literal>{coll.*}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "{coll.*}"
+msgstr ""
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr "Devolución de entidades no-administradas"
#. Tag: para
+#: query_sql.xml:344
#, no-c-format
msgid ""
"It is possible to apply a ResultTransformer to native SQL queries, allowing "
@@ -580,12 +750,22 @@
"Es posible aplicar un ResultTransformer para consultas SQL nativas, "
"permitiéndole retornar entidades no-administradas."
+#. Tag: programlisting
+#: query_sql.xml:347
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr "un transformador de resultado"
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
msgid ""
"The above query will return a list of <literal>CatDTO</literal> which has "
@@ -597,11 +777,13 @@
"NACIMIENTO en su propiedades o campos correspondientes."
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr "Manejo de herencias"
#. Tag: para
+#: query_sql.xml:369
#, no-c-format
msgid ""
"Native SQL queries which query for entities that are mapped as part of an "
@@ -613,35 +795,90 @@
"para la clase base y todas sus subclases."
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr "Parámetros"
#. Tag: para
+#: query_sql.xml:377
#, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr ""
"Las consultas SQL nativas soportan parámetros nombrados así como "
"posicionales:"
+#. Tag: programlisting
+#: query_sql.xml:380
+#, no-c-format
+msgid ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr "Consultas SQL nombradas"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:387
+#, fuzzy, no-c-format
msgid ""
-"Named SQL queries can be defined in the mapping document and called in "
-"exactly the same way as a named HQL query. In this case, you do "
-"<emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
+"Named SQL queries can also be defined in the mapping document and called in "
+"exactly the same way as a named HQL query (see <xref linkend=\"objectstate-"
+"querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> "
+"need to call <literal>addEntity()</literal>."
msgstr ""
"Las consultas SQL nombradas se pueden definir en el documento de mapeo y se "
"pueden llamar de la misma manera que una consulta HQL nombrada. En este "
"caso, <emphasis>no</emphasis> necesitamos llamar a <literal>addEntity()</"
"literal>."
+#. Tag: title
+#: query_sql.xml:394
+#, no-c-format
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:397
+#, no-c-format
+msgid ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, no-c-format
+msgid ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:406
#, no-c-format
msgid ""
"The <literal><return-join></literal> element is use to join "
@@ -652,7 +889,36 @@
"asociaciones y el elemento <literal><load-collection></literal> se usa "
"para definir consultas, las cuales dan inicio a colecciones."
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, no-c-format
+msgid ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
msgid ""
"A named SQL query may return a scalar value. You must declare the column "
@@ -663,7 +929,27 @@
"declarar el alias de la columna y el tipo de Hibernate utilizando el "
"elemento <literal><return-scalar></literal>:"
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name, \n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:426
#, no-c-format
msgid ""
"You can externalize the resultset mapping information in a <literal><"
@@ -676,7 +962,39 @@
"reutilizarlos a través de consultas nombradas o por medio de la API "
"<literal>setResultSetMapping()</literal>."
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, no-c-format
+msgid ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:438
#, no-c-format
msgid ""
"You can, alternatively, use the resultset mapping information in your hbm "
@@ -686,13 +1004,340 @@
"en sus archivos hbm directamente en código java."
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, no-c-format
+msgid ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid ""
+"So far we have only looked at externalizing SQL queries using Hibernate "
+"mapping files. The same concept is also available with anntations and is "
+"called named native queries. You can use <classname>@NamedNativeQuery</"
+"classname> (<classname>@NamedNativeQueries</classname>) in conjunction with "
+"<literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</"
+"literal>). Like <literal>@NamedQuery</literal>, "
+"<classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</"
+"literal> can be defined at class level, but their scope is global to the "
+"application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid ""
+"shows how 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. "
+"In the example 2 entities, <literal>Night</literal> and <literal>Area</"
+"literal>, are returned and each property is declared and associated to a "
+"column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid ""
+"In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set "
+"mapping is implicit. We only describe the entity class of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid ""
+"Finally, 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. This can be seen in "
+"<xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid ""
+"Named SQL query using <classname>@NamedNativeQuery</classname> together with "
+"<classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+" resultSetMapping=\"joinMapping\")\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"implicit\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", \n"
+" query=\"select * from SpaceShip\", \n"
+" resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column = \"name\"),\n"
+" @FieldResult(name=\"model\", column = \"model\"),\n"
+" @FieldResult(name=\"speed\", column = \"speed\"),\n"
+" @FieldResult(name=\"captain.firstname\", column = "
+"\"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column = \"lastn"
+"\"),\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"
+"@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
+#: query_sql.xml:510
+#, no-c-format
+msgid ""
+"If you retrieve a single entity using the default mapping, you can specify "
+"the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip"
+"\", resultClass=SpaceShip.class)\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+"@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension"
+"\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension "
+"from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr ""
"Utilización de la propiedad return para especificar explícitamente los "
"nombres de columnas/alias"
#. Tag: para
+#: query_sql.xml:538
#, no-c-format
msgid ""
"You can explicitly tell Hibernate what column aliases to use with "
@@ -704,7 +1349,25 @@
"utilizar la sintaxis <literal>{}</literal> para dejar que Hibernate inyecte "
"sus propios alias. Por ejemplo:"
+#. Tag: programlisting
+#: query_sql.xml:543
+#, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:545
#, no-c-format
msgid ""
"<literal><return-property></literal> also works with multiple columns. "
@@ -716,7 +1379,29 @@
"literal>, la cual no puede permitir control muy detallado de propiedades "
"multi-columnas."
+#. Tag: programlisting
+#: query_sql.xml:550
+#, no-c-format
+msgid ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:552
#, no-c-format
msgid ""
"In this example <literal><return-property></literal> was used in "
@@ -729,6 +1414,7 @@
"las propiedades."
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
msgid ""
"If your mapping has a discriminator you must use <literal><return-"
@@ -739,11 +1425,13 @@
"discriminadora."
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr "Utilización de procedimientos para consultas"
#. Tag: para
+#: query_sql.xml:565
#, no-c-format
msgid ""
"Hibernate3 provides support for queries via stored procedures and functions. "
@@ -759,14 +1447,55 @@
"Hibernate. A continuación hay un ejemplo de tal función almacenada en Oracle "
"9 y posteriores:"
+#. Tag: programlisting
+#: query_sql.xml:571
+#, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr ""
"Para utilizar esta consulta en Hibernate u.d necesita mapearla por medio de "
"una consulta nombrada."
+#. Tag: programlisting
+#: query_sql.xml:576
+#, no-c-format
+msgid ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:578
#, no-c-format
msgid ""
"Stored procedures currently only return scalars and entities. <literal><"
@@ -778,11 +1507,13 @@
"<literal><load-collection></literal> ."
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr "Reglas/limitaciones para utilizar procedimientos almacenados"
#. Tag: para
+#: query_sql.xml:585
#, no-c-format
msgid ""
"You cannot use stored procedures with Hibernate unless you follow some "
@@ -801,6 +1532,7 @@
"procedimientos almacenados."
#. Tag: para
+#: query_sql.xml:593
#, no-c-format
msgid ""
"Stored procedure queries cannot be paged with <literal>setFirstResult()/"
@@ -810,6 +1542,7 @@
"<literal>setFirstResult()/setMaxResults()</literal>."
#. Tag: para
+#: query_sql.xml:596
#, no-c-format
msgid ""
"The recommended call form is standard SQL92: <literal>{ ? = call functionName"
@@ -822,11 +1555,13 @@
"llamadas nativas."
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr "Para Oracle aplican las siguientes reglas:"
#. Tag: para
+#: query_sql.xml:605
#, no-c-format
msgid ""
"A function must return a result set. The first parameter of a procedure must "
@@ -843,11 +1578,13 @@
"información."
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr "Para Sybase o el servidor MS SQL aplican las siguientes reglas:"
#. Tag: para
+#: query_sql.xml:618
#, no-c-format
msgid ""
"The procedure must return a result set. Note that since these servers can "
@@ -862,6 +1599,7 @@
"será descartado."
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
msgid ""
"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it "
@@ -871,76 +1609,180 @@
"probablemente será más eficiente, pero no es un requerimiento."
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr "Personalice SQL para crear, actualizar y borrar"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:638
+#, fuzzy, no-c-format
msgid ""
"Hibernate3 can use custom SQL for create, update, and delete operations. The "
"SQL can be overridden at the statement level or inidividual column level. "
"This section describes statement overrides. For columns, see <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-"
+"annotations\"/> shows how to define custom SQL operatons using annotations."
msgstr ""
-"Hibernate3 puede utilizar SQL personalizado para crear, actualizar y borrar operaciones. El SQL se puede sobreescribir a nivel de declaración o a nivel de columna individual. "
-"Esta sección describe la sobreescritua de declaraciones. Para las columnas consulte <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"Hibernate3 puede utilizar SQL personalizado para crear, actualizar y borrar "
+"operaciones. El SQL se puede sobreescribir a nivel de declaración o a nivel "
+"de columna individual. Esta sección describe la sobreescritua de "
+"declaraciones. Para las columnas consulte <xref linkend=\"mapping-column-"
+"read-and-write\" />."
+#. Tag: title
+#: query_sql.xml:646
+#, no-c-format
+msgid "Custom CRUD via annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:648
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"@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"
+"@Loader(namedQuery = \"chaos\")\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
+#: query_sql.xml:651
#, no-c-format
msgid ""
-"The class and collection persisters in Hibernate already contain a set of "
-"configuration time generated strings (insertsql, deletesql, updatesql etc.). "
-"The mapping tags <literal><sql-insert></literal>, <literal><sql-"
-"delete></literal>, and <literal><sql-update></literal> override "
-"these strings:"
+"<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can "
+"be achieved using Hibernate mapping files and the <literal><sql-insert>"
+"</literal>, <literal><sql-update></literal> and <literal><sql-"
+"delete></literal> nodes. This can be seen in <xref linkend=\"example-"
+"custom-crdu-via-xml\"/>."
msgstr ""
-"Los persistentes de clase y de colección en "
-"Hibernate ya contienen un grupo de cadenas generadas en tiempo de "
-"configuración (insertsql, deletesql, updatesql, etc.). Las etiquetas de mapeo "
-"<literal><sql-insert></literal>, <literal><sql-delete></"
-"literal> y <literal><sql-update></literal> sobrescriben estas cadenas:"
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:666
#, no-c-format
msgid ""
-"The SQL is directly executed in your database, so you can use any dialect "
-"you like. This will reduce the portability of your mapping if you use "
-"database specific SQL."
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to <constant>true</constant>. In "
+"annotations as well as in xml."
msgstr ""
-"El SQL se ejecuta directamente en su base de datos asi que usted es libre de "
-"utilizar cualquier dialecto que desee. Esto reducirá la portabilidad de su "
-"mapeo si utiliza una base de datos especifica de SQL."
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
msgid ""
-"Stored procedures are supported if the <literal>callable</literal> attribute "
-"is set:"
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
msgstr ""
-"Los procedimientos almacenados se encuentran soportados si el atributo "
-"<literal>callable</literal> está configurado:"
#. Tag: para
+#: query_sql.xml:675
#, no-c-format
msgid ""
-"The order of the positional parameters is vital, as they must be in the same "
-"sequence as Hibernate expects them."
+"none: no check is performed: the store procedure is expected to fail upon "
+"issues"
msgstr ""
-"El orden de los parámetros posicionales es vital ya que se deben encontrar "
-"en la misma secuencia en que Hibernate los espera."
#. Tag: para
+#: query_sql.xml:680
#, no-c-format
+msgid "count: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:685
+#, no-c-format
msgid ""
-"You can view 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 view the expected sequence, do not include "
-"your custom SQL in the mapping files, as this will override the Hibernate "
-"generated static SQL."
+"param: like COUNT but using an output parameter rather that the standard "
+"mechanism"
msgstr ""
+
+#. Tag: para
+#: query_sql.xml:690
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal> parameter "
+"which is again available in annoations as well as in xml."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:693
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations respectively xml nodes to "
+"override the collection related statements -see <xref linkend=\"example-"
+"overriding-sql-collections-annotations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:698
+#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?"
+"\")\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:705
+#, fuzzy, no-c-format
+msgid ""
+"The parameter order is important and is defined by the order Hibernate "
+"handles 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 or mapping files "
+"as that will override the Hibernate generated static sql)"
+msgstr ""
"Puede ver el orden esperado habilitando el registro de depuración para el "
"nivel <literal>org.hibernate.persister.entity</literal>. Con este nivel "
"habilitado Hibernate imprimirá el SQL estático que se utiliza para crear, "
@@ -949,13 +1791,68 @@
"sobrescribirá el sql estático generado por Hibernate)."
#. Tag: para
+#: query_sql.xml:715
#, no-c-format
msgid ""
-"The stored procedures are in most cases required to return the number of "
-"rows inserted, updated and deleted, as Hibernate has some runtime checks for "
-"the success of the statement. Hibernate always registers the first statement "
-"parameter as a numeric output parameter for the CUD operations:"
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>@org.hibernate.annotations.Table</literal> and either (or all) "
+"attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
msgstr ""
+
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"@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"
+" sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values"
+"(upper(?), ?)\") )\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:726
+#, no-c-format
+msgid ""
+"The previous example also shows that you can give a comment to a given table "
+"(primary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:731
+#, fuzzy, no-c-format
+msgid ""
+"The SQL is directly executed in your database, so you can use any dialect "
+"you like. This will, however, reduce the portability of your mapping if you "
+"use database specific SQL."
+msgstr ""
+"El SQL se ejecuta directamente en su base de datos asi que usted es libre de "
+"utilizar cualquier dialecto que desee. Esto reducirá la portabilidad de su "
+"mapeo si utiliza una base de datos especifica de SQL."
+
+#. Tag: para
+#: query_sql.xml:736
+#, fuzzy, no-c-format
+msgid ""
+"Last but not least, stored procedures are in most cases required to return "
+"the number of rows inserted, updated and deleted. Hibernate always registers "
+"the first statement parameter as a numeric output parameter for the CUD "
+"operations:"
+msgstr ""
"En la mayoría de los casos se requiere que los procedimientos almacenados "
"retornen el número de filas insertadas, actualizadas y borradas ya que "
"Hibernate tiene algunas verificaciones en tiempo de ejecución para el éxito "
@@ -963,23 +1860,67 @@
"declaración como un parámetro de la salida numérica para las operaciones CUD:"
#. Tag: title
+#: query_sql.xml:742
#, no-c-format
+msgid "Stored procedures and their return value"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:744
+#, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
msgid "Custom SQL for loading"
msgstr "Personalice SQL para cargar"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:751
+#, fuzzy, no-c-format
msgid ""
"You can also declare your own SQL (or HQL) queries for entity loading. As "
"with inserts, updates, and deletes, this can be done at the individual "
-"column level as described in <xref linkend=\"mapping-column-read-and-write"
-"\" /> or at the statement level. Here is an example of a statement level "
+"column level as described in <xref linkend=\"mapping-column-read-and-write\"/"
+"> or at the statement level. Here is an example of a statement level "
"override:"
msgstr ""
-"También puede declarar su propias peticiones SQL (o HQL) para cargar entidades. Así como con las inserciones, actualizaciones y los borrados, esto se puede realizar a nivel de columna individual tal como se describe en <xref linkend=\"mapping-column-read-and-write"
-"\" /> o a nivel de declaración. Este es un ejemplo de una sobreescritura a nivel de declaración: "
+"También puede declarar su propias peticiones SQL (o HQL) para cargar "
+"entidades. Así como con las inserciones, actualizaciones y los borrados, "
+"esto se puede realizar a nivel de columna individual tal como se describe en "
+"<xref linkend=\"mapping-column-read-and-write\" /> o a nivel de declaración. "
+"Este es un ejemplo de una sobreescritura a nivel de declaración: "
+#. Tag: programlisting
+#: query_sql.xml:757
+#, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:759
#, no-c-format
msgid ""
"This is just a named query declaration, as discussed earlier. You can "
@@ -988,17 +1929,57 @@
"Esta es tan sólo una declaración de consulta nombrada, como se discutió "
"anteriormente. Puede referenciar esta consulta nombrada en un mapeo de clase:"
+#. Tag: programlisting
+#: query_sql.xml:762
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:764
#, no-c-format
msgid "This even works with stored procedures."
msgstr "Esto funciona inclusive con procedimientos almacenados."
#. Tag: para
+#: query_sql.xml:766
#, no-c-format
msgid "You can even define a query for collection loading:"
msgstr "Puede incluso definir una consulta para la carga de colección:"
+#. Tag: programlisting
+#: query_sql.xml:768
+#, no-c-format
+msgid ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:770
+#, no-c-format
+msgid ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:772
#, no-c-format
msgid ""
"You can also define an entity loader that loads a collection by join "
@@ -1007,3 +1988,59 @@
"También puede definir un cargador de entidad que cargue una colección con "
"una unión temprana:"
+#. Tag: programlisting
+#: query_sql.xml:775
+#, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid ""
+"The annotation equivalent <literal><loader></literal> is the @Loader "
+"annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/"
+">."
+msgstr ""
+
+#~ msgid "<literal>{item.*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
+
+#~ msgid "<literal>{coll.*}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
+
+#~ msgid ""
+#~ "The class and collection persisters in Hibernate already contain a set of "
+#~ "configuration time generated strings (insertsql, deletesql, updatesql "
+#~ "etc.). The mapping tags <literal><sql-insert></literal>, "
+#~ "<literal><sql-delete></literal>, and <literal><sql-update></"
+#~ "literal> override these strings:"
+#~ msgstr ""
+#~ "Los persistentes de clase y de colección en Hibernate ya contienen un "
+#~ "grupo de cadenas generadas en tiempo de configuración (insertsql, "
+#~ "deletesql, updatesql, etc.). Las etiquetas de mapeo <literal><sql-"
+#~ "insert></literal>, <literal><sql-delete></literal> y "
+#~ "<literal><sql-update></literal> sobrescriben estas cadenas:"
+
+#~ msgid ""
+#~ "Stored procedures are supported if the <literal>callable</literal> "
+#~ "attribute is set:"
+#~ msgstr ""
+#~ "Los procedimientos almacenados se encuentran soportados si el atributo "
+#~ "<literal>callable</literal> está configurado:"
+
+#~ msgid ""
+#~ "The order of the positional parameters is vital, as they must be in the "
+#~ "same sequence as Hibernate expects them."
+#~ msgstr ""
+#~ "El orden de los parámetros posicionales es vital ya que se deben "
+#~ "encontrar en la misma secuencia en que Hibernate los espera."
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/session_api.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/session_api.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/session_api.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: session_api\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:48\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 14:40+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,11 +24,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "Trabajo con objetos"
#. Tag: para
+#: session_api.xml:33
#, no-c-format
msgid ""
"Hibernate is a full object/relational mapping solution that not only shields "
@@ -47,6 +49,7 @@
"aplicaciones Java."
#. Tag: para
+#: session_api.xml:40
#, no-c-format
msgid ""
"In other words, Hibernate application developers should always think about "
@@ -62,16 +65,19 @@
"afinar el rendimiento del sistema."
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "Estados de objeto de Hibernate"
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr "Hibernate define y soporta los siguientes estados de objeto:"
#. Tag: para
+#: session_api.xml:53
#, no-c-format
msgid ""
"<emphasis>Transient</emphasis> - an object is transient if it has just been "
@@ -95,6 +101,7 @@
"necesitan ejecutarse para esta transición)."
#. Tag: para
+#: session_api.xml:65
#, no-c-format
msgid ""
"<emphasis>Persistent</emphasis> - a persistent instance has a representation "
@@ -117,6 +124,7 @@
"poner como transitorio."
#. Tag: para
+#: session_api.xml:77
#, no-c-format
msgid ""
"<emphasis>Detached</emphasis> - a detached instance is an object that has "
@@ -141,6 +149,7 @@
"unidad de trabajo desde el punto de vista del usuario."
#. Tag: para
+#: session_api.xml:90
#, no-c-format
msgid ""
"We will now discuss the states and state transitions (and the Hibernate "
@@ -150,21 +159,37 @@
"Hibernate que disparan una transición) en más detalle. "
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "Haciendo los objetos persistentes"
#. Tag: para
+#: session_api.xml:97
#, no-c-format
msgid ""
"Newly instantiated instances of a persistent class are considered "
"<emphasis>transient</emphasis> by Hibernate. We can make a transient "
"instance <emphasis>persistent</emphasis> by associating it with a session:"
msgstr ""
-"Las instancias recién instanciadas de una clase persistente, Hibernate las considera como <emphasis>transitorias</emphasis>. Podemos hacer una instancia "
-"transitoria <emphasis>persistente</emphasis> asociándola con una sesión:"
+"Las instancias recién instanciadas de una clase persistente, Hibernate las "
+"considera como <emphasis>transitorias</emphasis>. Podemos hacer una "
+"instancia transitoria <emphasis>persistente</emphasis> asociándola con una "
+"sesión:"
+#. Tag: programlisting
+#: session_api.xml:102
+#, no-c-format
+msgid ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:104
#, no-c-format
msgid ""
"If <literal>Cat</literal> has a generated identifier, the identifier is "
@@ -186,6 +211,7 @@
"el borrador de EJB3. "
#. Tag: para
+#: session_api.xml:115
#, no-c-format
msgid ""
"<literal>persist()</literal> makes a transient instance persistent. However, "
@@ -205,6 +231,7 @@
"un contexto extendido sesión/persistencia."
#. Tag: para
+#: session_api.xml:126
#, no-c-format
msgid ""
"<literal>save()</literal> does guarantee to return an identifier. If an "
@@ -221,6 +248,7 @@
"extendido sesión/persistencia."
#. Tag: para
+#: session_api.xml:135
#, no-c-format
msgid ""
"Alternatively, you can assign the identifier using an overloaded version of "
@@ -229,7 +257,21 @@
"Opcionalmente, puede asignar el identificador utilizando una versión "
"sobrecargada de <literal>save()</literal>."
+#. Tag: programlisting
+#: session_api.xml:138
+#, no-c-format
+msgid ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:140
#, no-c-format
msgid ""
"If the object you make persistent has associated objects (e.g. the "
@@ -250,6 +292,7 @@
"equivocado. "
#. Tag: para
+#: session_api.xml:148
#, no-c-format
msgid ""
"Usually you do not bother with this detail, as you will normally use "
@@ -266,11 +309,13 @@
"discute la persistencia transitiva."
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr "Cargando un objeto"
#. Tag: para
+#: session_api.xml:159
#, no-c-format
msgid ""
"The <literal>load()</literal> methods of <literal>Session</literal> provide "
@@ -284,12 +329,39 @@
"estado dentro de una instancia recién instanciada de esa clase, en un estado "
"persistente."
+#. Tag: programlisting
+#: session_api.xml:165
+#, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, no-c-format
+msgid ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr "Alternativamente, puede cargar estado dentro de una instancia dada:"
+#. Tag: programlisting
+#: session_api.xml:171
+#, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:173
#, no-c-format
msgid ""
"Be aware that <literal>load()</literal> will throw an unrecoverable "
@@ -311,6 +383,7 @@
"size</literal> para el mapeo de la clase."
#. Tag: para
+#: session_api.xml:182
#, no-c-format
msgid ""
"If you are not certain that a matching row exists, you should use the "
@@ -321,7 +394,20 @@
"el método <literal>get()</literal>, que llama a la base de datos "
"inmediatamente y devuelve nulo si no existe una fila correspondiente. "
+#. Tag: programlisting
+#: session_api.xml:186
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:188
#, no-c-format
msgid ""
"You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</"
@@ -332,7 +418,14 @@
"literal> de SQL, usando un <literal>LockMode</literal>. Consulte la "
"documentación de la API para obtener más información."
+#. Tag: programlisting
+#: session_api.xml:192
+#, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:194
#, no-c-format
msgid ""
"Any associated instances or contained collections will <emphasis>not</"
@@ -346,6 +439,7 @@
"un estilo de cascada para la asociación."
#. Tag: para
+#: session_api.xml:199
#, no-c-format
msgid ""
"It is possible to re-load an object and all its collections at any time, "
@@ -357,25 +451,37 @@
"cuando se usan disparadores de base de datos para inicializar algunas de las "
"propiedades del objeto."
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:204
#, no-c-format
msgid ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:206
+#, fuzzy, no-c-format
+msgid ""
"How much does Hibernate load from the database and how many SQL "
"<literal>SELECT</literal>s will it use? This depends on the "
"<emphasis>fetching strategy</emphasis>. This is explained in <xref linkend="
-"\"performance-fetching\" />."
+"\"performance-fetching\"/>."
msgstr ""
"¿Cuánto carga Hibernate de la base de datos y cuántos <literal>SELECT</"
"literal>s de SQL utilizará? Esto depende de la <emphasis>estrategia de "
-"recuperación</emphasis>. Esto se explica en la <xref linkend="
-"\"performance-fetching\" />."
+"recuperación</emphasis>. Esto se explica en la <xref linkend=\"performance-"
+"fetching\" />."
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "Consultas"
#. Tag: para
+#: session_api.xml:215
#, no-c-format
msgid ""
"If you do not know the identifiers of the objects you are looking for, you "
@@ -394,11 +500,13 @@
"conversión del conjunto de resultados a objetos."
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "Ejecución de consultas"
#. Tag: para
+#: session_api.xml:226
#, no-c-format
msgid ""
"HQL and native SQL queries are represented with an instance of <literal>org."
@@ -413,7 +521,38 @@
"consulta real. Siempre obtiene una <literal>Query</literal> utilizando la "
"<literal>Session</literal> actual:"
+#. Tag: programlisting
+#: session_api.xml:232
+#, no-c-format
+msgid ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:234
#, no-c-format
msgid ""
"A query is usually executed by invoking <literal>list()</literal>. The "
@@ -436,11 +575,13 @@
"<literal>Set</literal>."
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "Iteración de resultados"
#. Tag: para
+#: session_api.xml:246
#, no-c-format
msgid ""
"Occasionally, you might be able to achieve better performance by executing "
@@ -463,12 +604,33 @@
"que sólamente retorna identificadores y <emphasis>n</emphasis> selecciones "
"adicionales para inicializar las instancias reales."
+#. Tag: programlisting
+#: session_api.xml:257
+#, no-c-format
+msgid ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "Consultas que devuelven tuplas"
#. Tag: para
+#: session_api.xml:263
#, no-c-format
msgid ""
"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
@@ -477,12 +639,32 @@
"Las consultas de Hibernate a veces retornan tuplas de objetos. Cada tupla se "
"retorna como un array:"
+#. Tag: programlisting
+#: session_api.xml:266
+#, no-c-format
+msgid ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "Resultados escalares"
#. Tag: para
+#: session_api.xml:272
#, no-c-format
msgid ""
"Queries can specify a property of a class in the <literal>select</literal> "
@@ -494,12 +676,34 @@
"SQL. Las propiedades o agregaciones son considerados resultados \"escalares"
"\" y no entidades en estado persistente."
+#. Tag: programlisting
+#: session_api.xml:277
+#, no-c-format
+msgid ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "Ligado de parámetros"
#. Tag: para
+#: session_api.xml:283
#, no-c-format
msgid ""
"Methods on <literal>Query</literal> are provided for binding values to named "
@@ -516,28 +720,69 @@
"parámetros con nombre son las siguientes:"
#. Tag: para
+#: session_api.xml:292
#, no-c-format
-msgid "named parameters are insensitive to the order they occur in the query string"
+msgid ""
+"named parameters are insensitive to the order they occur in the query string"
msgstr ""
"los parámetros con nombre son insensibles al orden en que aparecen en la "
"cadena de consulta"
#. Tag: para
+#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "pueden aparecer múltiples veces en la misma petición"
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "son auto-documentados"
+#. Tag: programlisting
+#: session_api.xml:305
+#, no-c-format
+msgid ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, no-c-format
+msgid ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, no-c-format
+msgid ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "Paginación"
#. Tag: para
+#: session_api.xml:315
#, no-c-format
msgid ""
"If you need to specify bounds upon your result set, that is, the maximum "
@@ -549,7 +794,18 @@
"recuperar, puede utilizar los métodos de la interfaz <literal>Query</"
"literal>:"
+#. Tag: programlisting
+#: session_api.xml:320
+#, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
msgid ""
"Hibernate knows how to translate this limit query into the native SQL of "
@@ -559,11 +815,13 @@
"DBMS."
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr "Iteración deslizable"
#. Tag: para
+#: session_api.xml:329
#, no-c-format
msgid ""
"If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the "
@@ -576,7 +834,37 @@
"<literal>ScrollableResults</literal> que permite una navegación flexible de "
"los resultados de consulta. "
+#. Tag: programlisting
+#: session_api.xml:334
+#, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:336
#, no-c-format
msgid ""
"Note that an open database connection and cursor is required for this "
@@ -589,27 +877,106 @@
"paginación fuera de línea."
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "Externalización de consultas con nombre"
#. Tag: para
+#: session_api.xml:345
#, no-c-format
msgid ""
-"You can also define named queries in the mapping document. Remember to use a "
-"<literal>CDATA</literal> section if your query contains characters that "
-"could be interpreted as markup."
+"Queries can also be configured as so called named queries using annotations "
+"or Hibernate mapping documents. <literal>@NamedQuery</literal> and "
+"<literal>@NamedQueries</literal> can be defined at the class level as seen "
+"in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: session_api.xml:361
+#, fuzzy, no-c-format
+msgid ""
+"Using a mapping document can be configured using the <literal><query></"
+"literal> node. Remember to use a <literal>CDATA</literal> section if your "
+"query contains characters that could be interpreted as markup."
+msgstr ""
"También puede definir consultas con nombre en el documento de mapeo. "
"Recuerde utilizar una sección <literal>CDATA</literal> si su consulta "
"contiene caracteres que puedan ser interpretados como etiquetado."
+#. Tag: title
+#: session_api.xml:367
+#, no-c-format
+msgid "Defining a named query using <literal><query></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, no-c-format
+msgid ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+msgstr ""
+
#. Tag: para
-#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+#: session_api.xml:373
+#, fuzzy, no-c-format
+msgid ""
+"Parameter binding and executing is done programatically as seen in <xref "
+"linkend=\"example-parameter-binding-named-query\"/>."
msgstr "El ligado de parámetros y de ejecución se realiza programáticamente:"
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, no-c-format
+msgid ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:382
#, no-c-format
msgid ""
"The actual program code is independent of the query language that is used. "
@@ -621,6 +988,7 @@
"migrar consultas existentes a Hibernate colocándolas en archivos de mapeo."
#. Tag: para
+#: session_api.xml:387
#, no-c-format
msgid ""
"Also note that a query declaration inside a <literal><hibernate-"
@@ -637,11 +1005,13 @@
"<literal>eg.Cat.ByNameAndMaximumWeight</literal>."
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "Filtración de colecciones"
#. Tag: para
+#: session_api.xml:399
#, no-c-format
msgid ""
"A collection <emphasis>filter</emphasis> is a special type of query that can "
@@ -653,7 +1023,20 @@
"consulta puede referirse a <literal>this</literal>, lo que quiere decir el "
"elemento de la colección actual."
+#. Tag: programlisting
+#: session_api.xml:404
+#, no-c-format
+msgid ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:406
#, no-c-format
msgid ""
"The returned collection is considered a bag that is a copy of the given "
@@ -666,6 +1049,7 @@
"esperado."
#. Tag: para
+#: session_api.xml:411
#, no-c-format
msgid ""
"Observe that filters do not require a <literal>from</literal> clause, "
@@ -676,7 +1060,18 @@
"aunque pueden tener una si se necesita. Los filtros no están limitados a "
"devolver los elementos de colección por sí mismos."
+#. Tag: programlisting
+#: session_api.xml:415
+#, no-c-format
+msgid ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:417
#, no-c-format
msgid ""
"Even an empty filter query is useful, e.g. to load a subset of elements in a "
@@ -685,12 +1080,24 @@
"Incluso una consulta de filtro vacío es útil, por ejemplo, para cargar un "
"subconjunto de elementos en una colección enorme: "
+#. Tag: programlisting
+#: session_api.xml:420
+#, no-c-format
+msgid ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr "Consultas de criterios"
#. Tag: para
+#: session_api.xml:426
#, no-c-format
msgid ""
"HQL is extremely powerful, but some developers prefer to build queries "
@@ -703,23 +1110,35 @@
"vez de construir cadenas de consulta. Hibernate brinda una API intuitiva de "
"consulta <literal>Criteria</literal> para estos casos: "
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:431
#, no-c-format
msgid ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:433
+#, fuzzy, no-c-format
+msgid ""
"The <literal>Criteria</literal> and the associated <literal>Example</"
-"literal> API are discussed in more detail in <xref linkend=\"querycriteria"
-"\" />."
+"literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"
+">."
msgstr ""
"Las APIs de <literal>Criteria</literal> y el <literal>Example</literal> "
-"asociado se discuten en más detalle en el <xref linkend=\"querycriteria"
-"\" />."
+"asociado se discuten en más detalle en el <xref linkend=\"querycriteria\" />."
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "Consultas en SQL nativo"
#. Tag: para
+#: session_api.xml:441
#, no-c-format
msgid ""
"You can express a query in SQL, using <literal>createSQLQuery()</literal> "
@@ -735,23 +1154,50 @@
"directamente. Si elige usar la API de Hibernate, tiene que encerrar los "
"alias de SQL entre llaves:"
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:448
#, no-c-format
msgid ""
+"List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE "
+"ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:452
+#, fuzzy, no-c-format
+msgid ""
"SQL queries can contain named and positional parameters, just like Hibernate "
"queries. More information about native SQL queries in Hibernate can be found "
-"in <xref linkend=\"querysql\" />."
+"in <xref linkend=\"querysql\"/>."
msgstr ""
"Las consultas SQL pueden contener parámetros con nombre y posicionados, al "
"igual que las consultas de Hibernate. Puede encontrar más información sobre "
-"las consultas en SQL nativo en Hibernate en el <xref linkend=\"querysql\" />. "
+"las consultas en SQL nativo en Hibernate en el <xref linkend=\"querysql\" /"
+">. "
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr "Modificación de objetos persistentes"
#. Tag: para
+#: session_api.xml:461
#, no-c-format
msgid ""
"<emphasis>Transactional persistent instances</emphasis> (i.e. objects "
@@ -776,7 +1222,17 @@
"<literal>load()</literal> y luego manipularlo directamente, mientras la "
"<literal>Session</literal> está abierta:"
+#. Tag: programlisting
+#: session_api.xml:473
+#, no-c-format
+msgid ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:475
#, no-c-format
msgid ""
"Sometimes this programming model is inefficient, as it requires in the same "
@@ -791,7 +1247,8 @@
"instancias separadas."
#. Tag: para
-#, no-c-format
+#: session_api.xml:481
+#, fuzzy, no-c-format
msgid ""
"Hibernate does not offer its own API for direct execution of "
"<literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate "
@@ -802,7 +1259,7 @@
"the notion of mass operations conflicts with object/relational mapping for "
"online transaction processing-oriented applications. Future versions of "
"Hibernate can, however, provide special mass operation functions. See <xref "
-"linkend=\"batch\" /> for some possible batch operation tricks."
+"linkend=\"batch\"/> for some possible batch operation tricks."
msgstr ""
"Hibernate no ofrece su propia API para ejecución directa de declaraciones "
"<literal>UPDATE</literal> o <literal>DELETE</literal>. Hibernate es un "
@@ -818,11 +1275,13 @@
"trucos posibles para la operación en lote. "
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr "Modificación de objetos separados"
#. Tag: para
+#: session_api.xml:499
#, no-c-format
msgid ""
"Many applications need to retrieve an object in one transaction, send it to "
@@ -838,6 +1297,7 @@
"versionados para asegurar el aislamiento de la unidad de trabajo \"larga\"."
#. Tag: para
+#: session_api.xml:505
#, no-c-format
msgid ""
"Hibernate supports this model by providing for reattachment of detached "
@@ -848,7 +1308,25 @@
"utilizando los métodos <literal>Session.update()</literal> o "
"<literal>Session.merge()</literal>:"
+#. Tag: programlisting
+#: session_api.xml:509
+#, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
msgid ""
"If the <literal>Cat</literal> with identifier <literal>catId</literal> had "
@@ -860,6 +1338,7 @@
"aplicación intentó volver a unirlo, se habría lanzado una excepción."
#. Tag: para
+#: session_api.xml:516
#, no-c-format
msgid ""
"Use <literal>update()</literal> if you are certain that the session does not "
@@ -879,22 +1358,24 @@
"instancias separadas es la primera operación que se ejecuta."
#. Tag: para
-#, no-c-format
+#: session_api.xml:524
+#, fuzzy, no-c-format
msgid ""
"The application should individually <literal>update()</literal> detached "
"instances that are reachable from the given detached instance "
"<emphasis>only</emphasis> if it wants their state to be updated. This can be "
"automated using <emphasis>transitive persistence</emphasis>. See <xref "
-"linkend=\"objectstate-transitive\" /> for more information."
+"linkend=\"objectstate-transitive\"/> for more information."
msgstr ""
"La aplicación debe actualizar <literal>update()</literal> individualmente "
"las instancias separadas alcanzables desde la instancia separada dada "
"<emphasis>sólo</emphasis> si quiere que su estado se actualice. Esto puede "
-"ser automatizado utilizando la <emphasis>persistencia transitiva</"
-"emphasis>. Consulte la <xref linkend=\"objectstate-transitive\" /> para "
-"obtener mayor información."
+"ser automatizado utilizando la <emphasis>persistencia transitiva</emphasis>. "
+"Consulte la <xref linkend=\"objectstate-transitive\" /> para obtener mayor "
+"información."
#. Tag: para
+#: session_api.xml:530
#, no-c-format
msgid ""
"The <literal>lock()</literal> method also allows an application to "
@@ -905,7 +1386,20 @@
"reasociar un objeto con una sesión nueva. Sin embargo, la instancia separada "
"no puede haber sido modificada."
+#. Tag: programlisting
+#: session_api.xml:534
+#, no-c-format
+msgid ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:536
#, no-c-format
msgid ""
"Note that <literal>lock()</literal> can be used with various "
@@ -919,20 +1413,23 @@
"re-unión no es el único caso de uso para <literal>lock()</literal>."
#. Tag: para
-#, no-c-format
+#: session_api.xml:541
+#, fuzzy, no-c-format
msgid ""
"Other models for long units of work are discussed in <xref linkend="
-"\"transactions-optimistic\" />."
+"\"transactions-optimistic\"/>."
msgstr ""
"Se discuten otros modelos para unidades largas de trabajo en <xref linkend="
"\"transactions-optimistic\" />."
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr "Detección automática de estado"
#. Tag: para
+#: session_api.xml:548
#, no-c-format
msgid ""
"Hibernate users have requested a general purpose method that either saves a "
@@ -946,7 +1443,26 @@
"actual. El método <literal>saveOrUpdate()</literal> implementa esta "
"funcionalidad."
+#. Tag: programlisting
+#: session_api.xml:554
+#, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
msgid ""
"The usage and semantics of <literal>saveOrUpdate()</literal> seems to be "
@@ -964,6 +1480,7 @@
"ninguno de estos métodos."
#. Tag: para
+#: session_api.xml:563
#, no-c-format
msgid ""
"Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are "
@@ -973,26 +1490,31 @@
"se utilizan en el siguiente escenario:"
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr "la aplicación carga un objeto en la primera sesión"
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr "el objeto se pasa a la capa de UI"
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr "se realizan algunas modificaciones al objeto"
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr "el objeto se pasa abajo de regreso a la capa lógica de negocios"
#. Tag: para
+#: session_api.xml:585
#, no-c-format
msgid ""
"the application persists these modifications by calling <literal>update()</"
@@ -1002,16 +1524,19 @@
"<literal>update()</literal> en una segunda sesión"
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr "<literal>saveOrUpdate()</literal> hace lo siguiente:"
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr "si el objeto ya es persistente en esta sesión, no haga nada"
#. Tag: para
+#: session_api.xml:599
#, no-c-format
msgid ""
"if another object associated with the session has the same identifier, throw "
@@ -1021,6 +1546,7 @@
"una excepción"
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
msgstr ""
@@ -1028,6 +1554,7 @@
"<literal>save()</literal>"
#. Tag: para
+#: session_api.xml:609
#, no-c-format
msgid ""
"if the object's identifier has the value assigned to a newly instantiated "
@@ -1037,6 +1564,7 @@
"instanciado, guárdelo llamando a <literal>save()</literal>"
#. Tag: para
+#: session_api.xml:614
#, no-c-format
msgid ""
"if the object is versioned by a <literal><version></literal> or "
@@ -1050,16 +1578,20 @@
"a <literal>save()</literal>"
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
-msgstr "de otra manera actualice el objeto llamando a <literal>update()</literal>"
+msgstr ""
+"de otra manera actualice el objeto llamando a <literal>update()</literal>"
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr "y <literal>merge()</literal> es muy diferente:"
#. Tag: para
+#: session_api.xml:630
#, no-c-format
msgid ""
"if there is a persistent instance with the same identifier currently "
@@ -1071,6 +1603,7 @@
"persistente"
#. Tag: para
+#: session_api.xml:636
#, no-c-format
msgid ""
"if there is no persistent instance currently associated with the session, "
@@ -1081,11 +1614,13 @@
"persistente"
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr "la instancia persistente es devuelta"
#. Tag: para
+#: session_api.xml:646
#, no-c-format
msgid ""
"the given instance does not become associated with the session, it remains "
@@ -1093,11 +1628,13 @@
msgstr "la instancia dada no se asocia a la sesión, permanece separada"
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr "Borrado de objetos persistentes"
#. Tag: para
+#: session_api.xml:655
#, no-c-format
msgid ""
"<literal>Session.delete()</literal> will remove an object's state from the "
@@ -1110,7 +1647,14 @@
"a un objeto borrado. Lo mejor es pensar en <literal>delete()</literal> al "
"hacer transitoria una instancia persistente."
+#. Tag: programlisting
+#: session_api.xml:660
+#, no-c-format
+msgid "sess.delete(cat);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:662
#, no-c-format
msgid ""
"You can delete objects in any order, without risk of foreign key constraint "
@@ -1125,11 +1669,13 @@
"borrar los hijos."
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "Replicación de objetos entre dos almacenamientos de datos diferentes"
#. Tag: para
+#: session_api.xml:672
#, no-c-format
msgid ""
"It is sometimes useful to be able to take a graph of persistent instances "
@@ -1140,7 +1686,27 @@
"hacerlas persistentes en un almacenamiento de datos diferente, sin regenerar "
"los valores identificadores."
+#. Tag: programlisting
+#: session_api.xml:676
+#, no-c-format
+msgid ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:678
#, no-c-format
msgid ""
"The <literal>ReplicationMode</literal> determines how <literal>replicate()</"
@@ -1150,6 +1716,7 @@
"literal> tratará los conflictos con filas existentes en la base de datos:"
#. Tag: para
+#: session_api.xml:684
#, no-c-format
msgid ""
"<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is "
@@ -1159,6 +1726,7 @@
"una fila de la base de datos con el mismo identificador"
#. Tag: para
+#: session_api.xml:689
#, no-c-format
msgid ""
"<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing "
@@ -1168,6 +1736,7 @@
"la base de datos existente con el mismo identificador"
#. Tag: para
+#: session_api.xml:694
#, no-c-format
msgid ""
"<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there "
@@ -1177,6 +1746,7 @@
"una fila de la base de datos con el mismo identificador"
#. Tag: para
+#: session_api.xml:700
#, no-c-format
msgid ""
"<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its "
@@ -1188,6 +1758,7 @@
"contrario ignora el objeto"
#. Tag: para
+#: session_api.xml:706
#, no-c-format
msgid ""
"Usecases for this feature include reconciling data entered into different "
@@ -1201,11 +1772,13 @@
"producto, deshacer cambios realizados durante transacciones no-ACID y más."
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr "Limpieza (flushing) de la sesión"
#. Tag: para
+#: session_api.xml:715
#, no-c-format
msgid ""
"Sometimes the <literal>Session</literal> will execute the SQL statements "
@@ -1219,26 +1792,31 @@
"</emphasis>, ocurre por defecto en los siguientes puntos:"
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr "antes de algunas ejecuciones de consulta"
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr "desde <literal>org.hibernate.Transaction.commit()</literal>"
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr "desde <literal>Session.flush()</literal>"
#. Tag: para
+#: session_api.xml:736
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "Las declaraciones SQL se emiten en el siguiente orden:"
#. Tag: para
+#: session_api.xml:740
#, no-c-format
msgid ""
"all entity insertions in the same order the corresponding objects were saved "
@@ -1249,26 +1827,32 @@
"literal>"
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr "todas las actualizaciones de entidades"
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr "todas los borrados de colecciones"
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
-msgstr "todos los borrados, actualizaciones e inserciones de elementos de colección"
+msgstr ""
+"todos los borrados, actualizaciones e inserciones de elementos de colección"
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr "todas las inserciones de colecciones"
#. Tag: para
+#: session_api.xml:761
#, no-c-format
msgid ""
"all entity deletions in the same order the corresponding objects were "
@@ -1278,6 +1862,7 @@
"correspondientes fueron borrados usando <literal>Session.delete()</literal> "
#. Tag: para
+#: session_api.xml:766
#, no-c-format
msgid ""
"An exception is that objects using <literal>native</literal> ID generation "
@@ -1287,6 +1872,7 @@
"<literal>native</literal> se insertan cuando se guardan."
#. Tag: para
+#: session_api.xml:769
#, no-c-format
msgid ""
"Except when you explicitly <literal>flush()</literal>, there are absolutely "
@@ -1303,7 +1889,8 @@
"desactualizados o incorrectos."
#. Tag: para
-#, no-c-format
+#: session_api.xml:776
+#, fuzzy, no-c-format
msgid ""
"It is possible to change the default behavior so that flush occurs less "
"frequently. The <literal>FlushMode</literal> class defines three different "
@@ -1312,7 +1899,7 @@
"never flush unless <literal>flush()</literal> is called explicitly. The last "
"mode is useful for long running units of work, where a <literal>Session</"
"literal> is kept open and disconnected for a long time (see <xref linkend="
-"\"transactions-optimistic-longsession\" />)."
+"\"transactions-optimistic-longsession\"/>)."
msgstr ""
"Es posible cambiar el comportamiento predeterminado de modo que el vaciado "
"ocurra con menos frecuencia. La clase <literal>FlushMode</literal> define "
@@ -1321,16 +1908,37 @@
"automático utilizando la rutina explicada, o nunca vaciar a menos de que se "
"llame a <literal>flush()</literal> explícitamente. El último modo es útil "
"para unidades de trabajo largas, donde se mantiene abierta una "
-"<literal>Session</literal> y es desconectada por largo tiempo (consulte la <xref "
-"linkend=\"transactions-optimistic-longsession\"/>)."
+"<literal>Session</literal> y es desconectada por largo tiempo (consulte la "
+"<xref linkend=\"transactions-optimistic-longsession\"/>)."
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:786
#, no-c-format
msgid ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:788
+#, fuzzy, no-c-format
+msgid ""
"During flush, an exception might occur (e.g. if a DML operation violates a "
"constraint). Since handling exceptions involves some understanding of "
"Hibernate's transactional behavior, we discuss it in <xref linkend="
-"\"transactions\" />."
+"\"transactions\"/>."
msgstr ""
"Durante el vaciado se puede presentar una excepción (por ejemplo, si una "
"operación DML viola una restricción). Ya que el manejo de excepciones "
@@ -1338,11 +1946,13 @@
"lo discutimos en <xref linkend=\"transactions\" />. "
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr "Persistencia transitiva"
#. Tag: para
+#: session_api.xml:797
#, no-c-format
msgid ""
"It is quite cumbersome to save, delete, or reattach individual objects, "
@@ -1354,6 +1964,7 @@
"una relación padre/hijo. Considere el siguiente ejemplo:"
#. Tag: para
+#: session_api.xml:802
#, no-c-format
msgid ""
"If the children in a parent/child relationship would be value typed (e.g. a "
@@ -1376,6 +1987,7 @@
"referencias compartidas entonces borrará el hijo de la base de datos."
#. Tag: para
+#: session_api.xml:812
#, no-c-format
msgid ""
"Now consider the same scenario with parent and child objects being entities, "
@@ -1395,6 +2007,7 @@
"no implementa por defecto la <emphasis>persistencia por alcance</emphasis>."
#. Tag: para
+#: session_api.xml:820
#, no-c-format
msgid ""
"For each basic operation of the Hibernate session - including "
@@ -1414,12 +2027,26 @@
"largo de una asociación, debe indicar eso en el documento de mapeo. Por "
"ejemplo:"
+#. Tag: programlisting
+#: session_api.xml:828
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr "Los estilos de cascada pueden combinarse:"
+#. Tag: programlisting
+#: session_api.xml:832
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:834
#, no-c-format
msgid ""
"You can even use <literal>cascade=\"all\"</literal> to specify that "
@@ -1433,30 +2060,133 @@
"predeterminada especifica que ninguna operación se tratará en cascada. "
#. Tag: para
+#: session_api.xml:839
#, no-c-format
msgid ""
+"In case you are using annotatons you probably have noticed the "
+"<literal>cascade</literal> attribute taking an array of "
+"<classname>CascadeType</classname> as a value. The cascade concept in JPA is "
+"very is similar to the transitive persistence and cascading of operations as "
+"described above, but with slightly different semantics and cascading types:"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:848
+#, no-c-format
+msgid ""
+"<literal>CascadeType.PERSIST</literal>: cascades the persist (create) "
+"operation to associated entities persist() is called or if the entity is "
+"managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:854
+#, no-c-format
+msgid ""
+"<literal>CascadeType.MERGE</literal>: cascades the merge operation to "
+"associated entities if merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:860
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REMOVE</literal>: cascades the remove operation to "
+"associated entities if delete() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:865
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to "
+"associated entities if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:870
+#, no-c-format
+msgid ""
+"<literal>CascadeType.DETACH:</literal> cascades the detach operation to "
+"associated entities if detach() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:875
+#, fuzzy, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr "<literal>saveOrUpdate()</literal> hace lo siguiente:"
+
+#. Tag: para
+#: session_api.xml:880
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc..."
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:884
+#, no-c-format
+msgid ""
"A special cascade style, <literal>delete-orphan</literal>, applies only to "
"one-to-many associations, and indicates that the <literal>delete()</literal> "
"operation should be applied to any child object that is removed from the "
-"association."
+"association. Using annotations there is no <literal>CascadeType.DELETE-"
+"ORPHAN</literal> equivalent. Instead you can use the attribute "
+"<literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-"
+"many-with-orphan-removal\"/>. If an entity is removed from a "
+"<classname>@OneToMany</classname> collection or an associated entity is "
+"dereferenced from a <classname>@OneToOne</classname> association, this "
+"associated entity can be marked for deletion if <literal>orphanRemoval</"
+"literal> is set to true."
msgstr ""
-"Un estilo de cascada especial, <literal>delete-orphan</literal>, se aplica "
-"sólamente a asociaciones uno-a-muchos, e indica que la operación "
-"<literal>delete()</literal> debe aplicarse a cualquier objeto hijo que se "
-"elimine de la asociación."
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+"@Entity \n"
+"public class Customer {\n"
+" private Set<Order> orders;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+" public Set<Order> getOrders() { return orders; }\n"
+"\n"
+" public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+"\n"
+" [...]\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Order { ... }\n"
+"\n"
+"Customer customer = em.find(Customer.class, 1l);\n"
+"Order order = em.find(Order.class, 1l);\n"
+"customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:903
#, no-c-format
msgid "Recommendations:"
msgstr "Recomendaciones:"
#. Tag: para
-#, no-c-format
+#: session_api.xml:907
+#, fuzzy, no-c-format
msgid ""
-"It does not usually make sense to enable cascade on a <literal><many-to-"
-"one></literal> or <literal><many-to-many></literal> association. "
-"Cascade is often useful for <literal><one-to-one></literal> and "
-"<literal><one-to-many></literal> associations."
+"It does not usually make sense to enable cascade on a many-to-one or many-to-"
+"many association. In fact the <literal>@ManyToOne</literal> and "
+"<literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</"
+"literal> attribute. Cascading is often useful for one-to-one and one-to-many "
+"associations."
msgstr ""
"Usualmente no tiene sentido habilitar el tratamiento en cascada en una "
"asociación <literal><many-to-one></literal> o <literal><many-to-"
@@ -1465,17 +2195,20 @@
"many></literal>."
#. Tag: para
-#, no-c-format
+#: session_api.xml:915
+#, fuzzy, no-c-format
msgid ""
"If the child object's lifespan is bounded by the lifespan of the parent "
"object, make it a <emphasis>life cycle object</emphasis> by specifying "
-"<literal>cascade=\"all,delete-orphan\"</literal>."
+"<literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany"
+"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
msgstr ""
"Si el periodo de vida de los objetos hijos está ligado al periodo de vida "
"del objeto padre, hágalo un <emphasis>objeto de ciclo de vida</emphasis> "
"especificando <literal>cascade=\"all,delete-orphan\"</literal>. "
#. Tag: para
+#: session_api.xml:923
#, no-c-format
msgid ""
"Otherwise, you might not need cascade at all. But if you think that you will "
@@ -1490,6 +2223,7 @@
"update\"</literal>."
#. Tag: para
+#: session_api.xml:931
#, no-c-format
msgid ""
"Mapping an association (either a single valued association, or a collection) "
@@ -1504,15 +2238,16 @@
"hijo o hijos."
#. Tag: para
-#, no-c-format
+#: session_api.xml:937
+#, fuzzy, no-c-format
msgid ""
"Furthermore, a mere reference to a child from a persistent parent will "
"result in save/update of the child. This metaphor is incomplete, however. A "
"child which becomes unreferenced by its parent is <emphasis>not</emphasis> "
-"automatically deleted, except in the case of a <literal><one-to-many></"
-"literal> association mapped with <literal>cascade=\"delete-orphan\"</"
-"literal>. The precise semantics of cascading operations for a parent/child "
-"relationship are as follows:"
+"automatically deleted, except in the case of a one-to-many association "
+"mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise "
+"semantics of cascading operations for a parent/child relationship are as "
+"follows:"
msgstr ""
"Además, una mera referencia a un hijo desde un padre persistente hará que se "
"guarde/actualice el hijo. Sin embargo, esta metáfora se encuentra "
@@ -1523,6 +2258,7 @@
"una relación padre/hijo es la siguiente:"
#. Tag: para
+#: session_api.xml:948
#, no-c-format
msgid ""
"If a parent is passed to <literal>persist()</literal>, all children are "
@@ -1532,6 +2268,7 @@
"<literal>persist()</literal>"
#. Tag: para
+#: session_api.xml:953
#, no-c-format
msgid ""
"If a parent is passed to <literal>merge()</literal>, all children are passed "
@@ -1541,6 +2278,7 @@
"<literal>merge()</literal>"
#. Tag: para
+#: session_api.xml:958
#, no-c-format
msgid ""
"If a parent is passed to <literal>save()</literal>, <literal>update()</"
@@ -1552,6 +2290,7 @@
"<literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:964
#, no-c-format
msgid ""
"If a transient or detached child becomes referenced by a persistent parent, "
@@ -1561,13 +2300,16 @@
"persistente, le es pasado a <literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:970
#, no-c-format
msgid ""
"If a parent is deleted, all children are passed to <literal>delete()</"
"literal>"
-msgstr "Si se borra un padre, se pasan todos los hijos a <literal>delete()</literal>"
+msgstr ""
+"Si se borra un padre, se pasan todos los hijos a <literal>delete()</literal>"
#. Tag: para
+#: session_api.xml:975
#, no-c-format
msgid ""
"If a child is dereferenced by a persistent parent, <emphasis>nothing special "
@@ -1581,6 +2323,7 @@
"literal>, en cuyo caso se borra el hijo \"huérfano\"."
#. Tag: para
+#: session_api.xml:983
#, no-c-format
msgid ""
"Finally, note that cascading of operations can be applied to an object graph "
@@ -1600,11 +2343,13 @@
"<literal>Session</literal>."
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr "Utilización de metadatos"
#. Tag: para
+#: session_api.xml:995
#, no-c-format
msgid ""
"Hibernate requires a rich meta-level model of all entity and value types. "
@@ -1623,6 +2368,7 @@
"las entidades asociadas)."
#. Tag: para
+#: session_api.xml:1002
#, no-c-format
msgid ""
"Hibernate exposes metadata via the <literal>ClassMetadata</literal> and "
@@ -1635,3 +2381,34 @@
"la jerarquía <literal>Type</literal>. Las instancias de las interfaces de "
"metadatos se pueden obtener de la <literal>SessionFactory</literal>."
+#. Tag: programlisting
+#: session_api.xml:1007
+#, no-c-format
+msgid ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
+msgstr ""
+
+#~ msgid ""
+#~ "A special cascade style, <literal>delete-orphan</literal>, applies only "
+#~ "to one-to-many associations, and indicates that the <literal>delete()</"
+#~ "literal> operation should be applied to any child object that is removed "
+#~ "from the association."
+#~ msgstr ""
+#~ "Un estilo de cascada especial, <literal>delete-orphan</literal>, se "
+#~ "aplica sólamente a asociaciones uno-a-muchos, e indica que la operación "
+#~ "<literal>delete()</literal> debe aplicarse a cualquier objeto hijo que se "
+#~ "elimine de la asociación."
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/tutorial.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/tutorial.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/tutorial.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: tutorial\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 13:03+1000\n"
"Last-Translator: Angela Garcia <agarcia at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -24,11 +24,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr "Tutorial"
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
msgid ""
"Intended for new users, this chapter provides an step-by-step introduction "
@@ -44,6 +46,7 @@
"<filename>tutorials/web</filename> de la fuente del proyecto. "
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
msgid ""
"This tutorial expects the user have knowledge of both Java and SQL. If you "
@@ -56,6 +59,7 @@
"sobre Hibernate."
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
msgid ""
"The distribution contains another example application under the "
@@ -65,11 +69,13 @@
"fuente del proyecto <filename>tutorial/eg</filename>."
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr "Parte 1 - La primera aplicación Hibernate"
#. Tag: para
+#: tutorial.xml:64
#, no-c-format
msgid ""
"For this example, we will set up a small database application that can store "
@@ -80,6 +86,7 @@
"los anfitriones de estos eventos."
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
msgid ""
"Although you can use whatever database you feel comfortable using, we will "
@@ -93,11 +100,13 @@
"cualquier servidor de base de datos en particular."
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr "Configuración"
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
msgid ""
"The first thing we need to do is to set up the development environment. We "
@@ -120,6 +129,7 @@
"webapp</filename>."
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
msgid ""
"We will be using Maven in this tutorial, taking advantage of its transitive "
@@ -131,11 +141,65 @@
"muchos IDEs para configurar automáticamente un proyecto para nosotros con "
"base en el descriptor maven."
-#. Tag: para
+#. Tag: programlisting
+#: tutorial.xml:97
#, no-c-format
msgid ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
+msgstr ""
+
+#. Tag: para
+#: tutorial.xml:100
+#, fuzzy, no-c-format
+msgid ""
"It is not a requirement to use Maven. If you wish to use something else to "
-"build this tutoial (such as Ant), the layout will remain the same. The only "
+"build this tutorial (such as Ant), the layout will remain the same. The only "
"change is that you will need to manually account for all the needed "
"dependencies. If you use something like <ulink url=\"http://ant.apache.org/"
"ivy/\">Ivy</ulink> providing transitive dependency management you would "
@@ -148,34 +212,38 @@
"javassist</filename> directory; additionally you will need both the servlet-"
"api jar and one of the slf4j logging backends."
msgstr ""
-"No es un requerimiento el uso de Maven. Si desea utilizar alguna otra cosa para "
-"construir este tutorial (tal como Ant), el diseño sigue siendo el mismo. El "
-"único cambio es que necesitará dar cuenta manualmente por todas las "
-"dependencias que se necesitan. Si usa algo como <ulink url=\"http://ant.apache.org/"
-"ivy/\">Ivy</ulink> para brindar administración de dependencias transitivas "
-"todavía utilizaría las dependencias que mencionamos anteriormente. De otra "
-"manera, necesitará encontrar <emphasis>todas</emphasis> las dependencias, explícitas y "
-"transitivas y agregarlas a la ruta de clase del proyecto. Si trabaja desde "
-"el paquete de distribución Hibernate, esto significaría que "
-"<filename>hibernate3.jar</filename>, todos los artefactos en el directorio "
-"<filename>lib/required</filename> y todos los archivos del directorio "
-"<filename>lib/bytecode/cglib</filename> o <filename>lib/bytecode/javassist</"
-"filename>; además necesitará el servlet-api jar y uno de los backends de "
-"registro slf4j."
+"No es un requerimiento el uso de Maven. Si desea utilizar alguna otra cosa "
+"para construir este tutorial (tal como Ant), el diseño sigue siendo el "
+"mismo. El único cambio es que necesitará dar cuenta manualmente por todas "
+"las dependencias que se necesitan. Si usa algo como <ulink url=\"http://ant."
+"apache.org/ivy/\">Ivy</ulink> para brindar administración de dependencias "
+"transitivas todavía utilizaría las dependencias que mencionamos "
+"anteriormente. De otra manera, necesitará encontrar <emphasis>todas</"
+"emphasis> las dependencias, explícitas y transitivas y agregarlas a la ruta "
+"de clase del proyecto. Si trabaja desde el paquete de distribución "
+"Hibernate, esto significaría que <filename>hibernate3.jar</filename>, todos "
+"los artefactos en el directorio <filename>lib/required</filename> y todos "
+"los archivos del directorio <filename>lib/bytecode/cglib</filename> o "
+"<filename>lib/bytecode/javassist</filename>; además necesitará el servlet-"
+"api jar y uno de los backends de registro slf4j."
#. Tag: para
+#: tutorial.xml:117
#, no-c-format
-msgid "Save this file as <filename>pom.xml</filename> in the project root directory."
+msgid ""
+"Save this file as <filename>pom.xml</filename> in the project root directory."
msgstr ""
"Guarde este archivo como <filename>pom.xml</filename> en el directorio raíz "
"del proyecto."
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr "La primera clase"
#. Tag: para
+#: tutorial.xml:126
#, no-c-format
msgid ""
"Next, we create a class that represents the event we want to store in the "
@@ -184,7 +252,50 @@
"Luego creamos una clase que representa el evento que queremos almacenar en "
"la base de datos, es una clase JavaBean simple con algunas propiedades:"
+#. Tag: programlisting
+#: tutorial.xml:131
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:133
#, no-c-format
msgid ""
"This class uses standard JavaBean naming conventions for property getter and "
@@ -200,6 +311,7 @@
"benefician la robustez de la refactorización. "
#. Tag: para
+#: tutorial.xml:141
#, no-c-format
msgid ""
"The <literal>id</literal> property holds a unique identifier value for a "
@@ -229,6 +341,7 @@
"Puede escoger y hacer que se ajuste a su diseño de su aplicación."
#. Tag: para
+#: tutorial.xml:156
#, no-c-format
msgid ""
"The no-argument constructor is a requirement for all persistent classes; "
@@ -245,6 +358,7 @@
"código byte."
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
msgid ""
"Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</"
@@ -254,11 +368,13 @@
"tutorial/domain</filename>."
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr "El archivo de mapeo"
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
msgid ""
"Hibernate needs to know how to load and store objects of the persistent "
@@ -272,11 +388,27 @@
"la base de datos, y que columnas debe utilizar en esta tabla."
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr "La estructura básica de un archivo de mapeo se ve así:"
+#. Tag: programlisting
+#: tutorial.xml:185
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:187
#, no-c-format
msgid ""
"Hibernate DTD is sophisticated. You can use it for auto-completion of XML "
@@ -299,6 +431,7 @@
"la distribución)."
#. Tag: para
+#: tutorial.xml:200
#, no-c-format
msgid ""
"We will omit the DTD declaration in future examples to shorten the code. It "
@@ -308,6 +441,7 @@
"corto el código. Esto no es opcional."
#. Tag: para
+#: tutorial.xml:206
#, no-c-format
msgid ""
"Between the two <literal>hibernate-mapping</literal> tags, include a "
@@ -321,7 +455,21 @@
"entidades de primera clase) necesitan de dicho mapeo en una tabla en la base "
"de datos SQL:"
+#. Tag: programlisting
+#: tutorial.xml:213
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:215
#, no-c-format
msgid ""
"So far we have told Hibernate how to persist and load object of class "
@@ -339,7 +487,23 @@
"identificador, configuramos la estrategia de generación del identificador de "
"Hibernate para una columna clave primaria sustituta:"
+#. Tag: programlisting
+#: tutorial.xml:225
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
msgid ""
"The <literal>id</literal> element is the declaration of the identifier "
@@ -357,6 +521,7 @@
"tabla <literal>EVENTS</literal> tiene el valor de la llave principal."
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
msgid ""
"The nested <literal>generator</literal> element specifies the identifier "
@@ -378,17 +543,18 @@
"estrategia."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:249
+#, fuzzy, no-c-format
msgid ""
"<literal>native</literal> is no longer consider the best strategy in terms "
-"of portability. for further discussion, see <xref linkend=\"portability-idgen"
-"\" />"
+"of portability. for further discussion, see"
msgstr ""
"<literal>native</literal> ya no se considera como la mejor estrategia en "
-"términos de portabilidad. Para obtener mayor información consulte <xref linkend=\"portability-idgen"
-"\" />. "
+"términos de portabilidad. Para obtener mayor información consulte <xref "
+"linkend=\"portability-idgen\" />. "
#. Tag: para
+#: tutorial.xml:255
#, no-c-format
msgid ""
"Lastly, we need to tell Hibernate about the remaining entity class "
@@ -398,7 +564,26 @@
"de entidad que quedan. Por defecto, ninguna propiedad de la clase se "
"considera persistente:"
+#. Tag: programlisting
+#: tutorial.xml:261
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:263
#, no-c-format
msgid ""
"Similar to the <literal>id</literal> element, the <literal>name</literal> "
@@ -414,6 +599,7 @@
"()</literal>, <literal>getTitle()</literal> y <literal>setTitle()</literal>."
#. Tag: para
+#: tutorial.xml:274
#, no-c-format
msgid ""
"Why does the <literal>date</literal> property mapping include the "
@@ -432,6 +618,7 @@
"mejor que la mapeamos a un nombre diferente."
#. Tag: para
+#: tutorial.xml:284
#, no-c-format
msgid ""
"The <literal>title</literal> mapping also lacks a <literal>type</literal> "
@@ -466,6 +653,7 @@
"mantenemos la información completa sobre la hora y fecha."
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
msgid ""
"Hibernate makes this mapping type determination using reflection when the "
@@ -479,6 +667,7 @@
"definir explícitamente el tipo a usar."
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
msgid ""
"Save this mapping file as <filename>src/main/resources/org/hibernate/"
@@ -488,11 +677,13 @@
"tutorial/domain/Event.hbm.xml</filename>."
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr "Configuración de Hibernate"
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
msgid ""
"At this point, you should have the persistent class and its mapping file in "
@@ -504,11 +695,13 @@
"ejecute en \"modo de servidor\""
#. Tag: para
+#: tutorial.xml:324
#, no-c-format
msgid "We do this do that the data remains between runs."
msgstr "Hacemos esto o lo otro y los datos permanecen entre ejecuciones."
#. Tag: para
+#: tutorial.xml:329
#, no-c-format
msgid ""
"We will utilize the Maven exec plugin to launch the HSQLDB server by "
@@ -528,6 +721,7 @@
"en el directorio <filename>target/data</filename> e inicie HSQLDB de nuevo."
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
msgid ""
"Hibernate will be connecting to the database on behalf of your application, "
@@ -549,15 +743,18 @@
"conexiones incluido de Hibernate para este tutorial."
#. Tag: para
+#: tutorial.xml:351
#, no-c-format
msgid ""
"The built-in Hibernate connection pool is in no way intended for production "
"use. It lacks several features found on any decent connection pool."
msgstr ""
"El pool de conexiones de Hibernate no está diseñado para utilizarse en "
-"producción. Le faltan varias funcionalidades que se encuentran en cualquier pool de conexiones decente. "
+"producción. Le faltan varias funcionalidades que se encuentran en cualquier "
+"pool de conexiones decente. "
#. Tag: para
+#: tutorial.xml:357
#, no-c-format
msgid ""
"For Hibernate's configuration, we can use a simple <literal>hibernate."
@@ -571,12 +768,63 @@
"configuración completamente programática. La mayoría de los usuarios "
"prefieren el archivo de configuración XML:"
+#. Tag: programlisting
+#: tutorial.xml:363
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr "Observe que este archivo de configuración especifica un DTD diferente"
#. Tag: para
+#: tutorial.xml:369
#, no-c-format
msgid ""
"You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory "
@@ -591,6 +839,7 @@
"archivos de configuración."
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
msgid ""
"The first four <literal>property</literal> elements contain the necessary "
@@ -603,15 +852,18 @@
"particular que Hibernate genera."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:383
+#, fuzzy, no-c-format
msgid ""
"In most cases, Hibernate is able to properly determine which dialect to use. "
-"See <xref linkend=\"portability-dialectresolver\" /> for more information."
+"See <xref linkend=\"portability-dialectresolver\"/> for more information."
msgstr ""
"Hibernate tiene la habilidad de determinar correctamente qué dialecto "
-"utilizar en la mayoría de los casos. Consulte <xref linkend=\"portability-dialectresolver\" /> para obtener mayor información."
+"utilizar en la mayoría de los casos. Consulte <xref linkend=\"portability-"
+"dialectresolver\" /> para obtener mayor información."
#. Tag: para
+#: tutorial.xml:389
#, no-c-format
msgid ""
"Hibernate's automatic session management for persistence contexts is "
@@ -632,6 +884,7 @@
"clases persistentes."
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
msgid ""
"Save this file as <filename>hibernate.cfg.xml</filename> into the "
@@ -641,11 +894,13 @@
"directorio <filename>src/main/resources</filename>."
#. Tag: title
+#: tutorial.xml:406
#, no-c-format
msgid "Building with Maven"
msgstr "Construcción con Maven"
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
msgid ""
"We will now build the tutorial with Maven. You will need to have Maven "
@@ -663,12 +918,43 @@
"meta <literal>compile</literal> para asegurarnos de que podemos compilar "
"todo hasta el momento:"
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+"<![CDATA[[hibernateTutorial]$ mvn compile\n"
+"[INFO] Scanning for projects...\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Building First Hibernate Tutorial\n"
+"[INFO] task-segment: [compile]\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] [resources:resources]\n"
+"[INFO] Using default encoding to copy filtered resources.\n"
+"[INFO] [compiler:compile]\n"
+"[INFO] Compiling 1 source file to /home/steve/projects/sandbox/"
+"hibernateTutorial/target/classes\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] BUILD SUCCESSFUL\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Total time: 2 seconds\n"
+"[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+"[INFO] Final Memory: 5M/547M\n"
+"[INFO] "
+"------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr "Inicio y ayudantes"
#. Tag: para
+#: tutorial.xml:425
#, no-c-format
msgid ""
"It is time to load and store some <literal>Event</literal> objects, but "
@@ -695,6 +981,7 @@
"instancia una sóla vez."
#. Tag: para
+#: tutorial.xml:439
#, no-c-format
msgid ""
"We will create a <literal>HibernateUtil</literal> helper class that takes "
@@ -705,7 +992,42 @@
"encargue del inicio y haga más práctico el acceso a <interfacename>org."
"hibernate.SessionFactory</interfacename>. "
+#. Tag: programlisting
+#: tutorial.xml:445
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.util;\n"
+"\n"
+"import org.hibernate.SessionFactory;\n"
+"import org.hibernate.cfg.Configuration;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory = buildSessionFactory"
+"();\n"
+"\n"
+" private static SessionFactory buildSessionFactory() {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" return new Configuration().configure().buildSessionFactory();\n"
+" }\n"
+" catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
msgid ""
"Save this code as <filename>src/main/java/org/hibernate/tutorial/util/"
@@ -715,6 +1037,7 @@
"HibernateUtil.java</filename>"
#. Tag: para
+#: tutorial.xml:452
#, no-c-format
msgid ""
"This class not only produces the global <interfacename>org.hibernate."
@@ -732,6 +1055,7 @@
"lugar."
#. Tag: para
+#: tutorial.xml:461
#, no-c-format
msgid ""
"If you give the <interfacename>org.hibernate.SessionFactory</interfacename> "
@@ -749,6 +1073,7 @@
"JNDI. Más adelante discutiremos estas opciones avanzadas."
#. Tag: para
+#: tutorial.xml:470
#, no-c-format
msgid ""
"You now need to configure a logging system. Hibernate uses commons logging "
@@ -771,6 +1096,7 @@
"inicio de Hibernate en la salida estándar."
#. Tag: para
+#: tutorial.xml:480
#, no-c-format
msgid ""
"The tutorial infrastructure is complete and you are now ready to do some "
@@ -780,14 +1106,16 @@
"poco de trabajo real con Hibernate."
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr "Carga y almacenamiento de objetos"
#. Tag: para
-#, no-c-format
+#: tutorial.xml:490
+#, fuzzy, no-c-format
msgid ""
-"We are now ready to start doing some real worjk with Hibernate. Let's start "
+"We are now ready to start doing some real work with Hibernate. Let's start "
"by writing an <literal>EventManager</literal> class with a <literal>main()</"
"literal> method:"
msgstr ""
@@ -795,7 +1123,49 @@
"Empecemos por escribir una clase <literal>EventManager</literal> con un "
"método <literal>main()</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:496
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial;\n"
+"\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.*;\n"
+"\n"
+"import org.hibernate.tutorial.domain.Event;\n"
+"import org.hibernate.tutorial.util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:498
#, no-c-format
msgid ""
"In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</"
@@ -809,10 +1179,11 @@
"base de datos."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:505
+#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> is designed to represent a "
-"single unit of work (a single atmoic piece of work to be performed). For now "
+"single unit of work (a single atomic piece of work to be performed). For now "
"we will keep things simple and assume a one-to-one granularity between a "
"Hibernate <interface>org.hibernate.Session</interface> and a database "
"transaction. To shield our code from the actual underlying transaction "
@@ -831,6 +1202,7 @@
"transaccional basada en JDBC pero también puede ejecutarse con JTA. "
#. Tag: para
+#: tutorial.xml:518
#, no-c-format
msgid ""
"What does <literal>sessionFactory.getCurrentSession()</literal> do? First, "
@@ -852,6 +1224,7 @@
"encuentra vinculada al hilo de Java actual que ejecuta nuestra aplicación."
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
msgid ""
"Hibernate offers three methods of current session tracking. The \"thread\" "
@@ -865,6 +1238,7 @@
"detalles el rastreo de sesión actual."
#. Tag: para
+#: tutorial.xml:541
#, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> begins when the first call to "
@@ -887,6 +1261,7 @@
"unidad de trabajo. "
#. Tag: para
+#: tutorial.xml:554
#, no-c-format
msgid ""
"Related to the unit of work scope, should the Hibernate <interface>org."
@@ -916,9 +1291,10 @@
"muestra una aplicación web real, lo cual le ayudará a ilustrar esto."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:571
+#, fuzzy, no-c-format
msgid ""
-"See <xref linkend=\"transactions\" /> for more information about transaction "
+"See <xref linkend=\"transactions\"/> for more information about transaction "
"handling and demarcation. The previous example also skipped any error "
"handling and rollback."
msgstr ""
@@ -927,6 +1303,7 @@
"también nos saltamos el manejo de errores y cómo deshacerlos. "
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
msgid ""
"To run this, we will make use of the Maven exec plugin to call our class "
@@ -939,11 +1316,14 @@
"args=\"store\"</command>"
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
-msgstr "Es posible que primero necesite realizar <command>mvn compile</command>."
+msgstr ""
+"Es posible que primero necesite realizar <command>mvn compile</command>."
#. Tag: para
+#: tutorial.xml:589
#, no-c-format
msgid ""
"You should see Hibernate starting up and, depending on your configuration, "
@@ -952,29 +1332,75 @@
"Debe ver que Hibernate inicia y dependiendo de su configuración, también "
"verá bastantes salidas de registro. Al final, verá la siguiente línea:"
+#. Tag: programlisting
+#: tutorial.xml:594
+#, no-c-format
+msgid ""
+"<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) "
+"values (?, ?, ?)]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:596
#, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr "Este es el <literal>INSERT</literal> que Hibernate ejecuta."
#. Tag: para
+#: tutorial.xml:600
#, no-c-format
msgid "To list stored events an option is added to the main method:"
-msgstr "Para listar los eventos almacenados se agrega una opción al método principal:"
+msgstr ""
+"Para listar los eventos almacenados se agrega una opción al método principal:"
+#. Tag: programlisting
+#: tutorial.xml:604
+#, no-c-format
+msgid ""
+"<![CDATA[ if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+" else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\n"
+" \"Event: \" + theEvent.getTitle() + \" Time: \" + "
+"theEvent.getDate()\n"
+" );\n"
+" }\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:606
#, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr "También agregamos un método <literal>listEvents()</literal>:"
-#. Tag: para
+#. Tag: programlisting
+#: tutorial.xml:610
#, no-c-format
msgid ""
+"<![CDATA[ private List listEvents() {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+" session.getTransaction().commit();\n"
+" return result;\n"
+" }]]>"
+msgstr ""
+
+#. Tag: para
+#: tutorial.xml:612
+#, fuzzy, no-c-format
+msgid ""
"Here, we are using a Hibernate Query Language (HQL) query to load all "
"existing <literal>Event</literal> objects from the database. Hibernate will "
"generate the appropriate SQL, send it to the database and populate "
"<literal>Event</literal> objects with the data. You can create more complex "
-"queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
+"queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
msgstr ""
"Aquí utilizamos una consulta HQL (Hibernate Query Language) para cargar "
"todos los objetos <literal>Event</literal> desde la base de datos. Hibernate "
@@ -984,6 +1410,7 @@
"información."
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
msgid ""
"Now we can call our new functionality, again using the Maven exec plugin: "
@@ -995,11 +1422,13 @@
"tutorial.EventManager\" -Dexec.args=\"list\"</command>"
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr "Part 2 - Mapeo de asociaciones"
#. Tag: para
+#: tutorial.xml:632
#, no-c-format
msgid ""
"So far we have mapped a single persistent entity class to a table in "
@@ -1013,16 +1442,39 @@
"lista de eventos en las que participan."
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr "Mapeo de la clase Person"
#. Tag: para
+#: tutorial.xml:642
#, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
msgstr "El primer corte de la clase <literal>Person</literal> se ve así:"
+#. Tag: programlisting
+#: tutorial.xml:646
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
msgid ""
"Save this to a file named <filename>src/main/java/org/hibernate/tutorial/"
@@ -1032,6 +1484,7 @@
"tutorial/domain/Person.java</filename>"
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
msgid ""
"Next, create the new mapping file as <filename>src/main/resources/org/"
@@ -1040,12 +1493,40 @@
"Luego, cree el nuevo archivo de mapeo como <filename>src/main/resources/org/"
"hibernate/tutorial/domain/Person.hbm.xml</filename>"
+#. Tag: programlisting
+#: tutorial.xml:658
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr "Finalmente, añada el nuevo mapeo a la configuración de Hibernate:"
+#. Tag: programlisting
+#: tutorial.xml:664
+#, no-c-format
+msgid ""
+"<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:666
#, no-c-format
msgid ""
"Create an association between these two entities. Persons can participate in "
@@ -1058,11 +1539,13 @@
"multiplicidad y comportamiento de la colección."
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr "Una asociación unidireccional basada en Set"
#. Tag: para
+#: tutorial.xml:678
#, no-c-format
msgid ""
"By adding a collection of events to the <literal>Person</literal> class, you "
@@ -1082,7 +1565,26 @@
"contendrá elementos duplicados y el orden no es relevante para nuestros "
"ejemplos."
+#. Tag: programlisting
+#: tutorial.xml:689
+#, no-c-format
+msgid ""
+"<![CDATA[public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:691
#, no-c-format
msgid ""
"Before mapping this association, let's consider the other side. We could "
@@ -1106,7 +1608,28 @@
"asociación <emphasis>muchos-a-muchos</emphasis>. Por lo tanto, utilizamos un "
"mapeo muchos-a-muchos de Hibernate:"
+#. Tag: programlisting
+#: tutorial.xml:704
+#, no-c-format
+msgid ""
+"<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:706
#, no-c-format
msgid ""
"Hibernate supports a broad range of collection mappings, a <literal>set</"
@@ -1134,16 +1657,38 @@
"en su colección (la clase del otro lado de la colección de referencias)."
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr "Por consiguiente, el esquema de base de datos para este mapeo es:"
+#. Tag: programlisting
+#: tutorial.xml:726
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr "Trabajo de la asociación"
#. Tag: para
+#: tutorial.xml:733
#, no-c-format
msgid ""
"Now we will bring some people and events together in a new method in "
@@ -1152,7 +1697,25 @@
"Vamos a reunir a algunas personas y eventos en un nuevo método en "
"<literal>EventManager</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:737
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:739
#, no-c-format
msgid ""
"After loading a <literal>Person</literal> and an <literal>Event</literal>, "
@@ -1186,6 +1749,7 @@
"transacción de la base de datos."
#. Tag: para
+#: tutorial.xml:758
#, no-c-format
msgid ""
"You can load person and event in different units of work. Or you can modify "
@@ -1201,7 +1765,43 @@
"emphasis> ). Inclusive, puede modificar una colección cuando se encuentre "
"separada:"
+#. Tag: programlisting
+#: tutorial.xml:767
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p."
+"events where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use "
+"it detached\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory()."
+"getCurrentSession();\n"
+" session2.beginTransaction();\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:769
#, no-c-format
msgid ""
"The call to <literal>update</literal> makes a detached object persistent "
@@ -1217,6 +1817,7 @@
"o eliminaciones) que le hizo a una colección de ese objeto entidad."
#. Tag: para
+#: tutorial.xml:778
#, no-c-format
msgid ""
"This is not much use in our example, but it is an important concept you can "
@@ -1234,7 +1835,22 @@
"(pueda que necesite modificar algunos de los métodos anteriores para "
"retornar ese identificador):"
+#. Tag: programlisting
+#: tutorial.xml:786
+#, no-c-format
+msgid ""
+"<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
+"());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" "
+"+ eventId);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:788
#, no-c-format
msgid ""
"This is an example of an association between two equally important classes : "
@@ -1266,6 +1882,7 @@
"como tipos de valor. "
#. Tag: para
+#: tutorial.xml:806
#, no-c-format
msgid ""
"You can also design a collection of value types. This is conceptually "
@@ -1277,11 +1894,13 @@
"pero se ve casi igual en Java."
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr "Colección de valores"
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
msgid ""
"Let's add a collection of email addresses to the <literal>Person</literal> "
@@ -1293,12 +1912,39 @@
"<interfacename>java.util.Set</interfacename> de las instnaicas "
"<classname>java.lang.String</classname>:"
+#. Tag: programlisting
+#: tutorial.xml:823
+#, no-c-format
+msgid ""
+"<![CDATA[ private Set emailAddresses = new HashSet();\n"
+"\n"
+" public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+" }\n"
+"\n"
+" public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:825
#, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr "El mapeo de este <literal>Set</literal> es así:"
+#. Tag: programlisting
+#: tutorial.xml:829
+#, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+" </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:831
#, no-c-format
msgid ""
"The difference compared with the earlier mapping is the use of the "
@@ -1326,11 +1972,39 @@
"realmente se almacenarán los valores de la dirección de correo electrónico."
#. Tag: para
+#: tutorial.xml:847
#, no-c-format
msgid "Here is the updated schema:"
msgstr "Este es el esquema actualizado:"
+#. Tag: programlisting
+#: tutorial.xml:851
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
+"*PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:853
#, no-c-format
msgid ""
"You can see that the primary key of the collection table is in fact a "
@@ -1344,6 +2018,7 @@
"cual es exactamente la semántica que necesitamos para un conjunto en Java."
#. Tag: para
+#: tutorial.xml:859
#, no-c-format
msgid ""
"You can now try to add elements to this collection, just like we did before "
@@ -1352,7 +2027,27 @@
"Ahora, puede tratar de agregar elementos a esta colección, al igual que lo "
"hicimos antes vinculando personas y eventos. Es el mismo código en Java."
+#. Tag: programlisting
+#: tutorial.xml:864
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addEmailToPerson(Long personId, String "
+"emailAddress) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" // adding to the emailAddress collection might trigger a lazy load "
+"of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:866
#, no-c-format
msgid ""
"This time we did not use a <emphasis>fetch</emphasis> query to initialize "
@@ -1364,11 +2059,13 @@
"intente de optimizar esto con una recuperación temprana."
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr "Asociaciones bidireccionales"
#. Tag: para
+#: tutorial.xml:877
#, no-c-format
msgid ""
"Next you will map a bi-directional association. You will make the "
@@ -1382,6 +2079,7 @@
"multiplicidad muchos-a-muchos."
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
msgid ""
"A relational database is more flexible than a network programming language, "
@@ -1393,6 +2091,7 @@
"ver y recuperar de cualquier forma posible."
#. Tag: para
+#: tutorial.xml:893
#, no-c-format
msgid ""
"First, add a collection of participants to the <literal>Event</literal> "
@@ -1401,12 +2100,42 @@
"Primero, agregue una colección de participantes a la clase <literal>Event</"
"literal>:"
+#. Tag: programlisting
+#: tutorial.xml:898
+#, no-c-format
+msgid ""
+"<![CDATA[ private Set participants = new HashSet();\n"
+"\n"
+" public Set getParticipants() {\n"
+" return participants;\n"
+" }\n"
+"\n"
+" public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:900
#, no-c-format
-msgid "Now map this side of the association in <literal>Event.hbm.xml</literal>."
-msgstr "Ahora mapee este lado de la asociación en <literal>Event.hbm.xml</literal>."
+msgid ""
+"Now map this side of the association in <literal>Event.hbm.xml</literal>."
+msgstr ""
+"Ahora mapee este lado de la asociación en <literal>Event.hbm.xml</literal>."
+#. Tag: programlisting
+#: tutorial.xml:904
+#, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse="
+"\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+" </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:906
#, no-c-format
msgid ""
"These are normal <literal>set</literal> mappings in both mapping documents. "
@@ -1424,6 +2153,7 @@
"<literal>Event</literal>."
#. Tag: para
+#: tutorial.xml:914
#, no-c-format
msgid ""
"What this means is that Hibernate should take the other side, the "
@@ -1437,11 +2167,13 @@
"como se crea el enlace bidireccional entre nuestras dos entidades."
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr "Trabajo con enlaces bidireccionales"
#. Tag: para
+#: tutorial.xml:925
#, no-c-format
msgid ""
"First, keep in mind that Hibernate does not affect normal Java semantics. "
@@ -1465,6 +2197,7 @@
"absolutamente necesario con enlaces bidireccionales."
#. Tag: para
+#: tutorial.xml:935
#, no-c-format
msgid ""
"Many developers program defensively and create link management methods to "
@@ -1474,7 +2207,31 @@
"administración de enlaces para establecer correctamente ambos lados, (por "
"ejemplo, en <literal>Person</literal>):"
+#. Tag: programlisting
+#: tutorial.xml:940
+#, no-c-format
+msgid ""
+"<![CDATA[ protected Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"\n"
+" public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+" }\n"
+"\n"
+" public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:942
#, no-c-format
msgid ""
"The get and set methods for the collection are now protected. This allows "
@@ -1488,6 +2245,7 @@
"directamente. Repita los pasos para la colección del otro lado."
#. Tag: para
+#: tutorial.xml:949
#, no-c-format
msgid ""
"What about the <literal>inverse</literal> mapping attribute? For you, and "
@@ -1518,11 +2276,13 @@
"una asociación muchos-a-muchos, puede escoger cualquier lado."
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr "Part 3 - La aplicación web EventManager"
#. Tag: para
+#: tutorial.xml:967
#, no-c-format
msgid ""
"A Hibernate web application uses <literal>Session</literal> and "
@@ -1539,11 +2299,13 @@
"para ingresar eventos nuevos."
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr "Escritura de un servlet básico"
#. Tag: para
+#: tutorial.xml:977
#, no-c-format
msgid ""
"First we need create our basic processing servlet. Since our servlet only "
@@ -1554,7 +2316,52 @@
"nuestro servlet solo maneja pedidos <literal>GET</literal> HTTP sólamente, "
"solo implementaremos el método <literal>doGet()</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:983
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.web;\n"
+"\n"
+"// Imports\n"
+"\n"
+"public class EventManagerServlet extends HttpServlet {\n"
+"\n"
+" protected void doGet(\n"
+" HttpServletRequest request,\n"
+" HttpServletResponse response) throws ServletException, "
+"IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy"
+"\" );\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().commit();\n"
+" }\n"
+" catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().rollback();\n"
+" if ( ServletException.class.isInstance( ex ) ) {\n"
+" throw ( ServletException ) ex;\n"
+" }\n"
+" else {\n"
+" throw new ServletException( ex );\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
msgid ""
"Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/"
@@ -1564,6 +2371,7 @@
"EventManagerServlet.java</filename>"
#. Tag: para
+#: tutorial.xml:990
#, no-c-format
msgid ""
"The pattern applied here is called <emphasis>session-per-request</emphasis>. "
@@ -1583,6 +2391,7 @@
"aplicaciones."
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
msgid ""
"Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> "
@@ -1597,6 +2406,7 @@
"automáticamente al hilo de Java actual."
#. Tag: para
+#: tutorial.xml:1006
#, no-c-format
msgid ""
"Next, the possible actions of the request are processed and the response "
@@ -1606,6 +2416,7 @@
"respuesta HTML. Llegaremos a esa parte muy pronto. "
#. Tag: para
+#: tutorial.xml:1011
#, no-c-format
msgid ""
"Finally, the unit of work ends when processing and rendering are complete. "
@@ -1628,11 +2439,13 @@
"representar su vista en JSP, no en un servlet."
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr "Procesamiento y entrega"
#. Tag: para
+#: tutorial.xml:1027
#, no-c-format
msgid ""
"Now you can implement the processing of the request and the rendering of the "
@@ -1641,7 +2454,44 @@
"Ahora puede implementar el procesamiento del pedido y la representación de "
"la página."
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, no-c-format
+msgid ""
+"<![CDATA[ // Write HTML header\n"
+" PrintWriter out = response.getWriter();\n"
+" out.println(\"<html><head><title>Event Manager</title></head><body>"
+"\");\n"
+"\n"
+" // Handle actions\n"
+" if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date.</i></"
+"b>\");\n"
+" }\n"
+" else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse"
+"(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>\");\n"
+" }\n"
+" }\n"
+"\n"
+" // Print page\n"
+" printEventForm(out);\n"
+" listEvents(out, dateFormatter);\n"
+"\n"
+" // Write HTML footer\n"
+" out.println(\"</body></html>\");\n"
+" out.flush();\n"
+" out.close();]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1033
#, no-c-format
msgid ""
"This coding style, with a mix of Java and HTML, would not scale in a more "
@@ -1659,7 +2509,25 @@
"todos los eventos en la base de datos. El primer método es trivial y su "
"salida se realiza únicamente en HTML:"
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, no-c-format
+msgid ""
+"<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
+"\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
msgid ""
"The <literal>listEvents()</literal> method uses the Hibernate "
@@ -1669,7 +2537,38 @@
"<literal>Session</literal> vinculado al hilo actual para ejecutar una "
"petición:"
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, no-c-format
+msgid ""
+"<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
+"dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" Iterator it = result.iterator();\n"
+" while (it.hasNext()) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate()) "
+"+ \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
msgid ""
"Finally, the <literal>store</literal> action is dispatched to the "
@@ -1680,7 +2579,23 @@
"<literal>createAndStoreEvent()</literal>, el cual también utiliza la "
"<literal>Session</literal> del hilo actual:"
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, no-c-format
+msgid ""
+"<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) "
+"{\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1060
#, no-c-format
msgid ""
"The servlet is now complete. A request to the servlet will be processed in a "
@@ -1703,11 +2618,13 @@
"Refiérase al Wiki de Hibernate para ver más ejemplos."
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr "Despliegue y prueba"
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
msgid ""
"To deploy this application for testing we must create a Web ARchive (WAR). "
@@ -1718,7 +2635,32 @@
"(WAR). Primero debemos definir el descriptor WAR como <filename>src/main/"
"webapp/WEB-INF/web.xml</filename>"
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/"
+"xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
+"servlet-class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1084
#, no-c-format
msgid ""
"To build and deploy call <literal>mvn package</literal> in your project "
@@ -1730,17 +2672,19 @@
"literal> en su directorio <literal>webapp</literal> Tomcat. "
#. Tag: para
-#, no-c-format
+#: tutorial.xml:1091
+#, fuzzy, no-c-format
msgid ""
"If you do not have Tomcat installed, download it from <ulink url=\"http://"
-"tomcat.apache.org/\" /> and follow the installation instructions. Our "
+"tomcat.apache.org/\"></ulink> and follow the installation instructions. Our "
"application requires no changes to the standard Tomcat configuration."
msgstr ""
-"Si no tiene Tomcat instalado, descárguelo de <ulink url=\"http://"
-"tomcat.apache.org/\" /> y siga las instrucciones de instalación. Nuestra aplicación "
+"Si no tiene Tomcat instalado, descárguelo de <ulink url=\"http://tomcat."
+"apache.org/\" /> y siga las instrucciones de instalación. Nuestra aplicación "
"no requiere cambios a la configuración estándar de Tomcat."
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
msgid ""
"Once deployed and Tomcat is running, access the application at "
@@ -1758,11 +2702,13 @@
"la salida detallada si ocurre alguna excepción."
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr "Resumen"
#. Tag: para
+#: tutorial.xml:1114
#, no-c-format
msgid ""
"This tutorial covered the basics of writing a simple standalone Hibernate "
@@ -1773,4 +2719,3 @@
"aplicación de Hibernate autónoma y una pequeña aplicación web. Encontrará "
"más tutoriales en el website de Hibernate <ulink url=\"http://hibernate.org"
"\"></ulink>."
-
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/author_group.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/author_group.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/author_group.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-04T04:51:21\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-07-14 19:55+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
@@ -13,137 +13,215 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
+msgid ""
+"<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</"
+"surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
+msgid ""
+"<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
+msgid "Graphic Design"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
+msgid ""
+"<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> "
+"<email>kreimer at bbs.frc.utn.edu.ar</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
+msgid ""
+"<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></"
+"othercredit>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
+msgid ""
+"<firstname>Alvaro</firstname> <surname>Netto</surname> "
+"<email>alvaronetto at cetip.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
+msgid ""
+"<firstname>Anderson</firstname> <surname>Braulio</surname> "
+"<email>andersonbraulio at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
+msgid ""
+"<firstname>Daniel Vieira</firstname> <surname>Costa</surname> "
+"<email>danielvc at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
+msgid ""
+"<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco."
+"gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
+msgid ""
+"<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
+msgid ""
+"<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> "
+"<email>luizcarlos_rodrigues at yahoo.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
+msgid ""
+"<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel."
+"castelo at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
+msgid ""
+"<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail."
+"com</email>"
msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
+msgid ""
+"<firstname>Pablo L.</firstname> <surname>de Miranda</surname> "
+"<email>pablolmiranda at gmail.com</email>"
msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
+msgid ""
+"<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail."
+"com</email>"
msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid ""
+"<firstname>Rogério</firstname> <surname>Araújo</surname> "
+"<email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid ""
+"<firstname>Wanderson</firstname> <surname>Siqueira</surname> "
+"<email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid ""
+"<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> "
+"<orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</"
+"contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/basic_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/basic_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/basic_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: basic_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-04 17:01+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,23 +17,144 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "Mappage O/R de base"
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "Déclaration de mappage"
#. Tag: para
+#: basic_mapping.xml:36
#, no-c-format
+msgid "Object/relational mappings can be defined in three approaches:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:41
+#, no-c-format
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:46
+#, no-c-format
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
msgid ""
-"Object/relational mappings are usually defined in an XML document. The "
-"mapping document is designed to be readable and hand-editable. The mapping "
-"language is Java-centric, meaning that mappings are constructed around "
-"persistent class declarations and not table declarations."
+"Annotations are split in two categories, the logical mapping annotations "
+"(describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid ""
+"JPA annotations are in the <literal>javax.persistence.*</literal> package. "
+"Hibernate specific extensions are in <literal>org.hibernate.annotations.*</"
+"literal>. You favorite IDE can auto-complete annotations and their "
+"attributes for you (even without a specific \"JPA\" plugin, since JPA "
+"annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
+#, fuzzy, no-c-format
+msgid "Here is an example of mapping"
+msgstr "Commençons avec un exemple de mappage : "
+
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"@Entity \n"
+"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
+"discriminatorType=CHAR)\n"
+"public class Cat {\n"
+" \n"
+" @Id @GeneratedValue\n"
+" public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public BigDecimal getWeight() { return weight; }\n"
+" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+" private BigDecimal weight;\n"
+"\n"
+" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+" public Date getBirthdate() { return birthdate; }\n"
+" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+" private Date birthdate;\n"
+"\n"
+" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+" @NotNull @Column(updatable=false)\n"
+" public ColorType getColor() { return color; }\n"
+" public void setColor(ColorType color) { this.color = color; }\n"
+" private ColorType color;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public String getSex() { return sex; }\n"
+" public void setSex(String sex) { this.sex = sex; }\n"
+" private String sex;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public Integer getLitterId() { return litterId; }\n"
+" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+" private Integer litterId;\n"
+"\n"
+" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+" public Cat getMother() { return mother; }\n"
+" public void setMother(Cat mother) { this.mother = mother; }\n"
+" private Cat mother;\n"
+"\n"
+" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+" public Set<Cat> getKittens() { return kittens; }\n"
+" public void setKittens(Set<Cat> kittens) { this.kittens = "
+"kittens; }\n"
+" private Set<Cat> kittens = new HashSet<Cat>();\n"
+"}\n"
+"\n"
+"@Entity @DiscriminatorValue(\"D\")\n"
+"public class DomesticCat extends Cat {\n"
+"\n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name }\n"
+" private String name;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Dog { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:73
+#, fuzzy, no-c-format
+msgid ""
+"The legacy hbm.xml approach uses an XML schema designed to be readable and "
+"hand-editable. The mapping language is Java-centric, meaning that mappings "
+"are constructed around persistent class declarations and not table "
+"declarations."
+msgstr ""
"Les mappages objet/relationnel sont généralement définis dans un document "
"XML. Le document de mappage est conçu pour être lisible et éditable à la "
"main. Le langage de mappage est Java-centrique, c'est-à-dire que les "
@@ -41,6 +162,7 @@
"non à partir de déclarations de tables. "
#. Tag: para
+#: basic_mapping.xml:78
#, no-c-format
msgid ""
"Please note that even though many Hibernate users choose to write the XML by "
@@ -52,19 +174,93 @@
"générer ce document, notamment XDoclet, Middlegen et AndroMDA. "
#. Tag: para
+#: basic_mapping.xml:82
#, no-c-format
msgid "Here is an example mapping:"
msgstr "Commençons avec un exemple de mappage : "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:84
#, no-c-format
msgid ""
-"We will now discuss the content of the mapping document. We will only "
-"describe, however, the document elements and attributes that are used by "
-"Hibernate at runtime. The mapping document also contains some extra optional "
-"attributes and elements that affect the database schemas exported by the "
-"schema export tool (for example, the <literal> not-null</literal> attribute)."
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:86
+#, fuzzy, no-c-format
+msgid ""
+"We will now discuss the concepts of the mapping documents (both annotations "
+"and XML). We will only describe, however, the document elements and "
+"attributes that are used by Hibernate at runtime. The mapping document also "
+"contains some extra optional attributes and elements that affect the "
+"database schemas exported by the schema export tool (for example, the "
+"<literal> not-null</literal> attribute)."
+msgstr ""
"Étudions le contenu du document de mappage. Nous ne décrirons que les "
"éléments et attributs du document utilisés par Hibernate à l'exécution. Le "
"document de mappage contient aussi des attributs et éléments optionnels qui "
@@ -72,236 +268,431 @@
"de schéma. (Par exemple l'attribut <literal>not-null</literal>)."
#. Tag: title
+#: basic_mapping.xml:94
+#, fuzzy, no-c-format
+msgid "Entity"
+msgstr "EntityResolver"
+
+#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "Doctype"
-msgstr "Doctype"
+msgid ""
+"An entity is a regular Java object (aka POJO) which will be persisted by "
+"Hibernate."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:99
#, no-c-format
msgid ""
-"All XML mappings should declare the doctype shown. The actual DTD can be "
-"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
-"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
-"will always look for the DTD in its classpath first. If you experience "
-"lookups of the DTD using an Internet connection, check the DTD declaration "
-"against the contents of your classpath."
+"To mark an object as an entity in annotations, use the <classname>@Entity</"
+"classname> annotation."
msgstr ""
-"Tous les mappages XML devraient utiliser le doctype indiqué. En effet vous "
-"trouverez le fichier DTD à l'URL ci-dessus, dans le répertoire "
-"<literal>hibernate-x.x.x/src/org/hibernate</literal> ou dans "
-"<literal>hibernate3.jar</literal>. Hibernate va toujours chercher la DTD "
-"dans son classpath en premier lieu. Si vous constatez des recherches de la "
-"DTD sur Internet, vérifiez votre déclaration de DTD par rapport au contenu "
-"de votre classpath. "
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:102
#, no-c-format
-msgid "EntityResolver"
-msgstr "EntityResolver"
+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
+#: basic_mapping.xml:104
#, no-c-format
msgid ""
-"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
-"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
-"implementation with the SAXReader it uses to read in the xml files. This "
-"custom <literal>EntityResolver</literal> recognizes two different systemId "
-"namespaces:"
+"That's pretty much it, the rest is optional. There are however any options "
+"to tweak your entity mapping, let's explore them."
msgstr ""
-"Comme mentionné précédemment, Hibernate tentera en premier lieu de résoudre "
-"les DTD dans leur classpath. Il réussit à le faire en enregistrant une "
-"implémentation personnalisée de <literal>org.xml.sax.EntityResolver</"
-"literal> avec le SAXReader qu'il utilise pour lire les fichiers xml. Cet "
-"<literal>EntityResolver</literal> personnalisé reconnaît deux espaces de "
-"nommage systemId différents :"
#. Tag: para
+#: basic_mapping.xml:107
#, no-c-format
msgid ""
-"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
-"encounters a systemId starting with <literal>http://hibernate.sourceforge."
-"net/</literal>. The resolver attempts to resolve these entities via the "
-"classloader which loaded the Hibernate classes."
+"<classname>@Table</classname> lets you define the table the entity will be "
+"persisted into. If undefined, the table name is the unqualified class name "
+"of the entity. You can also optionally define the catalog, the schema as "
+"well as unique constraints on the table."
msgstr ""
-"un <literal>espace de nommage hibernate</literal> est reconnu dès que le "
-"résolveur rencontre un systemId commençant par <literal>http://hibernate."
-"sourceforge.net/</literal>. Le résolveur tente alors de résoudre ces entités "
-"via le chargeur de classe qui a chargé les classes Hibernate."
+#. Tag: programlisting
+#: basic_mapping.xml:112
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"TBL_FLIGHT\", \n"
+" schema=\"AIR_COMMAND\", \n"
+" uniqueConstraints=\n"
+" @UniqueConstraint(\n"
+" name=\"flight_number\", \n"
+" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+"public class Flight implements Serializable {\n"
+" @Column(name=\"comp_prefix\")\n"
+" public String getCompagnyPrefix() { return companyPrefix; }\n"
+"\n"
+" @Column(name=\"flight_number\")\n"
+" public String getNumber() { return number; }\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:114
#, no-c-format
msgid ""
-"a <literal>user namespace</literal> is recognized whenever the resolver "
-"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
-"The resolver will attempt to resolve these entities via (1) the current "
-"thread context classloader and (2) the classloader which loaded the "
-"Hibernate classes."
+"The constraint name is optional (generated if left undefined). The column "
+"names composing the constraint correspond to the column names as defined "
+"before the Hibernate <classname>NamingStrategy</classname> is applied."
msgstr ""
-"un <literal>espace de nommage utilisateur</literal> est reconnu dès que le "
-"résolveur rencontre un systemId qui utilise un protocole URL "
-"<literal>classpath://</literal>. Le résolveur tentera alors de résoudre ces "
-"entités via (1) le chargeur de classe du contexte du thread courant et (2) "
-"le chargeur de classe qui a chargé les classes Hibernate."
#. Tag: para
+#: basic_mapping.xml:119
#, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
-msgstr "Un exemple d'utilisation de l'espace de nommage utilisateur: "
+msgid ""
+"<literal>@Entity.name</literal> lets you define the shortcut name of the "
+"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
+"class name of the class."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:123
+#, no-c-format
+msgid ""
+"Hibernate goes beyond the JPA specification and provide additional "
+"configurations. Some of them are hosted on <classname>@org.hibernate."
+"annotations.Entity</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:129
#, fuzzy, no-c-format
msgid ""
-"Where <literal>types.xml</literal> is a resource in the <literal>your."
-"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
-"custom\">typedef</link>."
+"<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> "
+"(defaults to false): specifies that <literal>INSERT</literal> / "
+"<literal>UPDATE</literal> SQL should be generated at runtime and contain "
+"only the columns whose values are not null. The <literal>dynamic-update</"
+"literal> and <literal>dynamic-insert</literal> settings are not inherited by "
+"subclasses. Although these settings can increase performance in some cases, "
+"they can actually decrease performance in others."
msgstr ""
-"Là où <literal>types.xml</literal> est une ressource dans votre paquetage "
-"<literal>your.domain</literal> et contient un <xref linkend=\"mapping-types-"
-"custom\"/> personnalisé. "
+"Notez que les paramètres <literal>dynamic-update</literal> et "
+"<literal>dynamic-insert</literal> ne sont pas hérités par les sous-classes "
+"et peuvent donc être spécifiés pour les éléments <literal><subclass></"
+"literal> ou <literal><joined-subclass></literal>. Ces paramètres "
+"peuvent améliorer les performances dans certains cas, mais peuvent aussi les "
+"amoindrir. À utiliser en connaissance de causes. "
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"<literal>selectBeforeUpdate</literal> (defaults to false): specifies that "
+"Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</"
+"literal> unless it is certain that an object is actually modified. Only when "
+"a transient object has been associated with a new session using "
+"<literal>update()</literal>, will Hibernate perform an extra SQL "
+"<literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is "
+"actually required. Use of <literal>select-before-update</literal> will "
+"usually decrease performance. It is useful to prevent a database update "
+"trigger being called unnecessarily if you reattach a graph of detached "
+"instances to a <literal>Session</literal>."
+msgstr ""
+"<literal>select-before-update</literal> (optionnel, par défaut à "
+"<literal>false</literal>): spécifie que Hibernate ne doit <emphasis>jamais</"
+"emphasis> exécuter un SQL <literal>UPDATE</literal> sans être certain qu'un "
+"objet a été réellement modifié. Dans certains cas, (en réalité, seulement "
+"quand un objet transient a été associé à une nouvelle session par "
+"<literal>update()</literal>), cela signifie que Hibernate exécutera un SQL "
+"<literal>SELECT</literal> pour déterminer si un SQL <literal>UPDATE</"
+"literal> est véritablement nécessaire. "
+
+#. Tag: para
+#: basic_mapping.xml:154
+#, fuzzy, no-c-format
+msgid ""
+"<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): "
+"determines whether implicit or explicit query polymorphisms is used. "
+"<emphasis>Implicit</emphasis> polymorphisms means that instances of the "
+"class will be returned by a query that names any superclass or implemented "
+"interface or class, and that instances of any subclass of the class will be "
+"returned by a query that names the class itself. <emphasis>Explicit</"
+"emphasis> polymorphisms means that class instances will be returned only by "
+"queries that explicitly name that class. Queries that name the class will "
+"return only instances of subclasses mapped. For most purposes, the default "
+"<literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit "
+"polymorphisms is useful when two different classes are mapped to the same "
+"table This allows a \"lightweight\" class that contains a subset of the "
+"table columns."
+msgstr ""
+"Le polymorphisme <emphasis>implicite</emphasis> signifie que des instances "
+"de la classe seront retournées par une requête qui utilise les noms de la "
+"classe ou de chacune de ses superclasses ou encore des interfaces "
+"implémentées par cette classe ou ses superclasses. Les instances des classes "
+"filles seront retournées par une requête qui utilise le nom de la classe "
+"elle même. Le polymorphisme <emphasis>explicite</emphasis> signifie que les "
+"instances de la classe ne seront retournées que par une requête qui utilise "
+"explicitement son nom et que seules les instances des classes filles "
+"déclarées dans les éléments <literal><subclass></literal> ou "
+"<literal><joined-subclass></literal> seront retournées. Dans la "
+"majorités des cas la valeur par défaut, <literal>polymorphism=\"implicit\"</"
+"literal>, est appropriée. Le polymorphisme explicite est utile lorsque deux "
+"classes différentes sont mappées à la même table (ceci permet d'écrire une "
+"classe \"légère\" qui ne contient qu'une partie des colonnes de la table - "
+"voir la partie design pattern du site communautaire). "
+
+#. Tag: para
+#: basic_mapping.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"<literal>persister</literal>: specifies a custom <literal>ClassPersister</"
+"literal>. The <literal>persister</literal> attribute lets you customize the "
+"persistence strategy used for the class. You can, for example, specify your "
+"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
+"or you can even provide a completely new implementation of the interface "
+"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
+"for example, persistence via stored procedure calls, serialization to flat "
+"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
+"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgstr ""
+"L'attribut <literal>persister</literal> vous permet de personnaliser la "
+"stratégie de persistance utilisée pour la classe. Vous pouvez, par exemple, "
+"spécifier votre propre sous-classe de <literal>org.hibernate.persister."
+"EntityPersister</literal> ou vous pourriez aussi fournir une nouvelle "
+"implémentation de l'interface <literal>org.hibernate.persister."
+"ClassPersister</literal> qui proposerait une persistance via, par exemple, "
+"des appels de procédures stockées, de la sérialisation vers des fichiers "
+"plats ou un annuaire LDAP. Voir <literal>org.hibernate.test.CustomPersister</"
+"literal> pour un exemple simple (d'une \"persistance\" vers une "
+"<literal>Hashtable</literal>). "
+
+#. Tag: para
+#: basic_mapping.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): "
+"determines the optimistic locking strategy. If you enable "
+"<literal>dynamicUpdate</literal>, you will have a choice of optimistic "
+"locking strategies:"
+msgstr ""
+"Si vous utilisez le <literal>dynamic-update</literal>, les différentes "
+"stratégies de verrouillage optimiste sont les suivantes :"
+
+#. Tag: para
+#: basic_mapping.xml:192
#, no-c-format
-msgid "Hibernate-mapping"
-msgstr "Hibernate-mappage"
+msgid "<literal>version</literal>: check the version/timestamp columns"
+msgstr "<literal>version</literal> vérifie les colonnes version/timestamp "
#. Tag: para
+#: basic_mapping.xml:197
#, no-c-format
+msgid "<literal>all</literal>: check all columns"
+msgstr "<literal>all</literal> vérifie toutes les colonnes "
+
+#. Tag: para
+#: basic_mapping.xml:201
+#, no-c-format
msgid ""
-"This element has several optional attributes. The <literal>schema</literal> "
-"and <literal>catalog</literal> attributes specify that tables referred to in "
-"this mapping belong to the named schema and/or catalog. If they are "
-"specified, tablenames will be qualified by the given schema and catalog "
-"names. If they are missing, tablenames will be unqualified. The "
-"<literal>default-cascade</literal> attribute specifies what cascade style "
-"should be assumed for properties and collections that do not specify a "
-"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
-"literal> attribute allows you to use unqualified class names in the query "
-"language."
+"<literal>dirty</literal>: check the changed columns, allowing some "
+"concurrent updates"
msgstr ""
-"Cet élément a plusieurs attributs optionnels. Les attributs <literal>schema</"
-"literal> et <literal>catalog</literal> indiquent que les tables mentionnées "
-"dans ce mappage appartiennent au schéma nommé et/ou au catalogue. S'ils sont "
-"spécifiés, les noms de tables seront qualifiés par les noms de schéma et de "
-"catalogue. L'attribut <literal>default-cascade</literal> indique quel type "
-"de cascade sera utilisé par défaut pour les propriétés et collections qui ne "
-"précisent pas l'attribut <literal>cascade</literal>. L'attribut "
-"<literal>auto-import</literal> nous permet d'utiliser par défaut des noms de "
-"classes non qualifiés dans le langage de requête, par défaut. "
+"<literal>dirty</literal> vérifie les colonnes modifiées, permettant quelques "
+"mise à jour concurrentes "
#. Tag: para
+#: basic_mapping.xml:206
#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
-msgstr ""
-"<literal>schema</literal> (optionnel) : le nom d'un schéma de base de "
-"données. "
+msgid "<literal>none</literal>: do not use optimistic locking"
+msgstr "<literal>none</literal> n'utilisez pas le verrouillage optimiste "
#. Tag: para
+#: basic_mapping.xml:211
#, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
+msgid ""
+"It is <emphasis>strongly</emphasis> recommended that you use version/"
+"timestamp columns for optimistic locking with Hibernate. This strategy "
+"optimizes performance and correctly handles modifications made to detached "
+"instances (i.e. when <literal>Session.merge()</literal> is used)."
msgstr ""
-"<literal>catalog</literal> (optionnel) : le nom d'un catalogue de base de "
-"données. "
+"Nous encourageons <emphasis>très</emphasis> fortement l'utilisation de "
+"colonnes de version/timestamp pour le verrouillage optimiste avec Hibernate. "
+"C'est la meilleure stratégie en ce qui concerne les performances et la seule "
+"qui gère correctement les modifications sur les instances détachées (c'est à "
+"dire lorsqu'on utilise <literal>Session.merge()</literal>). "
#. Tag: para
+#: basic_mapping.xml:220
#, no-c-format
msgid ""
-"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
-"literal>): a default cascade style."
+"Be sure to import <classname>@javax.persistence.Entity</classname> to mark a "
+"class as an entity. It's a common mistake to import <classname>@org."
+"hibernate.annotations.Entity</classname> by accident."
msgstr ""
-"<literal>default-cascade</literal> (optionnel - par défaut vaut : "
-"<literal>none</literal>) : un type de cascade par défaut. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:227
+#, fuzzy, no-c-format
msgid ""
-"<literal>default-access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing all properties. "
-"It can be a custom implementation of <literal>PropertyAccessor</literal>."
+"Some entities are not mutable. They cannot be updated or deleted by the "
+"application. This allows Hibernate to make some minor performance "
+"optimizations.. Use the <classname>@Immutable</classname> annotation."
msgstr ""
-"<literal>default-access</literal> (optionnel - par défaut vaut : "
-"<literal>property</literal>) : Comment hibernate accèdera aux propriétés. On "
-"peut aussi redéfinir sa propre implémentation de <literal>PropertyAccessor</"
-"literal>. "
+"Les classes immuables, <literal>mutable=\"false\"</literal>, ne peuvent pas "
+"être modifiées ou supprimées par l'application. Cela permet à Hibernate de "
+"faire quelques optimisations mineures sur les performances. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:232
+#, fuzzy, no-c-format
msgid ""
-"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
-"literal>): the default value for unspecified <literal>lazy</literal> "
-"attributes of class and collection mappings."
+"You can also alter how Hibernate deals with lazy initialization for this "
+"class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false "
+"to disable lazy fetching (not recommended). You can also specify an "
+"interface to use for lazy initializing proxies (defaults to the class "
+"itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. "
+"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
+"the named interface. The persistent object will load when a method of the "
+"proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
-"<literal>default-lazy</literal> (optionnel - par défaut vaut : "
-"<literal>true</literal>) : Valeur par défaut pour des attributs "
-"<literal>lazy</literal> non spécifiés des mappages de classe et de "
-"collection. "
+"L'attribut optionnel <literal>proxy</literal> permet les initialisations "
+"différées des instances persistantes de la classe. Hibernate retournera "
+"initialement des proxies CGLIB qui implémentent l'interface nommée. Le "
+"véritable objet persistant ne sera chargé que lorsqu'une méthode du proxy "
+"sera appelée. Voir plus bas le paragraphe abordant les Proxies et leur "
+"initialisation différée (lazy initialization). "
#. Tag: para
+#: basic_mapping.xml:243
#, no-c-format
msgid ""
-"<literal>auto-import</literal> (optional - defaults to <literal>true</"
-"literal>): specifies whether we can use unqualified class names of classes "
-"in this mapping in the query language."
+"<classname>@BatchSize</classname> specifies a \"batch size\" for fetching "
+"instances of this class by identifier. Not yet loaded instances are loaded "
+"batch-size at a time (default 1)."
msgstr ""
-"<literal>auto-import</literal> (optionnel - par défaut vaut : <literal>true</"
-"literal>) : spécifie si l'on peut utiliser des noms de classes non qualifiés "
-"(de classes de ce mappage) dans le langage de requête. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:247
+#, fuzzy, no-c-format
msgid ""
-"<literal>package</literal> (optional): specifies a package prefix to use for "
-"unqualified class names in the mapping document."
+"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
+"objects of this class. Use <classname>@Where</classname> for that."
msgstr ""
-"<literal>package</literal> (optionnel) : préfixe de paquetage par défaut "
-"pour les noms de classe non qualifiés du document de mappage. "
+"<literal>where</literal> (optionnel) spécifie une clause SQL <literal>WHERE</"
+"literal> à utiliser lorsque l'on récupère des objets de cette classe. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:251
+#, fuzzy, no-c-format
msgid ""
-"If you have two persistent classes with the same unqualified name, you "
-"should set <literal>auto-import=\"false\"</literal>. An exception will "
-"result if you attempt to assign two classes to the same \"imported\" name."
+"In the same vein, <classname>@Check</classname> lets you define an SQL "
+"expression used to generate a multi-row <emphasis>check</emphasis> "
+"constraint for automatic schema generation."
msgstr ""
-"Si deux classes persistantes possèdent le même nom de classe (non qualifié), "
-"vous devez configurer <literal>auto-import=\"false\"</literal>. Hibernate "
-"lancera une exception si vous essayez d'assigner le même nom \"importé\" à "
-"deux classes."
+"<literal>check</literal> (optionnel) : expression SQL utilisée pour générer "
+"une contrainte de vérification <emphasis>check</emphasis> multi-lignes pour "
+"la génération automatique de schéma. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:255
+#, fuzzy, no-c-format
msgid ""
-"The <literal>hibernate-mapping</literal> element allows you to nest several "
-"persistent <literal><class></literal> mappings, as shown above. It is, "
-"however, good practice (and expected by some tools) to map only a single "
-"persistent class, or a single class hierarchy, in one mapping file and name "
-"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
-"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
-"<literal>Animal.hbm.xml</literal>."
+"There is no difference between a view and a base table for a Hibernate "
+"mapping. This is transparent at the database level, although some DBMS do "
+"not support views properly, especially with updates. Sometimes you want to "
+"use a view, but you cannot create one in the database (i.e. with a legacy "
+"schema). In this case, you can map an immutable and read-only entity to a "
+"given SQL subselect expression using <classname>@org.hibernate.annotations."
+"Subselect</classname>:"
msgstr ""
-"Notez que l'élément <literal>hibernate-mappage</literal> vous permet "
-"d'imbriquer plusieurs mappages de <literal><class></literal> "
-"persistantes, comme dans l'exemple ci-dessus. Cependant il est recommandé "
-"(et c'est parfois une exigence de certains outils) de mapper une seule "
-"classe persistante (ou une seule hiérarchie de classes) par fichier de "
-"mappage et de nommer ce fichier d'après le nom de la superclasse "
-"persistante, par exemple <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm."
-"xml</literal>, ou en cas d'héritage, <literal>Animal.hbm.xml</literal>. "
+"Il n'y a pas de différence entre table et vue pour le mappage Hibernate, "
+"comme on peut s'y attendre, cela est transparent au niveau base de données "
+"(remarquez que certaines BDD ne supportent pas les vues correctement, "
+"notamment pour les mise à jour). Il est possible que vous souhaitiez "
+"utiliser une vue mais vous ne puissiez pas en créer une sur votre BDD (c'est-"
+"à-dire avec un schéma ancien). Dans ces cas, vous pouvez mapper une entité "
+"immuable en lecture seule sur une expression sous-select SQL donnée :"
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:263
#, no-c-format
-msgid "Class"
-msgstr "Classe"
+msgid ""
+"@Entity\n"
+"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+" + \"from item \"\n"
+" + \"join bid on bid.item_id = item.id \"\n"
+" + \"group by item.name\")\n"
+"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+"public class Summary {\n"
+" @Id\n"
+" public String getId() { return id; }\n"
+" ...\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:265
#, no-c-format
msgid ""
-"You can declare a persistent class using the <literal>class</literal> "
-"element. For example:"
+"Declare the tables to synchronize this entity with, ensuring that auto-flush "
+"happens correctly and that queries against the derived entity do not return "
+"stale data. The <literal><subselect></literal> is available both as an "
+"attribute and a nested mapping element."
msgstr ""
+"Déclarez les tables à synchroniser avec cette entité pour assurer que le "
+"flush automatique se produise correctement, et pour que les requêtes sur "
+"l'entité dérivée ne renvoient pas des données périmées. Le <literal><"
+"subselect></literal> est disponible comme attribut ou comme élément de "
+"mappage imbriqué. "
+
+#. Tag: para
+#: basic_mapping.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"We will now explore the same options using the hbm.xml structure. You can "
+"declare a persistent class using the <literal>class</literal> element. For "
+"example:"
+msgstr ""
"Déclarez une classe persistante avec l'élément <literal>class</literal>. "
"Part exemple :"
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, no-c-format
+msgid ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:323
#, no-c-format
msgid ""
"<literal>name</literal> (optional): the fully qualified Java class name of "
@@ -313,6 +704,7 @@
"mappage ne se rapporte pas à une entité POJO. "
#. Tag: para
+#: basic_mapping.xml:330
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to the unqualified class "
@@ -322,6 +714,7 @@
"classe) : le nom de sa table en base de données."
#. Tag: para
+#: basic_mapping.xml:335
#, no-c-format
msgid ""
"<literal>discriminator-value</literal> (optional - defaults to the class "
@@ -335,6 +728,7 @@
"literal> et <literal>not null</literal> sont autorisées. "
#. Tag: para
+#: basic_mapping.xml:343
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -344,6 +738,7 @@
"défaut) : spécifie que des instances de la classe sont (ou non) immuables. "
#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): overrides the schema name specified by "
@@ -353,6 +748,7 @@
"par l'élément racine <literal><hibernate-mappage></literal>. "
#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
#, no-c-format
msgid ""
"<literal>catalog</literal> (optional): overrides the catalog name specified "
@@ -362,6 +758,7 @@
"spécifié par l'élément racine <literal><hibernate-mappage></literal>. "
#. Tag: para
+#: basic_mapping.xml:361
#, no-c-format
msgid ""
"<literal>proxy</literal> (optional): specifies an interface to use for lazy "
@@ -372,6 +769,7 @@
"indiquer le nom de la classe elle-même. "
#. Tag: para
+#: basic_mapping.xml:367
#, no-c-format
msgid ""
"<literal>dynamic-update</literal> (optional - defaults to <literal>false</"
@@ -384,6 +782,7 @@
"ont été modifiées. "
#. Tag: para
+#: basic_mapping.xml:374
#, no-c-format
msgid ""
"<literal>dynamic-insert</literal> (optional - defaults to <literal>false</"
@@ -396,6 +795,7 @@
"non nulles. "
#. Tag: para
+#: basic_mapping.xml:381
#, no-c-format
msgid ""
"<literal>select-before-update</literal> (optional - defaults to "
@@ -416,10 +816,11 @@
"literal> est véritablement nécessaire. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:393
+#, fuzzy, no-c-format
msgid ""
-"<literal>polymorphism</literal> (optional - defaults to <literal>implicit</"
-"literal>): determines whether implicit or explicit query polymorphism is "
+"<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</"
+"literal>): determines whether implicit or explicit query polymorphisms is "
"used."
msgstr ""
"<literal>polymorphism</literal> (optionnel, vaut <literal>implicit</literal> "
@@ -427,6 +828,7 @@
"implicite ou explicite est utilisée. "
#. Tag: para
+#: basic_mapping.xml:399
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -437,6 +839,7 @@
"literal> à utiliser lorsque l'on récupère des objets de cette classe. "
#. Tag: para
+#: basic_mapping.xml:405
#, no-c-format
msgid ""
"<literal>persister</literal> (optional): specifies a custom "
@@ -446,6 +849,7 @@
"<literal>ClassPersister</literal> particulier. "
#. Tag: para
+#: basic_mapping.xml:410
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): "
@@ -457,6 +861,7 @@
"cette classe par identifiant en une seule requête."
#. Tag: para
+#: basic_mapping.xml:416
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>version</"
@@ -467,6 +872,7 @@
"optimiste. "
#. Tag: para
+#: basic_mapping.xml:422
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional): lazy fetching can be disabled by setting "
@@ -477,14 +883,15 @@
"literal>."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:427
+#, fuzzy, no-c-format
msgid ""
"<literal>entity-name</literal> (optional - defaults to the class name): "
"Hibernate3 allows a class to be mapped multiple times, potentially to "
"different tables. It also allows entity mappings that are represented by "
"Maps or XML at the Java level. In these cases, you should provide an "
"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
-"classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
+"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
"<literal>entity-name</literal> (optionnel - le nom de classe par défaut) : "
"Hibernate3 permet à une classe d'être mappée plusieurs fois (potentiellement "
@@ -495,6 +902,7 @@
"d'informations. "
#. Tag: para
+#: basic_mapping.xml:437
#, no-c-format
msgid ""
"<literal>check</literal> (optional): an SQL expression used to generate a "
@@ -506,6 +914,7 @@
"la génération automatique de schéma. "
#. Tag: para
+#: basic_mapping.xml:443
#, no-c-format
msgid ""
"<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. "
@@ -522,6 +931,7 @@
"physique d'un uplet enregistré. "
#. Tag: para
+#: basic_mapping.xml:452
#, no-c-format
msgid ""
"<literal>subselect</literal> (optional): maps an immutable and read-only "
@@ -534,6 +944,7 @@
"plus d'informations. "
#. Tag: para
+#: basic_mapping.xml:459
#, no-c-format
msgid ""
"<literal>abstract</literal> (optional): is used to mark abstract "
@@ -544,6 +955,7 @@
"subclass></literal>. "
#. Tag: para
+#: basic_mapping.xml:466
#, no-c-format
msgid ""
"It is acceptable for the named persistent class to be an interface. You can "
@@ -560,314 +972,1230 @@
"des classes internes, c'est à dire <literal>eg.Foo$Bar</literal>."
#. Tag: para
+#: basic_mapping.xml:472
#, no-c-format
+msgid "Here is how to do a virtual view (subselect) in XML:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:474
+#, no-c-format
msgid ""
-"Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated "
-"or deleted by the application. This allows Hibernate to make some minor "
-"performance optimizations."
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"Les classes immuables, <literal>mutable=\"false\"</literal>, ne peuvent pas "
-"être modifiées ou supprimées par l'application. Cela permet à Hibernate de "
-"faire quelques optimisations mineures sur les performances. "
#. Tag: para
+#: basic_mapping.xml:476
#, no-c-format
msgid ""
-"The optional <literal>proxy</literal> attribute enables lazy initialization "
-"of persistent instances of the class. Hibernate will initially return CGLIB "
-"proxies that implement the named interface. The persistent object will load "
-"when a method of the proxy is invoked. See \"Initializing collections and "
-"proxies\" below."
+"The <literal><subselect></literal> is available both as an attribute "
+"and a nested mapping element."
msgstr ""
-"L'attribut optionnel <literal>proxy</literal> permet les initialisations "
-"différées des instances persistantes de la classe. Hibernate retournera "
-"initialement des proxies CGLIB qui implémentent l'interface nommée. Le "
-"véritable objet persistant ne sera chargé que lorsqu'une méthode du proxy "
-"sera appelée. Voir plus bas le paragraphe abordant les Proxies et leur "
-"initialisation différée (lazy initialization). "
+#. Tag: title
+#: basic_mapping.xml:481
+#, fuzzy, no-c-format
+msgid "Identifiers"
+msgstr "Identifiants assignés"
+
#. Tag: para
+#: basic_mapping.xml:483
+#, fuzzy, no-c-format
+msgid ""
+"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
+"the database table. Most classes will also have a JavaBeans-style property "
+"holding the unique identifier of an instance."
+msgstr ""
+"Les classes mappées <emphasis>doivent</emphasis> déclarer la clé primaire de "
+"la table en base de données. La plupart des classes auront aussi une "
+"propriété de type JavaBeans présentant l'identifiant unique d'une instance. "
+"L'élément <literal><id></literal> sert à définir le mappage entre "
+"cette propriété et la colonne de la clé primaire."
+
+#. Tag: para
+#: basic_mapping.xml:488
#, no-c-format
+msgid "Mark the identifier property with <classname>@Id</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
msgid ""
-"<emphasis>Implicit</emphasis> polymorphism means that instances of the class "
-"will be returned by a query that names any superclass or implemented "
-"interface or class, and that instances of any subclass of the class will be "
-"returned by a query that names the class itself. <emphasis>Explicit</"
-"emphasis> polymorphism means that class instances will be returned only by "
-"queries that explicitly name that class. Queries that name the class will "
-"return only instances of subclasses mapped inside this <literal><class>"
-"</literal> declaration as a <literal><subclass></literal> or "
-"<literal><joined-subclass></literal>. For most purposes, the default "
-"<literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit "
-"polymorphism is useful when two different classes are mapped to the same "
-"table This allows a \"lightweight\" class that contains a subset of the "
-"table columns."
+"@Entity\n"
+"public class Person {\n"
+" @Id Integer getId() { ... }\n"
+" ...\n"
+"}"
msgstr ""
-"Le polymorphisme <emphasis>implicite</emphasis> signifie que des instances "
-"de la classe seront retournées par une requête qui utilise les noms de la "
-"classe ou de chacune de ses superclasses ou encore des interfaces "
-"implémentées par cette classe ou ses superclasses. Les instances des classes "
-"filles seront retournées par une requête qui utilise le nom de la classe "
-"elle même. Le polymorphisme <emphasis>explicite</emphasis> signifie que les "
-"instances de la classe ne seront retournées que par une requête qui utilise "
-"explicitement son nom et que seules les instances des classes filles "
-"déclarées dans les éléments <literal><subclass></literal> ou "
-"<literal><joined-subclass></literal> seront retournées. Dans la "
-"majorités des cas la valeur par défaut, <literal>polymorphism=\"implicit\"</"
-"literal>, est appropriée. Le polymorphisme explicite est utile lorsque deux "
-"classes différentes sont mappées à la même table (ceci permet d'écrire une "
-"classe \"légère\" qui ne contient qu'une partie des colonnes de la table - "
-"voir la partie design pattern du site communautaire). "
#. Tag: para
+#: basic_mapping.xml:493
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><id></literal> element which defines the "
+"mapping from that property to the primary key column."
+msgstr ""
+"Remarquez l'utilisation des balises <literal><column></literal> pour "
+"mapper une propriété sur des colonnes multiples."
+
+#. Tag: programlisting
+#: basic_mapping.xml:509
#, no-c-format
msgid ""
-"The <literal>persister</literal> attribute lets you customize the "
-"persistence strategy used for the class. You can, for example, specify your "
-"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
-"or you can even provide a completely new implementation of the interface "
-"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
-"for example, persistence via stored procedure calls, serialization to flat "
-"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
-"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
msgstr ""
-"L'attribut <literal>persister</literal> vous permet de personnaliser la "
-"stratégie de persistance utilisée pour la classe. Vous pouvez, par exemple, "
-"spécifier votre propre sous-classe de <literal>org.hibernate.persister."
-"EntityPersister</literal> ou vous pourriez aussi fournir une nouvelle "
-"implémentation de l'interface <literal>org.hibernate.persister."
-"ClassPersister</literal> qui proposerait une persistance via, par exemple, "
-"des appels de procédures stockées, de la sérialisation vers des fichiers "
-"plats ou un annuaire LDAP. Voir <literal>org.hibernate.test.CustomPersister</"
-"literal> pour un exemple simple (d'une \"persistance\" vers une "
-"<literal>Hashtable</literal>). "
#. Tag: para
+#: basic_mapping.xml:513
#, no-c-format
msgid ""
-"The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> "
-"settings are not inherited by subclasses, so they can also be specified on "
-"the <literal><subclass></literal> or <literal><joined-subclass></"
-"literal> elements. Although these settings can increase performance in some "
-"cases, they can actually decrease performance in others."
+"<literal>name</literal> (optional): the name of the identifier property."
msgstr ""
-"Notez que les paramètres <literal>dynamic-update</literal> et "
-"<literal>dynamic-insert</literal> ne sont pas hérités par les sous-classes "
-"et peuvent donc être spécifiés pour les éléments <literal><subclass></"
-"literal> ou <literal><joined-subclass></literal>. Ces paramètres "
-"peuvent améliorer les performances dans certains cas, mais peuvent aussi les "
-"amoindrir. À utiliser en connaissance de causes. "
+"<literal>name</literal> (optionnel) : nom de la propriété de l'identifiant."
#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
#, no-c-format
msgid ""
-"Use of <literal>select-before-update</literal> will usually decrease "
-"performance. It is useful to prevent a database update trigger being called "
-"unnecessarily if you reattach a graph of detached instances to a "
-"<literal>Session</literal>."
+"<literal>type</literal> (optional): a name that indicates the Hibernate type."
msgstr ""
-"L'utilisation de <literal>select-before-update</literal> va généralement "
-"faire baisser les performances. Ce paramètre est pratique pour éviter "
-"l'appel inutile par un déclenchement de mise à jour de base de donnée, quand "
-"on ré-attache un graphe d'instances à une <literal>Session</literal>."
+"<literal>type</literal> (optionnel) : nom indiquant le type Hibernate. "
#. Tag: para
+#: basic_mapping.xml:523
#, no-c-format
msgid ""
-"If you enable <literal>dynamic-update</literal>, you will have a choice of "
-"optimistic locking strategies:"
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the primary key column."
msgstr ""
-"Si vous utilisez le <literal>dynamic-update</literal>, les différentes "
-"stratégies de verrouillage optimiste sont les suivantes :"
+"<literal>column</literal> (optionnel - le nom de la propriété est pris par "
+"défaut) : nom de la colonne de la clé primaire."
#. Tag: para
+#: basic_mapping.xml:528
#, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
-msgstr "<literal>version</literal> vérifie les colonnes version/timestamp "
+msgid ""
+"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
+"value): an identifier property value that indicates an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session."
+msgstr ""
+"<literal>unsaved-value</literal> (optionnel - devient par défaut une valeur "
+"\"sensible\") : une valeur de propriété d'identifiant qui indique que "
+"l'instance est nouvellement instanciée (non sauvegardée), et qui la "
+"distingue des instances détachées qui ont été sauvegardées ou chargées dans "
+"une session précédente. "
#. Tag: para
+#: basic_mapping.xml:536
#, no-c-format
-msgid "<literal>all</literal>: check all columns"
-msgstr "<literal>all</literal> vérifie toutes les colonnes "
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing the property "
+"value."
+msgstr ""
+"<literal>access</literal> (optionnel - par défaut <literal>property</"
+"literal>) : la stratégie que doit utiliser Hibernate pour accéder aux "
+"valeurs des propriétés. "
#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
msgid ""
-"<literal>dirty</literal>: check the changed columns, allowing some "
-"concurrent updates"
+"If the <literal>name</literal> attribute is missing, it is assumed that the "
+"class has no identifier property."
msgstr ""
-"<literal>dirty</literal> vérifie les colonnes modifiées, permettant quelques "
-"mise à jour concurrentes "
+"Si l'attribut <literal>name</literal> est absent, Hibernate considère que la "
+"classe ne possède pas de propriété d'identifiant."
#. Tag: para
+#: basic_mapping.xml:546
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>unsaved-value</literal> attribute is almost never needed in "
+"Hibernate3 and indeed has no corresponding element in annotations."
+msgstr ""
+"L'attribut <literal>unsaved-value</literal> n'est presque jamais nécessaire "
+"dans Hibernate3."
+
+#. Tag: para
+#: basic_mapping.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"You can also declare the identifier as a composite identifier. This allows "
+"access to legacy data with composite keys. Its use is strongly discouraged "
+"for anything else."
+msgstr ""
+"La déclaration alternative <literal><composite-id></literal> permet "
+"l'accès aux données d'anciens systèmes qui utilisent des clés composées. Son "
+"utilisation est fortement déconseillée pour d'autres cas."
+
+#. Tag: title
+#: basic_mapping.xml:555
+#, fuzzy, no-c-format
+msgid "Composite identifier"
+msgstr "Identifiants assignés"
+
+#. Tag: para
+#: basic_mapping.xml:557
#, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
-msgstr "<literal>none</literal> n'utilisez pas le verrouillage optimiste "
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:562
#, no-c-format
msgid ""
-"It is <emphasis>strongly</emphasis> recommended that you use version/"
-"timestamp columns for optimistic locking with Hibernate. This strategy "
-"optimizes performance and correctly handles modifications made to detached "
-"instances (i.e. when <literal>Session.merge()</literal> is used)."
+"use a component type to represent the identifier and map it as a property in "
+"the entity: you then annotated the property as <classname>@EmbeddedId</"
+"classname>. The component type has to be <classname>Serializable</classname>."
msgstr ""
-"Nous encourageons <emphasis>très</emphasis> fortement l'utilisation de "
-"colonnes de version/timestamp pour le verrouillage optimiste avec Hibernate. "
-"C'est la meilleure stratégie en ce qui concerne les performances et la seule "
-"qui gère correctement les modifications sur les instances détachées (c'est à "
-"dire lorsqu'on utilise <literal>Session.merge()</literal>). "
#. Tag: para
+#: basic_mapping.xml:569
#, no-c-format
msgid ""
-"There is no difference between a view and a base table for a Hibernate "
-"mapping. This is transparent at the database level, although some DBMS do "
-"not support views properly, especially with updates. Sometimes you want to "
-"use a view, but you cannot create one in the database (i.e. with a legacy "
-"schema). In this case, you can map an immutable and read-only entity to a "
-"given SQL subselect expression:"
+"map multiple properties as <classname>@Id</classname> properties: the "
+"identifier type is then the entity class itself and needs to be "
+"<classname>Serializable</classname>. This approach is unfortunately not "
+"standard and only supported by Hibernate."
msgstr ""
-"Il n'y a pas de différence entre table et vue pour le mappage Hibernate, "
-"comme on peut s'y attendre, cela est transparent au niveau base de données "
-"(remarquez que certaines BDD ne supportent pas les vues correctement, "
-"notamment pour les mise à jour). Il est possible que vous souhaitiez "
-"utiliser une vue mais vous ne puissiez pas en créer une sur votre BDD (c'est-"
-"à-dire avec un schéma ancien). Dans ces cas, vous pouvez mapper une entité "
-"immuable en lecture seule sur une expression sous-select SQL donnée :"
#. Tag: para
+#: basic_mapping.xml:577
#, no-c-format
msgid ""
-"Declare the tables to synchronize this entity with, ensuring that auto-flush "
-"happens correctly and that queries against the derived entity do not return "
-"stale data. The <literal><subselect></literal> is available both as an "
-"attribute and a nested mapping element."
+"map multiple properties as <classname>@Id</classname> properties and declare "
+"an external class to be the identifier type. This class, which needs to be "
+"<classname>Serializable</classname>, is declared on the entity via the "
+"<classname>@IdClass</classname> annotation. The identifier type must contain "
+"the same properties as the identifier properties of the entity: each "
+"property name must be the same, its type must be the same as well if the "
+"entity property is of a basic type, its type must be the type of the primary "
+"key of the associated entity if the entity property is an association "
+"(either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</"
+"classname>)."
msgstr ""
-"Déclarez les tables à synchroniser avec cette entité pour assurer que le "
-"flush automatique se produise correctement, et pour que les requêtes sur "
-"l'entité dérivée ne renvoient pas des données périmées. Le <literal><"
-"subselect></literal> est disponible comme attribut ou comme élément de "
-"mappage imbriqué. "
+#. Tag: para
+#: basic_mapping.xml:592
+#, no-c-format
+msgid ""
+"As you can see the last case is far from obvious. It has been inherited from "
+"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
+"to use it (for simplicity sake)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:596
+#, no-c-format
+msgid "Let's explore all three cases using examples."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:599
#, no-c-format
-msgid "id"
-msgstr "id"
+msgid "id as a property using a component type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:601
#, no-c-format
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
msgid ""
-"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
-"the database table. Most classes will also have a JavaBeans-style property "
-"holding the unique identifier of an instance. The <literal><id></"
-"literal> element defines the mapping from that property to the primary key "
-"column."
+"@Entity\n"
+"class User {\n"
+" @EmbeddedId\n"
+" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
+"\")\n"
+" UserId id;\n"
+"\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
msgstr ""
-"Les classes mappées <emphasis>doivent</emphasis> déclarer la clé primaire de "
-"la table en base de données. La plupart des classes auront aussi une "
-"propriété de type JavaBeans présentant l'identifiant unique d'une instance. "
-"L'élément <literal><id></literal> sert à définir le mappage entre "
-"cette propriété et la colonne de la clé primaire."
#. Tag: para
+#: basic_mapping.xml:606
#, no-c-format
msgid ""
-"<literal>name</literal> (optional): the name of the identifier property."
+"You can notice that the <classname>UserId</classname> class is serializable. "
+"To override the column mapping, use <classname>@AttributeOverride</"
+"classname>."
msgstr ""
-"<literal>name</literal> (optionnel) : nom de la propriété de l'identifiant."
#. Tag: para
+#: basic_mapping.xml:610
#, no-c-format
msgid ""
-"<literal>type</literal> (optional): a name that indicates the Hibernate type."
+"An embedded id can itself contains the primary key of an associated entity."
msgstr ""
-"<literal>type</literal> (optionnel) : nom indiquant le type Hibernate. "
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"\n"
+" @MapsId(\"userId\")\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" @OneToOne User user;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" UserId userId;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:615
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to the property name): the "
-"name of the primary key column."
+"In the embedded id object, the association is represented as the identifier "
+"of the associated entity. But you can link its value to a regular "
+"association in the entity via the <classname>@MapsId</classname> annotation. "
+"The <classname>@MapsId</classname> value correspond to the property name of "
+"the embedded id object containing the associated entity's identifier. In the "
+"database, it means that the <literal>Customer.user</literal> and the "
+"<literal>CustomerId.userId</literal> properties share the same underlying "
+"column (<literal>user_fk</literal> in this case)."
msgstr ""
-"<literal>column</literal> (optionnel - le nom de la propriété est pris par "
-"défaut) : nom de la colonne de la clé primaire."
#. Tag: para
+#: basic_mapping.xml:627
#, no-c-format
msgid ""
-"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
-"value): an identifier property value that indicates an instance is newly "
-"instantiated (unsaved), distinguishing it from detached instances that were "
-"saved or loaded in a previous session."
+"The component type used as identifier must implement <methodname>equals()</"
+"methodname> and <methodname>hashCode()</methodname>."
msgstr ""
-"<literal>unsaved-value</literal> (optionnel - devient par défaut une valeur "
-"\"sensible\") : une valeur de propriété d'identifiant qui indique que "
-"l'instance est nouvellement instanciée (non sauvegardée), et qui la "
-"distingue des instances détachées qui ont été sauvegardées ou chargées dans "
-"une session précédente. "
#. Tag: para
+#: basic_mapping.xml:632
#, no-c-format
msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing the property "
-"value."
+"In practice, your code only sets the <literal>Customer.user</literal> "
+"property and the user id value is copied by Hibernate into the "
+"<literal>CustomerId.userId</literal> property."
msgstr ""
-"<literal>access</literal> (optionnel - par défaut <literal>property</"
-"literal>) : la stratégie que doit utiliser Hibernate pour accéder aux "
-"valeurs des propriétés. "
#. Tag: para
+#: basic_mapping.xml:638
#, no-c-format
msgid ""
-"If the <literal>name</literal> attribute is missing, it is assumed that the "
-"class has no identifier property."
+"The id value can be copied as late as flush time, don't rely on it until "
+"after flush time."
msgstr ""
-"Si l'attribut <literal>name</literal> est absent, Hibernate considère que la "
-"classe ne possède pas de propriété d'identifiant."
#. Tag: para
+#: basic_mapping.xml:642
#, no-c-format
msgid ""
-"The <literal>unsaved-value</literal> attribute is almost never needed in "
-"Hibernate3."
+"While not supported in JPA, Hibernate lets you place your association "
+"directly in the embedded id component (instead of having to use the "
+"<classname>@MapsId</classname> annotation)."
msgstr ""
-"L'attribut <literal>unsaved-value</literal> n'est presque jamais nécessaire "
-"dans Hibernate3."
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:648
#, no-c-format
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:651
+#, no-c-format
msgid ""
-"There is an alternative <literal><composite-id></literal> declaration "
-"that allows access to legacy data with composite keys. Its use is strongly "
-"discouraged for anything else."
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" node=\"element-name|.\">\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
msgstr ""
-"La déclaration alternative <literal><composite-id></literal> permet "
-"l'accès aux données d'anciens systèmes qui utilisent des clés composées. Son "
-"utilisation est fortement déconseillée pour d'autres cas."
+#. Tag: para
+#: basic_mapping.xml:653
+#, no-c-format
+msgid "First a simple example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
+msgid ""
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:657
+#, no-c-format
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"\n"
+" <many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" </many-to-one>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:662
+#, no-c-format
+msgid "Notice a few things in the previous example:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:666
+#, no-c-format
+msgid ""
+"the order of the properties (and column) matters. It must be the same "
+"between the association and the primary key of the associated entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:672
+#, no-c-format
+msgid ""
+"the many to one uses the same columns as the primary key and thus must be "
+"marked as read only (<literal>insertable</literal> and <literal>updatable</"
+"literal> to false)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:679
+#, no-c-format
+msgid ""
+"unlike with <classname>@MapsId</classname>, the id value of the associated "
+"entity is not transparently copied, check the <literal>foreign</literal> id "
+"generator for more information."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:686
+#, no-c-format
+msgid ""
+"The last example shows how to map association directly in the embedded id "
+"component."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:691
+#, no-c-format
+msgid ""
+"This is the recommended approach to map composite identifier. The following "
+"options should not be considered unless some constraint are present."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:697
#, no-c-format
-msgid "Generator"
-msgstr "Generator"
+msgid "Multiple id properties without identifier type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:699
#, no-c-format
msgid ""
-"The optional <literal><generator></literal> child element names a Java "
-"class used to generate unique identifiers for instances of the persistent "
-"class. If any parameters are required to configure or initialize the "
-"generator instance, they are passed using the <literal><param></"
-"literal> element."
+"Another, arguably more natural, approach is to place <classname>@Id</"
+"classname> on multiple properties of your entity. This approach is only "
+"supported by Hibernate (not JPA compliant) but does not require an extra "
+"embeddable component."
msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:706
+#, no-c-format
+msgid ""
+"In this case <classname>Customer</classname> is its own identifier "
+"representation: it must implement <classname>Serializable</classname> and "
+"must implement <methodname>equals()</methodname> and <methodname>hashCode()</"
+"methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:712
+#, no-c-format
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id>\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:718
+#, no-c-format
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:721
+#, no-c-format
+msgid ""
+"<classname>@IdClass</classname> on an entity points to the class (component) "
+"representing the identifier of the class. The properties marked "
+"<classname>@Id</classname> on the entity must have their corresponding "
+"property on the <classname>@IdClass</classname>. The return type of search "
+"twin property must be either identical for basic properties or must "
+"correspond to the identifier class of the associated entity for an "
+"association."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:730
+#, no-c-format
+msgid ""
+"This approach is inherited from the EJB 2 days and we recommend against its "
+"use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" UserId user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:737
+#, no-c-format
+msgid ""
+"<classname>Customer</classname> and <classname>CustomerId</classname> do "
+"have the same properties <literal>customerNumber</literal> as well as "
+"<literal>user</literal>. <classname>CustomerId</classname> must be "
+"<classname>Serializable</classname> and implement <classname>equals()</"
+"classname> and <classname>hashCode()</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:745
+#, no-c-format
+msgid ""
+"While not JPA standard, Hibernate let's you declare the vanilla associated "
+"property in the <classname>@IdClass</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:751
+#, no-c-format
+msgid ""
+"This feature is of limited interest though as you are likely to have chosen "
+"the <classname>@IdClass</classname> approach to stay JPA compliant or you "
+"have a quite twisted mind."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:762
+#, fuzzy, no-c-format
+msgid "Identifier generator"
+msgstr "La méthode getter de l'identifiant "
+
+#. Tag: para
+#: basic_mapping.xml:764
+#, no-c-format
+msgid ""
+"Hibernate can generate and populate identifier values for you automatically. "
+"This is the recommended approach over \"business\" or \"natural\" id "
+"(especially composite ids)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:768
+#, no-c-format
+msgid ""
+"Hibernate offers various generation strategies, let's explore the most "
+"common ones first that happens to be standardized by JPA:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:774
+#, fuzzy, no-c-format
+msgid ""
+"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
+msgstr ""
+"prend en charge les colonnes d'identité dans DB2, MySQL, MS SQL Server, "
+"Sybase et HypersonicSQL. L'identifiant renvoyé est de type <literal>long</"
+"literal>, <literal>short</literal> ou <literal>int</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo "
+"algorithm to efficiently generate identifiers of type <literal>long</"
+"literal>, <literal>short</literal> or <literal>int</literal>, given a named "
+"database sequence."
+msgstr ""
+"utilise un algorithme hi/lo pour générer efficacement des identifiants de "
+"type <literal>long</literal>, <literal>short</literal> ou <literal>int</"
+"literal>, en prenant une séquence en base nommée."
+
+#. Tag: para
+#: basic_mapping.xml:788
+#, fuzzy, no-c-format
+msgid ""
+"TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in "
+"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
+"type <literal>long</literal>, <literal>short</literal> or <literal>int</"
+"literal>, given a table and column as a source of hi values. The hi/lo "
+"algorithm generates identifiers that are unique only for a particular "
+"database."
+msgstr ""
+"utilise un algorithme hi/lo pour générer de façon efficace des identifiants "
+"de type <literal>long</literal>, <literal>short</literal> ou <literal>int</"
+"literal>, en prenant comme source de valeurs \"hi\" une table et une colonne "
+"(par défaut <literal>hibernate_unique_key</literal> et <literal>next_hi</"
+"literal> respectivement). L'algorithme hi/lo génère des identifiants uniques "
+"pour une base de données particulière seulement."
+
+#. Tag: para
+#: basic_mapping.xml:798
+#, fuzzy, no-c-format
+msgid ""
+"AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or "
+"<literal>TABLE</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"choisit <literal>identity</literal>, <literal>sequence</literal> ou "
+"<literal>hilo</literal> selon les possibilités offertes par la base de "
+"données sous-jacente. "
+
+#. Tag: para
+#: basic_mapping.xml:805
+#, no-c-format
+msgid ""
+"We recommend all new projects to use the new enhanced identifier generators. "
+"They are deactivated by default for entities using annotations but can be "
+"activated using <code>hibernate.id.new_generator_mappings=true</code>. These "
+"new generators are more efficient and closer to the JPA 2 specification "
+"semantic."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:812
+#, no-c-format
+msgid ""
+"However they are not backward compatible with existing Hibernate based "
+"application (if a sequence or a table is used for id generation). See "
+"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
+"to activate them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:818
+#, no-c-format
+msgid ""
+"To mark an id property as generated, use the <classname>@GeneratedValue</"
+"classname> annotation. You can specify the strategy used (default to "
+"<literal>AUTO</literal>) by setting <literal>strategy</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue\n"
+" Integer getId() { ... };\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Invoice {\n"
+" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+" Integer getId() { ... };\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid ""
+"<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional "
+"configurations that you can set using <classname>@SequenceGenerator</"
+"classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
+#, fuzzy, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr "<literal>name</literal> : le nom de la propriété. "
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> / <literal>sequenceName</literal>: name of the "
+"table or the sequence (defaulting respectively to "
+"<literal>hibernate_sequences</literal> and <literal>hibernate_sequence</"
+"literal>)"
+msgstr ""
+"<literal>sequence_name</literal> (en option, par défaut = "
+"<literal>hibernate_sequence</literal>): le nom de la séquence ou table à "
+"utiliser."
+
+#. Tag: para
+#: basic_mapping.xml:843
+#, fuzzy, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, fuzzy, no-c-format
+msgid ""
+"<literal>initialValue</literal>: the value from which the id is to start "
+"generating"
+msgstr "<literal>table</literal> : le nom de la table jointe. "
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid ""
+"<literal>allocationSize</literal>: the amount to increment by when "
+"allocating id numbers from the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid ""
+"In addition, the <classname>TABLE</classname> strategy also let you "
+"customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
+#, fuzzy, no-c-format
+msgid ""
+"<literal>pkColumnName</literal>: the column name containing the entity "
+"identifier"
+msgstr "<literal>name</literal> : le nom de la propriété. "
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, fuzzy, no-c-format
+msgid ""
+"<literal>valueColumnName</literal>: the column name containing the "
+"identifier value"
+msgstr ""
+"<literal>name</literal> (optionnel) : nom de la propriété de l'identifiant."
+
+#. Tag: para
+#: basic_mapping.xml:873
+#, fuzzy, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr "<literal>id-type</literal> : le type identifiant."
+
+#. Tag: para
+#: basic_mapping.xml:878
+#, no-c-format
+msgid ""
+"<literal>uniqueConstraints</literal>: any potential column constraint on the "
+"table containing the ids"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:883
+#, no-c-format
+msgid ""
+"To link a table or sequence generator definition with an actual generated "
+"property, use the same name in both the definition <literal>name</literal> "
+"and the generator value <literal>generator</literal> as shown below."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+"@Id \n"
+"@GeneratedValue(\n"
+" strategy=GenerationType.SEQUENCE, \n"
+" generator=\"SEQ_GEN\")\n"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:890
+#, no-c-format
+msgid ""
+"The scope of a generator definition 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 in "
+"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
+"\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+"@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"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:898
+#, no-c-format
+msgid ""
+"If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used "
+"to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</"
+"literal> are application level generators."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:904
+#, no-c-format
+msgid ""
+"Package level definition is not supported by the JPA specification. However, "
+"you can use the <literal>@GenericGenerator</literal> at the package level "
+"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:910
+#, no-c-format
+msgid ""
+"These are the four standard JPA generators. Hibernate goes beyond that and "
+"provide additional generators or additional options as we will see below. "
+"You can also write your own custom identifier generator by implementing "
+"<classname>org.hibernate.id.IdentifierGenerator</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:916
+#, no-c-format
+msgid ""
+"To define a custom generator, use the <classname>@GenericGenerator</"
+"classname> annotation (and its plural counter part "
+"<classname>@GenericGenerators</classname>) that describes the class of the "
+"identifier generator or its short cut name (as described below) and a list "
+"of key/value parameters. When using <classname>@GenericGenerator</classname> "
+"and assigning it via <classname>@GeneratedValue.generator</classname>, the "
+"<classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+"@GenericGenerator(\n"
+" name=\"trigger-generated\", \n"
+" strategy = \"select\",\n"
+" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+")\n"
+"public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, fuzzy, no-c-format
+msgid ""
+"The hbm.xml approach uses the optional <literal><generator></literal> "
+"child element inside <literal><id></literal>. If any parameters are "
+"required to configure or initialize the generator instance, they are passed "
+"using the <literal><param></literal> element."
+msgstr ""
"L'élément enfant <literal><generator></literal> nomme une classe Java "
"utilisée pour générer les identifiants uniques pour les instances des "
"classes persistantes. Si des paramètres sont requis pour configurer ou "
"initialiser l'instance du générateur, ils sont passés en utilisant l'élément "
"<literal><param></literal>."
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:937
+#, no-c-format
+msgid "Various additional generators"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:939
#, no-c-format
msgid ""
"All generators implement the interface <literal>org.hibernate.id."
@@ -882,12 +2210,14 @@
"Cependant, Hibernate propose une série d'implémentations intégrées. Il "
"existe des noms raccourcis pour les générateurs intégrés :"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:946
#, no-c-format
-msgid "<literal>increment</literal>"
-msgstr "<literal>increment</literal>"
+msgid "increment"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
msgid ""
"generates identifiers of type <literal>long</literal>, <literal>short</"
@@ -900,12 +2230,14 @@
"processus n'insère de données dans la même table. <emphasis>Ne pas utiliser "
"en environnement clusterisé.</emphasis>"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:958
#, no-c-format
-msgid "<literal>identity</literal>"
-msgstr "<literal>identity</literal>"
+msgid "identity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
msgid ""
"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
@@ -916,12 +2248,14 @@
"Sybase et HypersonicSQL. L'identifiant renvoyé est de type <literal>long</"
"literal>, <literal>short</literal> ou <literal>int</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:969
#, no-c-format
-msgid "<literal>sequence</literal>"
-msgstr "<literal>sequence</literal>"
+msgid "sequence"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
msgid ""
"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
@@ -932,12 +2266,14 @@
"générateur dans Interbase. L'identifiant renvoyé est de type <literal>long</"
"literal>, <literal>short</literal> ou <literal>int</literal>"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:980
#, no-c-format
-msgid "<literal>hilo</literal>"
-msgstr "<literal>hilo</literal>"
+msgid "hilo"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -954,12 +2290,14 @@
"literal> respectivement). L'algorithme hi/lo génère des identifiants uniques "
"pour une base de données particulière seulement."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:996
#, no-c-format
-msgid "<literal>seqhilo</literal>"
-msgstr "<literal>seqhilo</literal>"
+msgid "seqhilo"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -970,39 +2308,122 @@
"type <literal>long</literal>, <literal>short</literal> ou <literal>int</"
"literal>, en prenant une séquence en base nommée."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
+#, fuzzy, no-c-format
+msgid "uuid"
+msgstr "id"
+
+#. Tag: para
+#: basic_mapping.xml:1010
#, no-c-format
-msgid "<literal>uuid</literal>"
-msgstr "<literal>uuid</literal>"
+msgid ""
+"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
+"represented as a string of 32 hexidecimal digits. Users can also configure "
+"it to use a separator (config parameter \"separator\") which separates the "
+"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
+"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
+"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
+"discussed below."
+msgstr ""
+#. Tag: literal
+#: basic_mapping.xml:1023
+#, no-c-format
+msgid "uuid2"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
msgid ""
-"uses a 128-bit UUID algorithm to generate identifiers of type string that "
-"are unique within a network (the IP address is used). The UUID is encoded as "
-"a string of 32 hexadecimal digits in length."
+"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
+"\"version\" (the RFC term) generated depends on the pluggable \"generation "
+"strategy\" used (see below). Capable of generating values as <classname>java."
+"util.UUID</classname>, <classname>java.lang.String</classname> or as a byte "
+"array of length 16 (<literal>byte[16]</literal>). The \"generation strategy"
+"\" is defined by the interface <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
+"configuration parameters for defining which generation strategy to use:"
msgstr ""
-"utilise un algorithme de type UUID 128 bits pour générer des identifiants de "
-"type string, unique au sein d'un réseau (l'adresse IP est utilisée). Le UUID "
-"est encodé en une chaîne de nombre héxadécimaux de longueur 32. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1038
#, no-c-format
-msgid "<literal>guid</literal>"
-msgstr "<literal>guid</literal>"
+msgid "uuid_gen_strategy_class"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1041
#, no-c-format
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1047
+#, no-c-format
+msgid "uuid_gen_strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1050
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the "
+"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
+"<methodname>randomUUID</methodname> method of <classname>java.util.UUID</"
+"classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - "
+"generates \"version 1\" UUID values, using IP address since mac address not "
+"available. If you need mac address to be used, consider leveraging one of "
+"the existing third party UUID generators which sniff out mac address and "
+"integrating it via the <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
+"time of this writing include <ulink url=\"http://johannburkard.de/software/"
+"uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url="
+"\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/"
+"sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, fuzzy, no-c-format
+msgid "guid"
+msgstr "id"
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
msgstr ""
"utilise une chaîne GUID générée par la base pour MS SQL Server et MySQL."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1094
#, no-c-format
-msgid "<literal>native</literal>"
-msgstr "<literal>native</literal>"
+msgid "native"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1097
#, no-c-format
msgid ""
"selects <literal>identity</literal>, <literal>sequence</literal> or "
@@ -1013,12 +2434,14 @@
"<literal>hilo</literal> selon les possibilités offertes par la base de "
"données sous-jacente. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1105
#, no-c-format
-msgid "<literal>assigned</literal>"
-msgstr "<literal>assigned</literal>"
+msgid "assigned"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1108
#, no-c-format
msgid ""
"lets the application assign an identifier to the object before <literal>save"
@@ -1029,12 +2452,14 @@
"méthode <literal>save()</literal> soit appelée. Il s'agit de la stratégie "
"par défaut si aucun <literal><generator></literal> n'est spécifié. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1117
#, no-c-format
-msgid "<literal>select</literal>"
-msgstr "<literal>select</literal>"
+msgid "select"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1120
#, no-c-format
msgid ""
"retrieves a primary key, assigned by a database trigger, by selecting the "
@@ -1044,12 +2469,14 @@
"données en sélectionnant la ligne par une clé unique quelconque et en "
"extrayant la valeur de la clé primaire."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1127
#, no-c-format
-msgid "<literal>foreign</literal>"
-msgstr "<literal>foreign</literal>"
+msgid "foreign"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1130
#, no-c-format
msgid ""
"uses the identifier of another associated object. It is usually used in "
@@ -1060,12 +2487,14 @@
"conjonction avec une association <literal><one-to-one></literal> sur "
"la clé primaire. "
-#. Tag: term
-#, no-c-format
-msgid "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1138
+#, fuzzy, no-c-format
+msgid "sequence-identity"
msgstr "<literal>sequence-identity</literal>"
#. Tag: para
+#: basic_mapping.xml:1141
#, no-c-format
msgid ""
"a specialized sequence generation strategy that utilizes a database sequence "
@@ -1084,11 +2513,13 @@
"à cause d'un bogue dans les pilotes d'Oracle. "
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "Algorithme Hi/lo"
#. Tag: para
+#: basic_mapping.xml:1157
#, no-c-format
msgid ""
"The <literal>hilo</literal> and <literal>seqhilo</literal> generators "
@@ -1103,7 +2534,33 @@
"héberger la prochaine valeur \"hi\" disponible. La seconde utilise une "
"séquence de type Oracle (quand la base sous-jacente le propose). "
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1167
#, no-c-format
msgid ""
"Unfortunately, you cannot use <literal>hilo</literal> when supplying your "
@@ -1119,11 +2576,13 @@
"<literal>hibernate.transaction.manager_lookup_class</literal>. "
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "Algorithme UUID "
#. Tag: para
+#: basic_mapping.xml:1177
#, no-c-format
msgid ""
"The UUID contains: IP address, startup time of the JVM that is accurate to a "
@@ -1138,11 +2597,13 @@
"sans utiliser JNI. "
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "Colonnes identifiantes et séquences"
#. Tag: para
+#: basic_mapping.xml:1187
#, no-c-format
msgid ""
"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
@@ -1158,7 +2619,30 @@
"génération de clé par <literal>sequence</literal>. Ces deux méthodes "
"nécessitent deux requêtes SQL pour insérer un nouvel objet. Par exemple :"
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1199
#, no-c-format
msgid ""
"For cross-platform development, the <literal>native</literal> strategy will, "
@@ -1172,20 +2656,22 @@
"possibilités offertes par la base sous-jacente. "
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "Identifiants assignés"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1209
+#, fuzzy, no-c-format
msgid ""
"If you want the application to assign identifiers, as opposed to having "
"Hibernate generate them, you can use the <literal>assigned</literal> "
"generator. This special generator uses the identifier value already assigned "
"to the object's identifier property. The generator is used when the primary "
"key is a natural key instead of a surrogate key. This is the default "
-"behavior if you do not specify a <literal><generator></literal> "
-"element."
+"behavior if you do not specify <classname>@GeneratedValue</classname> nor "
+"<literal><generator></literal> elements."
msgstr ""
"Si vous souhaitez que l'application assigne des identifiants (par opposition "
"à la génération par Hibernate), vous pouvez utiliser le générateur "
@@ -1196,6 +2682,7 @@
"pas d'élément <literal><generator></literal>."
#. Tag: para
+#: basic_mapping.xml:1218
#, no-c-format
msgid ""
"The <literal>assigned</literal> generator makes Hibernate use "
@@ -1211,11 +2698,13 @@
"de définir <literal>Interceptor.isUnsaved()</literal>. "
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "Clés primaires assignées par les triggers"
#. Tag: para
+#: basic_mapping.xml:1228
#, no-c-format
msgid ""
"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
@@ -1223,7 +2712,20 @@
"Pour les schémas de base hérités d'anciens systèmes uniquement (Hibernate ne "
"génère pas de DDL avec des triggers) "
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1233
#, no-c-format
msgid ""
"In the above example, there is a unique valued property named "
@@ -1237,11 +2739,91 @@
"<literal>person_id</literal> dont la valeur est générée par un trigger."
#. Tag: title
+#: basic_mapping.xml:1241
#, no-c-format
+msgid "Identity copy (foreign generator)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1243
+#, no-c-format
+msgid ""
+"Finally, you can ask Hibernate to copy the identifier from another "
+"associated entity. In the Hibernate jargon, it is known as a foreign "
+"generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumn(name = \"person_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1250
+#, fuzzy, no-c-format
+msgid "Or alternatively"
+msgstr "Métadonnées alternatives"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id Integer id;\n"
+"\n"
+" @MapsId @OneToOne\n"
+" @JoinColumn(name = \"patient_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Person {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1254
+#, no-c-format
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, no-c-format
+msgid ""
+"<class name=\"MedicalHistory\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">patient</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
+">\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, no-c-format
msgid "Enhanced identifier generators"
msgstr "La méthode getter de l'identifiant "
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
msgid ""
"Starting with release 3.2.3, there are 2 new generators which represent a re-"
@@ -1262,6 +2844,7 @@
"actuelles, et peuvent être référencés par FQN."
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
msgid ""
"The first of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1299,6 +2882,7 @@
"générateur a un certain nombre de paramètres de configuration :"
#. Tag: para
+#: basic_mapping.xml:1291
#, no-c-format
msgid ""
"<literal>sequence_name</literal> (optional, defaults to "
@@ -1310,6 +2894,7 @@
"utiliser."
#. Tag: para
+#: basic_mapping.xml:1297
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional, defaults to <literal>1</"
@@ -1323,6 +2908,7 @@
"WITH\" normalement."
#. Tag: para
+#: basic_mapping.xml:1304
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1336,6 +2922,7 @@
"clause généralement nommé \"INCREMENT BY\"."
#. Tag: para
+#: basic_mapping.xml:1312
#, no-c-format
msgid ""
"<literal>force_table_use</literal> (optional - defaults to <literal>false</"
@@ -1347,6 +2934,7 @@
"de soutien même si le dialecte peut supporter la séquence ?"
#. Tag: para
+#: basic_mapping.xml:1319
#, no-c-format
msgid ""
"<literal>value_column</literal> (optional - defaults to <literal>next_val</"
@@ -1358,17 +2946,17 @@
"de la colonne de la table qui est utilisée pour contenir la valeur."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1326
+#, fuzzy, no-c-format
msgid ""
"<literal>optimizer</literal> (optional - defaults to <literal>none</"
-"literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" /"
-">"
+"literal>): See"
msgstr ""
-"<literal>optimizer</literal> (en option - valeur par défaut = <literal>none</"
-"literal>): Voir <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
-"\" />"
+"<literal>cascade</literal> (optionnel - par défaut à <literal>none</"
+"literal>) : le style de cascade. "
#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
msgid ""
"The second of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1395,6 +2983,7 @@
"configuration :"
#. Tag: para
+#: basic_mapping.xml:1345
#, no-c-format
msgid ""
"<literal>table_name</literal> (optional - defaults to "
@@ -1404,6 +2993,7 @@
"<literal>hibernate_sequences</literal>): le nom de la table à utiliser."
#. Tag: para
+#: basic_mapping.xml:1351
#, no-c-format
msgid ""
"<literal>value_column_name</literal> (optional - defaults to "
@@ -1415,6 +3005,7 @@
"utilisée pour la valeur."
#. Tag: para
+#: basic_mapping.xml:1357
#, no-c-format
msgid ""
"<literal>segment_column_name</literal> (optional - defaults to "
@@ -1428,6 +3019,7 @@
"identifie la valeur d'incrément à utiliser."
#. Tag: para
+#: basic_mapping.xml:1365
#, no-c-format
msgid ""
"<literal>segment_value</literal> (optional - defaults to <literal>default</"
@@ -1440,6 +3032,7 @@
"générateur."
#. Tag: para
+#: basic_mapping.xml:1372
#, no-c-format
msgid ""
"<literal>segment_value_length</literal> (optional - defaults to "
@@ -1451,6 +3044,7 @@
"de la colonne pour créer cette colonne de clé de segment."
#. Tag: para
+#: basic_mapping.xml:1378
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional - defaults to <literal>1</"
@@ -1460,6 +3054,7 @@
"literal> : La valeur initiale à récupérer à partir de la table."
#. Tag: para
+#: basic_mapping.xml:1384
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1470,29 +3065,32 @@
"devront différer."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1390
+#, fuzzy, no-c-format
msgid ""
-"<literal>optimizer</literal> (optional - defaults to <literal></literal>): "
-"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+"<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): "
+"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
"<literal>optimizer</literal> (en option - valeur par défaut = <literal></"
"literal>): Voir <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
"\" />"
#. Tag: title
+#: basic_mapping.xml:1397
#, no-c-format
msgid "Identifier generator optimization"
msgstr "Optimisation du générateur d'identifiants"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1399
+#, fuzzy, no-c-format
msgid ""
"For identifier generators that store values in the database, it is "
"inefficient for them to hit the database on each and every call to generate "
"a new identifier value. Instead, you can group a bunch of them in memory and "
"only hit the database when you have exhausted your in-memory value group. "
"This is the role of the pluggable optimizers. Currently only the two "
-"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> "
+"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
"support this operation."
msgstr ""
"Pour les générateurs d'identifiants qui stockent des valeurs dans la base de "
@@ -1505,6 +3103,7 @@
"prennent en charge cette opération."
#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
msgid ""
"<literal>none</literal> (generally this is the default if no optimizer was "
@@ -1516,6 +3115,7 @@
"n'interrogera pas la base de données à chaque demande."
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
msgid ""
"<literal>hilo</literal>: applies a hi/lo algorithm around the database "
@@ -1533,6 +3133,7 @@
"valeur en mémoire pour définir un groupe de \"hi value\"."
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
msgid ""
"<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this "
@@ -1551,304 +3152,202 @@
"référence aux valeurs provenant de la base de données."
#. Tag: title
-#, no-c-format
-msgid "composite-id"
-msgstr "composite-id"
+#: basic_mapping.xml:1441
+#, fuzzy, no-c-format
+msgid "Partial identifier generation"
+msgstr "La méthode getter de l'identifiant "
#. Tag: para
+#: basic_mapping.xml:1443
#, no-c-format
msgid ""
-"A table with a composite key can be mapped with multiple properties of the "
-"class as identifier properties. The <literal><composite-id></literal> "
-"element accepts <literal><key-property></literal> property mappings "
-"and <literal><key-many-to-one></literal> mappings as child elements."
+"Hibernate supports the automatic generation of some of the identifier "
+"properties. Simply use the <classname>@GeneratedValue</classname> annotation "
+"on one or several id properties."
msgstr ""
-"Pour une table avec clé composée, vous pouvez mapper plusieurs attributs de "
-"la classe comme propriétés identifiantes. L'élément <literal><composite-"
-"id></literal> accepte les mappages de propriétés <literal><key-"
-"property></literal> et les mappages <literal><key-many-to-one></"
-"literal> comme éléments enfants. "
#. Tag: para
+#: basic_mapping.xml:1449
#, no-c-format
msgid ""
-"The persistent class <emphasis>must</emphasis> override <literal>equals()</"
-"literal> and <literal>hashCode()</literal> to implement composite identifier "
-"equality. It must also implement <literal>Serializable</literal>."
+"The Hibernate team has always felt such a construct as fundamentally wrong. "
+"Try hard to fix your data model before using this feature."
msgstr ""
-"Vos classes persistantes <emphasis>doivent</emphasis> surcharger les "
-"méthodes <literal>equals()</literal> et <literal>hashCode()</literal> pour "
-"implémenter l'égalité d'identifiant composite. Elles doivent aussi "
-"implémenter l'interface <literal>Serializable</literal>."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1454
#, no-c-format
msgid ""
-"Unfortunately, this approach means that a persistent object is its own "
-"identifier. There is no convenient \"handle\" other than the object itself. "
-"You must instantiate an instance of the persistent class itself and populate "
-"its identifier properties before you can <literal>load()</literal> the "
-"persistent state associated with a composite key. We call this approach an "
-"<emphasis>embedded</emphasis> composite identifier, and discourage it for "
-"serious applications."
+"@Entity\n"
+"public class CustomerInventory implements Serializable {\n"
+" @Id\n"
+" @TableGenerator(name = \"inventory\",\n"
+" table = \"U_SEQUENCES\",\n"
+" pkColumnName = \"S_ID\",\n"
+" valueColumnName = \"S_NEXTNUM\",\n"
+" pkColumnValue = \"inventory\",\n"
+" allocationSize = 1000)\n"
+" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
+"\")\n"
+" Integer id;\n"
+"\n"
+"\n"
+" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+" Customer customer;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @Id\n"
+" private int id;\n"
+"}"
msgstr ""
-"Malheureusement, cette approche signifie qu'un objet persistant est son "
-"propre identifiant. Il n'y a pas d'autre moyen pratique de \"manipuler\" "
-"l'objet que par l'objet lui-même. Vous devez instancier une instance de la "
-"classe persistante elle-même et peupler ses attributs identifiants avant de "
-"pouvoir appeler la méthode <literal>load()</literal> pour charger son état "
-"persistant associé à une clé composée. Nous appelons cette approche "
-"\"identifiant composé <emphasis>embarqué</emphasis>\" et ne la recommandons "
-"pas pour des applications complexes."
#. Tag: para
+#: basic_mapping.xml:1456
#, no-c-format
msgid ""
-"A second approach is what we call a <emphasis>mapped</emphasis> composite "
-"identifier, where the identifier properties named inside the <literal><"
-"composite-id></literal> element are duplicated on both the persistent "
-"class and a separate identifier class."
+"You can also generate properties inside an <classname>@EmbeddedId</"
+"classname> class."
msgstr ""
-"Une seconde approche, appelée identifiant composé <emphasis>mappé</"
-"emphasis>, consiste à dupliquer les propriétés identifiantes nommées dans "
-"l'élément <literal><composite-id></literal>) à la fois dans la classe "
-"persistante et dans une classe identifiante particulière."
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:1462
#, no-c-format
-msgid ""
-"In this example, both the composite identifier class, <literal>MedicareId</"
-"literal>, and the entity class itself have properties named "
-"<literal>medicareNumber</literal> and <literal>dependent</literal>. The "
-"identifier class must override <literal>equals()</literal> and "
-"<literal>hashCode()</literal> and implement <literal>Serializable</literal>. "
-"The main disadvantage of this approach is code duplication."
+msgid "Optimistic locking properties (optional)"
msgstr ""
-"Dans cet exemple, la classe d'identifiant composée,<literal>MedicareId</"
-"literal> et la classe mappée elle-même, possèdent les propriétés "
-"<literal>medicareNumber</literal> et <literal>dependent</literal>. La classe "
-"identifiante doit redéfinir <literal>equals()</literal> et <literal>hashCode"
-"()</literal> et implémenter <literal>Serializable</literal>. Le désavantage "
-"de cette approche est la duplication du code. "
#. Tag: para
+#: basic_mapping.xml:1464
#, no-c-format
msgid ""
-"The following attributes are used to specify a mapped composite identifier:"
+"When using long transactions or conversations that span several database "
+"transactions, it is useful to store versioning data to ensure that if the "
+"same entity is updated by two conversations, the last to commit changes will "
+"be informed and not override the other conversation's work. It guarantees "
+"some isolation while still allowing for good scalability and works "
+"particularly well in read-often write-sometimes situations."
msgstr ""
-"Les attributs suivants servent à configurer un identifiant composé mappé :"
#. Tag: para
+#: basic_mapping.xml:1472
#, no-c-format
-msgid ""
-"<literal>mapped</literal> (optional - defaults to <literal>false</literal>): "
-"indicates that a mapped composite identifier is used, and that the contained "
-"property mappings refer to both the entity class and the composite "
-"identifier class."
+msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
-"<literal>mapped</literal> (optionnel, défaut à <literal>false</literal>) : "
-"indique qu'un identifiant composé mappé est utilisé, et que les mappages de "
-"propriétés contenues font référence aux deux classes, la classe mappée et la "
-"classe identifiante composée. "
#. Tag: para
+#: basic_mapping.xml:1475
#, no-c-format
msgid ""
-"<literal>class</literal> (optional - but required for a mapped composite "
-"identifier): the class used as a composite identifier."
+"A version or timestamp property should never be null for a detached "
+"instance. Hibernate will detect any instance with a null version or "
+"timestamp as transient, irrespective of what other <literal>unsaved-value</"
+"literal> strategies are specified. <emphasis>Declaring a nullable version or "
+"timestamp property is an easy way to avoid problems with transitive "
+"reattachment in Hibernate. It is especially useful for people using assigned "
+"identifiers or composite keys</emphasis>."
msgstr ""
-"<literal>class</literal> (optionnel, mais requis pour un identifiant composé "
-"mappé) : la classe utilisée comme identifiant composé. "
+"Une propriété de version ou un timestamp ne doit jamais être null pour une "
+"instance détachée, ainsi Hibernate pourra détecter toute instance ayant une "
+"version ou un timestamp null comme transient, quelles que soient les "
+"stratégies <literal>unsaved-value</literal> spécifiées. <emphasis>Déclarer "
+"un numéro de version ou un timestamp \"nullable\" est un moyen pratique "
+"d'éviter tout problème avec les ré-attachements transitifs dans Hibernate, "
+"particulièrement utile pour ceux qui utilisent des identifiants assignés ou "
+"des clés composées </emphasis>."
-#. Tag: para
-#, no-c-format
-msgid ""
-"We will describe a third, even more convenient approach, where the composite "
-"identifier is implemented as a component class in <xref linkend=\"components-"
-"compositeid\" />. The attributes described below apply only to this "
-"alternative approach:"
-msgstr ""
-"Nous décrirons une troisième approche beaucoup plus efficace pour laquelle "
-"l'identifiant composé est implémenté comme une classe composant dans <xref "
-"linkend=\"components-compositeid\" />. Les attributs décrits ci dessous, ne "
-"s'appliquent que pour cette dernière approche :"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>name</literal> (optional - required for this approach): a property "
-"of component type that holds the composite identifier. Please see chapter 9 "
-"for more information."
-msgstr ""
-"<literal>name</literal> (optionnel, requis pour cette approche) : une "
-"propriété de type composant qui contient l'identifiant composé (voir "
-"chapitre 9). "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate uses for accessing the property value."
-msgstr ""
-"<literal>access</literal> (optionnel - par défaut <literal>property</"
-"literal>) : la stratégie que doit utiliser Hibernate pour accéder aux "
-"valeurs des propriétés. "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the component class used as a composite "
-"identifier. Please see the next section for more information."
-msgstr ""
-"<literal>class</literal> (optionnel - par défaut le type de la propriété "
-"déterminé par réflexion) : la classe composant utilisée comme identifiant "
-"(voir prochaine section). "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The third approach, an <emphasis>identifier component</emphasis>, is "
-"recommended for almost all applications."
-msgstr ""
-"La troisième approche, un <emphasis>composant d'identifiant</emphasis>, est "
-"celle que nous recommandons pour toutes vos applications."
-
#. Tag: title
+#: basic_mapping.xml:1485
#, no-c-format
-msgid "Discriminator"
-msgstr "Discriminator"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The <literal><discriminator></literal> element is required for "
-"polymorphic persistence using the table-per-class-hierarchy mapping "
-"strategy. It declares a discriminator column of the table. The discriminator "
-"column contains marker values that tell the persistence layer what subclass "
-"to instantiate for a particular row. A restricted set of types can be used: "
-"<literal>string</literal>, <literal>character</literal>, <literal>integer</"
-"literal>, <literal>byte</literal>, <literal>short</literal>, "
-"<literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</"
-"literal>."
+msgid "Version number"
msgstr ""
-"L'élément <literal><discriminator></literal> est nécessaire pour la "
-"persistance polymorphique qui utilise la stratégie de mappage de table par "
-"hiérarchie de classe et déclare une colonne discriminante de la table. La "
-"colonne discriminante contient des valeurs marqueur qui permettent à la "
-"couche de persistance de savoir quelle sous-classe instancier pour une ligne "
-"particulière de table en base. Un nombre restreint de types peuvent être "
-"utilisés : <literal>string</literal>, <literal>character</literal>, "
-"<literal>integer</literal>, <literal>byte</literal>, <literal>short</"
-"literal>, <literal>boolean</literal>, <literal>yes_no</literal>, "
-"<literal>true_false</literal>."
#. Tag: para
+#: basic_mapping.xml:1487
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
-"the name of the discriminator column."
+"You can add optimistic locking capability to an entity using the "
+"<literal>@Version</literal> annotation:"
msgstr ""
-"<literal>column</literal> (optionnel - par défaut à <literal>class</"
-"literal>), le nom de la colonne discriminante. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1490
#, no-c-format
msgid ""
-"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
-"a name that indicates the Hibernate type"
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
msgstr ""
-"<literal>type</literal> (optionnel - par défaut à <literal>string</literal>) "
-"un nom indiquant le type Hibernate. "
#. Tag: para
+#: basic_mapping.xml:1492
#, no-c-format
msgid ""
-"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
-"\"forces\" Hibernate to specify the allowed discriminator values, even when "
-"retrieving all instances of the root class."
+"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 ""
-"<literal>force</literal> (optionnel - par défaut à <literal>false</literal>) "
-"\"oblige\" Hibernate à spécifier une valeur discriminante autorisée même "
-"quand on récupère toutes les instances de la classe de base. "
#. Tag: para
+#: basic_mapping.xml:1497
#, no-c-format
msgid ""
-"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
-"set this to <literal>false</literal> if your discriminator column is also "
-"part of a mapped composite identifier. It tells Hibernate not to include the "
-"column in SQL <literal>INSERTs</literal>."
+"The version column may be a numeric. Hibernate supports any kind of type "
+"provided that you define and implement the appropriate "
+"<classname>UserVersionType</classname>."
msgstr ""
-"<literal>insert</literal> (optionnel - par défaut à <literal>true</literal>) "
-"à passer à <literal>false</literal> si la colonne discriminante fait aussi "
-"partie d'un identifiant composé mappé (Indique à Hibernate de ne pas inclure "
-"la colonne dans les SQL <literal>INSERT</literal> s). "
#. Tag: para
+#: basic_mapping.xml:1501
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
-"executed when a type has to be evaluated. It allows content-based "
-"discrimination."
+"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>LockModeType."
+"OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType."
+"PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
-"<literal>formula</literal> (optionnel) une expression SQL arbitraire qui est "
-"exécutée quand un type doit être évalué. Permet la discrimination basée sur "
-"le contenu. "
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
msgid ""
-"Actual values of the discriminator column are specified by the "
-"<literal>discriminator-value</literal> attribute of the <literal><"
-"class></literal> and <literal><subclass></literal> elements."
+"If the version number is generated by the database (via a trigger for "
+"example), make sure to use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"Les véritables valeurs de la colonne discriminante sont spécifiées par "
-"l'attribut <literal>discriminator-value</literal> des éléments <literal><"
-"class></literal> et <literal><subclass></literal>. "
#. Tag: para
+#: basic_mapping.xml:1511
#, no-c-format
-msgid ""
-"The <literal>force</literal> attribute is only useful if the table contains "
-"rows with \"extra\" discriminator values that are not mapped to a persistent "
-"class. This will not usually be the case."
+msgid "To declare a version property in hbm.xml, use:"
msgstr ""
-"L'attribut <literal>force</literal> n'est utile que si la table contient des "
-"lignes avec des valeurs \"extra\" discriminantes qui ne sont pas mappées à "
-"une classe persistante. Ce ne sera généralement pas le cas. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1530
#, no-c-format
msgid ""
-"The <literal>formula</literal> attribute allows you to declare an arbitrary "
-"SQL expression that will be used to evaluate the type of a row. For example:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
msgstr ""
-"En utilisant l'attribut <literal>formula</literal> vous pouvez déclarer une "
-"expression SQL arbitraire qui sera utilisée pour évaluer le type d'une "
-"ligne : "
-#. Tag: title
-#, no-c-format
-msgid "Version (optional)"
-msgstr "Version (optionnel)"
-
#. Tag: para
+#: basic_mapping.xml:1534
#, no-c-format
msgid ""
-"The <literal><version></literal> element is optional and indicates "
-"that the table contains versioned data. This is particularly useful if you "
-"plan to use <emphasis>long transactions</emphasis>. See below for more "
-"information:"
-msgstr ""
-"L'élément <literal><version></literal> est optionnel et indique que la "
-"table contient des données versionnées. C'est particulièrement utile si vous "
-"avez l'intention d'utiliser des <emphasis>transactions longues</emphasis> "
-"(voir plus-bas)."
-
-#. Tag: para
-#, no-c-format
-msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of the column holding the version number."
msgstr ""
@@ -1856,6 +3355,7 @@
"propriété) : le nom de la colonne contenant le numéro de version. "
#. Tag: para
+#: basic_mapping.xml:1540
#, no-c-format
msgid ""
"<literal>name</literal>: the name of a property of the persistent class."
@@ -1863,6 +3363,7 @@
"<literal>name</literal> : le nom d'un attribut de la classe persistante. "
#. Tag: para
+#: basic_mapping.xml:1545
#, no-c-format
msgid ""
"<literal>type</literal> (optional - defaults to <literal>integer</literal>): "
@@ -1872,6 +3373,7 @@
"literal>) : le type du numéro de version. "
#. Tag: para
+#: basic_mapping.xml:1551
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -1882,6 +3384,7 @@
"valeurs des propriétés. "
#. Tag: para
+#: basic_mapping.xml:1557
#, no-c-format
msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</"
@@ -1898,6 +3401,7 @@
"valeur de la propritété identifiant devrait être utilisée."
#. Tag: para
+#: basic_mapping.xml:1567
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -1911,6 +3415,7 @@
"\"mapping-generated\"/> pour obtenir des informations supplémentaires."
#. Tag: para
+#: basic_mapping.xml:1575
#, no-c-format
msgid ""
"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
@@ -1924,59 +3429,82 @@
"seulement si la colonne de la base de données est définie avec une valeur "
"par défaut égale à <literal>0</literal>. "
+#. Tag: title
+#: basic_mapping.xml:1586
+#, fuzzy, no-c-format
+msgid "Timestamp"
+msgstr "Timestamp (optionnel) "
+
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1588
+#, fuzzy, no-c-format
msgid ""
-"Version numbers can be of Hibernate type <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> or <literal>calendar</literal>."
+"Alternatively, you can use a timestamp. Timestamps are a less safe "
+"implementation of optimistic locking. However, sometimes the application "
+"might use the timestamps in other ways."
msgstr ""
-"Les numéros de version doivent avoir les types Hibernate <literal>long</"
-"literal>, <literal>integer</literal>, <literal>short</literal>, "
-"<literal>timestamp</literal> ou <literal>calendar</literal>. "
+"L'élément optionnel <literal><timestamp></literal> indique que la "
+"table contient des données horodatées (timestamped). Cela sert d'alternative "
+"à l'utilisation de numéros de version. Les timestamps (ou horodatage) sont "
+"par nature une implémentation moins fiable pour le verrouillage optimiste. "
+"Cependant, l'application peut parfois utiliser l'horodatage à d'autres fins. "
#. Tag: para
+#: basic_mapping.xml:1592
#, no-c-format
msgid ""
-"A version or timestamp property should never be null for a detached "
-"instance. Hibernate will detect any instance with a null version or "
-"timestamp as transient, irrespective of what other <literal>unsaved-value</"
-"literal> strategies are specified. <emphasis>Declaring a nullable version or "
-"timestamp property is an easy way to avoid problems with transitive "
-"reattachment in Hibernate. It is especially useful for people using assigned "
-"identifiers or composite keys</emphasis>."
+"Simply mark a property of type <classname>Date</classname> or "
+"<classname>Calendar</classname> as <classname>@Version</classname>."
msgstr ""
-"Une propriété de version ou un timestamp ne doit jamais être null pour une "
-"instance détachée, ainsi Hibernate pourra détecter toute instance ayant une "
-"version ou un timestamp null comme transient, quelles que soient les "
-"stratégies <literal>unsaved-value</literal> spécifiées. <emphasis>Déclarer "
-"un numéro de version ou un timestamp \"nullable\" est un moyen pratique "
-"d'éviter tout problème avec les ré-attachements transitifs dans Hibernate, "
-"particulièrement utile pour ceux qui utilisent des identifiants assignés ou "
-"des clés composées </emphasis>."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:1596
#, no-c-format
-msgid "Timestamp (optional)"
-msgstr "Timestamp (optionnel) "
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" public Date getLastUpdate() { ... }\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1598
#, no-c-format
msgid ""
-"The optional <literal><timestamp></literal> element indicates that the "
-"table contains timestamped data. This provides an alternative to versioning. "
-"Timestamps are a less safe implementation of optimistic locking. However, "
-"sometimes the application might use the timestamps in other ways."
+"Like version numbers, the timestamp can be generated by the database instead "
+"of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"L'élément optionnel <literal><timestamp></literal> indique que la "
-"table contient des données horodatées (timestamped). Cela sert d'alternative "
-"à l'utilisation de numéros de version. Les timestamps (ou horodatage) sont "
-"par nature une implémentation moins fiable pour le verrouillage optimiste. "
-"Cependant, l'application peut parfois utiliser l'horodatage à d'autres fins. "
#. Tag: para
+#: basic_mapping.xml:1602
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr ""
+"Par exemple, si nous avons le mappage de <literal><properties></"
+"literal> suivant : "
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
#, no-c-format
msgid ""
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1624
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of a column holding the timestamp."
msgstr ""
@@ -1984,6 +3512,7 @@
"propriété) : le nom d'une colonne contenant le timestamp. "
#. Tag: para
+#: basic_mapping.xml:1630
#, no-c-format
msgid ""
"<literal>name</literal>: the name of a JavaBeans style property of Java type "
@@ -1995,8 +3524,21 @@
"persistante. "
#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380
+#: basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
#, no-c-format
msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the property value."
+msgstr ""
+"<literal>access</literal> (optionnel - par défaut <literal>property</"
+"literal>) : la stratégie que doit utiliser Hibernate pour accéder aux "
+"valeurs des propriétés. "
+
+#. Tag: para
+#: basic_mapping.xml:1642
+#, no-c-format
+msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>null</"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
@@ -2011,6 +3553,7 @@
"de propriété identifiant devrait être utilisée). "
#. Tag: para
+#: basic_mapping.xml:1652
#, no-c-format
msgid ""
"<literal>source</literal> (optional - defaults to <literal>vm</literal>): "
@@ -2033,6 +3576,7 @@
"exemple)."
#. Tag: para
+#: basic_mapping.xml:1665
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2046,11 +3590,13 @@
"\"mapping-generated\"/> pour obtenir des informations supplémentaires. "
#. Tag: title
+#: basic_mapping.xml:1675
#, no-c-format
msgid "Note"
msgstr "Note"
#. Tag: para
+#: basic_mapping.xml:1677
#, no-c-format
msgid ""
"<literal><Timestamp></literal> is equivalent to <literal><version "
@@ -2064,20 +3610,834 @@
"</literal>"
#. Tag: title
+#: basic_mapping.xml:1686
#, no-c-format
msgid "Property"
msgstr "Property"
#. Tag: para
+#: basic_mapping.xml:1688
#, no-c-format
msgid ""
+"You need to decide which property needs to be made persistent in a given "
+"entity. This differs slightly between the annotation driven metadata and the "
+"hbm.xml files."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1693
+#, no-c-format
+msgid "Property mapping with annotations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1695
+#, no-c-format
+msgid ""
+"In the annotations world, every non static non transient property (field or "
+"method depending on the access type) of an entity 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."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1702
+#, no-c-format
+msgid ""
+"The <literal>@Basic</literal> annotation allows you to declare the fetching "
+"strategy for a property. If set to <literal>LAZY</literal>, specifies that "
+"this property should be fetched lazily when the instance variable is first "
+"accessed. It requires build-time bytecode instrumentation, if your classes "
+"are not instrumented, property level lazy loading is silently ignored. The "
+"default is <literal>EAGER</literal>. You can also mark a property as not "
+"optional thanks to the <classname>@Basic.optional</classname> attribute. "
+"This will ensure that the underlying column are not nullable (if possible). "
+"Note that a better approach is to use the <classname>@NotNull</classname> "
+"annotation of the Bean Validation specification."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1715
+#, no-c-format
+msgid "Let's look at a few examples:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+"@Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property \n"
+"\n"
+"@Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1719
+#, 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 Hibernate. <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). The recommended alternative is to "
+"use the projection capability of JP-QL (Java Persistence Query Language) or "
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1732
+#, no-c-format
+msgid ""
+"JPA support property mapping of all basic types supported by Hibernate (all "
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> "
+"annotation as shown in the <literal>note</literal> property example."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1742
+#, no-c-format
+msgid ""
+"In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
+#, 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 <classname>Serializable</classname> type "
+"will be persisted in a Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
+#, 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
+#: basic_mapping.xml:1768
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1770
+#, no-c-format
+msgid ""
+"You can also manually specify a type using the <literal>@org.hibernate."
+"annotations.Type</literal> and some parameters if needed. <classname>@Type."
+"type</classname> could be:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
+#, no-c-format
+msgid ""
+"The name of a Hibernate basic type: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgstr ""
+"Le nom d'un type basique Hibernate (par ex : <literal>integer, string, "
+"character, date, timestamp, float, binary, serializable, object, blob</"
+"literal> etc.). "
+
+#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
+#, no-c-format
+msgid ""
+"The name of a Java class with a default basic type: <literal>int, float, "
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal> etc."
+msgstr ""
+"le nom d'une classe Java avec un type basique par défaut (par ex : "
+"<literal>int, float, char, java.lang.String, java.util.Date, java.lang."
+"Integer, java.sql.Clob</literal> etc.). "
+
+#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
+#, no-c-format
+msgid "The name of a serializable Java class."
+msgstr "Le nom d'une classe Java sérialisable."
+
+#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
+#, no-c-format
+msgid ""
+"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
+"literal> etc."
+msgstr ""
+"Le nom d'une classe avec un type personnalisé (par ex : <literal>com.illflow."
+"type.MyCustomType</literal>)."
+
+#. Tag: para
+#: basic_mapping.xml:1798
+#, fuzzy, no-c-format
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4."
+msgstr ""
+"Si vous n'indiquez pas un type, Hibernate utilisera la réflexion sur le nom "
+"de la propriété pour tenter de trouver le type Hibernate correct. Hibernate "
+"essayera d'interprêter le nom de la classe retournée par le getter de la "
+"propriété en utilisant les règles 2, 3, 4 dans cet ordre. Dans certains cas "
+"vous aurez encore besoin de l'attribut <literal>type</literal>. (Par "
+"exemple, pour distinguer <literal>Hibernate.DATE</literal> et "
+"<literal>Hibernate.TIMESTAMP</literal>, ou pour préciser un type "
+"personnalisé)."
+
+#. Tag: para
+#: basic_mapping.xml:1803
+#, no-c-format
+msgid ""
+"<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when "
+"defined at the class level). If the type is used on a single entity, you can "
+"place the definition on the entity itself. Otherwise, it is recommended to "
+"place the definition at the package level. In the example below, when "
+"Hibernate encounters a property of class <literal>PhoneNumer</literal>, it "
+"delegates the persistence strategy to the custom mapping type "
+"<literal>PhoneNumberType</literal>. However, properties belonging to other "
+"classes, too, can delegate their persistence strategy to "
+"<literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</"
+"literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1819
+#, 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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+"@TypeDef(\n"
+" name = \"phoneNumber\",\n"
+" defaultForType = PhoneNumber.class,\n"
+" typeClass = PhoneNumberType.class\n"
+")\n"
+"\n"
+"@Entity\n"
+"public class ContactDetails {\n"
+" [...]\n"
+" private PhoneNumber localPhoneNumber;\n"
+" @Type(type=\"phoneNumber\")\n"
+" private OverseasPhoneNumber overseasPhoneNumber;\n"
+" [...]\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1826
+#, no-c-format
+msgid ""
+"The following example shows the usage of the <literal>parameters</literal> "
+"attribute to customize the TypeDef."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
+#, 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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+"@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
+#: basic_mapping.xml:1840
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1842
+#, no-c-format
+msgid ""
+"By default the access type of a class hierarchy is defined by the position "
+"of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> "
+"annotations. If these annotations are on a field, then only fields are "
+"considered for persistence and the state is accessed via the field. If there "
+"annotations are on a getter, then only the getters are considered for "
+"persistence and the state is accessed via the getter/setter. That works well "
+"in practice and is the recommended approach."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1850
+#, no-c-format
+msgid ""
+"The placement of annotations within a class hierarchy has to be consistent "
+"(either field or on property) to be able to determine the default access "
+"type. It is recommended to stick to one single annotation placement strategy "
+"throughout your whole application."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1857
+#, no-c-format
+msgid "However in some situations, you need to:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1861
+#, no-c-format
+msgid "force the access type of the entity hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1865
+#, no-c-format
+msgid "override the access type of a specific entity in the class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1870
+#, no-c-format
+msgid "override the access type of an embeddable type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid ""
+"The best use case is an embeddable class used by several entities that might "
+"not use the same access type. In this case it is better to force the access "
+"type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid ""
+"To force the access type on a given class, use the <classname>@Access</"
+"classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" @Embedded private Address address;\n"
+" public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class User {\n"
+" private Long id;\n"
+" @Id public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" private Address address;\n"
+" @Embedded public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"@Access(AcessType.PROPERTY)\n"
+"public class Address {\n"
+" private String street1;\n"
+" public String getStreet1() { return street1; }\n"
+" public void setStreet1() { this.street1 = street1; }\n"
+"\n"
+" private hashCode; //not persistent\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid ""
+"You can also override the access type of a single property while keeping the "
+"other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+" @Transient private String userId;\n"
+" @Transient private String orderId;\n"
+"\n"
+" @Access(AccessType.PROPERTY)\n"
+" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid ""
+"In this example, the default access type is <classname>FIELD</classname> "
+"except for the <literal>orderNumber</literal> property. Note that the "
+"corresponding field, if any must be marked as <classname>@Transient</"
+"classname> or <code>transient</code>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1896
+#, no-c-format
+msgid "@org.hibernate.annotations.AccessType"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1898
+#, no-c-format
+msgid ""
+"The annotation <classname>@org.hibernate.annotations.AccessType</classname> "
+"should be considered deprecated for FIELD and PROPERTY access. It is still "
+"useful however if you need to use a custom access type."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1907
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1909
+#, 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
+#: basic_mapping.xml:1914
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "<literal>assigned</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "<literal>string</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "<literal>hilo</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, fuzzy, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the property "
+"name)"
+msgstr ""
+"<literal>name</literal> (optionnel) : nom de la propriété de l'identifiant."
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal> (optionnel) : génère le DDL d'une contrainte "
+"d'unicité pour les colonnes. Permet aussi d'en faire la cible d'une "
+"<literal>property-ref</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, fuzzy, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable (default "
+"true)."
+msgstr ""
+"<literal>name</literal> (optionnel) : nom de la propriété de l'identifiant."
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column will be "
+"part of the insert statement (default true)"
+msgstr ""
+"<literal>name</literal> (optionnel) : nom de la propriété de l'identifiant."
+
+#. Tag: para
+#: basic_mapping.xml:2008
+#, fuzzy, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will be "
+"part of the update statement (default true)"
+msgstr ""
+"<literal>catalog</literal> (optionnel) : le nom d'un catalogue de base de "
+"données. "
+
+#. Tag: para
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL "
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default "
+"primary table)"
+msgstr ""
+"<literal>catalog</literal> (optionnel) : le nom d'un catalogue de base de "
+"données. "
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional): column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional): column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional): column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>Serializable</"
+"classname>, it is mapped as <classname>@Basic</classname> in a column "
+"holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>java.sql.Clob</"
+"classname> or <classname>java.sql.Blob</classname>, it is mapped as "
+"<classname>@Lob</classname> with the appropriate <classname>LobType</"
+"classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, no-c-format
+msgid ""
"The <literal><property></literal> element declares a persistent "
"JavaBean style property of the class."
msgstr ""
"L'élément <literal><property></literal> déclare une propriété "
"persistante de la classe au sens JavaBean."
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, no-c-format
+msgid ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2129
#, no-c-format
msgid ""
"<literal>name</literal>: the name of the property, with an initial lowercase "
@@ -2087,6 +4447,7 @@
"minuscule. "
#. Tag: para
+#: basic_mapping.xml:2134
#, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -2098,6 +4459,7 @@
"élément(s) <literal><column></literal> imbriqués. "
#. Tag: para
+#: basic_mapping.xml:2146
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2116,6 +4478,7 @@
"(utile si vous savez qu'un trigger affectera la valeur à la colonne). "
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2127,6 +4490,7 @@
"calculées ne possèdent pas leur propre mappage."
#. Tag: para
+#: basic_mapping.xml:2169
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
@@ -2140,6 +4504,7 @@
"construction). "
#. Tag: para
+#: basic_mapping.xml:2176
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2151,6 +4516,7 @@
"<literal>property-ref</literal>."
#. Tag: para
+#: basic_mapping.xml:2183
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2160,6 +4526,7 @@
"nullité pour les colonnes."
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2174,6 +4541,7 @@
"marquée obsolète (dirty)."
#. Tag: para
+#: basic_mapping.xml:2196
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2187,48 +4555,15 @@
"\"mapping-generated\"/> pour plus d'informations. "
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr "<emphasis>typename</emphasis> peut être :"
#. Tag: para
+#: basic_mapping.xml:2230
#, no-c-format
msgid ""
-"The name of a Hibernate basic type: <literal>integer, string, character, "
-"date, timestamp, float, binary, serializable, object, blob</literal> etc."
-msgstr ""
-"Le nom d'un type basique Hibernate (par ex : <literal>integer, string, "
-"character, date, timestamp, float, binary, serializable, object, blob</"
-"literal> etc.). "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The name of a Java class with a default basic type: <literal>int, float, "
-"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
-"literal> etc."
-msgstr ""
-"le nom d'une classe Java avec un type basique par défaut (par ex : "
-"<literal>int, float, char, java.lang.String, java.util.Date, java.lang."
-"Integer, java.sql.Clob</literal> etc.). "
-
-#. Tag: para
-#, no-c-format
-msgid "The name of a serializable Java class."
-msgstr "Le nom d'une classe Java sérialisable."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
-"literal> etc."
-msgstr ""
-"Le nom d'une classe avec un type personnalisé (par ex : <literal>com.illflow."
-"type.MyCustomType</literal>)."
-
-#. Tag: para
-#, no-c-format
-msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
@@ -2247,6 +4582,7 @@
"personnalisé)."
#. Tag: para
+#: basic_mapping.xml:2239
#, no-c-format
msgid ""
"The <literal>access</literal> attribute allows you to control how Hibernate "
@@ -2267,6 +4603,7 @@
"build-timey.PropertyAccessor</literal>. "
#. Tag: para
+#: basic_mapping.xml:2248
#, no-c-format
msgid ""
"A powerful feature is derived properties. These properties are by definition "
@@ -2280,7 +4617,20 @@
"expression SQL, qui se traduit par une sous-requête <literal>SELECT</"
"literal> dans la requête SQL qui charge une instance : "
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, no-c-format
+msgid ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2256
#, no-c-format
msgid ""
"You can reference the entity table by not declaring an alias on a particular "
@@ -2295,31 +4645,1817 @@
"l'attribut si vous le souhaitez. "
#. Tag: title
+#: basic_mapping.xml:2265
#, no-c-format
-msgid "Many-to-one"
-msgstr "Plusieurs-à-un"
+msgid "Embedded objects (aka components)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2267
+#, fuzzy, no-c-format
+msgid ""
+"Embeddable objects (or components) are objects whose properties are mapped "
+"to the same table as the owning entity's table. Components can, in turn, "
+"declare their own properties, components or collections"
+msgstr ""
+"L'élément <literal><component></literal> mappe les propriétés d'un "
+"objet enfant aux colonnes d'une classe parente. Les composants peuvent en "
+"retour déclarer leurs propres propriétés, composants ou collections. Voir "
+"\"Components\" plus bas :"
+
+#. Tag: para
+#: basic_mapping.xml:2272
#, no-c-format
msgid ""
-"An ordinary association to another persistent class is declared using a "
-"<literal>many-to-one</literal> element. The relational model is a many-to-"
-"one association; a foreign key in one table is referencing the primary key "
-"column(s) of the target table."
+"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 ""
-"Une association ordinaire vers une autre classe persistante est déclarée en "
-"utilisant un élément <literal>many-to-one</literal>. Le modèle relationnel "
-"est une association de type plusieurs-à-un : une clé étrangère dans une "
-"table référence la ou les clé(s) primaire(s) dans la table cible. "
+#. Tag: programlisting
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
#, no-c-format
+msgid ""
+"An embeddable object inherits the access type of its owning entity (note "
+"that you can override that using the <literal>@Access</literal> annotation)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2290
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded "
+"objects of embedded objects is through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2305
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column = @Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
+"(name=\"nat_Iso2\") ),\n"
+" @AttributeOverride(name=\"nationality.name\", column = @Column"
+"(name=\"nat_CountryName\") )\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2307
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports something that is not explicitly supported by "
+"the JPA 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
+#: basic_mapping.xml:2313
+#, no-c-format
+msgid ""
+"You can also use association annotations in an embeddable object (ie "
+"<literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, "
+"<classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To "
+"override the association columns you can use <literal>@AssociationOverride</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2319
+#, 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 as several embedded objects "
+"would share the same set of columns. In plain JPA, you need to override at "
+"least one set of columns. Hibernate, however, allows you to enhance the "
+"default naming mechanism through the <classname>NamingStrategy</classname> "
+"interface. You can write a strategy that prevent name clashing in such a "
+"situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an "
+"example of this."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2329
+#, no-c-format
+msgid ""
+"If a property of the embedded object points back to the owning entity, "
+"annotate it with the <classname>@Parent</classname> annotation. Hibernate "
+"will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
+#, no-c-format
+msgid ""
+"<component\n"
+" name=\"propertyName\"\n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
+#, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr "<literal>name</literal> : le nom de la propriété. "
#. Tag: para
+#: basic_mapping.xml:2364
#, no-c-format
msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the component (child) class."
+msgstr ""
+"<literal>class</literal> (optionnel - par défaut au type de la propriété "
+"déterminé par réflexion) : le nom de la classe (enfant) du composant. "
+
+#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
+#, no-c-format
+msgid ""
+"<literal>insert</literal>: do the mapped columns appear in SQL "
+"<literal>INSERTs</literal>?"
+msgstr ""
+"<literal>insert</literal> : les colonnes mappées apparaissent-elles dans les "
+"SQL <literal>INSERT</literal> s ? "
+
+#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
+#, no-c-format
+msgid ""
+"<literal>update</literal>: do the mapped columns appear in SQL "
+"<literal>UPDATEs</literal>?"
+msgstr ""
+"<literal>update</literal>: les colonnes mappées apparaissent-elles dans les "
+"SQL <literal>UPDATE</literal> s ? "
+
+#. Tag: para
+#: basic_mapping.xml:2386
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this component should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal> (optionnel - par défaut à <literal>false</"
+"literal>) : indique que ce composant doit être chargé en différé au premier "
+"accès à la variable d'instance (nécessite une instrumentation du bytecode "
+"lors de la phase de construction). "
+
+#. Tag: para
+#: basic_mapping.xml:2393
+#, no-c-format
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this component either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal> (optionnel - par défaut à <literal>true</"
+"literal>) : spécifie si les mise à jour sur ce composant nécessitent ou non "
+"l'acquisition d'un verrou optimiste. En d'autres termes, cela détermine si "
+"une incrémentation de version doit avoir lieu quand la propriété est marquée "
+"obsolète (dirty). "
+
+#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that a unique constraint exists upon all mapped columns of the "
+"component."
+msgstr ""
+"<literal>unique</literal> (optionnel - par défaut à <literal>false</"
+"literal>) : Indique qu'une contrainte d'unicité existe sur toutes les "
+"colonnes mappées de ce composant. "
+
+#. Tag: para
+#: basic_mapping.xml:2408
+#, no-c-format
+msgid ""
+"The child <literal><property></literal> tags map properties of the "
+"child class to table columns."
+msgstr ""
+"Les balises enfant <literal><property></literal> mappent les "
+"propriétés de la classe enfant sur les colonnes de la table. "
+
+#. Tag: para
+#: basic_mapping.xml:2411
+#, no-c-format
+msgid ""
+"The <literal><component></literal> element allows a <literal><"
+"parent></literal> subelement that maps a property of the component class "
+"as a reference back to the containing entity."
+msgstr ""
+"L'élément <literal><component></literal> permet de déclarer un sous-"
+"élément <literal><parent></literal> qui associe une propriété de la "
+"classe composant comme une référence arrière vers l'entité contenante. "
+
+#. Tag: para
+#: basic_mapping.xml:2415
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><dynamic-component></literal> element allows a "
+"<literal>Map</literal> to be mapped as a component, where the property names "
+"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
+"more information. This feature is not supported in annotations."
+msgstr ""
+"L'élément <literal><dynamic-component></literal> permet à une "
+"<literal>Map</literal> d'être mappée en tant que composant, quand les noms "
+"de la propriété font référence aux clés de cette Map. Voir <xref linkend="
+"\"components-dynamic\" />. "
+
+#. Tag: title
+#: basic_mapping.xml:2423
+#, no-c-format
+msgid "Inheritance strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2425
+#, no-c-format
+msgid ""
+"Java is a language supporting polymorphism: a class can inherit from "
+"another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2431
+#, no-c-format
+msgid ""
+"Single table per class hierarchy strategy: a single table hosts all the "
+"instances of a class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2436
+#, no-c-format
+msgid ""
+"Joined subclass strategy: one table per class and subclass is present and "
+"each table persist the properties specific to a given subclass. The state of "
+"the entity is then stored in its corresponding class table and all its "
+"superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2443
+#, no-c-format
+msgid ""
+"Table per class strategy: one table per concrete class and subclass is "
+"present and each table persist the properties of the class and its "
+"superclasses. The state of the entity is then stored entirely in the "
+"dedicated table for its class."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2453
+#, no-c-format
+msgid ""
+"With this approach the properties of all the subclasses in a given mapped "
+"class hierarchy are stored in a single table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2456
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass declares its own persistent properties and subclasses. Version "
+"and id properties are assumed to be inherited from the root class. Each "
+"subclass in a hierarchy must define a unique discriminator value. If this is "
+"not specified, the fully qualified Java class name is used."
+msgstr ""
+"Chaque sous-classe devrait déclarer ses propres propriétés persistantes et "
+"sous-classes. Les propriétés <literal><version></literal> et "
+"<literal><id></literal> sont implicitement hérités de la classe "
+"racine. Chaque sous-classe dans une hiérarchie doit définir une unique "
+"<literal>discriminator-value</literal>. Si non spécifiée, le nom complet de "
+"la classe Java est utilisé. "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: basic_mapping.xml:2464
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
+"<literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+"Pour finir, la persistance polymorphique nécessite la déclaration de chaque "
+"sous-classe de la classe racine persistante. Pour la stratégie de mappage de "
+"type table-per-class-hierarchy, on utilise la déclaration <literal><"
+"subclass></literal>. "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, no-c-format
+msgid ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
+#, no-c-format
+msgid ""
+"<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr "<literal>name</literal> : le nom de classe complet de la sous-classe. "
+
+#. Tag: para
+#: basic_mapping.xml:2488
+#, no-c-format
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses."
+msgstr ""
+"<literal>discriminator-value</literal> (optionnel - par défaut le nom de la "
+"classe) : une valeur qui distingue les différentes sous-classes. "
+
+#. Tag: para
+#: basic_mapping.xml:2494
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface used for "
+"lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (optionnel) : indique une classe ou interface à "
+"utiliser pour l'initialisation différée des proxies. "
+
+#. Tag: para
+#: basic_mapping.xml:2499
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (optionnel, par défaut à <literal>true</literal>) : "
+"spécifier <literal>lazy=\"false\"</literal> désactive l'utilisation de "
+"l'extraction différée."
+
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, fuzzy, no-c-format
+msgid ""
+"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
+">."
+msgstr ""
+"Pour plus d'informations sur les mappages d'héritage, consultez le <xref "
+"linkend=\"inheritance\" />. "
+
+#. Tag: title
+#: basic_mapping.xml:2511
+#, no-c-format
+msgid "Discriminator"
+msgstr "Discriminator"
+
+#. Tag: para
+#: basic_mapping.xml:2513
+#, fuzzy, no-c-format
+msgid ""
+"Discriminators are required for polymorphic persistence using the table-per-"
+"class-hierarchy mapping strategy. It declares a discriminator column of the "
+"table. The discriminator column contains marker values that tell the "
+"persistence layer what subclass to instantiate for a particular row. A "
+"restricted set of types can be used: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+"L'élément <literal><discriminator></literal> est nécessaire pour la "
+"persistance polymorphique qui utilise la stratégie de mappage de table par "
+"hiérarchie de classe et déclare une colonne discriminante de la table. La "
+"colonne discriminante contient des valeurs marqueur qui permettent à la "
+"couche de persistance de savoir quelle sous-classe instancier pour une ligne "
+"particulière de table en base. Un nombre restreint de types peuvent être "
+"utilisés : <literal>string</literal>, <literal>character</literal>, "
+"<literal>integer</literal>, <literal>byte</literal>, <literal>short</"
+"literal>, <literal>boolean</literal>, <literal>yes_no</literal>, "
+"<literal>true_false</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2523
+#, no-c-format
+msgid ""
+"Use the <classname>@DiscriminatorColumn</classname> to define the "
+"discriminator column as well as the discriminator type. Alternatively, you "
+"can also use <classname>@DiscriminatorFormula</classname> to express in SQL "
+"what would be in a virtual discriminator column. This is particularly handy "
+"when the discriminator value can be extracted from one or more columns of "
+"the table. Both <classname>@DiscriminatorColumn</classname> and "
+"<classname>@DiscriminatorFormula</classname> are to be set on the root "
+"entity (once per persisted hierarchy)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2534
+#, no-c-format
+msgid ""
+"Finally, use <classname>@DiscriminatorValue</classname> on each class of the "
+"hierarchy to specify the value stored in the discriminator column for a "
+"given entity. If you do not set <classname>@DiscriminatorValue</classname> "
+"on a class, the fully qualified class name is used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2542
+#, no-c-format
+msgid ""
+"In hbm.xml, the <literal><discriminator></literal> element is used to "
+"define the discriminator column or formula:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, no-c-format
+msgid ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2563
+#, no-c-format
+msgid ""
+"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
+"the name of the discriminator column."
+msgstr ""
+"<literal>column</literal> (optionnel - par défaut à <literal>class</"
+"literal>), le nom de la colonne discriminante. "
+
+#. Tag: para
+#: basic_mapping.xml:2569
+#, no-c-format
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
+"a name that indicates the Hibernate type"
+msgstr ""
+"<literal>type</literal> (optionnel - par défaut à <literal>string</literal>) "
+"un nom indiquant le type Hibernate. "
+
+#. Tag: para
+#: basic_mapping.xml:2575
+#, no-c-format
+msgid ""
+"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
+"\"forces\" Hibernate to specify the allowed discriminator values, even when "
+"retrieving all instances of the root class."
+msgstr ""
+"<literal>force</literal> (optionnel - par défaut à <literal>false</literal>) "
+"\"oblige\" Hibernate à spécifier une valeur discriminante autorisée même "
+"quand on récupère toutes les instances de la classe de base. "
+
+#. Tag: para
+#: basic_mapping.xml:2582
+#, no-c-format
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"set this to <literal>false</literal> if your discriminator column is also "
+"part of a mapped composite identifier. It tells Hibernate not to include the "
+"column in SQL <literal>INSERTs</literal>."
+msgstr ""
+"<literal>insert</literal> (optionnel - par défaut à <literal>true</literal>) "
+"à passer à <literal>false</literal> si la colonne discriminante fait aussi "
+"partie d'un identifiant composé mappé (Indique à Hibernate de ne pas inclure "
+"la colonne dans les SQL <literal>INSERT</literal> s). "
+
+#. Tag: para
+#: basic_mapping.xml:2590
+#, no-c-format
+msgid ""
+"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
+"executed when a type has to be evaluated. It allows content-based "
+"discrimination."
+msgstr ""
+"<literal>formula</literal> (optionnel) une expression SQL arbitraire qui est "
+"exécutée quand un type doit être évalué. Permet la discrimination basée sur "
+"le contenu. "
+
+#. Tag: para
+#: basic_mapping.xml:2597
+#, no-c-format
+msgid ""
+"Actual values of the discriminator column are specified by the "
+"<literal>discriminator-value</literal> attribute of the <literal><"
+"class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+"Les véritables valeurs de la colonne discriminante sont spécifiées par "
+"l'attribut <literal>discriminator-value</literal> des éléments <literal><"
+"class></literal> et <literal><subclass></literal>. "
+
+#. Tag: para
+#: basic_mapping.xml:2602
+#, no-c-format
+msgid ""
+"The <literal>force</literal> attribute is only useful if the table contains "
+"rows with \"extra\" discriminator values that are not mapped to a persistent "
+"class. This will not usually be the case."
+msgstr ""
+"L'attribut <literal>force</literal> n'est utile que si la table contient des "
+"lignes avec des valeurs \"extra\" discriminantes qui ne sont pas mappées à "
+"une classe persistante. Ce ne sera généralement pas le cas. "
+
+#. Tag: para
+#: basic_mapping.xml:2607
+#, no-c-format
+msgid ""
+"The <literal>formula</literal> attribute allows you to declare an arbitrary "
+"SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+"En utilisant l'attribut <literal>formula</literal> vous pouvez déclarer une "
+"expression SQL arbitraire qui sera utilisée pour évaluer le type d'une "
+"ligne : "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, no-c-format
+msgid ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, fuzzy, no-c-format
+msgid "Joined subclass strategy"
+msgstr "Joined-subclass"
+
+#. Tag: para
+#: basic_mapping.xml:2618
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass can also be mapped to its own table. This is called the table-"
+"per-subclass mapping strategy. An inherited state is retrieved by joining "
+"with the table of the superclass. A discriminator column is not required for "
+"this mapping strategy. Each subclass must, however, declare a table column "
+"holding the object identifier. The primary key of this table is also a "
+"foreign key to the superclass table and described by the "
+"<classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></"
+"literal> element."
+msgstr ""
+"Il est également possible de mapper chaque sous-classe vers sa propre table "
+"(stratégie de mappage de type table-per-subclass). L'état hérité est "
+"récupéré en joignant la table de la super-classe. L'élément <literal><"
+"joined-subclass></literal> est utilisé. Par exemple :"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
+#, no-c-format
+msgid ""
+"@Entity @Table(name=\"CATS\")\n"
+"@Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Cat implements Serializable { \n"
+" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+" String getId() { return id; }\n"
+"\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+"public class DomesticCat extends Cat { \n"
+" public String getName() { return name; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2631
+#, no-c-format
+msgid ""
+"The table name still defaults to the non qualified class name. Also if "
+"<classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / "
+"foreign key columns are assumed to have the same names as the primary key "
+"columns of the primary table of the superclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2638
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><joined-subclass></literal> element. For "
+"example:"
+msgstr ""
+"Déclarez une classe persistante avec l'élément <literal>class</literal>. "
+"Part exemple :"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, no-c-format
+msgid ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
+#, no-c-format
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr "<literal>table</literal>: le nom de la table de la sous-classe. "
+
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface to use "
+"for lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (optionnel) : indique une classe ou interface à "
+"utiliser pour l'initialisation différée des proxies. "
+
+#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (optionnel, par défaut à <literal>true</literal>) : "
+"spécifier <literal>lazy=\"false\"</literal> désactive l'utilisation de "
+"l'extraction différée. "
+
+#. Tag: para
+#: basic_mapping.xml:2679
+#, no-c-format
+msgid ""
+"Use the <literal><key></literal> element to declare the primary key / "
+"foreign key column. The mapping at the start of the chapter would then be re-"
+"written as:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2692
+#, fuzzy, no-c-format
+msgid ""
+"A third option is to map only the concrete classes of an inheritance "
+"hierarchy to tables. This is called the table-per-concrete-class strategy. "
+"Each table defines all persistent states of the class, including the "
+"inherited state. In Hibernate, it is not necessary to explicitly map such "
+"inheritance hierarchies. You can map each class as a separate entity root. "
+"However, if you wish use polymorphic associations (e.g. an association to "
+"the superclass of your hierarchy), you need to use the union subclass "
+"mapping."
+msgstr ""
+"Une troisième option est de mapper uniquement les classes concrètes d'une "
+"hiérarchie d'héritage vers des tables, (stratégie de type table-per-concrete-"
+"class) où chaque table définit tous les états persistants de la classe, y "
+"compris les états hérités. Dans Hibernate il n'est absolument pas nécessaire "
+"de mapper explicitement de telles hiérarchies d'héritage. Vous pouvez "
+"simplement mapper chaque classe avec une déclaration <literal><class></"
+"literal> différente. Cependant, si vous souhaitez utiliser des associations "
+"polymorphiques (c'est-à-dire une association vers la superclasse de votre "
+"hiérarchie), vous devez utiliser le mappage <literal><union-subclass></"
+"literal>. Par exemple :"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2703
+#, no-c-format
+msgid "Or in hbm.xml:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, no-c-format
+msgid ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid ""
+"No discriminator column or key column is required for this mapping strategy."
+msgstr ""
+"Aucune colonne discriminante ou colonne clé n'est requise pour cette "
+"stratégie de mappage."
+
+#. Tag: title
+#: basic_mapping.xml:2751
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2753
+#, 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>@MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
+#, 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
+#: basic_mapping.xml:2768
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as <literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2773
+#, no-c-format
+msgid ""
+"The default access type (field or methods) is used, unless you use the "
+"<literal>@Access</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2778
+#, 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
+#: basic_mapping.xml:2786
+#, 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
+#: basic_mapping.xml:2792
+#, 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
+#: basic_mapping.xml:2797
+#, 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
+#: basic_mapping.xml:2801
+#, 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( \n"
+" name=\"propulsion\", \n"
+" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+")\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2803
+#, 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
+#: basic_mapping.xml:2809
+#, 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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid ""
+"In hbm.xml, simply map the properties of the superclass in the <literal><"
+"class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2821
+#, no-c-format
+msgid "Mapping one entity to several tables"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2823
+#, no-c-format
+msgid ""
+"While not recommended for a fresh schema, some legacy databases force your "
+"to map a single entity on several tables."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2826
+#, no-c-format
+msgid ""
+"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>@JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2834
+#, 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
+#: basic_mapping.xml:2844
+#, no-c-format
+msgid ""
+"There is also additional tuning accessible via the <classname>@org.hibernate."
+"annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, fuzzy, 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 <classname>SELECT</classname> 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> (optionnel - par défaut à <literal>join</"
+"literal>) : si positionné à <literal>join</literal>, Hibernate utilisera une "
+"jointure interne pour charger une <literal>jointure</literal> définie par "
+"une classe ou ses super-classes et une jointure externe pour une "
+"<literal><jointure></literal> définie par une sous-classe. Si "
+"positionné à <literal>select</literal>, Hibernate utilisera un select "
+"séquentiel pour une <literal><jointure></literal> définie sur une sous-"
+"classe, qui ne sera délivrée que si une ligne représente une instance de la "
+"sous-classe. Les jointures internes seront quand même utilisées pour charger "
+"une <literal><jointure></literal> définie par une classe et ses super-"
+"classes. "
+
+#. Tag: para
+#: basic_mapping.xml:2862
+#, fuzzy, 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> (optionnel - par défaut à <literal>false</"
+"literal>) : si positionné à true, Hibernate n'essaiera pas d'insérer ou de "
+"mettre à jour les propriétés définies par cette jointure. "
+
+#. Tag: para
+#: basic_mapping.xml:2868
+#, fuzzy, 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>optionnel</literal> (optionnel - par défaut à <literal>false</"
+"literal>) : si positionné à true, Hibernate insèrera une ligne seulement si "
+"les propriétés définies par cette jointure sont non-nulles et utilisera "
+"toujours une jointure externe pour extraire les propriétés. "
+
+#. Tag: para
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid ""
+"Make sure to use the secondary table name in the <methodname>appliesto</"
+"methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTable(name=\"Cat1\")\n"
+"@org.hibernate.annotations.Table(\n"
+" appliesTo=\"Cat1\",\n"
+" fetch=FetchMode.SELECT,\n"
+" optional=true)\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
+msgstr ""
+"Par exemple, si nous avons le mappage de <literal><properties></"
+"literal> suivant : "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, no-c-format
+msgid ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+"\n"
+" <key ... />\n"
+"\n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2907
+#, no-c-format
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr "<literal>table</literal> : le nom de la table jointe. "
+
+#. Tag: para
+#: basic_mapping.xml:2924
+#, no-c-format
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
+"if set to <literal>join</literal>, the default, Hibernate will use an inner "
+"join to retrieve a <literal><join></literal> defined by a class or its "
+"superclasses. It will use an outer join for a <literal><join></"
+"literal> defined by a subclass. If set to <literal>select</literal> then "
+"Hibernate will use a sequential select for a <literal><join></literal> "
+"defined on a subclass. This will be issued only if a row represents an "
+"instance of the subclass. Inner joins will still be used to retrieve a "
+"<literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+"<literal>fetch</literal> (optionnel - par défaut à <literal>join</"
+"literal>) : si positionné à <literal>join</literal>, Hibernate utilisera une "
+"jointure interne pour charger une <literal>jointure</literal> définie par "
+"une classe ou ses super-classes et une jointure externe pour une "
+"<literal><jointure></literal> définie par une sous-classe. Si "
+"positionné à <literal>select</literal>, Hibernate utilisera un select "
+"séquentiel pour une <literal><jointure></literal> définie sur une sous-"
+"classe, qui ne sera délivrée que si une ligne représente une instance de la "
+"sous-classe. Les jointures internes seront quand même utilisées pour charger "
+"une <literal><jointure></literal> définie par une classe et ses super-"
+"classes. "
+
+#. Tag: para
+#: basic_mapping.xml:2939
+#, no-c-format
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will not insert or update the properties "
+"defined by this join."
+msgstr ""
+"<literal>inverse</literal> (optionnel - par défaut à <literal>false</"
+"literal>) : si positionné à true, Hibernate n'essaiera pas d'insérer ou de "
+"mettre à jour les propriétés définies par cette jointure. "
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, no-c-format
+msgid ""
+"<literal>optional</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will insert a row only if the properties "
+"defined by this join are non-null. It will always use an outer join to "
+"retrieve the properties."
+msgstr ""
+"<literal>optionnel</literal> (optionnel - par défaut à <literal>false</"
+"literal>) : si positionné à true, Hibernate insèrera une ligne seulement si "
+"les propriétés définies par cette jointure sont non-nulles et utilisera "
+"toujours une jointure externe pour extraire les propriétés. "
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, no-c-format
+msgid ""
+"For example, address information for a person can be mapped to a separate "
+"table while preserving value type semantics for all properties:"
+msgstr ""
+"Par exemple, les informations d'adresse pour une personne peuvent être "
+"mappées vers une table séparée (tout en préservant des sémantiques de type "
+"valeur pour toutes ses propriétés) : "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, no-c-format
+msgid ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, no-c-format
+msgid ""
+"This feature is often only useful for legacy data models. We recommend fewer "
+"tables than classes and a fine-grained domain model. However, it is useful "
+"for switching between inheritance mapping strategies in a single hierarchy, "
+"as explained later."
+msgstr ""
+"Cette fonctionnalité est souvent seulement utile pour les modèles de données "
+"hérités d'anciens systèmes, nous recommandons d'utiliser moins de tables que "
+"de classes et un modèle de domaine à granularité fine. Cependant, c'est "
+"utile pour passer d'une stratégie de mappage d'héritage à une autre dans une "
+"hiérarchie simple, comme nous le verrons plus tard. "
+
+#. Tag: title
+#: basic_mapping.xml:2967
+#, no-c-format
+msgid "Mapping one to one and one to many associations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2969
+#, no-c-format
+msgid ""
+"To link one entity to an other, you need to map the association property as "
+"a to one association. In the relational model, you can either use a foreign "
+"key or an association table, or (a bit less common) share the same primary "
+"key value between the two entities."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2974
+#, no-c-format
+msgid ""
+"To mark an association, use either <classname>@ManyToOne</classname> or "
+"<classname>@OnetoOne</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2978
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
+#, no-c-format
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than nothing will propagate certain operations to the "
+"associated object. The meaningful values are divided into three categories."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2992
+#, no-c-format
+msgid ""
+"basic operations, which include: <literal>persist, merge, delete, save-"
+"update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2998
+#, fuzzy, no-c-format
+msgid ""
+"special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+"Remarquez comment les associations sont désormais spécifiées en utilisant "
+"<literal>entity-name</literal> au lieu de <literal>class</literal>. "
+
+#. Tag: para
+#: basic_mapping.xml:3003
+#, no-c-format
+msgid ""
+"comma-separated combinations of operation names: <literal>cascade=\"persist,"
+"merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. "
+"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
+"that single valued many-to-one associations do not support orphan delete."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3012
+#, no-c-format
+msgid ""
+"By default, single point associations are eagerly fetched in JPA 2. You can "
+"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
+"LAZY) </classname>in which case Hibernate will proxy the association and "
+"load it when the state of the associated entity is reached. You can force "
+"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</"
+"classname>. In this case, the property is fetched lazily when the instance "
+"variable is first accessed. This requires build-time bytecode "
+"instrumentation. lazy=\"false\" specifies that the association will always "
+"be eagerly fetched."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid ""
+"With the default JPA options, single-ended associations are loaded with a "
+"subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used "
+"for <literal>EAGER</literal> associations. You can however adjust the "
+"fetching strategy, ie how data is fetched by using <literal>@Fetch</"
+"literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a "
+"select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, fuzzy, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr "association par clé étrangère unique"
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, fuzzy, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+"Une association un-à-un vers une autre classe persistante est déclarée avec "
+"l'élément <literal>one-to-one</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:3041
+#, no-c-format
+msgid ""
+"<classname>@ManyToOne</classname> if several entities can point to the the "
+"target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3046
+#, no-c-format
+msgid ""
+"<classname>@OneToOne</classname> if only a single entity can point to the "
+"the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3051
+#, no-c-format
+msgid ""
+"and a foreign key in one table is referencing the primary key column(s) of "
+"the target table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3056
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default value"
+"(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"targetEntity=CompanyImpl.class )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3066
+#, no-c-format
+msgid ""
+"You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing "
+"the target entity table (through <literal>@JoinTable.inverseJoinColumns</"
+"literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3077
+#, no-c-format
+msgid ""
+"You can use a SQL fragment to simulate a physical join column using the "
+"<classname>@JoinColumnOrFormula</classname> / "
+"<classname>@JoinColumnOrformulas</classname> annotations (just like you can "
+"use a SQL fragment to simulate a property column via the "
+"<classname>@Formula</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" @ManyToOne\n"
+" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+" public Person getOwner() {\n"
+" return person;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid ""
+"You can mark an association as mandatory by using the "
+"<literal>optional=false</literal> attribute. We recommend to use Bean "
+"Validation's <classname>@NotNull</classname> annotation as a better "
+"alternative however. As a consequence, the foreign key column(s) will be "
+"marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid ""
+"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. 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."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3100
+#, no-c-format
+msgid "@NotFound annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when "
+"a given entity is deleted. In this case Hibernate generates a cascade delete "
+"constraint at the database level."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name using "
+"<literal>@ForeignKey</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3120
+#, fuzzy, no-c-format
+msgid "@ForeignKey annotation"
+msgstr "association par clé étrangère unique"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @ForeignKey(name=\"FK_PARENT\")\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3125
+#, no-c-format
+msgid ""
+"Sometimes, you want to link one entity to an other not by the target entity "
+"primary key but by a different unique key. You can achieve that by "
+"referencing the unique key column(s) in <methodname>@JoinColumn."
+"referenceColumnName</methodname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Person {\n"
+" @Id Integer personNumber;\n"
+" String firstName;\n"
+" @Column(name=\"I\")\n"
+" String initial;\n"
+" String lastName;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Home {\n"
+" @ManyToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+" })\n"
+" Person owner\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3132
+#, no-c-format
+msgid ""
+"This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3135
+#, no-c-format
+msgid ""
+"In hbm.xml, mapping an association is similar. The main difference is that a "
+"<classname>@OneToOne</classname> is mapped as <literal><many-to-one "
+"unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, no-c-format
+msgid ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional): the name of the foreign key column. "
"This can also be specified by nested <literal><column></literal> "
"element(s)."
@@ -2329,6 +6465,7 @@
"<literal><column></literal>. "
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, no-c-format
msgid ""
"<literal>class</literal> (optional - defaults to the property type "
@@ -2338,6 +6475,7 @@
"déterminé par réflexion) : le nom de la classe associée. "
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional): specifies which operations should be "
@@ -2347,6 +6485,7 @@
"être cascadées de l'objet parent vers l'objet associé. "
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional - defaults to <literal>select</literal>): "
@@ -2357,6 +6496,7 @@
"join) ou le chargement par select successifs."
#. Tag: para
+#: basic_mapping.xml:3209
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2375,6 +6515,7 @@
"application. "
#. Tag: para
+#: basic_mapping.xml:3219
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2386,6 +6527,7 @@
"clé primaire de la classe associée est utilisée. "
#. Tag: para
+#: basic_mapping.xml:3232
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2399,6 +6541,7 @@
"association un-à-un. "
#. Tag: para
+#: basic_mapping.xml:3240
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2408,6 +6551,7 @@
"nullité pour les colonnes de clés étrangères."
#. Tag: para
+#: basic_mapping.xml:3254
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2426,6 +6570,7 @@
"sera toujours chargée."
#. Tag: para
+#: basic_mapping.xml:3264
#, no-c-format
msgid ""
"<literal>not-found</literal> (optional - defaults to <literal>exception</"
@@ -2439,6 +6584,7 @@
"manquante comme une association nulle. "
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, no-c-format
msgid ""
"<literal>entity-name</literal> (optional): the entity name of the associated "
@@ -2448,6 +6594,7 @@
"associée. "
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2457,7 +6604,8 @@
"valeur pour une clé étrangère calculée. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3284
+#, fuzzy, no-c-format
msgid ""
"Setting a value of the <literal>cascade</literal> attribute to any "
"meaningful value other than <literal>none</literal> will propagate certain "
@@ -2467,7 +6615,7 @@
"second, special values: <literal>delete-orphan</literal>; and third,"
"<literal>all</literal> comma-separated combinations of operation names: "
"<literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,"
-"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> "
+"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> "
"for a full explanation. Note that single valued, many-to-one and one-to-one, "
"associations do not support orphan delete."
msgstr ""
@@ -2485,6 +6633,7 @@
"(associations plusieurs-à-un et un-à-un) ne supportent pas orphan delete. "
#. Tag: para
+#: basic_mapping.xml:3298
#, no-c-format
msgid ""
"Here is an example of a typical <literal>many-to-one</literal> declaration:"
@@ -2492,7 +6641,15 @@
"Une déclaration <literal>many-to-one</literal> typique est aussi simple "
"que : "
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, no-c-format
+msgid ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3303
#, no-c-format
msgid ""
"The <literal>property-ref</literal> attribute should only be used for "
@@ -2511,17 +6668,36 @@
"unique qui n'est pas la clé primaire. L'attribut <literal>unique</literal> "
"contrôle la génération DDL par Hibernate avec l'outil SchemaExport."
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, no-c-format
+msgid ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3313
#, no-c-format
msgid "Then the mapping for <literal>OrderItem</literal> might use:"
msgstr "Ainsi le mappage pour <literal>OrderItem</literal> peut utiliser :"
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, no-c-format
+msgid ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3318
#, no-c-format
msgid "This is not encouraged, however."
msgstr "Bien que ce ne soit certainement pas encouragé."
#. Tag: para
+#: basic_mapping.xml:3320
#, no-c-format
msgid ""
"If the referenced unique key comprises multiple properties of the associated "
@@ -2533,6 +6709,7 @@
"<literal><properties></literal>. "
#. Tag: para
+#: basic_mapping.xml:3324
#, no-c-format
msgid ""
"If the referenced unique key is the property of a component, you can specify "
@@ -2541,23 +6718,100 @@
"Si la clé unique référencée est la propriété d'un composant, vous pouvez "
"spécifier le chemin de propriété :"
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, no-c-format
+msgid ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3331
#, no-c-format
-msgid "One-to-one"
-msgstr "Un-à-un"
+msgid "Sharing the primary key with the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3333
#, no-c-format
msgid ""
-"A one-to-one association to another persistent class is declared using a "
-"<literal>one-to-one</literal> element."
+"The second approach is to ensure an entity and its associated entity share "
+"the same primary key. In this case the primary key column is also a foreign "
+"key and there is no extra column. These associations are always one to one."
msgstr ""
-"Une association un-à-un vers une autre classe persistante est déclarée avec "
-"l'élément <literal>one-to-one</literal>."
+#. Tag: title
+#: basic_mapping.xml:3339
+#, fuzzy, no-c-format
+msgid "One to One association"
+msgstr "association par clé étrangère unique"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @MapsId\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"} \n"
+"\n"
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
msgid ""
+"Many people got confused by these primary key based one to one associations. "
+"They can only be lazily loaded if Hibernate knows that the other side of the "
+"association is always present. To indicate to Hibernate that it is the case, "
+"use <classname>@OneToOne(optional=false)</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3352
+#, no-c-format
+msgid "In hbm.xml, use the following mapping."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3377
+#, no-c-format
+msgid ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3397
+#, no-c-format
+msgid ""
"<literal>constrained</literal> (optional): specifies that a foreign key "
"constraint on the primary key of the mapped table and references the table "
"of the associated class. This option affects the order in which <literal>save"
@@ -2573,6 +6827,7 @@
"l'outil SchemaExport). "
#. Tag: para
+#: basic_mapping.xml:3413
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2584,6 +6839,7 @@
"n'est pas spécifié, la clé primaire de la classe associée est utilisée. "
#. Tag: para
+#: basic_mapping.xml:3426
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): almost all one-to-one associations "
@@ -2599,6 +6855,7 @@
"onetooneformula</literal> pour un exemple."
#. Tag: para
+#: basic_mapping.xml:3435
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2620,22 +6877,8 @@
"impossible et Hibernate chargera automatiquement l'association </emphasis>."
#. Tag: para
+#: basic_mapping.xml:3454
#, no-c-format
-msgid "There are two varieties of one-to-one associations:"
-msgstr "Il existe deux types d'associations un-à-un : "
-
-#. Tag: para
-#, no-c-format
-msgid "primary key associations"
-msgstr "association par clé primaire "
-
-#. Tag: para
-#, no-c-format
-msgid "unique foreign key associations"
-msgstr "association par clé étrangère unique"
-
-#. Tag: para
-#, no-c-format
msgid ""
"Primary key associations do not need an extra table column. If two rows are "
"related by the association, then the two table rows share the same primary "
@@ -2650,6 +6893,7 @@
"d'identifiant. "
#. Tag: para
+#: basic_mapping.xml:3460
#, no-c-format
msgid ""
"For a primary key association, add the following mappings to "
@@ -2658,7 +6902,21 @@
"Pour une association par clé primaire, ajoutez les mappages suivants à "
"<literal>Employee</literal> et <literal>Person</literal>, respectivement :"
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, no-c-format
+msgid ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3468
#, no-c-format
msgid ""
"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
@@ -2670,7 +6928,25 @@
"stratégie Hibernate spéciale de génération d'identifiants appelée "
"<literal>foreign</literal> : "
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, no-c-format
+msgid ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3474
#, no-c-format
msgid ""
"A newly saved instance of <literal>Person</literal> is assigned the same "
@@ -2682,41 +6958,23 @@
"<literal>Employee</literal> référencée par la propriété <literal>employee</"
"literal> de cette <literal>Person</literal>. "
-#. Tag: para
-#, no-c-format
-msgid ""
-"Alternatively, a foreign key with a unique constraint, from "
-"<literal>Employee</literal> to <literal>Person</literal>, can be expressed "
-"as:"
-msgstr ""
-"Alternativement, une clé étrangère avec contrainte d'unicité de "
-"<literal>Employee</literal> vers <literal>Person</literal> peut être "
-"indiquée ainsi : "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"This association can be made bidirectional by adding the following to the "
-"<literal>Person</literal> mapping:"
-msgstr ""
-"Et cette association peut être rendue bidirectionnelle en ajoutant ceci au "
-"mappage de <literal>Person</literal> : "
-
#. Tag: title
+#: basic_mapping.xml:3482
#, no-c-format
msgid "Natural-id"
msgstr "Natural-id"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3484
+#, fuzzy, no-c-format
msgid ""
"Although we recommend the use of surrogate keys as primary keys, you should "
"try to identify natural keys for all entities. A natural key is a property "
"or combination of properties that is unique and non-null. It is also "
-"immutable. Map the properties of the natural key inside the <literal><"
-"natural-id></literal> element. Hibernate will generate the necessary "
-"unique key and nullability constraints and, as a result, your mapping will "
-"be more self-documenting."
+"immutable. Map the properties of the natural key as <classname>@NaturalId</"
+"classname> or map them inside the <literal><natural-id></literal> "
+"element. Hibernate will generate the necessary unique key and nullability "
+"constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
"Bien que nous recommandions l'utilisation de clés primaires générées, vous "
"devriez toujours essayer d'identifier des clés métier (naturelles) pour "
@@ -2726,9 +6984,57 @@
"natural-id></literal>. Hibernate générera la clé unique nécessaire et les "
"contraintes de non-nullité, et votre mappage s'auto-documentera. "
+#. Tag: programlisting
+#: basic_mapping.xml:3493
+#, 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
+#: basic_mapping.xml:3495
#, no-c-format
+msgid "Or in XML,"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3497
+#, no-c-format
msgid ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3499
+#, no-c-format
+msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
"<literal>hashCode()</literal> to compare the natural key properties of the "
"entity."
@@ -2738,6 +7044,7 @@
"naturelles de l'entité."
#. Tag: para
+#: basic_mapping.xml:3503
#, no-c-format
msgid ""
"This mapping is not intended for use with entities that have natural primary "
@@ -2747,6 +7054,7 @@
"clés naturelles. "
#. Tag: para
+#: basic_mapping.xml:3508
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>false</"
@@ -2758,126 +7066,206 @@
"immuables (constants). "
#. Tag: title
-#, no-c-format
-msgid "Component and dynamic-component"
-msgstr "Component, dynamic-component"
+#: basic_mapping.xml:3516
+#, fuzzy, no-c-format
+msgid "<title>Any</title>"
+msgstr "<literal>binary</literal>"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3518
+#, fuzzy, no-c-format
msgid ""
-"The <literal><component></literal> element maps properties of a child "
-"object to columns of the table of a parent class. Components can, in turn, "
-"declare their own properties, components or collections. See the \"Component"
-"\" examples below:"
+"There is one more type of property mapping. The <classname>@Any</classname> "
+"mapping defines a polymorphic association to classes from multiple tables. "
+"This type of mapping requires more than one column. The first column "
+"contains the type of the associated entity. The remaining columns contain "
+"the identifier. It is impossible to specify a foreign key constraint for "
+"this kind of association. This is not the usual way of mapping polymorphic "
+"associations and you should use this only in special cases. For example, for "
+"audit logs, user session data, etc."
msgstr ""
-"L'élément <literal><component></literal> mappe les propriétés d'un "
-"objet enfant aux colonnes d'une classe parente. Les composants peuvent en "
-"retour déclarer leurs propres propriétés, composants ou collections. Voir "
-"\"Components\" plus bas :"
+"Il existe encore un type de mappage de propriété. L'élément de mappage "
+"<literal><any></literal> définit une association polymorphique vers "
+"des classes de tables multiples. 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'identifiant. Il est impossible de "
+"spécifier une contrainte de clé étrangère pour ce type d'association, donc "
+"ce n'est certainement pas considéré comme le moyen habituel de mapper des "
+"associations (polymorphiques). Ne doit être utilisé que dans des cas "
+"particuliers (par exemple des logs d'audit, des données de session "
+"utilisateur, etc...). "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3528
+#, fuzzy, no-c-format
msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the name of the component (child) class."
+"The <classname>@Any</classname> 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. The <literal>metaType</"
+"literal> attribute allows the application to specify a custom type that maps "
+"database column values to persistent classes that have identifier properties "
+"of the type specified by <literal>idType</literal>. You must specify the "
+"mapping from values of the <literal>metaType</literal> to class names."
msgstr ""
-"<literal>class</literal> (optionnel - par défaut au type de la propriété "
-"déterminé par réflexion) : le nom de la classe (enfant) du composant. "
+"L'attribut <literal>meta-type</literal> permet à l'application de spécifier "
+"un type personnalisé qui mappe des valeurs de colonnes de base de données "
+"sur des classes persistantes qui ont un attribut identifiant du type "
+"spécifié par <literal>id-type</literal>. Vous devez spécifier le mappage à "
+"partir de valeurs du méta-type sur les noms des classes. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3538
#, no-c-format
msgid ""
-"<literal>insert</literal>: do the mapped columns appear in SQL "
-"<literal>INSERTs</literal>?"
+"@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 ""
-"<literal>insert</literal> : les colonnes mappées apparaissent-elles dans les "
-"SQL <literal>INSERT</literal> s ? "
#. Tag: para
+#: basic_mapping.xml:3540
#, no-c-format
msgid ""
-"<literal>update</literal>: do the mapped columns appear in SQL "
-"<literal>UPDATEs</literal>?"
+"Note that <classname>@AnyDef</classname> can be mutualized and reused. It is "
+"recommended to place it as a package metadata in this case."
msgstr ""
-"<literal>update</literal>: les colonnes mappées apparaissent-elles dans les "
-"SQL <literal>UPDATE</literal> s ? "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3544
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that this component should be fetched lazily when the instance "
-"variable is first accessed. It requires build-time bytecode instrumentation."
+"//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 ""
-"<literal>lazy</literal> (optionnel - par défaut à <literal>false</"
-"literal>) : indique que ce composant doit être chargé en différé au premier "
-"accès à la variable d'instance (nécessite une instrumentation du bytecode "
-"lors de la phase de construction). "
#. Tag: para
+#: basic_mapping.xml:3546
#, no-c-format
+msgid "The hbm.xml equivalent is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3548
+#, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this component either do or do not "
-"require acquisition of the optimistic lock. It determines if a version "
-"increment should occur when this property is dirty."
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
msgstr ""
-"<literal>optimistic-lock</literal> (optionnel - par défaut à <literal>true</"
-"literal>) : spécifie si les mise à jour sur ce composant nécessitent ou non "
-"l'acquisition d'un verrou optimiste. En d'autres termes, cela détermine si "
-"une incrémentation de version doit avoir lieu quand la propriété est marquée "
-"obsolète (dirty). "
#. Tag: para
+#: basic_mapping.xml:3551
#, no-c-format
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3570
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that a unique constraint exists upon all mapped columns of the "
-"component."
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
msgstr ""
-"<literal>unique</literal> (optionnel - par défaut à <literal>false</"
-"literal>) : Indique qu'une contrainte d'unicité existe sur toutes les "
-"colonnes mappées de ce composant. "
#. Tag: para
+#: basic_mapping.xml:3574
#, no-c-format
+msgid "<literal>name</literal>: the property name."
+msgstr "<literal>name</literal> : le nom de la propriété. "
+
+#. Tag: para
+#: basic_mapping.xml:3578
+#, no-c-format
+msgid "<literal>id-type</literal>: the identifier type."
+msgstr "<literal>id-type</literal> : le type identifiant."
+
+#. Tag: para
+#: basic_mapping.xml:3582
+#, no-c-format
msgid ""
-"The child <literal><property></literal> tags map properties of the "
-"child class to table columns."
+"<literal>meta-type</literal> (optional - defaults to <literal>string</"
+"literal>): any type that is allowed for a discriminator mapping."
msgstr ""
-"Les balises enfant <literal><property></literal> mappent les "
-"propriétés de la classe enfant sur les colonnes de la table. "
+"<literal>meta-type</literal> (optionnel - par défaut à <literal>string</"
+"literal>) : tout type permis pour un mappage par discriminateur."
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
msgid ""
-"The <literal><component></literal> element allows a <literal><"
-"parent></literal> subelement that maps a property of the component class "
-"as a reference back to the containing entity."
+"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
+"the cascade style."
msgstr ""
-"L'élément <literal><component></literal> permet de déclarer un sous-"
-"élément <literal><parent></literal> qui associe une propriété de la "
-"classe composant comme une référence arrière vers l'entité contenante. "
+"<literal>cascade</literal> (optionnel - par défaut à <literal>none</"
+"literal>) : le style de cascade. "
#. Tag: para
+#: basic_mapping.xml:3599
#, no-c-format
msgid ""
-"The <literal><dynamic-component></literal> element allows a "
-"<literal>Map</literal> to be mapped as a component, where the property names "
-"refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for "
-"more information."
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property either do or do not "
+"require acquisition of the optimistic lock. It defines whether a version "
+"increment should occur if this property is dirty."
msgstr ""
-"L'élément <literal><dynamic-component></literal> permet à une "
-"<literal>Map</literal> d'être mappée en tant que composant, quand les noms "
-"de la propriété font référence aux clés de cette Map. Voir <xref linkend="
-"\"components-dynamic\" />. "
+"<literal>optimistic-lock</literal> (optionnel - par défaut à <literal>true</"
+"literal>) : indique si les mise à jour sur cette propriété nécessitent ou "
+"non l'acquisition d'un verrou optimiste. En d'autres termes, définit si un "
+"incrément de version doit avoir lieu quand cette propriété est marquée "
+"dirty. "
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
msgid "Properties"
msgstr "Propriétés"
#. Tag: para
+#: basic_mapping.xml:3612
#, no-c-format
msgid ""
"The <literal><properties></literal> element allows the definition of a "
@@ -2893,7 +7281,26 @@
"un moyen pratique de définir une contrainte d'unicité multi-colonnes. Par "
"exemple :"
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, no-c-format
+msgid ""
+"<properties\n"
+" name=\"logicalName\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3636
#, no-c-format
msgid ""
"<literal>name</literal>: the logical name of the grouping. It is "
@@ -2903,6 +7310,7 @@
"emphasis> le véritable nom d'une propriété. "
#. Tag: para
+#: basic_mapping.xml:3651
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2917,6 +7325,7 @@
"obsolète (dirty). "
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
msgid ""
"For example, if we have the following <literal><properties></literal> "
@@ -2925,7 +7334,25 @@
"Par exemple, si nous avons le mappage de <literal><properties></"
"literal> suivant : "
+#. Tag: programlisting
+#: basic_mapping.xml:3669
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+"\n"
+" ...\n"
+" <properties name=\"name\"\n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3671
#, no-c-format
msgid ""
"You might have some legacy data association that refers to this unique key "
@@ -2935,9 +7362,31 @@
"système qui font référence à cette clé unique de la table <literal>Person</"
"literal> au lieu de la clé primaire : "
+#. Tag: programlisting
+#: basic_mapping.xml:3675
+#, no-c-format
+msgid ""
+"<many-to-one name=\"owner\"\n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3678
#, no-c-format
msgid ""
+"When using annotations as a mapping strategy, such construct is not "
+"necessary as the binding between a column and its related column on the "
+"associated table is done directly"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3685
+#, no-c-format
+msgid ""
"The use of this outside the context of mapping legacy data is not "
"recommended."
msgstr ""
@@ -2945,276 +7394,288 @@
"mappage de données héritées d'anciens systèmes. "
#. Tag: title
+#: basic_mapping.xml:3690
#, no-c-format
-msgid "Subclass"
-msgstr "Subclass"
+msgid "Some hbm.xml specificities"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3692
#, no-c-format
msgid ""
-"Polymorphic persistence requires the declaration of each subclass of the "
-"root persistent class. For the table-per-class-hierarchy mapping strategy, "
-"the <literal><subclass></literal> declaration is used. For example:"
+"The hbm.xml structure has some specificities naturally not present when "
+"using annotations, let's describe them briefly."
msgstr ""
-"Pour finir, la persistance polymorphique nécessite la déclaration de chaque "
-"sous-classe de la classe racine persistante. Pour la stratégie de mappage de "
-"type table-per-class-hierarchy, on utilise la déclaration <literal><"
-"subclass></literal>. "
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3696
#, no-c-format
-msgid ""
-"<literal>name</literal>: the fully qualified class name of the subclass."
-msgstr "<literal>name</literal> : le nom de classe complet de la sous-classe. "
+msgid "Doctype"
+msgstr "Doctype"
#. Tag: para
+#: basic_mapping.xml:3698
#, no-c-format
msgid ""
-"<literal>discriminator-value</literal> (optional - defaults to the class "
-"name): a value that distinguishes individual subclasses."
+"All XML mappings should declare the doctype shown. The actual DTD can be "
+"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
+"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
+"will always look for the DTD in its classpath first. If you experience "
+"lookups of the DTD using an Internet connection, check the DTD declaration "
+"against the contents of your classpath."
msgstr ""
-"<literal>discriminator-value</literal> (optionnel - par défaut le nom de la "
-"classe) : une valeur qui distingue les différentes sous-classes. "
+"Tous les mappages XML devraient utiliser le doctype indiqué. En effet vous "
+"trouverez le fichier DTD à l'URL ci-dessus, dans le répertoire "
+"<literal>hibernate-x.x.x/src/org/hibernate</literal> ou dans "
+"<literal>hibernate3.jar</literal>. Hibernate va toujours chercher la DTD "
+"dans son classpath en premier lieu. Si vous constatez des recherches de la "
+"DTD sur Internet, vérifiez votre déclaration de DTD par rapport au contenu "
+"de votre classpath. "
+#. Tag: title
+#: basic_mapping.xml:3707
+#, no-c-format
+msgid "EntityResolver"
+msgstr "EntityResolver"
+
#. Tag: para
+#: basic_mapping.xml:3709
#, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface used for "
-"lazy initializing proxies."
+"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
+"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
+"implementation with the SAXReader it uses to read in the xml files. This "
+"custom <literal>EntityResolver</literal> recognizes two different systemId "
+"namespaces:"
msgstr ""
-"<literal>proxy</literal> (optionnel) : indique une classe ou interface à "
-"utiliser pour l'initialisation différée des proxies. "
+"Comme mentionné précédemment, Hibernate tentera en premier lieu de résoudre "
+"les DTD dans leur classpath. Il réussit à le faire en enregistrant une "
+"implémentation personnalisée de <literal>org.xml.sax.EntityResolver</"
+"literal> avec le SAXReader qu'il utilise pour lire les fichiers xml. Cet "
+"<literal>EntityResolver</literal> personnalisé reconnaît deux espaces de "
+"nommage systemId différents :"
#. Tag: para
+#: basic_mapping.xml:3718
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
+"encounters a systemId starting with <literal>http://hibernate.sourceforge."
+"net/</literal>. The resolver attempts to resolve these entities via the "
+"classloader which loaded the Hibernate classes."
msgstr ""
-"<literal>lazy</literal> (optionnel, par défaut à <literal>true</literal>) : "
-"spécifier <literal>lazy=\"false\"</literal> désactive l'utilisation de "
-"l'extraction différée."
+"un <literal>espace de nommage hibernate</literal> est reconnu dès que le "
+"résolveur rencontre un systemId commençant par <literal>http://hibernate."
+"sourceforge.net/</literal>. Le résolveur tente alors de résoudre ces entités "
+"via le chargeur de classe qui a chargé les classes Hibernate."
#. Tag: para
+#: basic_mapping.xml:3726
#, no-c-format
msgid ""
-"Each subclass declares its own persistent properties and subclasses. "
-"<literal><version></literal> and <literal><id></literal> "
-"properties are assumed to be inherited from the root class. Each subclass in "
-"a hierarchy must define a unique <literal>discriminator-value</literal>. If "
-"this is not specified, the fully qualified Java class name is used."
+"a <literal>user namespace</literal> is recognized whenever the resolver "
+"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
+"The resolver will attempt to resolve these entities via (1) the current "
+"thread context classloader and (2) the classloader which loaded the "
+"Hibernate classes."
msgstr ""
-"Chaque sous-classe devrait déclarer ses propres propriétés persistantes et "
-"sous-classes. Les propriétés <literal><version></literal> et "
-"<literal><id></literal> sont implicitement hérités de la classe "
-"racine. Chaque sous-classe dans une hiérarchie doit définir une unique "
-"<literal>discriminator-value</literal>. Si non spécifiée, le nom complet de "
-"la classe Java est utilisé. "
+"un <literal>espace de nommage utilisateur</literal> est reconnu dès que le "
+"résolveur rencontre un systemId qui utilise un protocole URL "
+"<literal>classpath://</literal>. Le résolveur tentera alors de résoudre ces "
+"entités via (1) le chargeur de classe du contexte du thread courant et (2) "
+"le chargeur de classe qui a chargé les classes Hibernate."
#. Tag: para
+#: basic_mapping.xml:3735
#, no-c-format
+msgid "The following is an example of utilizing user namespacing:"
+msgstr "Un exemple d'utilisation de l'espace de nommage utilisateur: "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3738
+#, no-c-format
msgid ""
-"For information about inheritance mappings see <xref linkend=\"inheritance"
-"\" />."
+"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
msgstr ""
-"Pour plus d'informations sur les mappages d'héritage, consultez le <xref "
-"linkend=\"inheritance\" />. "
-#. Tag: title
-#, no-c-format
-msgid "Joined-subclass"
-msgstr "Joined-subclass"
-
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3740
+#, fuzzy, no-c-format
msgid ""
-"Each subclass can also be mapped to its own table. This is called the table-"
-"per-subclass mapping strategy. An inherited state is retrieved by joining "
-"with the table of the superclass. To do this you use the <literal><joined-"
-"subclass></literal> element. For example:"
+"Where <literal>types.xml</literal> is a resource in the <literal>your."
+"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
+"custom\">typedef</link>."
msgstr ""
-"Il est également possible de mapper chaque sous-classe vers sa propre table "
-"(stratégie de mappage de type table-per-subclass). L'état hérité est "
-"récupéré en joignant la table de la super-classe. L'élément <literal><"
-"joined-subclass></literal> est utilisé. Par exemple :"
+"Là où <literal>types.xml</literal> est une ressource dans votre paquetage "
+"<literal>your.domain</literal> et contient un <xref linkend=\"mapping-types-"
+"custom\"/> personnalisé. "
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3747
#, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
-msgstr "<literal>table</literal>: le nom de la table de la sous-classe. "
+msgid "Hibernate-mapping"
+msgstr "Hibernate-mappage"
#. Tag: para
+#: basic_mapping.xml:3749
#, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface to use "
-"for lazy initializing proxies."
+"This element has several optional attributes. The <literal>schema</literal> "
+"and <literal>catalog</literal> attributes specify that tables referred to in "
+"this mapping belong to the named schema and/or catalog. If they are "
+"specified, tablenames will be qualified by the given schema and catalog "
+"names. If they are missing, tablenames will be unqualified. The "
+"<literal>default-cascade</literal> attribute specifies what cascade style "
+"should be assumed for properties and collections that do not specify a "
+"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
+"literal> attribute allows you to use unqualified class names in the query "
+"language."
msgstr ""
-"<literal>proxy</literal> (optionnel) : indique une classe ou interface à "
-"utiliser pour l'initialisation différée des proxies. "
+"Cet élément a plusieurs attributs optionnels. Les attributs <literal>schema</"
+"literal> et <literal>catalog</literal> indiquent que les tables mentionnées "
+"dans ce mappage appartiennent au schéma nommé et/ou au catalogue. S'ils sont "
+"spécifiés, les noms de tables seront qualifiés par les noms de schéma et de "
+"catalogue. L'attribut <literal>default-cascade</literal> indique quel type "
+"de cascade sera utilisé par défaut pour les propriétés et collections qui ne "
+"précisent pas l'attribut <literal>cascade</literal>. L'attribut "
+"<literal>auto-import</literal> nous permet d'utiliser par défaut des noms de "
+"classes non qualifiés dans le langage de requête, par défaut. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3778
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
msgstr ""
-"<literal>lazy</literal> (optionnel, par défaut à <literal>true</literal>) : "
-"spécifier <literal>lazy=\"false\"</literal> désactive l'utilisation de "
-"l'extraction différée. "
#. Tag: para
+#: basic_mapping.xml:3782
#, no-c-format
-msgid ""
-"A discriminator column is not required for this mapping strategy. Each "
-"subclass must, however, declare a table column holding the object identifier "
-"using the <literal><key></literal> element. The mapping at the start "
-"of the chapter would then be re-written as:"
+msgid "<literal>schema</literal> (optional): the name of a database schema."
msgstr ""
-"Aucune colonne discriminante n'est nécessaire pour cette stratégie de "
-"mappage. Cependant, chaque sous-classe doit déclarer une colonne de table "
-"contenant l'objet identifiant qui utilise l'élément <literal><key></"
-"literal>. Le mappage au début de ce chapitre serait ré-écrit ainsi : "
+"<literal>schema</literal> (optionnel) : le nom d'un schéma de base de "
+"données. "
-#. Tag: title
-#, no-c-format
-msgid "Union-subclass"
-msgstr "Union-subclass"
-
#. Tag: para
+#: basic_mapping.xml:3787
#, no-c-format
-msgid ""
-"A third option is to map only the concrete classes of an inheritance "
-"hierarchy to tables. This is called the table-per-concrete-class strategy. "
-"Each table defines all persistent states of the class, including the "
-"inherited state. In Hibernate, it is not necessary to explicitly map such "
-"inheritance hierarchies. You can map each class with a separate <literal><"
-"class></literal> declaration. However, if you wish use polymorphic "
-"associations (e.g. an association to the superclass of your hierarchy), you "
-"need to use the <literal><union-subclass></literal> mapping. For "
-"example:"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
msgstr ""
-"Une troisième option est de mapper uniquement les classes concrètes d'une "
-"hiérarchie d'héritage vers des tables, (stratégie de type table-per-concrete-"
-"class) où chaque table définit tous les états persistants de la classe, y "
-"compris les états hérités. Dans Hibernate il n'est absolument pas nécessaire "
-"de mapper explicitement de telles hiérarchies d'héritage. Vous pouvez "
-"simplement mapper chaque classe avec une déclaration <literal><class></"
-"literal> différente. Cependant, si vous souhaitez utiliser des associations "
-"polymorphiques (c'est-à-dire une association vers la superclasse de votre "
-"hiérarchie), vous devez utiliser le mappage <literal><union-subclass></"
-"literal>. Par exemple :"
+"<literal>catalog</literal> (optionnel) : le nom d'un catalogue de base de "
+"données. "
#. Tag: para
+#: basic_mapping.xml:3792
#, no-c-format
msgid ""
-"No discriminator column or key column is required for this mapping strategy."
+"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
+"literal>): a default cascade style."
msgstr ""
-"Aucune colonne discriminante ou colonne clé n'est requise pour cette "
-"stratégie de mappage."
+"<literal>default-cascade</literal> (optionnel - par défaut vaut : "
+"<literal>none</literal>) : un type de cascade par défaut. "
-#. Tag: title
-#, no-c-format
-msgid "Join"
-msgstr "Join"
-
#. Tag: para
+#: basic_mapping.xml:3797
#, no-c-format
msgid ""
-"Using the <literal><join></literal> element, it is possible to map "
-"properties of one class to several tables that have a one-to-one "
-"relationship. For example:"
+"<literal>default-access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing all properties. "
+"It can be a custom implementation of <literal>PropertyAccessor</literal>."
msgstr ""
-"En utilisant l'élément <literal><join></literal>, il est possible de "
-"mapper des propriétés d'une classe sur plusieurs tables quand il existe une "
-"relation un-à-un entre les tables. Par exemple :"
+"<literal>default-access</literal> (optionnel - par défaut vaut : "
+"<literal>property</literal>) : Comment hibernate accèdera aux propriétés. On "
+"peut aussi redéfinir sa propre implémentation de <literal>PropertyAccessor</"
+"literal>. "
#. Tag: para
+#: basic_mapping.xml:3804
#, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
-msgstr "<literal>table</literal> : le nom de la table jointe. "
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"if set to <literal>join</literal>, the default, Hibernate will use an inner "
-"join to retrieve a <literal><join></literal> defined by a class or its "
-"superclasses. It will use an outer join for a <literal><join></"
-"literal> defined by a subclass. If set to <literal>select</literal> then "
-"Hibernate will use a sequential select for a <literal><join></literal> "
-"defined on a subclass. This will be issued only if a row represents an "
-"instance of the subclass. Inner joins will still be used to retrieve a "
-"<literal><join></literal> defined by the class and its superclasses."
+"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
+"literal>): the default value for unspecified <literal>lazy</literal> "
+"attributes of class and collection mappings."
msgstr ""
-"<literal>fetch</literal> (optionnel - par défaut à <literal>join</"
-"literal>) : si positionné à <literal>join</literal>, Hibernate utilisera une "
-"jointure interne pour charger une <literal>jointure</literal> définie par "
-"une classe ou ses super-classes et une jointure externe pour une "
-"<literal><jointure></literal> définie par une sous-classe. Si "
-"positionné à <literal>select</literal>, Hibernate utilisera un select "
-"séquentiel pour une <literal><jointure></literal> définie sur une sous-"
-"classe, qui ne sera délivrée que si une ligne représente une instance de la "
-"sous-classe. Les jointures internes seront quand même utilisées pour charger "
-"une <literal><jointure></literal> définie par une classe et ses super-"
-"classes. "
+"<literal>default-lazy</literal> (optionnel - par défaut vaut : "
+"<literal>true</literal>) : Valeur par défaut pour des attributs "
+"<literal>lazy</literal> non spécifiés des mappages de classe et de "
+"collection. "
#. Tag: para
+#: basic_mapping.xml:3811
#, no-c-format
msgid ""
-"<literal>inverse</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will not insert or update the properties "
-"defined by this join."
+"<literal>auto-import</literal> (optional - defaults to <literal>true</"
+"literal>): specifies whether we can use unqualified class names of classes "
+"in this mapping in the query language."
msgstr ""
-"<literal>inverse</literal> (optionnel - par défaut à <literal>false</"
-"literal>) : si positionné à true, Hibernate n'essaiera pas d'insérer ou de "
-"mettre à jour les propriétés définies par cette jointure. "
+"<literal>auto-import</literal> (optionnel - par défaut vaut : <literal>true</"
+"literal>) : spécifie si l'on peut utiliser des noms de classes non qualifiés "
+"(de classes de ce mappage) dans le langage de requête. "
#. Tag: para
+#: basic_mapping.xml:3818
#, no-c-format
msgid ""
-"<literal>optional</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will insert a row only if the properties "
-"defined by this join are non-null. It will always use an outer join to "
-"retrieve the properties."
+"<literal>package</literal> (optional): specifies a package prefix to use for "
+"unqualified class names in the mapping document."
msgstr ""
-"<literal>optionnel</literal> (optionnel - par défaut à <literal>false</"
-"literal>) : si positionné à true, Hibernate insèrera une ligne seulement si "
-"les propriétés définies par cette jointure sont non-nulles et utilisera "
-"toujours une jointure externe pour extraire les propriétés. "
+"<literal>package</literal> (optionnel) : préfixe de paquetage par défaut "
+"pour les noms de classe non qualifiés du document de mappage. "
#. Tag: para
+#: basic_mapping.xml:3825
#, no-c-format
msgid ""
-"For example, address information for a person can be mapped to a separate "
-"table while preserving value type semantics for all properties:"
+"If you have two persistent classes with the same unqualified name, you "
+"should set <literal>auto-import=\"false\"</literal>. An exception will "
+"result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
-"Par exemple, les informations d'adresse pour une personne peuvent être "
-"mappées vers une table séparée (tout en préservant des sémantiques de type "
-"valeur pour toutes ses propriétés) : "
+"Si deux classes persistantes possèdent le même nom de classe (non qualifié), "
+"vous devez configurer <literal>auto-import=\"false\"</literal>. Hibernate "
+"lancera une exception si vous essayez d'assigner le même nom \"importé\" à "
+"deux classes."
#. Tag: para
+#: basic_mapping.xml:3830
#, no-c-format
msgid ""
-"This feature is often only useful for legacy data models. We recommend fewer "
-"tables than classes and a fine-grained domain model. However, it is useful "
-"for switching between inheritance mapping strategies in a single hierarchy, "
-"as explained later."
+"The <literal>hibernate-mapping</literal> element allows you to nest several "
+"persistent <literal><class></literal> mappings, as shown above. It is, "
+"however, good practice (and expected by some tools) to map only a single "
+"persistent class, or a single class hierarchy, in one mapping file and name "
+"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
+"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
+"<literal>Animal.hbm.xml</literal>."
msgstr ""
-"Cette fonctionnalité est souvent seulement utile pour les modèles de données "
-"hérités d'anciens systèmes, nous recommandons d'utiliser moins de tables que "
-"de classes et un modèle de domaine à granularité fine. Cependant, c'est "
-"utile pour passer d'une stratégie de mappage d'héritage à une autre dans une "
-"hiérarchie simple, comme nous le verrons plus tard. "
+"Notez que l'élément <literal>hibernate-mappage</literal> vous permet "
+"d'imbriquer plusieurs mappages de <literal><class></literal> "
+"persistantes, comme dans l'exemple ci-dessus. Cependant il est recommandé "
+"(et c'est parfois une exigence de certains outils) de mapper une seule "
+"classe persistante (ou une seule hiérarchie de classes) par fichier de "
+"mappage et de nommer ce fichier d'après le nom de la superclasse "
+"persistante, par exemple <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm."
+"xml</literal>, ou en cas d'héritage, <literal>Animal.hbm.xml</literal>. "
#. Tag: title
+#: basic_mapping.xml:3841
#, no-c-format
-msgid "Key"
-msgstr "Key"
+msgid "<title>Key</title>"
+msgstr ""
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3843
+#, fuzzy, no-c-format
msgid ""
-"The <literal><key></literal> element has featured a few times within "
+"The <literal><key></literal> element is featured a few times within "
"this guide. It appears anywhere the parent mapping element defines a join to "
"a new table that references the primary key of the original table. It also "
"defines the foreign key in the joined table:"
@@ -3224,7 +7685,22 @@
"définit une jointure sur une nouvelle table, et définit la clé étrangère "
"dans la table jointe, qui référence la clé primaire de la table d'origine :"
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, no-c-format
+msgid ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3874
#, no-c-format
msgid ""
"<literal>on-delete</literal> (optional - defaults to <literal>noaction</"
@@ -3236,6 +7712,7 @@
"au niveau base de données de suppression en cascade. "
#. Tag: para
+#: basic_mapping.xml:3880
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): specifies that the foreign key "
@@ -3247,6 +7724,7 @@
"d'origine (Pour les données d'anciens systèmes). "
#. Tag: para
+#: basic_mapping.xml:3886
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): specifies that the foreign key "
@@ -3258,6 +7736,7 @@
"fait partie de la clé primaire). "
#. Tag: para
+#: basic_mapping.xml:3892
#, no-c-format
msgid ""
"<literal>update</literal> (optional): specifies that the foreign key should "
@@ -3269,6 +7748,7 @@
"primaire). "
#. Tag: para
+#: basic_mapping.xml:3898
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): specifies that the foreign key should "
@@ -3280,6 +7760,7 @@
"la clé primaire). "
#. Tag: para
+#: basic_mapping.xml:3905
#, no-c-format
msgid ""
"For systems where delete performance is important, we recommend that all "
@@ -3298,6 +7779,7 @@
"versionnées. "
#. Tag: para
+#: basic_mapping.xml:3913
#, no-c-format
msgid ""
"The <literal>not-null</literal> and <literal>update</literal> attributes are "
@@ -3313,52 +7795,13 @@
"<literal><key not-null=\"true\"></literal>. "
#. Tag: title
+#: basic_mapping.xml:3922
#, no-c-format
-msgid "Column and formula elements"
-msgstr "Éléments column et formula "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Mapping elements which accept a <literal>column</literal> attribute will "
-"alternatively accept a <literal><column></literal> subelement. "
-"Likewise, <literal><formula></literal> is an alternative to the "
-"<literal>formula</literal> attribute. For example:"
-msgstr ""
-"Tout élément de mappage qui accepte un attribut <literal>column</literal> "
-"acceptera alternativement un sous-élément <literal><column></literal>. "
-"Pareillement <literal><formula></literal> est une alternative à "
-"l'attribut <literal>formula</literal>. Par exemple :"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Most of the attributes on <literal>column</literal> provide a means of "
-"tailoring the DDL during automatic schema generation. The <literal>read</"
-"literal> and <literal>write</literal> attributes allow you to specify custom "
-"SQL that Hibernate will use to access the column's value. For more on this, "
-"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
-"read and write expressions</link>."
-msgstr ""
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"The <literal>column</literal> and <literal>formula</literal> elements can "
-"even be combined within the same property or association mapping to express, "
-"for example, exotic join conditions."
-msgstr ""
-"Les attributs <literal>column</literal> et <literal>formula</literal> "
-"peuvent même être combinés au sein d'une même propriété ou mappage "
-"d'association pour exprimer, par exemple, des conditions de jointure "
-"exotiques. "
-
-#. Tag: title
-#, no-c-format
msgid "Import"
msgstr "Import"
#. Tag: para
+#: basic_mapping.xml:3924
#, no-c-format
msgid ""
"If your application has two persistent classes with the same name, and you "
@@ -3374,13 +7817,31 @@
"literal>.Vous pouvez même importer des classes et interfaces qui ne sont pas "
"mappées explicitement :"
+#. Tag: programlisting
+#: basic_mapping.xml:3930
+#, no-c-format
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3939
+#, no-c-format
+msgid ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3943
#, no-c-format
msgid ""
"<literal>class</literal>: the fully qualified class name of any Java class."
msgstr "<literal>class</literal> : nom complet de toute classe Java. "
#. Tag: para
+#: basic_mapping.xml:3948
#, no-c-format
msgid ""
"<literal>rename</literal> (optional - defaults to the unqualified class "
@@ -3389,102 +7850,108 @@
"<literal>rename</literal> (optionnel - par défaut vaut le nom de la classe "
"non qualifié): nom pouvant être utilisé dans le langage de requête. "
+#. Tag: para
+#: basic_mapping.xml:3956
+#, no-c-format
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3962
#, no-c-format
-msgid "Any"
-msgstr "Any"
+msgid "Column and formula elements"
+msgstr "Éléments column et formula "
#. Tag: para
+#: basic_mapping.xml:3964
#, no-c-format
msgid ""
-"There is one more type of property mapping. The <literal><any></"
-"literal> mapping element defines a polymorphic association to classes from "
-"multiple tables. This type of mapping requires more than one column. The "
-"first column contains the type of the associated entity. The remaining "
-"columns contain the identifier. It is impossible to specify a foreign key "
-"constraint for this kind of association. This is not the usual way of "
-"mapping polymorphic associations and you should use this only in special "
-"cases. For example, for audit logs, user session data, etc."
+"Mapping elements which accept a <literal>column</literal> attribute will "
+"alternatively accept a <literal><column></literal> subelement. "
+"Likewise, <literal><formula></literal> is an alternative to the "
+"<literal>formula</literal> attribute. For example:"
msgstr ""
-"Il existe encore un type de mappage de propriété. L'élément de mappage "
-"<literal><any></literal> définit une association polymorphique vers "
-"des classes de tables multiples. 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'identifiant. Il est impossible de "
-"spécifier une contrainte de clé étrangère pour ce type d'association, donc "
-"ce n'est certainement pas considéré comme le moyen habituel de mapper des "
-"associations (polymorphiques). Ne doit être utilisé que dans des cas "
-"particuliers (par exemple des logs d'audit, des données de session "
-"utilisateur, etc...). "
+"Tout élément de mappage qui accepte un attribut <literal>column</literal> "
+"acceptera alternativement un sous-élément <literal><column></literal>. "
+"Pareillement <literal><formula></literal> est une alternative à "
+"l'attribut <literal>formula</literal>. Par exemple :"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3970
#, no-c-format
msgid ""
-"The <literal>meta-type</literal> attribute allows the application to specify "
-"a custom type that maps database column values to persistent classes that "
-"have identifier properties of the type specified by <literal>id-type</"
-"literal>. You must specify the mapping from values of the meta-type to class "
-"names."
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"\n"
+" read=\"SQL expression\"\n"
+" write=\"SQL expression\"/>"
msgstr ""
-"L'attribut <literal>meta-type</literal> permet à l'application de spécifier "
-"un type personnalisé qui mappe des valeurs de colonnes de base de données "
-"sur des classes persistantes qui ont un attribut identifiant du type "
-"spécifié par <literal>id-type</literal>. Vous devez spécifier le mappage à "
-"partir de valeurs du méta-type sur les noms des classes. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3972
#, no-c-format
-msgid "<literal>name</literal>: the property name."
-msgstr "<literal>name</literal> : le nom de la propriété. "
+msgid "<formula>SQL expression</formula>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "<literal>id-type</literal>: the identifier type."
-msgstr "<literal>id-type</literal> : le type identifiant."
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>meta-type</literal> (optional - defaults to <literal>string</"
-"literal>): any type that is allowed for a discriminator mapping."
+"Most of the attributes on <literal>column</literal> provide a means of "
+"tailoring the DDL during automatic schema generation. The <literal>read</"
+"literal> and <literal>write</literal> attributes allow you to specify custom "
+"SQL that Hibernate will use to access the column's value. For more on this, "
+"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
+"read and write expressions</link>."
msgstr ""
-"<literal>meta-type</literal> (optionnel - par défaut à <literal>string</"
-"literal>) : tout type permis pour un mappage par discriminateur."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3982
+#, fuzzy, no-c-format
msgid ""
-"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
-"the cascade style."
+"The <literal>column</literal> and <literal>formula</literal> elements can "
+"even be combined within the same property or association mapping to express, "
+"for example, exotic join conditions."
msgstr ""
-"<literal>cascade</literal> (optionnel - par défaut à <literal>none</"
-"literal>) : le style de cascade. "
+"Les attributs <literal>column</literal> et <literal>formula</literal> "
+"peuvent même être combinés au sein d'une même propriété ou mappage "
+"d'association pour exprimer, par exemple, des conditions de jointure "
+"exotiques. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3986
#, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this property either do or do not "
-"require acquisition of the optimistic lock. It defines whether a version "
-"increment should occur if this property is dirty."
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
msgstr ""
-"<literal>optimistic-lock</literal> (optionnel - par défaut à <literal>true</"
-"literal>) : indique si les mise à jour sur cette propriété nécessitent ou "
-"non l'acquisition d'un verrou optimiste. En d'autres termes, définit si un "
-"incrément de version doit avoir lieu quand cette propriété est marquée "
-"dirty. "
#. Tag: title
+#: basic_mapping.xml:3992
#, no-c-format
msgid "Hibernate types"
msgstr "Types Hibernate "
#. Tag: title
+#: basic_mapping.xml:3995
#, no-c-format
msgid "Entities and values"
msgstr "Entités et valeurs"
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
msgid ""
"In relation to the persistence service, Java language-level objects are "
@@ -3494,6 +7961,7 @@
"niveau langage Java :"
#. Tag: para
+#: basic_mapping.xml:4000
#, no-c-format
msgid ""
"An <emphasis>entity</emphasis> exists independently of any other objects "
@@ -3518,6 +7986,7 @@
"partagées. Elles peuvent aussi être versionnées."
#. Tag: para
+#: basic_mapping.xml:4010
#, no-c-format
msgid ""
"An entity's persistent state consists of references to other entities and "
@@ -3542,6 +8011,7 @@
"partagées par deux entités ou collections. "
#. Tag: para
+#: basic_mapping.xml:4020
#, no-c-format
msgid ""
"Until now, we have been using the term \"persistent class\" to refer to "
@@ -3572,12 +8042,14 @@
"l'agrégation se traduit en général par une valeur type. "
#. Tag: para
+#: basic_mapping.xml:4033
#, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
msgstr ""
"Nous nous pencherons sur ces deux concepts tout au long de la documentation. "
#. Tag: para
+#: basic_mapping.xml:4036
#, no-c-format
msgid ""
"The challenge is to map the Java type system, and the developers' definition "
@@ -3605,6 +8077,7 @@
"nous le verrons plus tard. "
#. Tag: para
+#: basic_mapping.xml:4049
#, no-c-format
msgid ""
"With the exception of collections, all built-in Hibernate types support null "
@@ -3614,11 +8087,13 @@
"sémantiques null. "
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
msgid "Basic value types"
msgstr "Types valeurs de base "
#. Tag: para
+#: basic_mapping.xml:4056
#, no-c-format
msgid ""
"The built-in <emphasis>basic mapping types</emphasis> can be roughly "
@@ -3627,16 +8102,18 @@
"Les <emphasis>types de mappage de base</emphasis> peuvent être classés de la "
"façon suivante :"
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4059
+#, fuzzy, no-c-format
msgid ""
-"<literal>integer, long, short, float, double, character, byte, boolean, "
-"yes_no, true_false</literal>"
+"integer, long, short, float, double, character, byte, boolean, yes_no, "
+"true_false"
msgstr ""
"<literal>integer, long, short, float, double, character, byte, boolean, "
"yes_no, true_false</literal>"
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
msgid ""
"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
@@ -3650,12 +8127,14 @@
"des alternatives pour les types Java <literal>boolean</literal> ou "
"<literal>java.lang.Boolean</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4073
#, no-c-format
-msgid "<literal>string</literal>"
-msgstr "<literal>string</literal>"
+msgid "string"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</"
@@ -3664,12 +8143,14 @@
"Mappage de type de <literal>java.lang.String</literal> vers "
"<literal>VARCHAR</literal> (ou le <literal>VARCHAR2</literal> Oracle)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4083
+#, fuzzy, no-c-format
+msgid "date, time, timestamp"
msgstr "<literal>date, time, timestamp</literal>"
#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Date</literal> and its subclasses to "
@@ -3680,12 +8161,14 @@
"vers les types SQL <literal>DATE</literal>, <literal>TIME</literal> et "
"<literal>TIMESTAMP</literal> (ou équivalent)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4094
+#, fuzzy, no-c-format
+msgid "calendar, calendar_date"
msgstr "<literal>calendar, calendar_date</literal>"
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Calendar</literal> to SQL types "
@@ -3694,12 +8177,14 @@
"mappages de type pour <literal>java.util.Calendar</literal> vers les types "
"SQL <literal>TIMESTAMP</literal> et <literal>DATE</literal> (ou équivalent)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4104
+#, fuzzy, no-c-format
+msgid "big_decimal, big_integer"
msgstr "<literal>big_decimal, big_integer</literal>"
#. Tag: para
+#: basic_mapping.xml:4107
#, no-c-format
msgid ""
"Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java."
@@ -3710,12 +8195,14 @@
"math.BigInteger</literal> vers <literal>NUMERIC</literal> (ou le "
"<literal>NUMBER</literal> Oracle)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4115
+#, fuzzy, no-c-format
+msgid "locale, timezone, currency"
msgstr "<literal>locale, timezone, currency</literal>"
#. Tag: para
+#: basic_mapping.xml:4118
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Locale</literal>, <literal>java.util."
@@ -3732,12 +8219,14 @@
"mappées sur leurs codes ISO. Les instances de <literal>TimeZone</literal> "
"sont mappées sur leur <literal>ID</literal>."
-#. Tag: term
-#, no-c-format
-msgid "<literal>class</literal>"
-msgstr "<literal>class</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4131
+#, fuzzy, no-c-format
+msgid "class"
+msgstr "Classe"
#. Tag: para
+#: basic_mapping.xml:4134
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</"
@@ -3748,22 +8237,26 @@
"<literal>VARCHAR</literal> (ou le <literal>VARCHAR2</literal> Oracle). Un "
"objet <literal>Class</literal> est mappé sur son nom Java complet."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4142
#, no-c-format
-msgid "<literal>binary</literal>"
-msgstr "<literal>binary</literal>"
+msgid "binary"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4145
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr "Mappe les tableaux de bytes vers le type binaire SQL approprié."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4150
#, no-c-format
-msgid "<literal>text</literal>"
-msgstr "<literal>text</literal>"
+msgid "text"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4153
#, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</"
@@ -3772,12 +8265,14 @@
"Mappe les longues chaînes de caractères Java vers les types SQL "
"<literal>CLOB</literal> ou <literal>TEXT</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4159
#, no-c-format
-msgid "<literal>serializable</literal>"
-msgstr "<literal>serializable</literal>"
+msgid "serializable"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4162
#, no-c-format
msgid ""
"Maps serializable Java types to an appropriate SQL binary type. You can also "
@@ -3789,12 +8284,14 @@
"le nom d'une classe Java sérialisable ou une interface qui ne soit pas par "
"défaut un type de base. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4171
#, no-c-format
-msgid "<literal>clob, blob</literal>"
-msgstr "<literal>clob, blob</literal>"
+msgid "clob, blob"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4174
#, no-c-format
msgid ""
"Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and "
@@ -3808,16 +8305,18 @@
"réutilisable en dehors d'une transaction (de plus l'implémentation par les "
"pilotes comporte des lacunes)."
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4184
+#, fuzzy, no-c-format
msgid ""
-"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
-"imm_serializable, imm_binary</literal>"
+"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary"
msgstr ""
"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary</literal>"
#. Tag: para
+#: basic_mapping.xml:4188
#, no-c-format
msgid ""
"Type mappings for what are considered mutable Java types. This is where "
@@ -3838,6 +8337,7 @@
"assigner un nouvel (non identique) objet à la propriété. "
#. Tag: para
+#: basic_mapping.xml:4200
#, no-c-format
msgid ""
"Unique identifiers of entities and collections can be of any basic type "
@@ -3851,6 +8351,7 @@
"composites sont aussi permis, voir plus bas). "
#. Tag: para
+#: basic_mapping.xml:4205
#, no-c-format
msgid ""
"The basic value types have corresponding <literal>Type</literal> constants "
@@ -3864,11 +8365,13 @@
"<literal>string</literal>. "
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
msgid "Custom value types"
msgstr "Types de valeur personnalisés"
#. Tag: para
+#: basic_mapping.xml:4214
#, no-c-format
msgid ""
"It is relatively easy for developers to create their own value types. For "
@@ -3893,6 +8396,7 @@
"literal>, <literal>SURNAME</literal>. "
#. Tag: para
+#: basic_mapping.xml:4225
#, no-c-format
msgid ""
"To implement a custom type, implement either <literal>org.hibernate."
@@ -3907,7 +8411,19 @@
"classes complets du type. Consultez <literal>org.hibernate.test."
"DoubleStringType</literal> pour étudier les possibilités. "
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, no-c-format
+msgid ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4234
#, no-c-format
msgid ""
"Notice the use of <literal><column></literal> tags to map a property "
@@ -3917,6 +8433,7 @@
"mapper une propriété sur des colonnes multiples."
#. Tag: para
+#: basic_mapping.xml:4237
#, no-c-format
msgid ""
"The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</"
@@ -3930,6 +8447,7 @@
"plus spécialisées. "
#. Tag: para
+#: basic_mapping.xml:4243
#, no-c-format
msgid ""
"You can even supply parameters to a <literal>UserType</literal> in the "
@@ -3945,7 +8463,19 @@
"propre, vous pouvez utiliser l'élément <literal><type></literal> dans "
"vos fichiers de mappage. "
+#. Tag: programlisting
+#: basic_mapping.xml:4250
+#, no-c-format
+msgid ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4252
#, no-c-format
msgid ""
"The <literal>UserType</literal> can now retrieve the value for the parameter "
@@ -3957,6 +8487,7 @@
"<literal>Properties</literal> qui lui est passé. "
#. Tag: para
+#: basic_mapping.xml:4256
#, no-c-format
msgid ""
"If you regularly use a certain <literal>UserType</literal>, it is useful to "
@@ -3971,7 +8502,24 @@
"d'assigner un nom à votre type propre et peuvent aussi contenir une liste de "
"valeurs de paramètres par défaut si ce type est paramétré. "
+#. Tag: programlisting
+#: basic_mapping.xml:4262
+#, no-c-format
+msgid ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:4264
+#, no-c-format
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4266
#, no-c-format
msgid ""
"It is also possible to override the parameters supplied in a typedef on a "
@@ -3982,6 +8530,7 @@
"propriété. "
#. Tag: para
+#: basic_mapping.xml:4270
#, no-c-format
msgid ""
"Even though Hibernate's rich range of built-in types and support for "
@@ -4005,11 +8554,13 @@
"changements futurs dans votre façon de représenter des valeurs monétaires. "
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
msgid "Mapping a class more than once"
msgstr "Mapper une classe plus d'une fois"
#. Tag: para
+#: basic_mapping.xml:4285
#, no-c-format
msgid ""
"It is possible to provide more than one mapping for a particular persistent "
@@ -4027,7 +8578,31 @@
"écrivez des requêtes ou quand vous mappez des associations vers les entités "
"nommées. "
+#. Tag: programlisting
+#: basic_mapping.xml:4293
+#, no-c-format
+msgid ""
+"<class name=\"Contract\" table=\"Contracts\"\n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\"\n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\"\n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\"\n"
+" column=\"currentContractId\"\n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4295
#, no-c-format
msgid ""
"Associations are now specified using <literal>entity-name</literal> instead "
@@ -4036,12 +8611,20 @@
"Remarquez comment les associations sont désormais spécifiées en utilisant "
"<literal>entity-name</literal> au lieu de <literal>class</literal>. "
+#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
+#, no-c-format
+msgid "This feature is not supported in Annotations"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
msgid "SQL quoted identifiers"
msgstr "SQL quoted identifiers"
#. Tag: para
+#: basic_mapping.xml:4306
#, no-c-format
msgid ""
"You can force Hibernate to quote an identifier in the generated SQL by "
@@ -4056,101 +8639,32 @@
"pour le SQL <literal>Dialect</literal> (habituellement des doubles quotes, "
"mais des parenthèses pour SQL Server et des backticks pour MySQL). "
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:4312
#, no-c-format
-msgid "Metadata alternatives"
-msgstr "Métadonnées alternatives"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"XML does not suit all users so there are some alternative ways to define O/R "
-"mapping metadata in Hibernate."
+"@Entity @Table(name=\"`Line Item`\")\n"
+"class LineItem {\n"
+" @id @Column(name=\"`Item Id`\") Integer id;\n"
+" @Column(name=\"`Item #`\") int itemNumber\n"
+"}\n"
+"\n"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"XML ne convient pas à tout le monde, il y a donc des moyens alternatifs pour "
-"définir des métadonnées de mappage O/R dans Hibernate. "
#. Tag: title
+#: basic_mapping.xml:4316
#, no-c-format
-msgid "Using XDoclet markup"
-msgstr "Utilisation de XDoclet "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Many Hibernate users prefer to embed mapping information directly in "
-"sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover "
-"this approach in this reference guide since it is considered part of "
-"XDoclet. However, we include the following example of the <literal>Cat</"
-"literal> class with XDoclet mappings:"
-msgstr ""
-"De nombreux utilisateurs de Hibernate préfèrent embarquer les informations "
-"de mappages directement au sein du code source en utilisant lesbalises "
-"XDoclet <literal>@hibernate.tags</literal>. Nous ne couvrons pas cette "
-"approche dans ce document puisque cela est considéré comme faisant partie de "
-"XDoclet. Cependant, nous présentons l'exemple suivant de la classe "
-"<literal>Cat</literal> avec des mappages XDoclet :"
-
-#. Tag: para
-#, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr ""
-"Voyez le site web de Hibernate pour plus d'exemples sur XDoclet et "
-"Hibernate. "
-
-#. Tag: title
-#, no-c-format
-msgid "Using JDK 5.0 Annotations"
-msgstr "Utilisation des annotations JDK 5.0"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"JDK 5.0 introduced XDoclet-style annotations at the language level that are "
-"type-safe and checked at compile time. This mechanism is more powerful than "
-"XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, "
-"for example, supports auto-completion and syntax highlighting of JDK 5.0 "
-"annotations. The new revision of the EJB specification (JSR-220) uses JDK "
-"5.0 annotations as the primary metadata mechanism for entity beans. "
-"Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the "
-"persistence API). Support for mapping metadata is available via the "
-"<emphasis>Hibernate Annotations</emphasis> package as a separate download. "
-"Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
-msgstr ""
-"Le JDK 5.0 introduit des annotations proches de celles de XDoclet au niveau "
-"java, qui sont type-safe et vérifiées à la compilation. Ce mécanisme est "
-"plus puissant que XDoclet et mieux supporté par les outils et les IDE. "
-"IntelliJ IDEA, par exemple, supporte l'auto-complétion et le surlignement "
-"syntaxique des annotations JDK 5.0. La nouvelle révision des spécifications "
-"des EJB (JSR-220) utilise les annotations JDK 5.0 comme mécanisme primaire "
-"pour les metadonnées des beans entités. Hibernate3 implémente "
-"l'<literal>EntityManager</literal> de la JSR-220 (API de persistance), le "
-"support du mappage de métadonnées est disponible via le paquetage "
-"<emphasis>Hibernate Annotations</emphasis>, en tant que module séparé à "
-"télécharger. EJB3 (JSR-220) et les métadonnées Hibernate3 sont supportés. "
-
-#. Tag: para
-#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
-msgstr "Ceci est un exemple d'une classe POJO annotée comme un EJB entité :"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Support for JDK 5.0 Annotations (and JSR-220) is currently under "
-"development. Please refer to the Hibernate Annotations module for more "
-"details."
-msgstr ""
-"Notez que le support des annotations JDK 5.0 (et de la JSR-220) est encore "
-"en cours et n'est pas terminé. Référez vous au module Hibernate Annotation "
-"pour plus d'informations. "
-
-#. Tag: title
-#, no-c-format
msgid "Generated properties"
msgstr "Propriétés générées "
#. Tag: para
+#: basic_mapping.xml:4318
#, no-c-format
msgid ""
"Generated properties are properties that have their values generated by the "
@@ -4172,6 +8686,7 @@
"les valeurs générées. "
#. Tag: para
+#: basic_mapping.xml:4327
#, fuzzy, no-c-format
msgid ""
"Properties marked as generated must additionally be non-insertable and non-"
@@ -4187,6 +8702,7 @@
"property\" /> peuvent être marqués comme générés. "
#. Tag: para
+#: basic_mapping.xml:4334
#, no-c-format
msgid ""
"<literal>never</literal> (the default): the given property value is not "
@@ -4196,6 +8712,7 @@
"propriété n'est pas générée dans la base de données. "
#. Tag: para
+#: basic_mapping.xml:4337
#, fuzzy, no-c-format
msgid ""
"<literal>insert</literal>: the given property value is generated on insert, "
@@ -4214,6 +8731,7 @@
"générées, cette option n'est pas disponible."
#. Tag: para
+#: basic_mapping.xml:4344
#, no-c-format
msgid ""
"<literal>always</literal>: the property value is generated both on insert "
@@ -4222,24 +8740,43 @@
"<literal>always</literal> - indique que la valeur de la propriété est "
"générée à l'insertion comme aux mise à jour. "
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4354
#, no-c-format
msgid ""
"Hibernate allows you to customize the SQL it uses to read and write the "
"values of columns mapped to <link linkend=\"mapping-declaration-property"
"\">simple properties</link>. For example, if your database provides a set of "
"data encryption functions, you can invoke them for individual columns like "
-"this: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"this:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4359
+#, no-c-format
+msgid ""
+"<property name=\"creditCardNumber\">\n"
+" <column \n"
+" name=\"credit_card_num\"\n"
+" read=\"decrypt(credit_card_num)\"\n"
+" write=\"encrypt(?)\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
msgid ""
"Hibernate applies the custom expressions automatically whenever the property "
@@ -4248,6 +8785,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
msgid ""
"The property is backed by one or more columns that are exported as part of "
@@ -4255,11 +8793,13 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
msgid ""
"The <literal>write</literal> expression, if specified, must contain exactly "
@@ -4267,11 +8807,13 @@
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4384
#, no-c-format
msgid "Auxiliary database objects"
msgstr "Objets auxiliaires de la base de données "
#. Tag: para
+#: basic_mapping.xml:4386
#, no-c-format
msgid ""
"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
@@ -4294,6 +8836,7 @@
"objets auxiliaires de base de données :"
#. Tag: para
+#: basic_mapping.xml:4396
#, no-c-format
msgid ""
"The first mode is to explicitly list the CREATE and DROP commands in the "
@@ -4302,7 +8845,21 @@
"Le premier mode est de lister explicitement les commandes CREATE et DROP "
"dans le fichier de mappage : "
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4401
#, no-c-format
msgid ""
"The second mode is to supply a custom class that constructs the CREATE and "
@@ -4314,7 +8871,20 @@
"implémenter l'interface <literal>org.hibernate.mappage."
"AuxiliaryDatabaseObject</literal>. "
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4408
#, no-c-format
msgid ""
"Additionally, these database objects can be optionally scoped so that they "
@@ -4322,3 +8892,392 @@
msgstr ""
"De plus, ces objets de base de données peuvent être optionnellement traités "
"selon l'utilisation de dialectes particuliers. "
+
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
+">\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#~ msgid ""
+#~ "Use of <literal>select-before-update</literal> will usually decrease "
+#~ "performance. It is useful to prevent a database update trigger being "
+#~ "called unnecessarily if you reattach a graph of detached instances to a "
+#~ "<literal>Session</literal>."
+#~ msgstr ""
+#~ "L'utilisation de <literal>select-before-update</literal> va généralement "
+#~ "faire baisser les performances. Ce paramètre est pratique pour éviter "
+#~ "l'appel inutile par un déclenchement de mise à jour de base de donnée, "
+#~ "quand on ré-attache un graphe d'instances à une <literal>Session</"
+#~ "literal>."
+
+#~ msgid "Generator"
+#~ msgstr "Generator"
+
+#~ msgid "<literal>increment</literal>"
+#~ msgstr "<literal>increment</literal>"
+
+#~ msgid "<literal>identity</literal>"
+#~ msgstr "<literal>identity</literal>"
+
+#~ msgid "<literal>sequence</literal>"
+#~ msgstr "<literal>sequence</literal>"
+
+#~ msgid "<literal>seqhilo</literal>"
+#~ msgstr "<literal>seqhilo</literal>"
+
+#~ msgid "<literal>uuid</literal>"
+#~ msgstr "<literal>uuid</literal>"
+
+#~ msgid ""
+#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
+#~ "are unique within a network (the IP address is used). The UUID is encoded "
+#~ "as a string of 32 hexadecimal digits in length."
+#~ msgstr ""
+#~ "utilise un algorithme de type UUID 128 bits pour générer des identifiants "
+#~ "de type string, unique au sein d'un réseau (l'adresse IP est utilisée). "
+#~ "Le UUID est encodé en une chaîne de nombre héxadécimaux de longueur 32. "
+
+#~ msgid "<literal>guid</literal>"
+#~ msgstr "<literal>guid</literal>"
+
+#~ msgid "<literal>native</literal>"
+#~ msgstr "<literal>native</literal>"
+
+#~ msgid "<literal>select</literal>"
+#~ msgstr "<literal>select</literal>"
+
+#~ msgid "<literal>foreign</literal>"
+#~ msgstr "<literal>foreign</literal>"
+
+#~ msgid ""
+#~ "<literal>optimizer</literal> (optional - defaults to <literal>none</"
+#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
+#~ msgstr ""
+#~ "<literal>optimizer</literal> (en option - valeur par défaut = "
+#~ "<literal>none</literal>): Voir <xref linkend=\"mapping-declaration-id-"
+#~ "enhanced-optimizers\" />"
+
+#~ msgid "composite-id"
+#~ msgstr "composite-id"
+
+#~ msgid ""
+#~ "A table with a composite key can be mapped with multiple properties of "
+#~ "the class as identifier properties. The <literal><composite-id></"
+#~ "literal> element accepts <literal><key-property></literal> property "
+#~ "mappings and <literal><key-many-to-one></literal> mappings as child "
+#~ "elements."
+#~ msgstr ""
+#~ "Pour une table avec clé composée, vous pouvez mapper plusieurs attributs "
+#~ "de la classe comme propriétés identifiantes. L'élément <literal><"
+#~ "composite-id></literal> accepte les mappages de propriétés "
+#~ "<literal><key-property></literal> et les mappages <literal><key-"
+#~ "many-to-one></literal> comme éléments enfants. "
+
+#~ msgid ""
+#~ "The persistent class <emphasis>must</emphasis> override <literal>equals()"
+#~ "</literal> and <literal>hashCode()</literal> to implement composite "
+#~ "identifier equality. It must also implement <literal>Serializable</"
+#~ "literal>."
+#~ msgstr ""
+#~ "Vos classes persistantes <emphasis>doivent</emphasis> surcharger les "
+#~ "méthodes <literal>equals()</literal> et <literal>hashCode()</literal> "
+#~ "pour implémenter l'égalité d'identifiant composite. Elles doivent aussi "
+#~ "implémenter l'interface <literal>Serializable</literal>."
+
+#~ msgid ""
+#~ "Unfortunately, this approach means that a persistent object is its own "
+#~ "identifier. There is no convenient \"handle\" other than the object "
+#~ "itself. You must instantiate an instance of the persistent class itself "
+#~ "and populate its identifier properties before you can <literal>load()</"
+#~ "literal> the persistent state associated with a composite key. We call "
+#~ "this approach an <emphasis>embedded</emphasis> composite identifier, and "
+#~ "discourage it for serious applications."
+#~ msgstr ""
+#~ "Malheureusement, cette approche signifie qu'un objet persistant est son "
+#~ "propre identifiant. Il n'y a pas d'autre moyen pratique de \"manipuler\" "
+#~ "l'objet que par l'objet lui-même. Vous devez instancier une instance de "
+#~ "la classe persistante elle-même et peupler ses attributs identifiants "
+#~ "avant de pouvoir appeler la méthode <literal>load()</literal> pour "
+#~ "charger son état persistant associé à une clé composée. Nous appelons "
+#~ "cette approche \"identifiant composé <emphasis>embarqué</emphasis>\" et "
+#~ "ne la recommandons pas pour des applications complexes."
+
+#~ msgid ""
+#~ "A second approach is what we call a <emphasis>mapped</emphasis> composite "
+#~ "identifier, where the identifier properties named inside the <literal><"
+#~ "composite-id></literal> element are duplicated on both the persistent "
+#~ "class and a separate identifier class."
+#~ msgstr ""
+#~ "Une seconde approche, appelée identifiant composé <emphasis>mappé</"
+#~ "emphasis>, consiste à dupliquer les propriétés identifiantes nommées dans "
+#~ "l'élément <literal><composite-id></literal>) à la fois dans la "
+#~ "classe persistante et dans une classe identifiante particulière."
+
+#~ msgid ""
+#~ "In this example, both the composite identifier class, "
+#~ "<literal>MedicareId</literal>, and the entity class itself have "
+#~ "properties named <literal>medicareNumber</literal> and "
+#~ "<literal>dependent</literal>. The identifier class must override "
+#~ "<literal>equals()</literal> and <literal>hashCode()</literal> and "
+#~ "implement <literal>Serializable</literal>. The main disadvantage of this "
+#~ "approach is code duplication."
+#~ msgstr ""
+#~ "Dans cet exemple, la classe d'identifiant composée,<literal>MedicareId</"
+#~ "literal> et la classe mappée elle-même, possèdent les propriétés "
+#~ "<literal>medicareNumber</literal> et <literal>dependent</literal>. La "
+#~ "classe identifiante doit redéfinir <literal>equals()</literal> et "
+#~ "<literal>hashCode()</literal> et implémenter <literal>Serializable</"
+#~ "literal>. Le désavantage de cette approche est la duplication du code. "
+
+#~ msgid ""
+#~ "The following attributes are used to specify a mapped composite "
+#~ "identifier:"
+#~ msgstr ""
+#~ "Les attributs suivants servent à configurer un identifiant composé mappé :"
+
+#~ msgid ""
+#~ "<literal>mapped</literal> (optional - defaults to <literal>false</"
+#~ "literal>): indicates that a mapped composite identifier is used, and that "
+#~ "the contained property mappings refer to both the entity class and the "
+#~ "composite identifier class."
+#~ msgstr ""
+#~ "<literal>mapped</literal> (optionnel, défaut à <literal>false</"
+#~ "literal>) : indique qu'un identifiant composé mappé est utilisé, et que "
+#~ "les mappages de propriétés contenues font référence aux deux classes, la "
+#~ "classe mappée et la classe identifiante composée. "
+
+#~ msgid ""
+#~ "<literal>class</literal> (optional - but required for a mapped composite "
+#~ "identifier): the class used as a composite identifier."
+#~ msgstr ""
+#~ "<literal>class</literal> (optionnel, mais requis pour un identifiant "
+#~ "composé mappé) : la classe utilisée comme identifiant composé. "
+
+#~ msgid ""
+#~ "We will describe a third, even more convenient approach, where the "
+#~ "composite identifier is implemented as a component class in <xref linkend="
+#~ "\"components-compositeid\" />. The attributes described below apply only "
+#~ "to this alternative approach:"
+#~ msgstr ""
+#~ "Nous décrirons une troisième approche beaucoup plus efficace pour "
+#~ "laquelle l'identifiant composé est implémenté comme une classe composant "
+#~ "dans <xref linkend=\"components-compositeid\" />. Les attributs décrits "
+#~ "ci dessous, ne s'appliquent que pour cette dernière approche :"
+
+#~ msgid ""
+#~ "<literal>name</literal> (optional - required for this approach): a "
+#~ "property of component type that holds the composite identifier. Please "
+#~ "see chapter 9 for more information."
+#~ msgstr ""
+#~ "<literal>name</literal> (optionnel, requis pour cette approche) : une "
+#~ "propriété de type composant qui contient l'identifiant composé (voir "
+#~ "chapitre 9). "
+
+#~ msgid ""
+#~ "<literal>class</literal> (optional - defaults to the property type "
+#~ "determined by reflection): the component class used as a composite "
+#~ "identifier. Please see the next section for more information."
+#~ msgstr ""
+#~ "<literal>class</literal> (optionnel - par défaut le type de la propriété "
+#~ "déterminé par réflexion) : la classe composant utilisée comme identifiant "
+#~ "(voir prochaine section). "
+
+#~ msgid ""
+#~ "The third approach, an <emphasis>identifier component</emphasis>, is "
+#~ "recommended for almost all applications."
+#~ msgstr ""
+#~ "La troisième approche, un <emphasis>composant d'identifiant</emphasis>, "
+#~ "est celle que nous recommandons pour toutes vos applications."
+
+#~ msgid "Version (optional)"
+#~ msgstr "Version (optionnel)"
+
+#~ msgid ""
+#~ "The <literal><version></literal> element is optional and indicates "
+#~ "that the table contains versioned data. This is particularly useful if "
+#~ "you plan to use <emphasis>long transactions</emphasis>. See below for "
+#~ "more information:"
+#~ msgstr ""
+#~ "L'élément <literal><version></literal> est optionnel et indique que "
+#~ "la table contient des données versionnées. C'est particulièrement utile "
+#~ "si vous avez l'intention d'utiliser des <emphasis>transactions longues</"
+#~ "emphasis> (voir plus-bas)."
+
+#~ msgid ""
+#~ "Version numbers can be of Hibernate type <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> or <literal>calendar</literal>."
+#~ msgstr ""
+#~ "Les numéros de version doivent avoir les types Hibernate <literal>long</"
+#~ "literal>, <literal>integer</literal>, <literal>short</literal>, "
+#~ "<literal>timestamp</literal> ou <literal>calendar</literal>. "
+
+#~ msgid "Many-to-one"
+#~ msgstr "Plusieurs-à-un"
+
+#~ msgid ""
+#~ "An ordinary association to another persistent class is declared using a "
+#~ "<literal>many-to-one</literal> element. The relational model is a many-to-"
+#~ "one association; a foreign key in one table is referencing the primary "
+#~ "key column(s) of the target table."
+#~ msgstr ""
+#~ "Une association ordinaire vers une autre classe persistante est déclarée "
+#~ "en utilisant un élément <literal>many-to-one</literal>. Le modèle "
+#~ "relationnel est une association de type plusieurs-à-un : une clé "
+#~ "étrangère dans une table référence la ou les clé(s) primaire(s) dans la "
+#~ "table cible. "
+
+#~ msgid "One-to-one"
+#~ msgstr "Un-à-un"
+
+#~ msgid "There are two varieties of one-to-one associations:"
+#~ msgstr "Il existe deux types d'associations un-à-un : "
+
+#~ msgid "primary key associations"
+#~ msgstr "association par clé primaire "
+
+#~ msgid ""
+#~ "Alternatively, a foreign key with a unique constraint, from "
+#~ "<literal>Employee</literal> to <literal>Person</literal>, can be "
+#~ "expressed as:"
+#~ msgstr ""
+#~ "Alternativement, une clé étrangère avec contrainte d'unicité de "
+#~ "<literal>Employee</literal> vers <literal>Person</literal> peut être "
+#~ "indiquée ainsi : "
+
+#~ msgid ""
+#~ "This association can be made bidirectional by adding the following to the "
+#~ "<literal>Person</literal> mapping:"
+#~ msgstr ""
+#~ "Et cette association peut être rendue bidirectionnelle en ajoutant ceci "
+#~ "au mappage de <literal>Person</literal> : "
+
+#~ msgid "Component and dynamic-component"
+#~ msgstr "Component, dynamic-component"
+
+#~ msgid "Subclass"
+#~ msgstr "Subclass"
+
+#~ msgid ""
+#~ "A discriminator column is not required for this mapping strategy. Each "
+#~ "subclass must, however, declare a table column holding the object "
+#~ "identifier using the <literal><key></literal> element. The mapping "
+#~ "at the start of the chapter would then be re-written as:"
+#~ msgstr ""
+#~ "Aucune colonne discriminante n'est nécessaire pour cette stratégie de "
+#~ "mappage. Cependant, chaque sous-classe doit déclarer une colonne de table "
+#~ "contenant l'objet identifiant qui utilise l'élément <literal><key></"
+#~ "literal>. Le mappage au début de ce chapitre serait ré-écrit ainsi : "
+
+#~ msgid "Union-subclass"
+#~ msgstr "Union-subclass"
+
+#~ msgid "Join"
+#~ msgstr "Join"
+
+#~ msgid ""
+#~ "Using the <literal><join></literal> element, it is possible to map "
+#~ "properties of one class to several tables that have a one-to-one "
+#~ "relationship. For example:"
+#~ msgstr ""
+#~ "En utilisant l'élément <literal><join></literal>, il est possible "
+#~ "de mapper des propriétés d'une classe sur plusieurs tables quand il "
+#~ "existe une relation un-à-un entre les tables. Par exemple :"
+
+#~ msgid "Key"
+#~ msgstr "Key"
+
+#~ msgid "Any"
+#~ msgstr "Any"
+
+#~ msgid "<literal>class</literal>"
+#~ msgstr "<literal>class</literal>"
+
+#~ msgid "<literal>text</literal>"
+#~ msgstr "<literal>text</literal>"
+
+#~ msgid "<literal>clob, blob</literal>"
+#~ msgstr "<literal>clob, blob</literal>"
+
+#~ msgid ""
+#~ "XML does not suit all users so there are some alternative ways to define "
+#~ "O/R mapping metadata in Hibernate."
+#~ msgstr ""
+#~ "XML ne convient pas à tout le monde, il y a donc des moyens alternatifs "
+#~ "pour définir des métadonnées de mappage O/R dans Hibernate. "
+
+#~ msgid "Using XDoclet markup"
+#~ msgstr "Utilisation de XDoclet "
+
+#~ msgid ""
+#~ "Many Hibernate users prefer to embed mapping information directly in "
+#~ "sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not "
+#~ "cover this approach in this reference guide since it is considered part "
+#~ "of XDoclet. However, we include the following example of the "
+#~ "<literal>Cat</literal> class with XDoclet mappings:"
+#~ msgstr ""
+#~ "De nombreux utilisateurs de Hibernate préfèrent embarquer les "
+#~ "informations de mappages directement au sein du code source en utilisant "
+#~ "lesbalises XDoclet <literal>@hibernate.tags</literal>. Nous ne couvrons "
+#~ "pas cette approche dans ce document puisque cela est considéré comme "
+#~ "faisant partie de XDoclet. Cependant, nous présentons l'exemple suivant "
+#~ "de la classe <literal>Cat</literal> avec des mappages XDoclet :"
+
+#~ msgid ""
+#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
+#~ msgstr ""
+#~ "Voyez le site web de Hibernate pour plus d'exemples sur XDoclet et "
+#~ "Hibernate. "
+
+#~ msgid "Using JDK 5.0 Annotations"
+#~ msgstr "Utilisation des annotations JDK 5.0"
+
+#~ msgid ""
+#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
+#~ "are type-safe and checked at compile time. This mechanism is more "
+#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
+#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
+#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
+#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
+#~ "mechanism for entity beans. Hibernate3 implements the "
+#~ "<literal>EntityManager</literal> of JSR-220 (the persistence API). "
+#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
+#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
+#~ "220) and Hibernate3 metadata is supported."
+#~ msgstr ""
+#~ "Le JDK 5.0 introduit des annotations proches de celles de XDoclet au "
+#~ "niveau java, qui sont type-safe et vérifiées à la compilation. Ce "
+#~ "mécanisme est plus puissant que XDoclet et mieux supporté par les outils "
+#~ "et les IDE. IntelliJ IDEA, par exemple, supporte l'auto-complétion et le "
+#~ "surlignement syntaxique des annotations JDK 5.0. La nouvelle révision des "
+#~ "spécifications des EJB (JSR-220) utilise les annotations JDK 5.0 comme "
+#~ "mécanisme primaire pour les metadonnées des beans entités. Hibernate3 "
+#~ "implémente l'<literal>EntityManager</literal> de la JSR-220 (API de "
+#~ "persistance), le support du mappage de métadonnées est disponible via le "
+#~ "paquetage <emphasis>Hibernate Annotations</emphasis>, en tant que module "
+#~ "séparé à télécharger. EJB3 (JSR-220) et les métadonnées Hibernate3 sont "
+#~ "supportés. "
+
+#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+#~ msgstr "Ceci est un exemple d'une classe POJO annotée comme un EJB entité :"
+
+#~ msgid ""
+#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
+#~ "development. Please refer to the Hibernate Annotations module for more "
+#~ "details."
+#~ msgstr ""
+#~ "Notez que le support des annotations JDK 5.0 (et de la JSR-220) est "
+#~ "encore en cours et n'est pas terminé. Référez vous au module Hibernate "
+#~ "Annotation pour plus d'informations. "
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/collection_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/collection_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/collection_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: collection_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 08:54+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,33 +17,53 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: collection_mapping.xml:31
#, no-c-format
msgid "Collection mapping"
msgstr "Mapper une collection "
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr "Collections persistantes"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:36
+#, fuzzy, no-c-format
msgid ""
-"Hibernate requires that persistent collection-valued fields be declared as "
-"an interface type. For example:"
+"Naturally Hibernate also allows to persist collections. These persistent "
+"collections can contain almost any other Hibernate type, including: basic "
+"types, custom types, components and references to other entities. The "
+"distinction between value and reference semantics is in this context very "
+"important. An object in a collection might be handled with \"value\" "
+"semantics (its life cycle fully depends on the collection owner), or it "
+"might be a reference to another entity with its own life cycle. In the "
+"latter case, only the \"link\" between the two objects is considered to be a "
+"state held by the collection."
msgstr ""
-"Hibernate requiert que les champs contenant des collections persistantes "
-"soient déclarés comme des types d'interface, par exemple : "
+"Les collections peuvent contenir la plupart des autres types Hibernate, y "
+"compris tous les types basiques, les types utilisateur, les composants, et "
+"bien sûr, les références vers d'autres entités. C'est une distinction "
+"importante. Un objet dans une collection pourrait être géré avec une "
+"sémantique de \"valeur\" (sa durée de vie dépend complètement du "
+"propriétaire de la collection) ou il pourrait avoir une référence vers une "
+"autre entité, avec sa propre durée de vie. Dans le dernier cas, seul le "
+"\"lien\" entre les deux objets est considéré être l'état retenu par la "
+"collection. "
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:46
+#, fuzzy, no-c-format
msgid ""
-"The actual interface might be <literal>java.util.Set</literal>, "
+"As a requirement persistent collection-valued fields must be declared as an "
+"interface type (see <xref linkend=\"example.collection.mapping.annotations\"/"
+">). The actual interface might be <literal>java.util.Set</literal>, "
"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
"<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, "
"<literal>java.util.SortedMap</literal> or anything you like (\"anything you "
"like\" means you will have to write an implementation of <literal>org."
-"hibernate.usertype.UserCollectionType</literal>.)"
+"hibernate.usertype.UserCollectionType</literal>)."
msgstr ""
"L'interface réelle peut être <literal>java.util.Set</literal>, <literal>java."
"util.Collection</literal>, <literal>java.util.List</literal>, <literal>java."
@@ -53,15 +73,17 @@
"hibernate.usertype.UserCollectionType</literal>.)"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:57
+#, fuzzy, no-c-format
msgid ""
-"Notice how the instance variable was initialized with an instance of "
-"<literal>HashSet</literal>. This is the best way to initialize collection "
+"Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the "
+"instance variable <literal>parts</literal> was initialized with an instance "
+"of <literal>HashSet</literal>. This is the best way to initialize collection "
"valued properties of newly instantiated (non-persistent) instances. When you "
-"make the instance persistent, by calling <literal>persist()</literal> for "
-"example, Hibernate will actually replace the <literal>HashSet</literal> with "
-"an instance of Hibernate's own implementation of <literal>Set</literal>. Be "
-"aware of the following errors:"
+"make the instance persistent, by calling <literal>persist()</literal>, "
+"Hibernate will actually replace the <literal>HashSet</literal> with an "
+"instance of Hibernate's own implementation of <literal>Set</literal>. Be "
+"aware of the following error:"
msgstr ""
"Notez comment nous avons initialisé la variable d'instance avec une instance "
"de <literal>HashSet</literal>. C'est le meilleur moyen pour initialiser les "
@@ -71,7 +93,30 @@
"literal> par une instance d'une implémentation propre à Hibernate de "
"<literal>Set</literal>. Prenez garde aux erreurs suivantes : "
+#. Tag: title
+#: collection_mapping.xml:68
+#, no-c-format
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:73
#, no-c-format
msgid ""
"The persistent collections injected by Hibernate behave like "
@@ -85,6 +130,7 @@
"<literal>ArrayList</literal>, selon le type de l'interface. "
#. Tag: para
+#: collection_mapping.xml:78
#, no-c-format
msgid ""
"Collections instances have the usual behavior of value types. They are "
@@ -108,11 +154,12 @@
"et une collection vide. "
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:89
+#, fuzzy, no-c-format
msgid ""
"Use persistent collections the same way you use ordinary Java collections. "
-"However, please ensure you understand the semantics of bidirectional "
-"associations (these are discussed later)."
+"However, ensure you understand the semantics of bidirectional associations "
+"(see <xref linkend=\"collections-bidirectional\"/>)."
msgstr ""
"Ne vous en souciez pas trop. Utilisez les collections persistantes de la "
"même manière que vous utilisez des collections Java ordinaires. Assurez-vous "
@@ -120,58 +167,337 @@
"loin). "
#. Tag: title
+#: collection_mapping.xml:97
+#, fuzzy, no-c-format
+msgid "How to map collections"
+msgstr "Collections triées"
+
+#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "Collection mappings"
-msgstr "Mapper une collection"
+msgid ""
+"Using annotations you can map <classname>Collection</classname>s, "
+"<classname>List</classname>s, <classname>Map</classname>s and "
+"<classname>Set</classname>s of associated entities using @OneToMany and "
+"@ManyToMany. For collections of a basic or embeddable type use "
+"@ElementCollection. In the simplest case a collection mapping looks like "
+"this:"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinColumn(name=\"PART_ID\")\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:112
#, no-c-format
msgid ""
-"There are quite a range of mappings that can be generated for collections "
-"that cover many common relational models. We suggest you experiment with the "
-"schema generation tool so that you understand how various mapping "
-"declarations translate to database tables."
+"Product describes a unidirectional relationship with Part using the join "
+"column PART_ID. In this unidirectional one to many scenario you can also use "
+"a join table as seen in <xref linkend=\"example-one-to-many-with-join-table"
+"\"/>."
msgstr ""
-"Il y a une grande variété de mappages qui peuvent être générés pour les "
-"collections, couvrant beaucoup de nombreux modèles relationnels communs. "
-"Nous vous suggérons d'expérimenter avec l'outil de génération de schéma pour "
-"cerner comment les différentes déclarations de mappage se traduisent vers "
-"des tables de bases de données. "
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"PRODUCT_PARTS\",\n"
+" joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+" )\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:124
#, no-c-format
msgid ""
-"The Hibernate mapping element used for mapping a collection depends upon the "
-"type of interface. For example, a <literal><set></literal> element is "
-"used for mapping properties of type <literal>Set</literal>."
+"Without describing any physical mapping (no <classname>@JoinColumn</"
+"classname> or <classname>@JoinTable</classname>), a unidirectional one to "
+"many with join table is used. The table name is the concatenation of the "
+"owner table name, _, and the other side table name. The foreign key name(s) "
+"referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:135
+#, fuzzy, no-c-format
+msgid ""
+"Lets have a look now how collections are mapped using Hibernate mapping "
+"files. In this case the first step is to chose the right mapping element. It "
+"depends on the type of interface. For example, a <literal><set></"
+"literal> element is used for mapping properties of type <literal>Set</"
+"literal>."
+msgstr ""
"L'élément de mappage d'Hibernate utilisé pour mapper une collection dépend "
"du type de l'interface. Par exemple, un élément <literal><set></"
"literal> est utilisé pour mapper des propriétés de type <literal>Set</"
"literal>. "
+#. Tag: title
+#: collection_mapping.xml:142
+#, no-c-format
+msgid "Mapping a Set using <set>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, no-c-format
+msgid ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:147
+#, fuzzy, no-c-format
+msgid ""
+"In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many "
+"association</emphasis> links the <literal>Product</literal> and "
+"<literal>Part</literal> entities. This association requires the existence of "
+"a foreign key column and possibly an index column to the <literal>Part</"
+"literal> table. This mapping loses certain semantics of normal Java "
+"collections:"
+msgstr ""
+"Une association de <literal>Product</literal> vers <literal>Part</literal> "
+"requiert l'existence d'une clé étrangère et éventuellement une colonne "
+"d'index pour la table <literal>Part</literal>. Une balise <literal><one-"
+"to-many></literal> indique que c'est une association un-à-plusieurs. "
+
+#. Tag: para
+#: collection_mapping.xml:156
#, no-c-format
msgid ""
-"Apart from <literal><set></literal>, there is also <literal><"
-"list></literal>, <literal><map></literal>, <literal><bag></"
-"literal>, <literal><array></literal> and <literal><primitive-"
-"array></literal> mapping elements. The <literal><map></literal> "
-"element is representative:"
+"An instance of the contained entity class cannot belong to more than one "
+"instance of the collection."
msgstr ""
+"Une instance de la classe de l'entité contenue ne peut pas appartenir à plus "
+"d'une instance de la collection."
+
+#. Tag: para
+#: collection_mapping.xml:161
+#, no-c-format
+msgid ""
+"An instance of the contained entity class cannot appear at more than one "
+"value of the collection index."
+msgstr ""
+"Une instance de la classe de l'entité contenue peut ne pas apparaître à plus "
+"plus d'une valeur d'index de la collection."
+
+#. Tag: para
+#: collection_mapping.xml:166
+#, no-c-format
+msgid ""
+"Looking closer at the used <literal><one-to-many></literal> tag we see "
+"that it has the following options."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, no-c-format
+msgid ""
+"<one-to-many\n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:185
+#, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr "<literal>class</literal> (requis) : le nom de la classe associée."
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, no-c-format
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how cached identifiers that reference missing rows will "
+"be handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal> (optionnel - par défaut <literal>exception</"
+"literal>) : spécifie comment les identifiants cachés qui référencent des "
+"lignes manquantes seront gérés : <literal>ignore</literal> traitera une "
+"ligne manquante comme une association nulle."
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class, as an alternative to <literal>class</literal>."
+msgstr ""
+"<literal>entity-name</literal> (optionnel) : le nom de l'entité de la classe "
+"associée, comme une alternative à <literal>class</literal>. "
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, no-c-format
+msgid ""
+"The <literal><one-to-many></literal> element does not need to declare "
+"any columns. Nor is it necessary to specify the <literal>table</literal> "
+"name anywhere."
+msgstr ""
+"Notez que l'élément <literal><one-to-many></literal> n'a pas besoin de "
+"déclarer de colonnes. Il n'est pas non plus nécessaire de spécifier le nom "
+"de la <literal>table</literal> à aucun endroit."
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, fuzzy, no-c-format
+msgid ""
+"If the foreign key column of a <literal><one-to-many></literal> "
+"association is declared <literal>NOT NULL</literal>, you must declare the "
+"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
+"or <emphasis>use a bidirectional association</emphasis> with the collection "
+"mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend="
+"\"collections-bidirectional\"/>."
+msgstr ""
+"<emphasis>Note très importante :</emphasis> si la colonne de la clé d'une "
+"association <literal><one-to-many></literal> est déclarée <literal>NOT "
+"NULL</literal>, vous devez déclarer le mappage de <literal><key></"
+"literal> avec <literal>not-null=\"true\"</literal> ou <emphasis> utiliser "
+"une association bidirectionnelle </emphasis> avec le mappage de la "
+"collection marqué <literal>inverse=\"true\"</literal>. Voir la discussion "
+"sur les associations bidirectionnelles plus tard dans ce chapitre. "
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, fuzzy, no-c-format
+msgid ""
+"Apart from the <literal><set> </literal>tag as shown in <xref linkend="
+"\"example.collections.set\"/>, there is also <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> and <literal><primitive-array></"
+"literal> mapping elements. The <literal><map></literal> element is "
+"representative:"
+msgstr ""
"À part <literal><set></literal>, il y aussi les éléments de mappage "
"<literal><list></literal>, <literal><map></literal>, "
"<literal><bag></literal>, <literal><array></literal> et "
"<literal><primitive-array></literal>. L'élément <literal><map></"
"literal> est représentatif : "
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, no-c-format
+msgid ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:266
#, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr ""
"<literal>name</literal> : le nom de la propriété contenant la collection "
#. Tag: para
+#: collection_mapping.xml:270
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to property name): the name of "
@@ -182,6 +508,7 @@
"plusieurs) "
#. Tag: para
+#: collection_mapping.xml:276
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): the name of a table schema to override "
@@ -191,6 +518,7 @@
"schéma déclaré dans l'élément racine "
#. Tag: para
+#: collection_mapping.xml:281
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
@@ -206,6 +534,7 @@
"collection (approprié pour de très grosses collections)."
#. Tag: para
+#: collection_mapping.xml:290
#, no-c-format
msgid ""
"<literal>inverse</literal> (optional - defaults to <literal>false</"
@@ -217,6 +546,7 @@
"l'association bidirectionnelle."
#. Tag: para
+#: collection_mapping.xml:296
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional - defaults to <literal>none</literal>): "
@@ -226,6 +556,7 @@
"literal>) : active les opérations de cascade vers les entités filles."
#. Tag: para
+#: collection_mapping.xml:302
#, no-c-format
msgid ""
"<literal>sort</literal> (optional): specifies a sorted collection with "
@@ -236,12 +567,13 @@
"donnée."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:308
+#, fuzzy, no-c-format
msgid ""
-"<literal>order-by</literal> (optional, JDK1.4 only): specifies a table "
-"column or columns that define the iteration order of the <literal>Map</"
-"literal>, <literal>Set</literal> or bag, together with an optional "
-"<literal>asc</literal> or <literal>desc</literal>."
+"<literal>order-by</literal> (optional): specifies a table column or columns "
+"that define the iteration order of the <literal>Map</literal>, <literal>Set</"
+"literal> or bag, together with an optional <literal>asc</literal> or "
+"<literal>desc</literal>."
msgstr ""
"<literal>order-by</literal> (optionnel, seulement à partir du JDK1.4) : "
"spécifie une colonne de table (ou des colonnes) qui définit l'ordre "
@@ -249,6 +581,7 @@
"en option <literal>asc</literal> ou <literal>desc</literal>."
#. Tag: para
+#: collection_mapping.xml:316
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -262,6 +595,7 @@
"données disponibles)."
#. Tag: para
+#: collection_mapping.xml:324
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional, defaults to <literal>select</literal>): "
@@ -274,6 +608,7 @@
"séquentiels."
#. Tag: para
+#: collection_mapping.xml:331
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): "
@@ -284,6 +619,7 @@
"instances de cette collection."
#. Tag: para
+#: collection_mapping.xml:337
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -295,6 +631,7 @@
"valeur de la propriété."
#. Tag: para
+#: collection_mapping.xml:343
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -309,6 +646,7 @@
"paramètre)."
#. Tag: para
+#: collection_mapping.xml:351
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -321,19 +659,31 @@
"de la collection ne changent jamais (une optimisation mineure dans certains "
"cas)."
+#. Tag: para
+#: collection_mapping.xml:360
+#, no-c-format
+msgid ""
+"After exploring the basic mapping of collections in the preceding paragraphs "
+"we will now focus details like physical mapping considerations, indexed "
+"collections and collections of value types."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr "Les clés étrangères d'une collection"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:367
+#, fuzzy, no-c-format
msgid ""
-"Collection instances are distinguished in the database by the foreign key of "
-"the entity that owns the collection. This foreign key is referred to as the "
-"<emphasis>collection key column</emphasis>, or columns, of the collection "
-"table. The collection key column is mapped by the <literal><key></"
-"literal> element."
+"On the database level collection instances are distinguished by the foreign "
+"key of the entity that owns the collection. This foreign key is referred to "
+"as the <emphasis>collection key column</emphasis>, or columns, of the "
+"collection table. The collection key column is mapped by the "
+"<literal>@JoinColumn</literal> annotation respectively the <literal><"
+"key></literal> XML element."
msgstr ""
"Les instances d'une collection sont distinguées dans la base de données par "
"la clé étrangère de l'entité qui possède la collection. Cette clé étrangère "
@@ -342,182 +692,302 @@
"collection est mappée par l'élément <literal><key></literal>."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:374
+#, fuzzy, no-c-format
msgid ""
"There can be a nullability constraint on the foreign key column. For most "
"collections, this is implied. For unidirectional one-to-many associations, "
-"the foreign key column is nullable by default, so you may need to specify "
-"<literal>not-null=\"true\"</literal>."
+"the foreign key column is nullable by default, so you may need to specify"
msgstr ""
"Il peut y avoir une contrainte de nullité sur la colonne de la clé "
"étrangère. Pour les associations unidirectionnelles un-à-plusieurs, la "
"colonne de la clé étrangère peut être nulle par défaut, donc vous pourriez "
"avoir besoin de spécifier <literal>not-null=\"true\"</literal>. "
+#. Tag: programlisting
+#: collection_mapping.xml:379
+#, no-c-format
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:381
#, no-c-format
+msgid "<para>or</para>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:383
+#, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:385
+#, fuzzy, no-c-format
msgid ""
-"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
+"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In "
+"XML this can be expressed via:"
msgstr ""
"La contraite de la clé étrangère peut utiliser <literal>ON DELETE CASCADE</"
"literal>. "
+#. Tag: programlisting
+#: collection_mapping.xml:388
+#, no-c-format
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:390
#, no-c-format
msgid ""
-"See the previous chapter for a full definition of the <literal><key></"
-"literal> element."
+"In annotations the Hibernate specific annotation @OnDelete has to be used."
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:393
+#, no-c-format
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:395
+#, fuzzy, no-c-format
+msgid ""
+"See <xref lang=\"\" linkend=\"section.key\"/> for more information about the "
+"<literal><key></literal> element."
+msgstr ""
"Voir le chapitre précédent pour une définition complète de l'élément "
"<literal><key></literal>."
#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
-msgid "Collection elements"
-msgstr "Les éléments d'une collection"
+msgid "Indexed collections"
+msgstr "Collections indexées"
#. Tag: para
+#: collection_mapping.xml:402
#, no-c-format
msgid ""
-"Collections can contain almost any other Hibernate type, including: basic "
-"types, custom types, components and references to other entities. This is an "
-"important distinction. An object in a collection might be handled with "
-"\"value\" semantics (its life cycle fully depends on the collection owner), "
-"or it might be a reference to another entity with its own life cycle. In the "
-"latter case, only the \"link\" between the two objects is considered to be a "
-"state held by the collection."
+"In the following paragraphs we have a closer at the indexed collections "
+"<classname>List</classname> and <classname>Map</classname> how the their "
+"index can be mapped in Hibernate."
msgstr ""
-"Les collections peuvent contenir la plupart des autres types Hibernate, y "
-"compris tous les types basiques, les types utilisateur, les composants, et "
-"bien sûr, les références vers d'autres entités. C'est une distinction "
-"importante. Un objet dans une collection pourrait être géré avec une "
-"sémantique de \"valeur\" (sa durée de vie dépend complètement du "
-"propriétaire de la collection) ou il pourrait avoir une référence vers une "
-"autre entité, avec sa propre durée de vie. Dans le dernier cas, seul le "
-"\"lien\" entre les deux objets est considéré être l'état retenu par la "
-"collection. "
+#. Tag: title
+#: collection_mapping.xml:407
+#, no-c-format
+msgid "Lists"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
+msgid "Lists can be mapped in two different ways:"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:413
+#, no-c-format
+msgid "as ordered lists, where the order is not materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:418
+#, no-c-format
+msgid "as indexed lists, where the order is materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:423
+#, no-c-format
msgid ""
-"The contained type is referred to as the <emphasis>collection element type</"
-"emphasis>. Collection elements are mapped by <literal><element></"
-"literal> or <literal><composite-element></literal>, or in the case of "
-"entity references, with <literal><one-to-many></literal> or "
-"<literal><many-to-many></literal>. The first two map elements with "
-"value semantics, the next two are used to map entity associations."
+"To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> "
+"to your property. This annotation takes as parameter a list of comma "
+"separated properties (of the target entity) and orders the collection "
+"accordingly (eg <code>firstname asc, age desc</code>), if the string is "
+"empty, the collection will be ordered by the primary key of the target "
+"entity."
msgstr ""
-"Le type contenu est référencé comme le <emphasis>type de l'élément de la "
-"collection</emphasis>. Les éléments de la collections sont mappés par "
-"<literal><element></literal> ou <literal><composite-element></"
-"literal>, ou dans le cas des références d'entité, avec <literal><one-to-"
-"many></literal> ou <literal><many-to-many></literal>. Les deux "
-"premiers mappent des éléments avec une sémantique de valeur, les deux "
-"suivants sont utilisés pour mapper des associations d'entité."
#. Tag: title
+#: collection_mapping.xml:432
#, no-c-format
-msgid "Indexed collections"
-msgstr "Collections indexées"
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:434
#, no-c-format
msgid ""
-"All collection mappings, except those with set and bag semantics, need an "
-"<emphasis>index column</emphasis> in the collection table. An index column "
-"is a column that maps to an array index, or <literal>List</literal> index, "
-"or <literal>Map</literal> key. The index of a <literal>Map</literal> may be "
-"of any basic type, mapped with <literal><map-key></literal>. It can be "
-"an entity reference mapped with <literal><map-key-many-to-many></"
-"literal>, or it can be a composite type mapped with <literal><composite-"
-"map-key></literal>. The index of an array or list is always of type "
-"<literal>integer</literal> and is mapped using the <literal><list-"
-"index></literal> element. The mapped column contains sequential integers "
-"that are numbered from zero by default."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderBy(\"number\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"Tous les mappages de collection, exceptés ceux avec les sémantiques "
-"d'ensemble (set) et de sac (bag), ont besoin d'une <emphasis>colonne "
-"d'index</emphasis> dans la table de la collection - une colonne qui mappe un "
-"index de tableau, ou un index de <literal>List</literal>, ou une clé de "
-"<literal>Map</literal>. L'index d'une <literal>Map</literal> peut être "
-"n'importe quel type basique, mappé avec <literal><map-key></literal>, "
-"ou peut être une référence d'entité mappée avec <literal><map-key-many-to-"
-"many></literal>, ou peut être un type composé, mappé avec <literal><"
-"composite-map-key></literal>. L'index d'un tableau ou d'une liste est "
-"toujours de type <literal>integer</literal> et est mappé en utilisant "
-"l'élément <literal><list-index></literal>. Les colonnes mappées "
-"contiennent des entiers séquentiels (numérotés à partir de zéro par défaut). "
#. Tag: para
+#: collection_mapping.xml:437
#, no-c-format
msgid ""
-"<literal>column_name</literal> (required): the name of the column holding "
-"the collection index values."
+"To store the index value in a dedicated column, use the <classname>@javax."
+"persistence.OrderColumn</classname> annotation on your property. This "
+"annotations describes the column name and attributes of the column keeping "
+"the index value. This column is hosted on the table containing the "
+"association foreign key. If the column name is not specified, the default is "
+"the name of the referencing property, followed by underscore, followed by "
+"<literal>ORDER</literal> (in the following example, it would be "
+"<literal>orders_ORDER</literal>)."
msgstr ""
-"<literal>column_name</literal> (champ requis): lenom de la lolonne qui "
-"contient les valeurs 'index' de la collection."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:448
#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
msgid ""
-"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
-"value of the index column that corresponds to the first element of the list "
-"or array."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderColumn(name=\"orders_index\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|--------------| |----------|\n"
+"| Order | | Customer |\n"
+"|--------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"| orders_order |\n"
+"|--------------|"
msgstr ""
-"<literal>base</literal> (optionnel - par défaut = <literal>0</literal>) : la "
-"valeur de la colonne 'index' qui correspond au premier élément de la liste "
-"ou de la table."
#. Tag: para
+#: collection_mapping.xml:455
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection index values."
+"We recommend you to convert <classname>the legacy @org.hibernate.annotations."
+"IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless "
+"you are making use of the base property. The <literal>base</literal> "
+"property lets you define the index value of the first element (aka as base "
+"index). The usual value is <literal>0</literal> or <literal>1</literal>. The "
+"default is 0 like in Java."
msgstr ""
-"<literal>colonne</literal> (optionnel) : le nom de la colonne qui contient "
-"les valeurs 'index' de la collection."
#. Tag: para
+#: collection_mapping.xml:464
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
-"key of the map."
+"Looking again at the Hibernate mapping file equivalent, the index of an "
+"array or list is always of type <literal>integer</literal> and is mapped "
+"using the <literal><list-index></literal> element. The mapped column "
+"contains sequential integers that are numbered from zero by default."
msgstr ""
-"<literal>formula</literal> (optionnel): formule SQL utilisée pour évaluer la "
-"clé de la mappe."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:471
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
-msgstr "<literal>type</literal> (requis) : le type de clés de mappe."
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:481
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the foreign key column for "
-"the collection index values."
+"<list-index\n"
+" column=\"column_name\"\n"
+" base=\"0|1|...\"/>"
msgstr ""
-"<literal>colonne</literal> (optionnel) : le nom de la colonne de clés "
-"étrangères pour la collection de valeurs 'index'."
#. Tag: para
+#: collection_mapping.xml:485
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
-"foreign key of the map key."
+"<literal>column_name</literal> (required): the name of the column holding "
+"the collection index values."
msgstr ""
-"<literal>formula</literal> (optionnel): formule SQ utilisée pour évaluer la "
-"clé étrangère d'une clé de mappe."
+"<literal>column_name</literal> (champ requis): lenom de la lolonne qui "
+"contient les valeurs 'index' de la collection."
#. Tag: para
+#: collection_mapping.xml:490
#, no-c-format
msgid ""
-"<literal>class</literal> (required): the entity class used as the map key."
+"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
+"value of the index column that corresponds to the first element of the list "
+"or array."
msgstr ""
-"<literal>class</literal> (requis) : le nom de la classe utilisée en tant que "
-"clé de mappe."
+"<literal>base</literal> (optionnel - par défaut = <literal>0</literal>) : la "
+"valeur de la colonne 'index' qui correspond au premier élément de la liste "
+"ou de la table."
#. Tag: para
+#: collection_mapping.xml:498
#, no-c-format
msgid ""
"If your table does not have an index column, and you still wish to use "
@@ -533,311 +1003,589 @@
"données, mais il peut être optionnellement trié ou ordonné. "
#. Tag: title
+#: collection_mapping.xml:506
#, no-c-format
-msgid "Collections of values and many-to-many associations"
-msgstr "Collections de valeurs et associations plusieurs-à-plusieurs"
+msgid "Maps"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:508
#, no-c-format
msgid ""
-"Any collection of values or many-to-many associations requires a dedicated "
-"<emphasis>collection table</emphasis> with a foreign key column or columns, "
-"<emphasis>collection element column</emphasis> or columns, and possibly an "
-"index column or columns."
+"The question with <classname>Map</classname>s is where the key value is "
+"stored. There are everal options. Maps can borrow their keys from one of the "
+"associated entity properties or have dedicated columns to store an explicit "
+"key."
msgstr ""
-"Toute collection de valeurs ou association plusieurs-à-plusieurs requiert "
-"une <emphasis>table de collection</emphasis> avec une(des) colonne(s) de clé "
-"étrangère, une(des) <emphasis>colonne(s) d'élément de la collection</"
-"emphasis> ou des colonnes et éventuellement une(des) colonne(s) d'index. "
#. Tag: para
+#: collection_mapping.xml:513
#, no-c-format
msgid ""
-"For a collection of values use the <literal><element></literal> tag. "
-"For example:"
+"To use one of the target entity property as a key of the map, use "
+"<literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</"
+"literal> is a property name in the target entity. When using "
+"<literal>@MapKey</literal> without the name attribuate, 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, "
+"because the map key 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."
msgstr ""
-"Pour une collection de valeurs, nous utilisons la balise <literal><"
-"element></literal>. Par exemple :"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:525
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection element values."
+"Use of target entity property as map key via <classname>@MapKey</classname>"
msgstr ""
-"<literal>colonne</literal> (optionnel) : le nom de la colonne qui contient "
-"les valeurs des éléments de collection."
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:528
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @MapKey(name=\"number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> order) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"<literal>formula</literal> (optionnel) : formule SQL utilisée pour évaluer "
-"l'élément."
#. Tag: para
+#: collection_mapping.xml:531
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
-msgstr "<literal>type</literal> (requis) : le type d'élément de collection."
+msgid ""
+"Alternatively the map key is mapped to a dedicated column or columns. In "
+"order to customize the mapping use one of the following annotations:"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:537
#, no-c-format
msgid ""
-"A <emphasis>many-to-many association</emphasis> is specified using the "
-"<literal><many-to-many></literal> element."
+"@<classname>MapKeyColumn</classname> if the map key is a basic type. If you "
+"don't specify the column name, the name of the property followed by "
+"underscore followed by <literal>KEY</literal> is used (for example "
+"<literal>orders_KEY</literal>)."
msgstr ""
-"Une association <emphasis>many-to-many</emphasis> est spécifiée en utilisant "
-"l'élément <literal><many-to-many></literal>."
#. Tag: para
+#: collection_mapping.xml:544
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the element foreign key "
-"column."
+"<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</"
+"classname> if the map key type is respectively an enum or a <classname>Date</"
+"classname>."
msgstr ""
-"<literal>colonne</literal> (optionnel) : le nom de la colonne de clés "
-"étrangères des éléments."
#. Tag: para
+#: collection_mapping.xml:550
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element foreign key value."
+"<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</"
+"classname> if the map key type is another entity."
msgstr ""
-"<literal>formula</literal> (optionnel): formule SQL utilisée pour évaluer la "
-"valeur des clés étrangères des éléments."
#. Tag: para
+#: collection_mapping.xml:555
#, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
-msgstr "<literal>class</literal> (requis) : le nom de la classe associée."
+msgid ""
+"<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</"
+"classname> when the map key is a embeddable object. Use <literal>key.</"
+"literal> as a prefix for your embeddable object property names."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:562
#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"enables outer-join or sequential select fetching for this association. This "
-"is a special case; for full eager fetching in a single <literal>SELECT</"
-"literal> of an entity and its many-to-many relationships to other entities, "
-"you would enable <literal>join</literal> fetching,not only of the collection "
-"itself, but also with this attribute on the <literal><many-to-many></"
-"literal> nested element."
+"You can also use <classname>@MapKeyClass</classname> to define the type of "
+"the key if you don't use generics."
msgstr ""
-"<literal>fetch</literal> (optionnel - par défaut <literal>join</literal>): "
-"permet la récupération par jointures externes ou bien par selects "
-"séquentiels pour cette association. Il s'agit d'un cas particulier de "
-"récupération. Pour que la récupération soit toujours rapportée en un seul "
-"<literal>SELECT</literal> d'entité ou à partir de ses relations many-to-many "
-"à d'autres entités, vous devrez activer la récupération <literal>join</"
-"literal>, non seulement pour la collection elle-même, mais aussi avec cet "
-"attribut qui se trouve sur l'élément <literal><many-to-many></literal>."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:566
#, no-c-format
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional): enables the DDL generation of a unique "
-"constraint for the foreign-key column. This makes the association "
-"multiplicity effectively one-to-many."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+" @MapKeyColumn(name=\"orders_number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> orders) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------| |---------------|\n"
+"| Order | | Customer | | Cust_Order |\n"
+"|-------------| |----------| |---------------|\n"
+"| id | | id | | customer_id |\n"
+"| number | |----------| | order_id |\n"
+"| customer_id | | orders_number |\n"
+"|-------------| |---------------|"
msgstr ""
-"<literal>unique</literal> (optionnel): permet la génération DDL d'une seule "
-"contrainte pour la colonne de la clé étrangère. Cela transforme la "
-"muticiplicité de l'association en one-to-many."
#. Tag: para
+#: collection_mapping.xml:573
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how foreign keys that reference missing rows will be "
-"handled: <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</"
+"classname> to the new standard approach described above"
msgstr ""
-"<literal>not-found</literal> (optionnel - par défaut <literal>exception</"
-"literal>) : spécifie comment les clés étrangères cachées qui référencent des "
-"lignes manquantes seront gérées : <literal>ignore</literal> traitera une "
-"ligne manquante comme une association nulle."
#. Tag: para
+#: collection_mapping.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files there exists equivalent concepts to the "
+"descibed annotations. You have to use <literal><map-key></literal>, "
+"<literal><map-key-many-to-many></literal> and <literal><composite-"
+"map-key></literal>. <literal><map-key></literal> is used for any "
+"basic type, <literal><map-key-many-to-many></literal> for an entity "
+"reference and <literal><composite-map-key></literal> for a composite "
+"type."
+msgstr ""
+"À part <literal><set></literal>, il y aussi les éléments de mappage "
+"<literal><list></literal>, <literal><map></literal>, "
+"<literal><bag></literal>, <literal><array></literal> et "
+"<literal><primitive-array></literal>. L'élément <literal><map></"
+"literal> est représentatif : "
+
+#. Tag: title
+#: collection_mapping.xml:590
#, no-c-format
+msgid "map-key xml mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
msgid ""
-"<literal>entity-name</literal> (optional): the entity name of the associated "
-"class, as an alternative to <literal>class</literal>."
+"<map-key\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"type_name\"\n"
+" node=\"@attribute-name\"\n"
+" length=\"N\"/>"
msgstr ""
-"<literal>entity-name</literal> (optionnel) : le nom de l'entité de la classe "
-"associée, comme une alternative à <literal>class</literal>. "
#. Tag: para
+#: collection_mapping.xml:605
#, no-c-format
msgid ""
-"<literal>property-ref</literal> (optional): the name of a property of the "
-"associated class that is joined to this foreign key. If not specified, the "
-"primary key of the associated class is used."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection index values."
msgstr ""
-"<literal>property-ref</literal> (optionnel): nom d'une propriété de la "
-"classe associée associée à une clé étrangère. Si elle n'est pas précisée, la "
-"clé primaire de la classe associée sera alors utilisée."
+"<literal>colonne</literal> (optionnel) : le nom de la colonne qui contient "
+"les valeurs 'index' de la collection."
#. Tag: para
+#: collection_mapping.xml:610
#, no-c-format
-msgid "Here are some examples."
-msgstr "Voici quelques exemples :"
+msgid ""
+"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
+"key of the map."
+msgstr ""
+"<literal>formula</literal> (optionnel): formule SQL utilisée pour évaluer la "
+"clé de la mappe."
#. Tag: para
+#: collection_mapping.xml:615
#, no-c-format
-msgid "A set of strings:"
-msgstr "Un ensemble de chaînes de caractères :"
+msgid "<literal>type</literal> (required): the type of the map keys."
+msgstr "<literal>type</literal> (requis) : le type de clés de mappe."
+#. Tag: title
+#: collection_mapping.xml:623
+#, fuzzy, no-c-format
+msgid "map-key-many-to-many"
+msgstr "plusieurs-à-plusieurs "
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
+#, no-c-format
+msgid ""
+"<map-key-many-to-many\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" class=\"ClassName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:638
#, no-c-format
msgid ""
-"A bag containing integers with an iteration order determined by the "
-"<literal>order-by</literal> attribute:"
+"<literal>column</literal> (optional): the name of the foreign key column for "
+"the collection index values."
msgstr ""
-"Un sac contenant des entiers (avec un ordre d'itération déterminé par "
-"l'attribut <literal>order-by</literal>) : "
+"<literal>colonne</literal> (optionnel) : le nom de la colonne de clés "
+"étrangères pour la collection de valeurs 'index'."
#. Tag: para
+#: collection_mapping.xml:643
#, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
+msgid ""
+"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
+"foreign key of the map key."
msgstr ""
-"Un tableau d'entités - dans ce cas, une association plusieurs-à-plusieurs : "
+"<literal>formula</literal> (optionnel): formule SQ utilisée pour évaluer la "
+"clé étrangère d'une clé de mappe."
#. Tag: para
+#: collection_mapping.xml:648
#, no-c-format
-msgid "A map from string indices to dates:"
-msgstr "Une map de chaînes de caractères vers des dates :"
+msgid ""
+"<literal>class</literal> (required): the entity class used as the map key."
+msgstr ""
+"<literal>class</literal> (requis) : le nom de la classe utilisée en tant que "
+"clé de mappe."
+#. Tag: title
+#: collection_mapping.xml:658
+#, fuzzy, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr "Collections de valeurs et associations plusieurs-à-plusieurs"
+
#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
-msgstr "Une liste de composants (traité dans le prochain chapitre) : "
+msgid ""
+"In some situations you don't need to associate two entities but simply "
+"create a collection of basic types or embeddable objects. Use the "
+"<classname>@ElementCollection</classname> for this case."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:665
#, no-c-format
-msgid "One-to-many associations"
-msgstr "Associations un-à-plusieurs"
+msgid ""
+"Collection of basic types mapped via <classname>@ElementCollection</"
+"classname>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @Column(name=\"nickname\")\n"
+" public Set<String> getNicknames() { ... } \n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:671
#, no-c-format
msgid ""
-"A <emphasis>one-to-many association</emphasis> links the tables of two "
-"classes via a foreign key with no intervening collection table. This mapping "
-"loses certain semantics of normal Java collections:"
+"The collection table holding the collection data is set using the "
+"<classname>@CollectionTable</classname> annotation. If omitted the "
+"collection table name defaults to the concatenation of the name of the "
+"containing entity and the name of the collection attribute, separated by an "
+"underscore. In our example, it would be <literal>User_nicknames</literal>."
msgstr ""
-"Une <emphasis>association un-à-plusieurs</emphasis> lie les tables de deux "
-"classes par une clé étrangère, sans l'intervention d'une table de "
-"collection. Ce mappage perd certaines sémantiques des collections Java "
-"normales : "
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot belong to more than one "
-"instance of the collection."
+"The column holding the basic type is set using the <classname>@Column</"
+"classname> annotation. If omitted, the column name defaults to the property "
+"name: in our example, it would be <literal>nicknames</literal>."
msgstr ""
-"Une instance de la classe de l'entité contenue ne peut pas appartenir à plus "
-"d'une instance de la collection."
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot appear at more than one "
-"value of the collection index."
+"But you are not limited to basic types, the collection type can be any "
+"embeddable object. To override the columns of the embeddable object in the "
+"collection table, use the <classname>@AttributeOverride</classname> "
+"annotation."
msgstr ""
-"Une instance de la classe de l'entité contenue peut ne pas apparaître à plus "
-"plus d'une valeur d'index de la collection."
+#. Tag: title
+#: collection_mapping.xml:689
+#, no-c-format
+msgid "@ElementCollection for embeddable objects"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:691
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street"
+"\"))\n"
+" })\n"
+" public Set<Address> getAddresses() { ... } \n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" public String getStreet1() {...}\n"
+" [...]\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:694
#, no-c-format
+msgid "Such an embeddable object cannot contains a collection itself."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:698
+#, no-c-format
msgid ""
-"An association from <literal>Product</literal> to <literal>Part</literal> "
-"requires the existence of a foreign key column and possibly an index column "
-"to the <literal>Part</literal> table. A <literal><one-to-many></"
-"literal> tag indicates that this is a one-to-many association."
+"in <classname>@AttributeOverride</classname>, you must use the "
+"<literal>value.</literal> prefix to override properties of the embeddable "
+"object used in the map value and the <literal>key.</literal> prefix to "
+"override properties of the embeddable object used in the map key."
msgstr ""
-"Une association de <literal>Product</literal> vers <literal>Part</literal> "
-"requiert l'existence d'une clé étrangère et éventuellement une colonne "
-"d'index pour la table <literal>Part</literal>. Une balise <literal><one-"
-"to-many></literal> indique que c'est une association un-à-plusieurs. "
+#. Tag: programlisting
+#: collection_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" @ElementCollection\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"key.street1\", column=@Column(name="
+"\"fld_street\")),\n"
+" @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note"
+"\"))\n"
+" })\n"
+" public Map<Address,Rating> getFavHomes() { ... }"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:708
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how cached identifiers that reference missing rows will "
-"be handled. <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"CollectionOfElements</classname> to the new <classname>@ElementCollection</"
+"classname> annotation."
msgstr ""
-"<literal>not-found</literal> (optionnel - par défaut <literal>exception</"
-"literal>) : spécifie comment les identifiants cachés qui référencent des "
-"lignes manquantes seront gérés : <literal>ignore</literal> traitera une "
-"ligne manquante comme une association nulle."
#. Tag: para
+#: collection_mapping.xml:714
+#, fuzzy, no-c-format
+msgid ""
+"Using the mapping file approach a collection of values is mapped using the "
+"<literal><element></literal> tag. For example:"
+msgstr ""
+"Pour une collection de valeurs, nous utilisons la balise <literal><"
+"element></literal>. Par exemple :"
+
+#. Tag: title
+#: collection_mapping.xml:718
#, no-c-format
+msgid "<element> tag for collection values using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
msgid ""
-"The <literal><one-to-many></literal> element does not need to declare "
-"any columns. Nor is it necessary to specify the <literal>table</literal> "
-"name anywhere."
+"<element\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"typename\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
msgstr ""
-"Notez que l'élément <literal><one-to-many></literal> n'a pas besoin de "
-"déclarer de colonnes. Il n'est pas non plus nécessaire de spécifier le nom "
-"de la <literal>table</literal> à aucun endroit."
#. Tag: para
+#: collection_mapping.xml:734
#, no-c-format
msgid ""
-"If the foreign key column of a <literal><one-to-many></literal> "
-"association is declared <literal>NOT NULL</literal>, you must declare the "
-"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
-"or <emphasis>use a bidirectional association</emphasis> with the collection "
-"mapping marked <literal>inverse=\"true\"</literal>. See the discussion of "
-"bidirectional associations later in this chapter for more information."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection element values."
msgstr ""
-"<emphasis>Note très importante :</emphasis> si la colonne de la clé d'une "
-"association <literal><one-to-many></literal> est déclarée <literal>NOT "
-"NULL</literal>, vous devez déclarer le mappage de <literal><key></"
-"literal> avec <literal>not-null=\"true\"</literal> ou <emphasis> utiliser "
-"une association bidirectionnelle </emphasis> avec le mappage de la "
-"collection marqué <literal>inverse=\"true\"</literal>. Voir la discussion "
-"sur les associations bidirectionnelles plus tard dans ce chapitre. "
+"<literal>colonne</literal> (optionnel) : le nom de la colonne qui contient "
+"les valeurs des éléments de collection."
#. Tag: para
+#: collection_mapping.xml:739
#, no-c-format
msgid ""
-"The following example shows a map of <literal>Part</literal> entities by "
-"name, where <literal>partName</literal> is a persistent property of "
-"<literal>Part</literal>. Notice the use of a formula-based index:"
+"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
+"element."
msgstr ""
-"Cet exemple montre une map d'entités <literal>Part</literal> par nom (où "
-"<literal>partName</literal> est une propriété persistante de <literal>Part</"
-"literal>). Notez l'utilisation d'un index basé sur une formule :"
+"<literal>formula</literal> (optionnel) : formule SQL utilisée pour évaluer "
+"l'élément."
+#. Tag: para
+#: collection_mapping.xml:744
+#, no-c-format
+msgid "<literal>type</literal> (required): the type of the collection element."
+msgstr "<literal>type</literal> (requis) : le type d'élément de collection."
+
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr "Mappages de collection avancés"
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr "Collections triées"
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
msgid ""
"Hibernate supports collections implementing <literal>java.util.SortedMap</"
-"literal> and <literal>java.util.SortedSet</literal>. You must specify a "
-"comparator in the mapping file:"
+"literal> and <literal>java.util.SortedSet</literal>. With annotations you "
+"declare a sort comparator using <literal>@Sort</literal>. You chose between "
+"the comparator types unsorted, natural or custom. If you want to use your "
+"own comparator implementation, you'll also have to specify 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 ""
-"Hibernate supporte des collections implémentant <literal>java.util."
-"SortedMap</literal> et <literal>java.util.SortedSet</literal>. Vous devez "
-"spécifier un comparateur dans le fichier de mappage :"
+#. Tag: title
+#: collection_mapping.xml:770
+#, fuzzy, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr "Collections triées"
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+"@JoinColumn(name=\"CUST_ID\")\n"
+"@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+"public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
msgid ""
+"Using Hibernate mapping files you specify a comparator in the mapping file "
+"with <literal><sort></literal>:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:779
+#, fuzzy, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr "Collections triées"
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, no-c-format
+msgid ""
+"<set name=\"aliases\"\n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:784
+#, no-c-format
+msgid ""
"Allowed values of the <literal>sort</literal> attribute are "
"<literal>unsorted</literal>, <literal>natural</literal> and the name of a "
"class implementing <literal>java.util.Comparator</literal>."
@@ -847,6 +1595,7 @@
"classe implémentant <literal>java.util.Comparator</literal>."
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
msgid ""
"Sorted collections actually behave like <literal>java.util.TreeSet</literal> "
@@ -856,14 +1605,15 @@
"TreeSet</literal> ou <literal>java.util.TreeMap</literal>."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:794
+#, fuzzy, no-c-format
msgid ""
"If you want the database itself to order the collection elements, use the "
"<literal>order-by</literal> attribute of <literal>set</literal>, "
"<literal>bag</literal> or <literal>map</literal> mappings. This solution is "
-"only available under JDK 1.4 or higher and is implemented using "
-"<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This "
-"performs the ordering in the SQL query and not in the memory."
+"implemented using <literal>LinkedHashSet</literal> or "
+"<literal>LinkedHashMap</literal> and performs the ordering in the SQL query "
+"and not in the memory."
msgstr ""
"Si vous voulez que la base de données elle-même ordonne les éléments de la "
"collection, utilisez l'attribut <literal>order-by</literal> des mappages "
@@ -874,11 +1624,36 @@
"pas en mémoire. "
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, no-c-format
+msgid ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr "Note"
#. Tag: para
+#: collection_mapping.xml:810
#, no-c-format
msgid ""
"The value of the <literal>order-by</literal> attribute is an SQL ordering, "
@@ -888,6 +1663,7 @@
"SQL, et non pas un ordre HQL."
#. Tag: para
+#: collection_mapping.xml:814
#, no-c-format
msgid ""
"Associations can even be sorted by arbitrary criteria at runtime using a "
@@ -897,11 +1673,27 @@
"l'exécution en utilisant un <literal>filter()</literal> de collection :"
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, no-c-format
+msgid ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr "Associations bidirectionnelles"
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
msgid ""
"A <emphasis>bidirectional association</emphasis> allows navigation from both "
@@ -913,32 +1705,348 @@
"bidirectionnelles sont supportées : "
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr "un-à-plusieurs (one-to-many)"
#. Tag: para
+#: collection_mapping.xml:834
#, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr "ensemble ou sac à une extrémité, une seule valeur à l'autre "
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr "plusieurs-à-plusieurs "
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr "ensemble ou sac aux deux extrémités"
#. Tag: para
+#: collection_mapping.xml:848
#, no-c-format
msgid ""
-"You can specify a bidirectional many-to-many association by mapping two many-"
-"to-many associations to the same database table and declaring one end as "
-"<emphasis>inverse</emphasis>. You cannot select an indexed collection."
+"Often there exists a many to one association which is the owner side of a "
+"bidirectional relationship. The corresponding one to many association is in "
+"this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:854
+#, no-c-format
+msgid "Bidirectional one to many with many to one side as association owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:860
+#, no-c-format
+msgid ""
+"<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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:865
+#, no-c-format
+msgid ""
+"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 not optimized and will produce additional UPDATE "
+"statements."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:872
+#, fuzzy, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr "Associations bidirectionnelles avec des collections indexées"
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:878
+#, fuzzy, no-c-format
+msgid ""
+"How does the mappping of a bidirectional mapping look like in Hibernate "
+"mapping xml? There you define a bidirectional one-to-many association by "
+"mapping a one-to-many association to the same table column(s) as a many-to-"
+"one association and declaring the many-valued end <literal>inverse=\"true\"</"
+"literal>."
+msgstr ""
+"Vous pouvez définir une association bidirectionnelle un-à-plusieurs en "
+"mappant une association un-à-plusieurs vers la(es) même(s) colonne(s) de "
+"table qu'une association plusieurs-à-un et en déclarant l'extrémité pluri-"
+"valuée <literal>inverse=\"true\"</literal>. "
+
+#. Tag: title
+#: collection_mapping.xml:885
+#, no-c-format
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:890
+#, no-c-format
+msgid ""
+"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
+"does not affect the operation of cascades as these are orthogonal concepts."
+msgstr ""
+"Mapper une extrémité d'une association avec <literal>inverse=\"true\"</"
+"literal> n'affecte pas l'opération de cascades, ce sont des concepts "
+"orthogonaux."
+
+#. Tag: para
+#: collection_mapping.xml:894
+#, no-c-format
+msgid ""
+"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):"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:903
+#, no-c-format
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:910
+#, no-c-format
+msgid ""
+"In this example <classname>@JoinTable</classname> defines a <literal>name</"
+"literal>, an array of join columns, 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\"). 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:919
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:938
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:955
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:961
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:966
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files you can map a bidirectional many-to-many "
+"association by mapping two many-to-many associations to the same database "
+"table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
"Vous pouvez spécifier une association bidirectionnelle plusieurs-à-plusieurs "
"simplement en mappant deux associations plusieurs-à-plusieurs vers la même "
"table de base de données et en déclarant une extrémité comme "
@@ -946,17 +2054,56 @@
"indexée). "
#. Tag: para
+#: collection_mapping.xml:970
#, no-c-format
+msgid "You cannot select an indexed collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:973
+#, fuzzy, no-c-format
msgid ""
-"Here is an example of a bidirectional many-to-many association that "
-"illustrates how each category can have many items and each item can be in "
-"many categories:"
+"shows a bidirectional many-to-many association that illustrates how each "
+"category can have many items and each item can be in many categories:"
msgstr ""
"Voici un exemple d'association bidirectionnelle plusieurs-à-plusieurs ; "
"chaque catégorie peut avoir plusieurs objets et chaque objet peut être dans "
"plusieurs catégories : "
+#. Tag: title
+#: collection_mapping.xml:979
+#, no-c-format
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, no-c-format
+msgid ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:984
#, no-c-format
msgid ""
"Changes made only to the inverse end of the association are <emphasis>not</"
@@ -972,50 +2119,52 @@
"si vous pensez au modèle objet de Java et à la façon dont nous créons une "
"relation plusieurs-à-plusieurs dans Java : "
-#. Tag: para
-#, no-c-format
-msgid ""
-"The non-inverse side is used to save the in-memory representation to the "
-"database."
-msgstr ""
-"La partie non-inverse est utilisée pour sauvegarder la représentation en "
-"mémoire dans la base de données."
+#. Tag: title
+#: collection_mapping.xml:992
+#, fuzzy, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr "Collections de valeurs et associations plusieurs-à-plusieurs"
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:995
#, no-c-format
msgid ""
-"You can define a bidirectional one-to-many association by mapping a one-to-"
-"many association to the same table column(s) as a many-to-one association "
-"and declaring the many-valued end <literal>inverse=\"true\"</literal>."
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
msgstr ""
-"Vous pouvez définir une association bidirectionnelle un-à-plusieurs en "
-"mappant une association un-à-plusieurs vers la(es) même(s) colonne(s) de "
-"table qu'une association plusieurs-à-un et en déclarant l'extrémité pluri-"
-"valuée <literal>inverse=\"true\"</literal>. "
#. Tag: para
+#: collection_mapping.xml:998
#, no-c-format
msgid ""
-"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
-"does not affect the operation of cascades as these are orthogonal concepts."
+"The non-inverse side is used to save the in-memory representation to the "
+"database."
msgstr ""
-"Mapper une extrémité d'une association avec <literal>inverse=\"true\"</"
-"literal> n'affecte pas l'opération de cascades, ce sont des concepts "
-"orthogonaux."
+"La partie non-inverse est utilisée pour sauvegarder la représentation en "
+"mémoire dans la base de données."
#. Tag: title
+#: collection_mapping.xml:1003
#, no-c-format
msgid "Bidirectional associations with indexed collections"
msgstr "Associations bidirectionnelles avec des collections indexées"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1005
+#, fuzzy, no-c-format
msgid ""
-"A bidirectional association where one end is represented as a <literal><"
-"list></literal> or <literal><map></literal>, requires special "
-"consideration. If there is a property of the child class that maps to the "
-"index column you can use <literal>inverse=\"true\"</literal> on the "
-"collection mapping:"
+"There are some additional considerations for bidirectional mappings with "
+"indexed collections (where one end is represented as a <literal><list>"
+"</literal> or <literal><map></literal>) when using Hibernate mapping "
+"files. If there is a property of the child class that maps to the index "
+"column you can use <literal>inverse=\"true\"</literal> on the collection "
+"mapping:"
msgstr ""
"Une association bidirectionnelle où une extrémité est représentée comme une "
"<literal><list></literal> ou une <literal><map></literal> "
@@ -1024,7 +2173,41 @@
"continuer à utiliser <literal>inverse=\"true\"</literal> sur le mappage de "
"la collection : "
+#. Tag: title
+#: collection_mapping.xml:1013
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr "Associations bidirectionnelles avec des collections indexées"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1018
#, no-c-format
msgid ""
"If there is no such property on the child class, the association cannot be "
@@ -1040,7 +2223,42 @@
"mapper la collection <literal>inverse=\"true\"</literal>. Par contre, nous "
"utiliserons le mappage suivant : "
+#. Tag: title
+#: collection_mapping.xml:1026
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr "Associations bidirectionnelles avec des collections indexées"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1032
#, fuzzy, no-c-format
msgid ""
"Note that in this mapping, the collection-valued end of the association is "
@@ -1051,11 +2269,13 @@
"Does this really result in some unnecessary update statements? -->"
#. Tag: title
+#: collection_mapping.xml:1037
#, no-c-format
msgid "Ternary associations"
msgstr "Associations ternaires"
#. Tag: para
+#: collection_mapping.xml:1039
#, no-c-format
msgid ""
"There are three possible approaches to mapping a ternary association. One "
@@ -1065,40 +2285,64 @@
"est d'utiliser une <literal>Map</literal> avec une association comme son "
"index : "
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1044
+#, fuzzy, no-c-format
+msgid "Ternary association mapping"
+msgstr "Associations ternaires"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1046
#, no-c-format
msgid ""
-"A second approach is to remodel the association as an entity class. This is "
-"the most common approach."
+"@Entity\n"
+"public class Company {\n"
+" @Id \n"
+" int id;\n"
+" ...\n"
+" @OneToMany // unidirectional\n"
+" @MapKeyJoinColumn(name=\"employee_id\")\n"
+" Map<Employee, Contract> contracts;\n"
+"}\n"
+"\n"
+"// or\n"
+"\n"
+"<map name=\"contracts\">\n"
+" <key column=\"employer_id\" not-null=\"true\"/>\n"
+" <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+" <one-to-many class=\"Contract\"/>\n"
+"</map>"
msgstr ""
-"Une seconde approche est simplement de remodeler l'association comme une "
-"classe d'entité. C'est l'approche la plus commune. "
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1049
+#, fuzzy, no-c-format
msgid ""
-"A final alternative is to use composite elements, which will be discussed "
-"later."
+"A second approach is to remodel the association as an entity class. This is "
+"the most common approach. A final alternative is to use composite elements, "
+"which will be discussed later."
msgstr ""
-"Une alternative finale est d'utiliser des éléments composites, dont nous "
-"discuterons plus tard. "
+"Une seconde approche est simplement de remodeler l'association comme une "
+"classe d'entité. C'est l'approche la plus commune. "
-#. Tag: title
+#. Tag: literal
+#: collection_mapping.xml:1055
#, fuzzy, no-c-format
-msgid "<literal>Using an <idbag></literal>"
+msgid "Using an <idbag>"
msgstr "<literal>Using an <idbag></literal>"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1057
+#, fuzzy, no-c-format
msgid ""
"The majority of the many-to-many associations and collections of values "
"shown previously all map to tables with composite keys, even though it has "
-"been have suggested that entities should have synthetic identifiers "
-"(surrogate keys). A pure association table does not seem to benefit much "
-"from a surrogate key, although a collection of composite values "
-"<emphasis>might</emphasis>. It is for this reason that Hibernate provides a "
-"feature that allows you to map many-to-many associations and collections of "
-"values to a table with a surrogate key."
+"been suggested that entities should have synthetic identifiers (surrogate "
+"keys). A pure association table does not seem to benefit much from a "
+"surrogate key, although a collection of composite values <emphasis>might</"
+"emphasis>. For this reason Hibernate provides a feature that allows you to "
+"map many-to-many associations and collections of values to a table with a "
+"surrogate key."
msgstr ""
"Si vous êtes bien d'accord avec nous sur le fait que les clés composées sont "
"une mauvaise chose et que les entités devraient avoir des identifiants "
@@ -1113,6 +2357,7 @@
"clé subrogée. "
#. Tag: para
+#: collection_mapping.xml:1066
#, no-c-format
msgid ""
"The <literal><idbag></literal> element lets you map a <literal>List</"
@@ -1122,7 +2367,22 @@
"<literal>List</literal> (ou une <literal>Collection</literal>) avec une "
"sémantique de sac. Par exemple :"
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, no-c-format
+msgid ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1072
#, no-c-format
msgid ""
"An <literal><idbag></literal> has a synthetic id generator, just like "
@@ -1137,6 +2397,7 @@
"subrogée d'une ligne particulière. "
#. Tag: para
+#: collection_mapping.xml:1077
#, no-c-format
msgid ""
"The update performance of an <literal><idbag></literal> supersedes a "
@@ -1151,6 +2412,7 @@
"liste, une map ou un ensemble. "
#. Tag: para
+#: collection_mapping.xml:1082
#, no-c-format
msgid ""
"In the current implementation, the <literal>native</literal> identifier "
@@ -1162,16 +2424,19 @@
"identifiants de collection <literal><idbag></literal>. "
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr "Exemples de collections"
#. Tag: para
+#: collection_mapping.xml:1105
#, no-c-format
msgid "This section covers collection examples."
msgstr "Exemples de collections "
#. Tag: para
+#: collection_mapping.xml:1107
#, no-c-format
msgid ""
"The following class has a collection of <literal>Child</literal> instances:"
@@ -1179,7 +2444,39 @@
"La classe suivante possède une collection d'instances <literal>Child</"
"literal>(filles) :"
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid ""
+"Example classes <classname>Parent</classname> and <classname>Child</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" private long id;\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" private long id;\n"
+" private String name\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, no-c-format
msgid ""
"If each child has, at most, one parent, the most natural mapping is a one-to-"
@@ -1188,12 +2485,103 @@
"Si chaque instance fille a au plus un parent, le mappage le plus naturel est "
"une association un-à-plusieurs :"
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr "Ceci mappe les définitions de tables suivantes :"
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid ""
+"Table definitions for unidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
msgid ""
"If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-"
@@ -1202,48 +2590,523 @@
"Si le parent est <emphasis>requis</emphasis>, utilisez une association "
"bidirectionnelle un-à-plusieurs : "
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+" \n"
+" @ManyToOne\n"
+" private Parent parent;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr "Notez la contrainte <literal>NOT NULL</literal> : "
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1164
#, no-c-format
msgid ""
-"Alternatively, if this association must be unidirectional you can declare "
-"the <literal>NOT NULL</literal> constraint on the <literal><key></"
-"literal> mapping:"
+"Table definitions for bidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1171
+#, fuzzy, no-c-format
+msgid ""
+"Alternatively, if this association must be unidirectional you can enforce "
+"the <literal>NOT NULL</literal> constraint."
+msgstr ""
"Alternativement, si vous insistez absolument pour que cette association soit "
"unidirectionnelle, vous pouvez déclarer la contrainte <literal>NOT NULL</"
"literal> sur le mappage <literal><key></literal> : "
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1175
#, no-c-format
msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(optional=false)\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1188
+#, fuzzy, no-c-format
+msgid ""
"On the other hand, if a child has multiple parents, a many-to-many "
-"association is appropriate:"
+"association is appropriate."
msgstr ""
"D'autre part, si un enfant peut avoir plusieurs parents, une association "
"plusieurs-à-plusieurs est plus appropriée : "
+#. Tag: title
+#: collection_mapping.xml:1192
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using "
+"annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @ManyToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using mapping "
+"files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr "Définitions des tables :"
+#. Tag: title
+#: collection_mapping.xml:1208
+#, no-c-format
+msgid "Table definitions for many to many releationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1213
#, fuzzy, no-c-format
msgid ""
"For more examples and a complete explanation of a parent/child relationship "
-"mapping, see <xref linkend=\"example-parentchild\" /> for more information."
+"mapping, see <xref linkend=\"example-parentchild\"/> for more information. "
+"Even more complex association mappings are covered in the next chapter."
msgstr ""
"Pour plus d'exemples et une revue complète du mappage de la relation parent/"
"enfant, consultez le <xref linkend=\"example-parentchild\" />. "
-#. Tag: para
-#, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
-msgstr ""
-"Des mappages d'association plus exotiques sont possibles, nous cataloguerons "
-"toutes les possibilités dans le prochain chapitre. "
+#~ msgid ""
+#~ "Hibernate requires that persistent collection-valued fields be declared "
+#~ "as an interface type. For example:"
+#~ msgstr ""
+#~ "Hibernate requiert que les champs contenant des collections persistantes "
+#~ "soient déclarés comme des types d'interface, par exemple : "
+
+#~ msgid "Collection mappings"
+#~ msgstr "Mapper une collection"
+
+#~ msgid ""
+#~ "There are quite a range of mappings that can be generated for collections "
+#~ "that cover many common relational models. We suggest you experiment with "
+#~ "the schema generation tool so that you understand how various mapping "
+#~ "declarations translate to database tables."
+#~ msgstr ""
+#~ "Il y a une grande variété de mappages qui peuvent être générés pour les "
+#~ "collections, couvrant beaucoup de nombreux modèles relationnels communs. "
+#~ "Nous vous suggérons d'expérimenter avec l'outil de génération de schéma "
+#~ "pour cerner comment les différentes déclarations de mappage se traduisent "
+#~ "vers des tables de bases de données. "
+
+#~ msgid "Collection elements"
+#~ msgstr "Les éléments d'une collection"
+
+#~ msgid ""
+#~ "The contained type is referred to as the <emphasis>collection element "
+#~ "type</emphasis>. Collection elements are mapped by <literal><"
+#~ "element></literal> or <literal><composite-element></literal>, or "
+#~ "in the case of entity references, with <literal><one-to-many></"
+#~ "literal> or <literal><many-to-many></literal>. The first two map "
+#~ "elements with value semantics, the next two are used to map entity "
+#~ "associations."
+#~ msgstr ""
+#~ "Le type contenu est référencé comme le <emphasis>type de l'élément de la "
+#~ "collection</emphasis>. Les éléments de la collections sont mappés par "
+#~ "<literal><element></literal> ou <literal><composite-element></"
+#~ "literal>, ou dans le cas des références d'entité, avec <literal><one-"
+#~ "to-many></literal> ou <literal><many-to-many></literal>. Les "
+#~ "deux premiers mappent des éléments avec une sémantique de valeur, les "
+#~ "deux suivants sont utilisés pour mapper des associations d'entité."
+
+#~ msgid ""
+#~ "All collection mappings, except those with set and bag semantics, need an "
+#~ "<emphasis>index column</emphasis> in the collection table. An index "
+#~ "column is a column that maps to an array index, or <literal>List</"
+#~ "literal> index, or <literal>Map</literal> key. The index of a "
+#~ "<literal>Map</literal> may be of any basic type, mapped with <literal><"
+#~ "map-key></literal>. It can be an entity reference mapped with "
+#~ "<literal><map-key-many-to-many></literal>, or it can be a composite "
+#~ "type mapped with <literal><composite-map-key></literal>. The index "
+#~ "of an array or list is always of type <literal>integer</literal> and is "
+#~ "mapped using the <literal><list-index></literal> element. The "
+#~ "mapped column contains sequential integers that are numbered from zero by "
+#~ "default."
+#~ msgstr ""
+#~ "Tous les mappages de collection, exceptés ceux avec les sémantiques "
+#~ "d'ensemble (set) et de sac (bag), ont besoin d'une <emphasis>colonne "
+#~ "d'index</emphasis> dans la table de la collection - une colonne qui mappe "
+#~ "un index de tableau, ou un index de <literal>List</literal>, ou une clé "
+#~ "de <literal>Map</literal>. L'index d'une <literal>Map</literal> peut être "
+#~ "n'importe quel type basique, mappé avec <literal><map-key></"
+#~ "literal>, ou peut être une référence d'entité mappée avec <literal><"
+#~ "map-key-many-to-many></literal>, ou peut être un type composé, mappé "
+#~ "avec <literal><composite-map-key></literal>. L'index d'un tableau "
+#~ "ou d'une liste est toujours de type <literal>integer</literal> et est "
+#~ "mappé en utilisant l'élément <literal><list-index></literal>. Les "
+#~ "colonnes mappées contiennent des entiers séquentiels (numérotés à partir "
+#~ "de zéro par défaut). "
+
+#~ msgid ""
+#~ "Any collection of values or many-to-many associations requires a "
+#~ "dedicated <emphasis>collection table</emphasis> with a foreign key column "
+#~ "or columns, <emphasis>collection element column</emphasis> or columns, "
+#~ "and possibly an index column or columns."
+#~ msgstr ""
+#~ "Toute collection de valeurs ou association plusieurs-à-plusieurs requiert "
+#~ "une <emphasis>table de collection</emphasis> avec une(des) colonne(s) de "
+#~ "clé étrangère, une(des) <emphasis>colonne(s) d'élément de la collection</"
+#~ "emphasis> ou des colonnes et éventuellement une(des) colonne(s) d'index. "
+
+#~ msgid ""
+#~ "A <emphasis>many-to-many association</emphasis> is specified using the "
+#~ "<literal><many-to-many></literal> element."
+#~ msgstr ""
+#~ "Une association <emphasis>many-to-many</emphasis> est spécifiée en "
+#~ "utilisant l'élément <literal><many-to-many></literal>."
+
+#~ msgid ""
+#~ "<literal>column</literal> (optional): the name of the element foreign key "
+#~ "column."
+#~ msgstr ""
+#~ "<literal>colonne</literal> (optionnel) : le nom de la colonne de clés "
+#~ "étrangères des éléments."
+
+#~ msgid ""
+#~ "<literal>formula</literal> (optional): an SQL formula used to evaluate "
+#~ "the element foreign key value."
+#~ msgstr ""
+#~ "<literal>formula</literal> (optionnel): formule SQL utilisée pour évaluer "
+#~ "la valeur des clés étrangères des éléments."
+
+#~ msgid ""
+#~ "<literal>fetch</literal> (optional - defaults to <literal>join</"
+#~ "literal>): enables outer-join or sequential select fetching for this "
+#~ "association. This is a special case; for full eager fetching in a single "
+#~ "<literal>SELECT</literal> of an entity and its many-to-many relationships "
+#~ "to other entities, you would enable <literal>join</literal> fetching,not "
+#~ "only of the collection itself, but also with this attribute on the "
+#~ "<literal><many-to-many></literal> nested element."
+#~ msgstr ""
+#~ "<literal>fetch</literal> (optionnel - par défaut <literal>join</"
+#~ "literal>): permet la récupération par jointures externes ou bien par "
+#~ "selects séquentiels pour cette association. Il s'agit d'un cas "
+#~ "particulier de récupération. Pour que la récupération soit toujours "
+#~ "rapportée en un seul <literal>SELECT</literal> d'entité ou à partir de "
+#~ "ses relations many-to-many à d'autres entités, vous devrez activer la "
+#~ "récupération <literal>join</literal>, non seulement pour la collection "
+#~ "elle-même, mais aussi avec cet attribut qui se trouve sur l'élément "
+#~ "<literal><many-to-many></literal>."
+
+#~ msgid ""
+#~ "<literal>unique</literal> (optional): enables the DDL generation of a "
+#~ "unique constraint for the foreign-key column. This makes the association "
+#~ "multiplicity effectively one-to-many."
+#~ msgstr ""
+#~ "<literal>unique</literal> (optionnel): permet la génération DDL d'une "
+#~ "seule contrainte pour la colonne de la clé étrangère. Cela transforme la "
+#~ "muticiplicité de l'association en one-to-many."
+
+#~ msgid ""
+#~ "<literal>not-found</literal> (optional - defaults to <literal>exception</"
+#~ "literal>): specifies how foreign keys that reference missing rows will be "
+#~ "handled: <literal>ignore</literal> will treat a missing row as a null "
+#~ "association."
+#~ msgstr ""
+#~ "<literal>not-found</literal> (optionnel - par défaut <literal>exception</"
+#~ "literal>) : spécifie comment les clés étrangères cachées qui référencent "
+#~ "des lignes manquantes seront gérées : <literal>ignore</literal> traitera "
+#~ "une ligne manquante comme une association nulle."
+
+#~ msgid ""
+#~ "<literal>property-ref</literal> (optional): the name of a property of the "
+#~ "associated class that is joined to this foreign key. If not specified, "
+#~ "the primary key of the associated class is used."
+#~ msgstr ""
+#~ "<literal>property-ref</literal> (optionnel): nom d'une propriété de la "
+#~ "classe associée associée à une clé étrangère. Si elle n'est pas précisée, "
+#~ "la clé primaire de la classe associée sera alors utilisée."
+
+#~ msgid "Here are some examples."
+#~ msgstr "Voici quelques exemples :"
+
+#~ msgid "A set of strings:"
+#~ msgstr "Un ensemble de chaînes de caractères :"
+
+#~ msgid ""
+#~ "A bag containing integers with an iteration order determined by the "
+#~ "<literal>order-by</literal> attribute:"
+#~ msgstr ""
+#~ "Un sac contenant des entiers (avec un ordre d'itération déterminé par "
+#~ "l'attribut <literal>order-by</literal>) : "
+
+#~ msgid "An array of entities, in this case, a many-to-many association:"
+#~ msgstr ""
+#~ "Un tableau d'entités - dans ce cas, une association plusieurs-à-"
+#~ "plusieurs : "
+
+#~ msgid "A map from string indices to dates:"
+#~ msgstr "Une map de chaînes de caractères vers des dates :"
+
+#~ msgid "A list of components (this is discussed in the next chapter):"
+#~ msgstr "Une liste de composants (traité dans le prochain chapitre) : "
+
+#~ msgid "One-to-many associations"
+#~ msgstr "Associations un-à-plusieurs"
+
+#~ msgid ""
+#~ "A <emphasis>one-to-many association</emphasis> links the tables of two "
+#~ "classes via a foreign key with no intervening collection table. This "
+#~ "mapping loses certain semantics of normal Java collections:"
+#~ msgstr ""
+#~ "Une <emphasis>association un-à-plusieurs</emphasis> lie les tables de "
+#~ "deux classes par une clé étrangère, sans l'intervention d'une table de "
+#~ "collection. Ce mappage perd certaines sémantiques des collections Java "
+#~ "normales : "
+
+#~ msgid ""
+#~ "The following example shows a map of <literal>Part</literal> entities by "
+#~ "name, where <literal>partName</literal> is a persistent property of "
+#~ "<literal>Part</literal>. Notice the use of a formula-based index:"
+#~ msgstr ""
+#~ "Cet exemple montre une map d'entités <literal>Part</literal> par nom (où "
+#~ "<literal>partName</literal> est une propriété persistante de "
+#~ "<literal>Part</literal>). Notez l'utilisation d'un index basé sur une "
+#~ "formule :"
+
+#~ msgid ""
+#~ "Hibernate supports collections implementing <literal>java.util.SortedMap</"
+#~ "literal> and <literal>java.util.SortedSet</literal>. You must specify a "
+#~ "comparator in the mapping file:"
+#~ msgstr ""
+#~ "Hibernate supporte des collections implémentant <literal>java.util."
+#~ "SortedMap</literal> et <literal>java.util.SortedSet</literal>. Vous devez "
+#~ "spécifier un comparateur dans le fichier de mappage :"
+
+#~ msgid ""
+#~ "A final alternative is to use composite elements, which will be discussed "
+#~ "later."
+#~ msgstr ""
+#~ "Une alternative finale est d'utiliser des éléments composites, dont nous "
+#~ "discuterons plus tard. "
+
+#~ msgid ""
+#~ "Even more complex association mappings are covered in the next chapter."
+#~ msgstr ""
+#~ "Des mappages d'association plus exotiques sont possibles, nous "
+#~ "cataloguerons toutes les possibilités dans le prochain chapitre. "
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/configuration.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/configuration.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/configuration.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: configuration\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 09:05+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,11 +17,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr "Configuration"
#. Tag: para
+#: configuration.xml:33
#, no-c-format
msgid ""
"Hibernate is designed to operate in many different environments and, as "
@@ -40,11 +42,13 @@
"besoins."
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr "Configuration par programmation"
#. Tag: para
+#: configuration.xml:43
#, no-c-format
msgid ""
"An instance of <classname>org.hibernate.cfg.Configuration</classname> "
@@ -60,6 +64,7 @@
"mappages sont constitués d'un ensemble de fichiers de mappage XML. "
#. Tag: para
+#: configuration.xml:51
#, no-c-format
msgid ""
"You can obtain a <classname>org.hibernate.cfg.Configuration</classname> "
@@ -72,7 +77,17 @@
"mappage. Si les fichiers de mappage sont dans le classpath, vous pouvez "
"utiliser la méthode <literal>addResource()</literal> : "
+#. Tag: programlisting
+#: configuration.xml:57
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:59
#, no-c-format
msgid ""
"An alternative way is to specify the mapped class and allow Hibernate to "
@@ -81,7 +96,17 @@
"Une solution alternative consiste à spécifier la classe mappée et à donner à "
"Hibernate la possibilité de trouver les documents de mappage pour vous :"
+#. Tag: programlisting
+#: configuration.xml:62
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:64
#, no-c-format
msgid ""
"Hibernate will then search for mapping files named <filename>/org/hibernate/"
@@ -95,6 +120,7 @@
"en dur. "
#. Tag: para
+#: configuration.xml:69
#, no-c-format
msgid ""
"A <classname>org.hibernate.cfg.Configuration</classname> also allows you to "
@@ -103,7 +129,22 @@
"Une <literal>Configuration</literal> vous permet également de préciser des "
"propriétés de configuration. Par exemple :"
+#. Tag: programlisting
+#: configuration.xml:72
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:74
#, no-c-format
msgid ""
"This is not the only way to pass configuration properties to Hibernate. Some "
@@ -113,6 +154,7 @@
"Hibernate. Les différentes options sont : "
#. Tag: para
+#: configuration.xml:79
#, no-c-format
msgid ""
"Pass an instance of <classname>java.util.Properties</classname> to "
@@ -122,6 +164,7 @@
"<literal>Configuration.setProperties()</literal>. "
#. Tag: para
+#: configuration.xml:84
#, no-c-format
msgid ""
"Place a file named <filename>hibernate.properties</filename> in a root "
@@ -131,6 +174,7 @@
"chemin de classe."
#. Tag: para
+#: configuration.xml:89
#, no-c-format
msgid ""
"Set <literal>System</literal> properties using <literal>java -"
@@ -140,6 +184,7 @@
"<literal>java -Dproperty=value</literal>."
#. Tag: para
+#: configuration.xml:94
#, no-c-format
msgid ""
"Include <literal><property></literal> elements in <literal>hibernate."
@@ -149,6 +194,7 @@
"<literal>hibernate.cfg.xml</literal> (voir plus loin). "
#. Tag: para
+#: configuration.xml:99
#, no-c-format
msgid ""
"If you want to get started quickly<filename>hibernate.properties</filename> "
@@ -158,6 +204,7 @@
"filename> est l'approche la plus facile."
#. Tag: para
+#: configuration.xml:103
#, no-c-format
msgid ""
"The <classname>org.hibernate.cfg.Configuration</classname> is intended as a "
@@ -169,11 +216,13 @@
"literal> aura été créée."
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr "Obtenir une SessionFactory"
#. Tag: para
+#: configuration.xml:111
#, fuzzy, no-c-format
msgid ""
"When all mappings have been parsed by the <classname>org.hibernate.cfg."
@@ -186,7 +235,14 @@
"<literal>Session</literal>. Cette fabrique sera partagée entre tous les "
"threads de l'application : "
+#. Tag: programlisting
+#: configuration.xml:117
+#, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:119
#, fuzzy, no-c-format
msgid ""
"Hibernate does allow your application to instantiate more than one "
@@ -198,11 +254,13 @@
"plus d'une base de données. "
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr "Connexions JDBC "
#. Tag: para
+#: configuration.xml:127
#, no-c-format
msgid ""
"It is advisable to have the <interfacename>org.hibernate.SessionFactory</"
@@ -215,7 +273,14 @@
"Si vous suivez cette approche, ouvrir une <interfacename>org.hibernate."
"Session</interfacename> est aussi simple que :"
+#. Tag: programlisting
+#: configuration.xml:133
+#, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:135
#, no-c-format
msgid ""
"Once you start a task that requires access to the database, a JDBC "
@@ -225,6 +290,7 @@
"données, une connexion JDBC sera récupérée dans le pool."
#. Tag: para
+#: configuration.xml:138
#, no-c-format
msgid ""
"Before you can do this, you first need to pass some JDBC connection "
@@ -240,6 +306,7 @@
"plus importants. "
#. Tag: para
+#: configuration.xml:144
#, no-c-format
msgid ""
"Hibernate will obtain and pool connections using <classname>java.sql."
@@ -250,71 +317,89 @@
"de la manière suivante : "
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr "Propriétés JDBC de Hibernate"
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327
+#: configuration.xml:495 configuration.xml:657 configuration.xml:753
+#: configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr "Nom de la propriété"
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329
+#: configuration.xml:497 configuration.xml:659 configuration.xml:755
+#: configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr "Fonction"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+#. Tag: property
+#: configuration.xml:166
+#, fuzzy, no-c-format
+msgid "hibernate.connection.driver_class"
msgstr "<property>hibernate.connection.driver_class</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:168
+#, fuzzy, no-c-format
+msgid "JDBC driver class"
msgstr "<emphasis>Classe de pilote JDBC</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+#. Tag: property
+#: configuration.xml:172
+#, fuzzy, no-c-format
+msgid "hibernate.connection.url"
msgstr "<property>hibernate.connection.url</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:174
#, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
-msgstr "<emphasis>JDBC URL</emphasis>"
+msgid "JDBC URL"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.username</property>"
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
+#, fuzzy, no-c-format
+msgid "hibernate.connection.username"
msgstr "<property>hibernate.connection.username</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:180
#, no-c-format
-msgid "<emphasis>database user</emphasis>"
-msgstr "<emphasis>utilisateur de la base de données</emphasis>"
+msgid "database user"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.password</property>"
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
+#, fuzzy, no-c-format
+msgid "hibernate.connection.password"
msgstr "<property>hibernate.connection.password</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>database user password</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:186
+#, fuzzy, no-c-format
+msgid "database user password"
msgstr "<emphasis>mot de passe de l'utilisateur de base de données</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+#. Tag: property
+#: configuration.xml:190
+#, fuzzy, no-c-format
+msgid "hibernate.connection.pool_size"
msgstr "<property>hibernate.connection.pool_size</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:192
+#, fuzzy, no-c-format
+msgid "maximum number of pooled connections"
msgstr "<emphasis>nombre maximum de connexions dans le pool</emphasis>"
#. Tag: para
+#: configuration.xml:199
#, no-c-format
msgid ""
"Hibernate's own connection pooling algorithm is, however, quite rudimentary. "
@@ -336,6 +421,7 @@
"C3P0. "
#. Tag: para
+#: configuration.xml:208
#, no-c-format
msgid ""
"C3P0 is an open source JDBC connection pool distributed along with Hibernate "
@@ -355,6 +441,7 @@
"web Hibernate pour plus d'informations. "
#. Tag: para
+#: configuration.xml:216
#, no-c-format
msgid ""
"The following is an example <filename>hibernate.properties</filename> file "
@@ -363,7 +450,23 @@
"Voici un exemple de fichier <literal>hibernate.properties</literal> pour "
"C3P0: "
+#. Tag: programlisting
+#: configuration.xml:219
+#, no-c-format
+msgid ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:221
#, no-c-format
msgid ""
"For use inside an application server, you should almost always configure "
@@ -378,36 +481,43 @@
"moins une des propriétés suivantes : "
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr "Propriétés d'une Datasource Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+#. Tag: property
+#: configuration.xml:244
+#, fuzzy, no-c-format
+msgid "hibernate.connection.datasource"
msgstr "<property>hibernate.connection.datasource</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:246
+#, fuzzy, no-c-format
+msgid "datasource JNDI name"
msgstr "<emphasis>nom JNDI de la source de données</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+#. Tag: property
+#: configuration.xml:250
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.url"
msgstr "<property>hibernate.jndi.url</property>"
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr "<emphasis>URL du fournisseur JNDI</emphasis> (optionnel)"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+#. Tag: property
+#: configuration.xml:257
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.class"
msgstr "<property>hibernate.jndi.class</property>"
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
msgid ""
"<emphasis>class of the JNDI <literal>InitialContextFactory</literal></"
@@ -417,11 +527,13 @@
"(optionnel)"
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr "<emphasis>utilisateur de base de données</emphasis> (optionnel)"
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
msgstr ""
@@ -429,6 +541,7 @@
"(optionnel)"
#. Tag: para
+#: configuration.xml:280
#, no-c-format
msgid ""
"Here is an example <filename>hibernate.properties</filename> file for an "
@@ -437,7 +550,20 @@
"Voici un exemple de fichier <literal>hibernate.properties</literal> pour "
"l'utilisation d'une datasource JNDI fournie par un serveur d'applications : "
+#. Tag: programlisting
+#: configuration.xml:283
+#, no-c-format
+msgid ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
msgid ""
"JDBC connections obtained from a JNDI datasource will automatically "
@@ -448,6 +574,7 @@
"d'applications."
#. Tag: para
+#: configuration.xml:289
#, no-c-format
msgid ""
"Arbitrary connection properties can be given by prepending "
@@ -461,6 +588,7 @@
"<literal>hibernate.connection.charSet</literal>. "
#. Tag: para
+#: configuration.xml:294
#, no-c-format
msgid ""
"You can define your own plugin strategy for obtaining JDBC connections by "
@@ -476,11 +604,13 @@
"literal>."
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr "Propriétés de configuration optionnelles"
#. Tag: para
+#: configuration.xml:304
#, no-c-format
msgid ""
"There are a number of other properties that control the behavior of "
@@ -491,6 +621,7 @@
"comme valeurs par défaut des valeurs raisonnables."
#. Tag: para
+#: configuration.xml:309
#, fuzzy, no-c-format
msgid ""
"<emphasis>Some of these properties are \"system-level\" only.</emphasis> "
@@ -506,16 +637,19 @@
"dessus. "
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr "Propriétés de configuration Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.dialect</property>"
+#. Tag: property
+#: configuration.xml:335
+#, fuzzy, no-c-format
+msgid "hibernate.dialect"
msgstr "<property>hibernate.dialect</property>"
#. Tag: entry
+#: configuration.xml:337
#, no-c-format
msgid ""
"The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</"
@@ -527,6 +661,7 @@
"une base de données relationnelle particulière. "
#. Tag: para
+#: configuration.xml:340
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of."
@@ -536,6 +671,7 @@
"Dialect</literal> "
#. Tag: para
+#: configuration.xml:341
#, no-c-format
msgid ""
"In most cases Hibernate will actually be able to choose the correct "
@@ -547,12 +683,14 @@
"convient sur la base des <literal>métadonnées JDBC</literal> retournées par "
"le driver JDBC."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+#. Tag: property
+#: configuration.xml:349
+#, fuzzy, no-c-format
+msgid "hibernate.show_sql"
msgstr "<property>hibernate.show_sql</property>"
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
msgid ""
"Write all SQL statements to console. This is an alternative to setting the "
@@ -564,6 +702,11 @@
"<literal>debug</literal>. "
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426
+#: configuration.xml:435 configuration.xml:443 configuration.xml:453
+#: configuration.xml:468 configuration.xml:525 configuration.xml:545
+#: configuration.xml:555 configuration.xml:598 configuration.xml:797
+#: configuration.xml:808 configuration.xml:904
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
@@ -572,22 +715,26 @@
" <emphasis role=\"strong\">par ex.</emphasis><literal>true</literal> | "
"<literal>false</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+#. Tag: property
+#: configuration.xml:359
+#, fuzzy, no-c-format
+msgid "hibernate.format_sql"
msgstr "<property>hibernate.format_sql</property>"
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr "Effectue un pretty print du SQL dans la console et dans le log. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+#. Tag: property
+#: configuration.xml:367
+#, fuzzy, no-c-format
+msgid "hibernate.default_schema"
msgstr "<property>hibernate.default_schema</property>"
#. Tag: entry
+#: configuration.xml:369
#, no-c-format
msgid ""
"Qualify unqualified table names with the given schema/tablespace in "
@@ -597,18 +744,21 @@
"SQL généré."
#. Tag: para
+#: configuration.xml:370
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
msgstr ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+#. Tag: property
+#: configuration.xml:376
+#, fuzzy, no-c-format
+msgid "hibernate.default_catalog"
msgstr "<property>hibernate.default_catalog</property>"
#. Tag: entry
+#: configuration.xml:378
#, no-c-format
msgid ""
"Qualifies unqualified table names with the given catalog in generated SQL."
@@ -617,18 +767,21 @@
"généré. "
#. Tag: para
+#: configuration.xml:379
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
msgstr ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+#. Tag: property
+#: configuration.xml:384
+#, fuzzy, no-c-format
+msgid "hibernate.session_factory_name"
msgstr "<property>hibernate.session_factory_name</property>"
#. Tag: entry
+#: configuration.xml:386
#, no-c-format
msgid ""
"The <interfacename>org.hibernate.SessionFactory</interfacename> will be "
@@ -638,6 +791,7 @@
"automatiquement liée à ce nom dans JNDI après sa création. "
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
@@ -646,12 +800,14 @@
" <emphasis role=\"strong\">par ex.</emphasis><literal>jndi/composite/name</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+#. Tag: property
+#: configuration.xml:394
+#, fuzzy, no-c-format
+msgid "hibernate.max_fetch_depth"
msgstr "<property>hibernate.max_fetch_depth</property>"
#. Tag: entry
+#: configuration.xml:396
#, no-c-format
msgid ""
"Sets a maximum \"depth\" for the outer join fetch tree for single-ended "
@@ -664,6 +820,7 @@
"externe."
#. Tag: para
+#: configuration.xml:398
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -672,12 +829,14 @@
"<emphasis role=\"strong\">par ex.</emphasis> valeurs recommandées entre "
"<literal>0</literal> et <literal>3</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+#. Tag: property
+#: configuration.xml:404
+#, fuzzy, no-c-format
+msgid "hibernate.default_batch_fetch_size"
msgstr "<property>hibernate.default_batch_fetch_size</property>"
#. Tag: entry
+#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr ""
@@ -685,6 +844,7 @@
"Hibernate "
#. Tag: para
+#: configuration.xml:407
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</"
@@ -693,12 +853,14 @@
"<emphasis role=\"strong\">ex.</emphasis> valeurs recommandées : <literal>4</"
"literal>, <literal>8</literal>, <literal>16</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+#. Tag: property
+#: configuration.xml:413
+#, fuzzy, no-c-format
+msgid "hibernate.default_entity_mode"
msgstr "<property>hibernate.default_entity_mode</property>"
#. Tag: entry
+#: configuration.xml:415
#, fuzzy, no-c-format
msgid ""
"Sets a default mode for entity representation for all sessions opened from "
@@ -708,6 +870,7 @@
"sessions ouvertes depuis cette <literal>SessionFactory</literal> "
#. Tag: para
+#: configuration.xml:416
#, no-c-format
msgid ""
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
@@ -716,12 +879,14 @@
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+#. Tag: property
+#: configuration.xml:422
+#, fuzzy, no-c-format
+msgid "hibernate.order_updates"
msgstr "<property>hibernate.order_updates</property>"
#. Tag: entry
+#: configuration.xml:424
#, no-c-format
msgid ""
"Forces Hibernate to order SQL updates by the primary key value of the items "
@@ -732,12 +897,14 @@
"primaire des éléments mis à jour. Cela permet de limiter les deadlocks de "
"transaction dans les systèmes hautement concurrents."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
-msgstr "<property>hibernate.generate_statistics</property>"
+#. Tag: property
+#: configuration.xml:432
+#, fuzzy, no-c-format
+msgid "hibernate.generate_statistics"
+msgstr "Statistiques Hibernate"
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
msgid ""
"If enabled, Hibernate will collect statistics useful for performance tuning."
@@ -745,12 +912,14 @@
"Si activé, Hibernate va collecter des statistiques utiles pour le réglage "
"des performances. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+#. Tag: property
+#: configuration.xml:440
+#, fuzzy, no-c-format
+msgid "hibernate.use_identifier_rollback"
msgstr "<property>hibernate.use_identifer_rollback</property>"
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
msgid ""
"If enabled, generated identifier properties will be reset to default values "
@@ -759,12 +928,14 @@
"Si activé, les propriétés correspondant à l'identifiant des objets sont "
"remises aux valeurs par défaut lorsque les objets sont supprimés. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
+#. Tag: property
+#: configuration.xml:449
+#, fuzzy, no-c-format
+msgid "hibernate.use_sql_comments"
msgstr "<property>hibernate.use_sql_comments</property>"
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
msgid ""
"If turned on, Hibernate will generate comments inside the SQL, for easier "
@@ -773,17 +944,51 @@
"Si activé, Hibernate génère des commentaires à l'intérieur des requêtes SQL "
"pour faciliter le débogage, par défaut à <literal>false</literal>."
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:460
+#, no-c-format
+msgid ""
+"Setting is relevant when using <classname>@GeneratedValue</classname>. It "
+"indicates whether or not the new <classname>IdentifierGenerator</classname> "
+"implementations are used for <classname>javax.persistence.GenerationType."
+"AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</"
+"classname> and <classname>javax.persistence.GenerationType.SEQUENCE</"
+"classname>. Default to <literal>false</literal> to keep backward "
+"compatibility."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid ""
+"We recommend all new projects which make use of to use "
+"<classname>@GeneratedValue</classname> to also set <code>hibernate.id."
+"new_generator_mappings=true</code> as the new generators are more efficient "
+"and closer to the JPA 2 specification semantic. However they are not "
+"backward compatible with existing databases (if a sequence or a table is "
+"used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr "Propriétés Hibernate liées à JDBC et aux connexions"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+#. Tag: property
+#: configuration.xml:503
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.fetch_size"
msgstr "<property>hibernate.jdbc.fetch_size</property>"
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
msgid ""
"A non-zero value determines the JDBC fetch size (calls <literal>Statement."
@@ -792,12 +997,14 @@
"Une valeur non nulle détermine la taille des chargements JDBC (appelle "
"<literal>Statement.setFetchSize()</literal>)."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+#. Tag: property
+#: configuration.xml:510
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_size"
msgstr "<property>hibernate.jdbc.batch_size</property>"
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr ""
@@ -805,6 +1012,7 @@
"lot de JDBC2. "
#. Tag: para
+#: configuration.xml:513
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -813,16 +1021,18 @@
"<emphasis role=\"strong\">ex.</emphasis> les valeurs recommandées entre "
"<literal>5</literal> et <literal>30</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+#. Tag: property
+#: configuration.xml:519
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr "<property>hibernate.jdbc.batch_versioned_data</property>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:521
+#, fuzzy, no-c-format
msgid ""
"Set this property to <literal>true</literal> if your JDBC driver returns "
-"correct row counts from <literal>executeBatch()</literal>. Iit is usually "
+"correct row counts from <literal>executeBatch()</literal>. It is usually "
"safe to turn this option on. Hibernate will then use batched DML for "
"automatically versioned data. Defaults to <literal>false</literal>."
msgstr ""
@@ -832,12 +1042,14 @@
"utilisera alors le \"batched DML\" pour les données automatiquement "
"versionnées. Par défaut à <literal>false</literal>. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+#. Tag: property
+#: configuration.xml:531
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.factory_class"
msgstr "<property>hibernate.jdbc.factory_class</property>"
#. Tag: entry
+#: configuration.xml:533
#, no-c-format
msgid ""
"Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. "
@@ -848,6 +1060,7 @@
"propriété de configuration."
#. Tag: para
+#: configuration.xml:535
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -856,12 +1069,14 @@
"<emphasis role=\"strong\">par.ex.</emphasis> <literal>classname.of."
"BatcherFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+#. Tag: property
+#: configuration.xml:541
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr "<property>hibernate.jdbc.use_scrollable_resultset</property>"
#. Tag: entry
+#: configuration.xml:543
#, no-c-format
msgid ""
"Enables use of JDBC2 scrollable resultsets by Hibernate. This property is "
@@ -873,12 +1088,14 @@
"connexions JDBC fournies par l'utilisateur. Autrement, Hibernate utilise les "
"métadonnées de la connexion."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+#. Tag: property
+#: configuration.xml:551
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr "<property>hibernate.jdbc.use_streams_for_binary</property>"
#. Tag: entry
+#: configuration.xml:553
#, no-c-format
msgid ""
"Use streams when writing/reading <literal>binary</literal> or "
@@ -889,12 +1106,14 @@
"ou des types <literal>serializable</literal>vers/à partir de JDBC. "
"<emphasis>*system-level property*</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+#. Tag: property
+#: configuration.xml:561
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr "<property>hibernate.jdbc.use_get_generated_keys</property>"
#. Tag: entry
+#: configuration.xml:563
#, no-c-format
msgid ""
"Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> "
@@ -911,17 +1130,21 @@
"metadonnées de connexion."
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687
+#: configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
msgstr ""
"<emphasis role=\"strong\">par ex.</emphasis> <literal>true|false</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+#. Tag: property
+#: configuration.xml:574
+#, fuzzy, no-c-format
+msgid "hibernate.connection.provider_class"
msgstr "<property>hibernate.connection.provider_class</property>"
#. Tag: entry
+#: configuration.xml:576
#, no-c-format
msgid ""
"The classname of a custom <interfacename>org.hibernate.connection."
@@ -933,6 +1156,7 @@
"JDBC à Hibernate."
#. Tag: para
+#: configuration.xml:578
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -941,12 +1165,14 @@
"<emphasis role=\"strong\">par ex.</emphasis><literal>classname.of."
"ConnectionProvider</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+#. Tag: property
+#: configuration.xml:584
+#, fuzzy, no-c-format
+msgid "hibernate.connection.isolation"
msgstr "<property>hibernate.connection.isolation</property>"
#. Tag: entry
+#: configuration.xml:586
#, no-c-format
msgid ""
"Sets the JDBC transaction isolation level. Check <interfacename>java.sql."
@@ -961,29 +1187,34 @@
"supplémentaires."
#. Tag: para
+#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
msgstr ""
"<emphasis role=\"strong\">par ex.</emphasis><literal>1, 2, 4, 8</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+#. Tag: property
+#: configuration.xml:595
+#, fuzzy, no-c-format
+msgid "hibernate.connection.autocommit"
msgstr " hibernate.connection.autocommit"
#. Tag: entry
+#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr ""
"Active le mode de commit automatique (autocommit) pour les connexions JDBC "
"du pool (non recommandé). "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+#. Tag: property
+#: configuration.xml:603
+#, fuzzy, no-c-format
+msgid "hibernate.connection.release_mode"
msgstr "<property>hibernate.connection.release_mode</property>"
#. Tag: entry
+#: configuration.xml:605
#, no-c-format
msgid ""
"Specifies when Hibernate should release JDBC connections. By default, a JDBC "
@@ -1009,6 +1240,7 @@
"transactions JDBC. "
#. Tag: para
+#: configuration.xml:615
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) "
@@ -1020,15 +1252,15 @@
"<literal>after_statement</literal>"
#. Tag: para
-#, no-c-format
+#: configuration.xml:618
+#, fuzzy, no-c-format
msgid ""
"This setting only affects <literal>Session</literal>s returned from "
"<literal>SessionFactory.openSession</literal>. For <literal>Session</"
"literal>s obtained through <literal>SessionFactory.getCurrentSession</"
"literal>, the <literal>CurrentSessionContext</literal> implementation "
"configured for use controls the connection release mode for those "
-"<literal>Session</literal>s. See <xref linkend=\"architecture-current-session"
-"\" />"
+"<literal>Session</literal>s. See"
msgstr ""
"Remarquez que ce paramètre influence uniquement les <literal>Session</"
"literal> s retournées depuis <literal>SessionFactory.openSession</literal>. "
@@ -1039,6 +1271,7 @@
"literal> s. Consultez <xref linkend=\"architecture-current-session\" />"
#. Tag: entry
+#: configuration.xml:630
#, no-c-format
msgid ""
"<property>hibernate.connection.</property><emphasis><propertyName></"
@@ -1048,6 +1281,7 @@
"emphasis>"
#. Tag: entry
+#: configuration.xml:632
#, no-c-format
msgid ""
"Pass the JDBC property <emphasis><propertyName></emphasis> to "
@@ -1057,6 +1291,7 @@
"<literal>DriverManager.getConnection()</literal>. "
#. Tag: entry
+#: configuration.xml:638
#, no-c-format
msgid ""
"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
@@ -1064,6 +1299,7 @@
"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
#. Tag: entry
+#: configuration.xml:640
#, no-c-format
msgid ""
"Pass the property <emphasis><propertyName></emphasis> to the JNDI "
@@ -1073,21 +1309,25 @@
"<literal>InitialContextFactory</literal>."
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr "Propriétés du Cache Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+#. Tag: literal
+#: configuration.xml:665
+#, fuzzy, no-c-format
+msgid "hibernate.cache.provider_class"
msgstr "<literal>hibernate.cache.provider_class</literal>"
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
msgstr "Le nom de classe d'un <literal>CacheProvider</literal> personnalisé."
#. Tag: para
+#: configuration.xml:668
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1096,12 +1336,14 @@
"<emphasis role=\"strong\">par ex.</emphasis><literal>classname.of."
"CacheProvider</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+#. Tag: literal
+#: configuration.xml:673
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_minimal_puts"
msgstr "<literal>hibernate.cache.use_minimal_puts</literal>"
#. Tag: entry
+#: configuration.xml:675
#, no-c-format
msgid ""
"Optimizes second-level cache operation to minimize writes, at the cost of "
@@ -1113,12 +1355,14 @@
"et est activé par défaut dans hibernate3 pour les implémentations de cache "
"en cluster. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+#. Tag: literal
+#: configuration.xml:684
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache"
msgstr "<literal>hibernate.cache.use_query_cache</literal>"
#. Tag: entry
+#: configuration.xml:686
#, no-c-format
msgid ""
"Enables the query cache. Individual queries still have to be set cachable."
@@ -1126,12 +1370,14 @@
"Activer le cache de requête, les requêtes individuelles doivent tout de même "
"être déclarées comme pouvant être mises en cache."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+#. Tag: literal
+#: configuration.xml:692
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_second_level_cache"
msgstr "<literal>hibernate.cache.use_second_level_cache</literal>"
#. Tag: entry
+#: configuration.xml:694
#, no-c-format
msgid ""
"Can be used to completely disable the second level cache, which is enabled "
@@ -1142,12 +1388,14 @@
"est activé par défaut pour les classes qui spécifient un élément "
"<literal><cache></literal> dans leur mappage. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+#. Tag: literal
+#: configuration.xml:702
+#, fuzzy, no-c-format
+msgid "hibernate.cache.query_cache_factory"
msgstr "<literal>hibernate.cache.query_cache_factory</literal>"
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
msgid ""
"The classname of a custom <literal>QueryCache</literal> interface, defaults "
@@ -1158,6 +1406,7 @@
"literal> imbriqué."
#. Tag: para
+#: configuration.xml:706
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
@@ -1166,28 +1415,33 @@
"<emphasis role=\"strong\">par ex.</emphasis><literal>classname.of."
"QueryCache</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+#. Tag: literal
+#: configuration.xml:712
+#, fuzzy, no-c-format
+msgid "hibernate.cache.region_prefix"
msgstr "<literal>hibernate.cache.region_prefix</literal>"
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr ""
"Un préfixe à utiliser pour les noms de régions du cache de second niveau. "
#. Tag: para
+#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
msgstr "<emphasis role=\"strong\">par ex.</emphasis> <literal>prefix</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+#. Tag: literal
+#: configuration.xml:720
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_structured_entries"
msgstr "<literal>hibernate.cache.use_structured_entries</literal>"
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
msgid ""
"Forces Hibernate to store data in the second-level cache in a more human-"
@@ -1196,17 +1450,36 @@
"Force Hibernate à stocker les données dans le cache de second niveau en un "
"format plus adapté à la visualisation. "
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid ""
+"Setting used to give the name of the default <classname>org.hibernate."
+"annotations.CacheConcurrencyStrategy</classname> to use when either "
+"<classname>@Cacheable</classname> or <classname>@Cache</classname> is used. "
+"<code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr "Propriétés des transactions Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:761
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.factory_class"
msgstr "<literal>hibernate.transaction.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
msgid ""
"The classname of a <literal>TransactionFactory</literal> to use with "
@@ -1218,6 +1491,7 @@
"par défaut est <literal>JDBCTransactionFactory</literal>). "
#. Tag: para
+#: configuration.xml:765
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1226,12 +1500,14 @@
"<emphasis role=\"strong\">par ex.</emphasis><literal>classname.of."
"TransactionFactory</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+#. Tag: literal
+#: configuration.xml:771
+#, fuzzy, no-c-format
+msgid "jta.UserTransaction"
msgstr "<literal>jta.UserTransaction</literal>"
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
msgid ""
"A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the "
@@ -1240,12 +1516,14 @@
"Le nom JNDI utilisé par la <literal>JTATransactionFactory</literal> pour "
"obtenir la <literal>UserTransaction</literal> JTA du serveur d'applications."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:781
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+msgid "hibernate.transaction.manager_lookup_class"
msgstr "<literal>hibernate.transaction. manager_lookup_class</literal>"
#. Tag: entry
+#: configuration.xml:783
#, no-c-format
msgid ""
"The classname of a <literal>TransactionManagerLookup</literal>. It is "
@@ -1257,6 +1535,7 @@
"générateur hilo dans un environnement JTA."
#. Tag: para
+#: configuration.xml:786
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1265,17 +1544,19 @@
"<emphasis role=\"strong\">par ex.</emphasis><literal>classname.of."
"TransactionManagerLookup</literal> "
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:792
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+msgid "hibernate.transaction.flush_before_completion"
msgstr "<literal>hibernate.transaction. flush_before_completion</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:794
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically flushed during the before "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Si activé, la session sera automatiquement vidée durant la phase qui précède "
@@ -1283,17 +1564,19 @@
"session fourni par Hibernate est préférable, consultez <xref linkend="
"\"architecture-current-session\" />."
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:803
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+msgid "hibernate.transaction.auto_close_session"
msgstr "<literal>hibernate.transaction. auto_close_session</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:805
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically closed during the after "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Si activé, la session sera automatiquement fermée pendant la phase qui suit "
@@ -1302,27 +1585,31 @@
"\"architecture-current-session\" />."
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr "Propriétés diverses"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:834
#, fuzzy, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+msgid "hibernate.current_session_context_class"
msgstr "<literal>hibernate. current_session_context_class</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:836
+#, fuzzy, no-c-format
msgid ""
"Supply a custom strategy for the scoping of the \"current\" "
"<literal>Session</literal>. See <xref linkend=\"architecture-current-session"
-"\" /> for more information about the built-in strategies."
+"\"/> for more information about the built-in strategies."
msgstr ""
"Fournit une stratégie particulière pour la portée de la <literal>Session</"
"literal> courante. Consultez <xref linkend=\"architecture-current-session\" /"
"> pour plus d'informations sur les stratégies incorporées. "
#. Tag: para
+#: configuration.xml:839
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | "
@@ -1333,17 +1620,20 @@
"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
"Class</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:846
+#, fuzzy, no-c-format
+msgid "hibernate.query.factory_class"
msgstr "<literal>hibernate.query.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr "Choisit l'implémentation du parseur de requête HQL. "
#. Tag: para
+#: configuration.xml:848
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast."
@@ -1354,12 +1644,14 @@
"ASTQueryTranslatorFactory</literal> ou <literal>org.hibernate.hql.classic."
"ClassicQueryTranslatorFactory</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
+#. Tag: literal
+#: configuration.xml:857
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions"
msgstr "<literal>hibernate.query.substitutions</literal>"
#. Tag: entry
+#: configuration.xml:859
#, no-c-format
msgid ""
"Is used to map from tokens in Hibernate queries to SQL tokens (tokens might "
@@ -1369,6 +1661,7 @@
"peuvent être des fonctions ou des noms textuels par exemple)."
#. Tag: para
+#: configuration.xml:861
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
@@ -1377,12 +1670,14 @@
"<emphasis role=\"strong\">par ex.</emphasis><literal>hqlLiteral=SQL_LITERAL, "
"hqlFunction=SQLFUNC</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+#. Tag: literal
+#: configuration.xml:867
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.auto"
msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
#. Tag: entry
+#: configuration.xml:869
#, no-c-format
msgid ""
"Automatically validates or exports schema DDL to the database when the "
@@ -1397,6 +1692,7 @@
"explicitement."
#. Tag: para
+#: configuration.xml:873
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | "
@@ -1407,12 +1703,49 @@
"<literal>update</literal> | <literal>create</literal> | <literal>create-"
"drop</literal> "
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:880
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+msgid "hibernate.hbm2ddl.import_file"
+msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
+
+#. Tag: para
+#: configuration.xml:882
+#, no-c-format
+msgid ""
+"Comma-separated names of the optional files containing SQL DML statements "
+"executed during the <classname>SessionFactory</classname> creation. This is "
+"useful for testing or demoing: by adding INSERT statements for example you "
+"can populate your database with a minimal set of data when it is deployed."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:887
+#, no-c-format
+msgid ""
+"File order matters, the statements of a give file are executed before the "
+"statements of the following files. These statements are only executed if the "
+"schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to "
+"<literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:892
+#, fuzzy, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">par ex.</emphasis> <literal>true|false</literal>"
+
+#. Tag: literal
+#: configuration.xml:898
+#, fuzzy, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
msgstr "<literal>hibernate.cglib. use_reflection_optimizer</literal>"
#. Tag: entry
+#: configuration.xml:900
#, no-c-format
msgid ""
"Enables the use of CGLIB instead of runtime reflection (System-level "
@@ -1427,11 +1760,13 @@
"cette propriété dans la <literal>hibernate.cfg.xml</literal>. "
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr "Dialectes SQL"
#. Tag: para
+#: configuration.xml:915
#, no-c-format
msgid ""
"Always set the <literal>hibernate.dialect</literal> property to the correct "
@@ -1447,256 +1782,307 @@
"propriétés listées ci-dessus, vous évitant ainsi de l'effectuer à la main. "
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr "Dialectes SQL de Hibernate (<literal>hibernate.dialect</literal>)"
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr "RDBMS"
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr "Dialecte"
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
-msgstr "DB2"
+msgid "<entry>DB2</entry>"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:943
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr "<literal>org.hibernate.dialect.DB2Dialect</literal>"
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr "DB2 AS/400"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:949
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr "DB2 OS390"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:955
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr "PostgreSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:961
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr "MySQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:967
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr "<literal>org.hibernate.dialect.MySQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr "MySQL with InnoDB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:973
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr "MySQL with MyISAM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+#. Tag: literal
+#: configuration.xml:979
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr "Oracle (toutes versions)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+#. Tag: literal
+#: configuration.xml:985
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.OracleDialect"
msgstr "<literal>org.hibernate.dialect.OracleDialect</literal>"
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr "Oracle 9i"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+#. Tag: literal
+#: configuration.xml:991
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr "Oracle 10g"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+#. Tag: literal
+#: configuration.xml:997
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr "Sybase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1003
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr "<literal>org.hibernate.dialect.SybaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr "Sybase Anywhere"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1009
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr "Microsoft SQL Server"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1015
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr "SAP DB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1021
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr "Informix"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1027
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InformixDialect"
msgstr "<literal>org.hibernate.dialect.InformixDialect</literal>"
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr "HypersonicSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1033
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr "<literal>org.hibernate.dialect.HSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr "Ingres"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1039
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.IngresDialect"
msgstr "<literal>org.hibernate.dialect.IngresDialect</literal>"
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr "Progress"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1045
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr "<literal>org.hibernate.dialect.ProgressDialect</literal>"
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr "Mckoi SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1051
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr "<literal>org.hibernate.dialect.MckoiDialect</literal>"
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr "Interbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1057
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr "Pointbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1063
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr "FrontBase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1069
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr "Firebird"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1075
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr "Chargement par jointure externe"
#. Tag: para
+#: configuration.xml:1085
#, no-c-format
msgid ""
"If your database supports ANSI, Oracle or Sybase style outer joins, "
@@ -1716,6 +2102,7 @@
"un d'être chargé en un seul SQL<literal>SELECT</literal>."
#. Tag: para
+#: configuration.xml:1094
#, no-c-format
msgid ""
"Outer join fetching can be disabled <emphasis>globally</emphasis> by setting "
@@ -1732,18 +2119,21 @@
"<literal>fetch=\"join\"</literal>. "
#. Tag: para
-#, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+#: configuration.xml:1100
+#, fuzzy, no-c-format
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr ""
"Reportez vous à <xref linkend=\"performance-fetching\" /> pour plus "
"d'informations."
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr "Flux binaires"
#. Tag: para
+#: configuration.xml:1107
#, no-c-format
msgid ""
"Oracle limits the size of <literal>byte</literal> arrays that can be passed "
@@ -1760,27 +2150,31 @@
"une fonctionalité de niveau système uniquement.</emphasis>"
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr "Cache de second niveau et cache de requêtes"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1118
+#, fuzzy, no-c-format
msgid ""
"The properties prefixed by <literal>hibernate.cache</literal> allow you to "
"use a process or cluster scoped second-level cache system with Hibernate. "
-"See the <xref linkend=\"performance-cache\" /> for more information."
+"See the <xref linkend=\"performance-cache\"/> for more information."
msgstr ""
"Les propriétés préfixées par <literal>hibernate.cache</literal> vous "
"permettent d'utiliser un système de cache de second niveau avec Hibernate. "
"Référez vous à <xref linkend=\"performance-cache\" /> pour plus de détails."
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr "Substitution dans le langage de requêtes"
#. Tag: para
+#: configuration.xml:1127
#, no-c-format
msgid ""
"You can define new Hibernate query tokens using <literal>hibernate.query."
@@ -1789,7 +2183,14 @@
"Vous pouvez définir de nouveaux jetons dans les requêtes Hibernate en "
"utilisant <literal>hibernate.query.substitutions</literal>. Par exemple :"
+#. Tag: programlisting
+#: configuration.xml:1130
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr "<literal>hibernate.query.substitutions</literal>"
+
#. Tag: para
+#: configuration.xml:1132
#, no-c-format
msgid ""
"This would cause the tokens <literal>true</literal> and <literal>false</"
@@ -1798,18 +2199,27 @@
"Cela signifierait que les jetons <literal>true</literal> et <literal>false</"
"literal> seraient transformés par des entiers dans le SQL généré."
+#. Tag: programlisting
+#: configuration.xml:1136
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr "<literal>hibernate.query.substitutions</literal>"
+
#. Tag: para
+#: configuration.xml:1138
#, no-c-format
msgid ""
"This would allow you to rename the SQL <literal>LOWER</literal> function."
msgstr "Cela permettrait de renommer la fonction SQL <literal>LOWER</literal>."
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr "Statistiques Hibernate"
#. Tag: para
+#: configuration.xml:1145
#, no-c-format
msgid ""
"If you enable <literal>hibernate.generate_statistics</literal>, Hibernate "
@@ -1826,11 +2236,13 @@
"hibernate.stats</literal> pour plus d'informations. "
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr "Journalisation"
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
msgid ""
"Hibernate utilizes <ulink url=\"http://www.slf4j.org/\">Simple Logging "
@@ -1861,6 +2273,7 @@
"dans le répertoire <literal>src/</literal>."
#. Tag: para
+#: configuration.xml:1171
#, no-c-format
msgid ""
"It is recommended that you familiarize yourself with Hibernate's log "
@@ -1876,60 +2289,71 @@
"suivantes : "
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr "Catégories de logs de Hibernate"
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr "Catégorie"
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr "Fonction"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
+#. Tag: literal
+#: configuration.xml:1195
+#, fuzzy, no-c-format
+msgid "org.hibernate.SQL"
msgstr "<literal>org.hibernate.SQL</literal>"
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr ""
"Journalise toutes les requêtes SQL de type DML (gestion des données) qui "
"sont exécutées"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
+#. Tag: literal
+#: configuration.xml:1201
+#, fuzzy, no-c-format
+msgid "org.hibernate.type"
msgstr "<literal>org.hibernate.type</literal>"
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr "Journalise tous les paramètres JDBC"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1207
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+msgid "org.hibernate.tool.hbm2ddl"
msgstr "<literal>org.hibernate.tool. hbm2ddl</literal>"
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr ""
"Journalise toutes les requêtes SQL de type DDL (gestion de la structure de "
"la base) qui sont exécutées"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
+#. Tag: literal
+#: configuration.xml:1213
+#, fuzzy, no-c-format
+msgid "org.hibernate.pretty"
msgstr "<literal>org.hibernate.pretty</literal>"
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
msgid ""
"Log the state of all entities (max 20 entities) associated with the session "
@@ -1938,64 +2362,76 @@
"Journalise l'état de toutes les entités (20 entités maximum) associées avec "
"la session Hibernate au moment du flush"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
+#. Tag: literal
+#: configuration.xml:1220
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache"
msgstr "<literal>org.hibernate.cache</literal>"
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr "Journalise toute activité du cache de second niveau"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1226
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+msgid "org.hibernate.transaction"
msgstr "<literal>org.hibernate. transaction</literal>"
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr "Journalise toute activité relative aux transactions"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
+#. Tag: literal
+#: configuration.xml:1232
+#, fuzzy, no-c-format
+msgid "org.hibernate.jdbc"
msgstr "<literal>org.hibernate.jdbc</literal>"
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr "Journalise toute acquisition de ressource JDBC "
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1238
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+msgid "org.hibernate.hql.ast.AST"
msgstr "<literal>org.hibernate.hql. ast.AST</literal>"
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr ""
"Journalise l'arbre syntaxique des requêtes HQL et SQL durant l'analyse "
"syntaxique des requêtes"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
+#. Tag: literal
+#: configuration.xml:1244
+#, fuzzy, no-c-format
+msgid "org.hibernate.secure"
msgstr "<literal>org.hibernate.secure</literal>"
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr "Journalise toutes les demandes d'autorisation JAAS"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1250
#, no-c-format
-msgid "<literal>org.hibernate</literal>"
-msgstr "<literal>org.hibernate</literal>"
+msgid "org.hibernate"
+msgstr ""
#. Tag: entry
+#: configuration.xml:1252
#, no-c-format
msgid ""
"Log everything. This is a lot of information but it is useful for "
@@ -2005,6 +2441,7 @@
"problèmes)."
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
msgid ""
"When developing applications with Hibernate, you should almost always work "
@@ -2018,12 +2455,14 @@
"propriété <literal>hibernate.show_sql</literal> activée."
#. Tag: title
+#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr ""
"Sélectionne une <literal>NamingStrategy</literal> (stratégie de nommage)"
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
msgid ""
"The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you "
@@ -2034,6 +2473,7 @@
"de données."
#. Tag: para
+#: configuration.xml:1272
#, no-c-format
msgid ""
"You can provide rules for automatically generating database identifiers from "
@@ -2052,6 +2492,7 @@
"utilisée par Hibernate est assez minimale."
#. Tag: para
+#: configuration.xml:1279
#, no-c-format
msgid ""
"You can specify a different strategy by calling <literal>Configuration."
@@ -2061,7 +2502,19 @@
"<literal>Configuration.setNamingStrategy()</literal> avant d'ajouter des "
"mappages : "
+#. Tag: programlisting
+#: configuration.xml:1283
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
msgid ""
"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in "
@@ -2072,11 +2525,13 @@
"applications."
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr "Fichier de configuration XML"
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
msgid ""
"An alternative approach to configuration is to specify a full configuration "
@@ -2091,6 +2546,7 @@
"présents."
#. Tag: para
+#: configuration.xml:1299
#, no-c-format
msgid ""
"The XML configuration file is by default expected to be in the root of your "
@@ -2099,7 +2555,53 @@
"Le fichier de configuration XML doit par défaut se placer à la racine du "
"<literal>CLASSPATH</literal>. En voici un exemple : "
+#. Tag: programlisting
+#: configuration.xml:1302
+#, no-c-format
+msgid ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1304
#, no-c-format
msgid ""
"The advantage of this approach is the externalization of the mapping file "
@@ -2119,24 +2621,44 @@
"dessus. "
#. Tag: para
+#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr ""
"Avec la configuration XML, démarrer Hibernate devient donc aussi simple que "
"ceci : "
+#. Tag: programlisting
+#: configuration.xml:1314
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
msgstr ""
"Vous pouvez choisir un fichier de configuration XML différent en utilisant : "
+#. Tag: programlisting
+#: configuration.xml:1318
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr "Intégration à un serveur d'applications J2EE"
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr ""
@@ -2144,6 +2666,7 @@
"J2EE :"
#. Tag: para
+#: configuration.xml:1329
#, no-c-format
msgid ""
"<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC "
@@ -2167,6 +2690,7 @@
"portabilité de votre code entre plusieurs serveurs d'application. "
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
msgid ""
"<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its "
@@ -2176,6 +2700,7 @@
"sa <literal>SessionFactory</literal> à JNDI après le démarrage."
#. Tag: para
+#: configuration.xml:1350
#, no-c-format
msgid ""
"<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</"
@@ -2196,6 +2721,7 @@
"façon programmatique (BMT/UserTransaction)."
#. Tag: para
+#: configuration.xml:1362
#, no-c-format
msgid ""
"<emphasis>JMX deployment:</emphasis> if you have a JMX capable application "
@@ -2216,6 +2742,7 @@
"disponible avant le démarrage de Hibernate, etc). "
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
msgid ""
"Depending on your environment, you might have to set the configuration "
@@ -2228,11 +2755,13 @@
"containment\"."
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr "Configuration de la stratégie transactionnelle"
#. Tag: para
+#: configuration.xml:1381
#, no-c-format
msgid ""
"The Hibernate <literal>Session</literal> API is independent of any "
@@ -2252,6 +2781,7 @@
"cela est nécessaire. "
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
msgid ""
"To keep your code portable between these two (and other) environments we "
@@ -2270,27 +2800,32 @@
"factory_class</literal>."
#. Tag: para
+#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr "Il existe trois choix standards (intégrés) : "
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1401
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr ""
"délègue aux transactions de la base de données (JDBC) (valeur par défaut)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1409
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1412
#, no-c-format
msgid ""
"delegates to container-managed transactions if an existing transaction is "
@@ -2301,17 +2836,20 @@
"méthode d'un EJB session), sinon une nouvelle transaction est entamée et une "
"transaction gérée par le bean est utilisée. "
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1420
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr "délègue aux transactions JTA gérées par le conteneur"
#. Tag: para
+#: configuration.xml:1428
#, no-c-format
msgid ""
"You can also define your own transaction strategies (for a CORBA transaction "
@@ -2321,6 +2859,7 @@
"un service de transaction CORBA par exemple). "
#. Tag: para
+#: configuration.xml:1431
#, no-c-format
msgid ""
"Some features in Hibernate (i.e., the second level cache, Contextual "
@@ -2338,151 +2877,164 @@
"car J2EE ne fournit pas un seul mécanisme standard. "
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr "TransactionManagers JTA"
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr "Fabrique de transaction"
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr "Serveur d'applications"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1456
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JBossTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr "JBoss"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1462
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. WeblogicTransactionManagerLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr "Weblogic"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1468
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
-"literal>"
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. WebSphereTransactionManagerLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr "WebSphere"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1474
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
-"literal>"
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr ""
"<literal>org.hibernate.transaction. WebSphereExtendedJTATransactionLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr "WebSphere 6"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1480
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. OrionTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr "Orion"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1486
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. ResinTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr "Resin"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1492
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JOTMTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr "JOTM"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1498
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JOnASTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr "JOnAS"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1504
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JRun4TransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr "JRun4"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1510
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. BESTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr "Borland ES"
#. Tag: title
+#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr "<literal>SessionFactory</literal> associée au JNDI"
#. Tag: para
+#: configuration.xml:1522
#, no-c-format
msgid ""
"A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the "
@@ -2497,6 +3049,7 @@
"même registre ! "
#. Tag: para
+#: configuration.xml:1528
#, no-c-format
msgid ""
"If you wish to have the <literal>SessionFactory</literal> bound to a JNDI "
@@ -2515,6 +3068,7 @@
"comme c'est le cas pour Tomcat). "
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
msgid ""
"When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will "
@@ -2529,6 +3083,7 @@
"literal> par défaut sera utilisé. "
#. Tag: para
+#: configuration.xml:1542
#, no-c-format
msgid ""
"Hibernate will automatically place the <literal>SessionFactory</literal> in "
@@ -2546,6 +3101,7 @@
"plus tard dans ce document. "
#. Tag: para
+#: configuration.xml:1550
#, no-c-format
msgid ""
"If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other "
@@ -2557,7 +3113,8 @@
"utilisant une recherche JNDI. "
#. Tag: para
-#, no-c-format
+#: configuration.xml:1554
+#, fuzzy, no-c-format
msgid ""
"It is recommended that you bind the <literal>SessionFactory</literal> to "
"JNDI in a managed environment and use a <literal>static</literal> singleton "
@@ -2565,7 +3122,7 @@
"recommend to hide the actual lookup code for a <literal>SessionFactory</"
"literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory"
"()</literal>. Note that such a class is also a convenient way to startup "
-"Hibernate—see chapter 1."
+"Hibernate—see chapter 1."
msgstr ""
"Nous recommandons de lier la <literal>SessionFactory</literal> à JNDI dans "
"les environnements gérés et d'utilisier un singleton <literal>static</"
@@ -2576,22 +3133,24 @@
"classe est aussi un moyen efficace de démarrer Hibernate - voir chapitre 1. "
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr "Gestion du contexte de la session courante à JTA"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1567
+#, fuzzy, no-c-format
msgid ""
"The easiest way to handle <literal>Sessions</literal> and transactions is "
"Hibernate's automatic \"current\" <literal>Session</literal> management. For "
"a discussion of contextual sessions see <xref linkend=\"architecture-current-"
-"session\" />. Using the <literal>\"jta\"</literal> session context, if there "
+"session\"/>. Using the <literal>\"jta\"</literal> session context, if there "
"is no Hibernate <literal>Session</literal> associated with the current JTA "
"transaction, one will be started and associated with that JTA transaction "
"the first time you call <literal>sessionFactory.getCurrentSession()</"
"literal>. The <literal>Session</literal>s retrieved via "
-"<literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> "
+"<literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> "
"context are set to automatically flush before the transaction completes, "
"close after the transaction completes, and aggressively release JDBC "
"connections after each statement. This allows the <literal>Session</"
@@ -2625,11 +3184,13 @@
"déclarative des transactions avec CMT est recommandée. "
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr "Déploiement JMX"
#. Tag: para
+#: configuration.xml:1592
#, no-c-format
msgid ""
"The line <literal>cfg.buildSessionFactory()</literal> still has to be "
@@ -2646,6 +3207,7 @@
"que <emphasis>service géré</emphasis>. "
#. Tag: para
+#: configuration.xml:1598
#, no-c-format
msgid ""
"Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</"
@@ -2659,7 +3221,64 @@
"chaque vendeur. Voici un fichier <literal>jboss-service.xml</literal> "
"d'exemple pour JBoss 4.0.x :"
+#. Tag: programlisting
+#: configuration.xml:1604
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1606
#, no-c-format
msgid ""
"This file is deployed in a directory called <literal>META-INF</literal> and "
@@ -2681,3 +3300,18 @@
"fichier JAR dans le jar principal du service pour avoir une seule unité "
"déployable à chaud. Vous pouvez consulter la documentation de JBoss AS pour "
"plus d'informations sur les services JMX et le déploiement des EJB. "
+
+#~ msgid "<emphasis>JDBC URL</emphasis>"
+#~ msgstr "<emphasis>JDBC URL</emphasis>"
+
+#~ msgid "<emphasis>database user</emphasis>"
+#~ msgstr "<emphasis>utilisateur de la base de données</emphasis>"
+
+#~ msgid "<property>hibernate.generate_statistics</property>"
+#~ msgstr "<property>hibernate.generate_statistics</property>"
+
+#~ msgid "DB2"
+#~ msgstr "DB2"
+
+#~ msgid "<literal>org.hibernate</literal>"
+#~ msgstr "<literal>org.hibernate</literal>"
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/filters.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/filters.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/filters.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: filters\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:35\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-11-11 09:26+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,11 +17,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr "Filtrer les données"
#. Tag: para
+#: filters.xml:33
#, no-c-format
msgid ""
"Hibernate3 provides an innovative new approach to handling data with "
@@ -35,11 +37,13 @@
"désactivé pour une session Hibernate particulière. "
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr "Filtres Hibernate"
#. Tag: para
+#: filters.xml:41
#, no-c-format
msgid ""
"Hibernate3 has the ability to pre-define filter criteria and attach those "
@@ -62,9 +66,95 @@
"données, mais paramétrées dans l'application. "
#. Tag: para
+#: filters.xml:50
#, no-c-format
msgid ""
-"In order to use filters, they must first be defined and then attached to the "
+"Using annotatons filters are defined via <literal>@org.hibernate.annotations."
+"FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</"
+"literal>. A filter definition has a <methodname>name()</methodname> 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 "
+"<methodname>defaultCondition()</methodname> parameter for a given "
+"<literal>@FilterDef</literal> to set the default condition to use when none "
+"are defined in each individual <literal>@Filter</literal>. "
+"<literal>@FilterDef</literal>(s) can be defined at the class or package "
+"level."
+msgstr ""
+
+#. Tag: para
+#: filters.xml:63
+#, 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. The connection between "
+"<classname>@FilterName</classname> and <classname>@Filter</classname> is a "
+"matching name."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
+#, 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 want "
+"to target the association table, use the <literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid ""
+"Using <classname>@FilterJoinTable</classname> for filterting on the "
+"association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files for defining filters the situtation is very "
+"similar. The filters must first be defined and then attached to the "
"appropriate mapping elements. To define a filter, use the <literal><"
"filter-def/></literal> element within a <literal><hibernate-mapping/"
"></literal> element:"
@@ -74,22 +164,58 @@
"l'élément <literal><filter-def/></literal> dans un élément "
"<literal><hibernate-mapping/></literal> :"
-#. Tag: para
+#. Tag: title
+#: filters.xml:97
#, no-c-format
-msgid "This filter can then be attached to a class:"
-msgstr "Puis, ce filtre peut être attaché à une classe : "
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
+#. Tag: programlisting
+#: filters.xml:100
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"This filter can then be attached to a class or collection (or, to both or "
+"multiples of each at the same time):"
+msgstr "Ou même encore, aux deux (ou à plusieurs de chaque) en même temps."
+
+#. Tag: title
+#: filters.xml:107
#, no-c-format
-msgid "Or, to a collection:"
-msgstr "Ou bien, à une collection :"
+msgid ""
+"Attaching a filter to a class or collection using <literal><filter></"
+"literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: filters.xml:110
#, no-c-format
-msgid "Or, to both or multiples of each at the same time."
-msgstr "Ou même encore, aux deux (ou à plusieurs de chaque) en même temps."
+msgid ""
+"<class name=\"myClass\" ...>\n"
+" ...\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+"\n"
+" <set ...>\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+" </set> \n"
+"</class>"
+msgstr ""
#. Tag: para
+#: filters.xml:113
#, no-c-format
msgid ""
"The methods on <literal>Session</literal> are: <literal>enableFilter(String "
@@ -110,7 +236,18 @@
"instance de l'interface <literal>Filter</literal>. Utiliser le simple filtre "
"défini ci-dessus ressemblerait à : "
+#. Tag: programlisting
+#: filters.xml:123
+#, fuzzy, no-c-format
+msgid ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+msgstr ""
+"<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", "
+"\"some-value\");]]>"
+
#. Tag: para
+#: filters.xml:125
#, no-c-format
msgid ""
"Methods on the org.hibernate.Filter interface do allow the method-chaining "
@@ -120,6 +257,7 @@
"chaînage de beaucoup de méthodes communes à Hibernate. "
#. Tag: para
+#: filters.xml:128
#, no-c-format
msgid ""
"The following is a full example, using temporal data with an effective "
@@ -128,7 +266,79 @@
"Un exemple complet, utilisant des données temporelles avec une structure de "
"date d'enregistrement effectif : "
+#. Tag: programlisting
+#: filters.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department\"/"
+">\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column=\"eff_start_dt"
+"\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt\"/"
+">\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>]]>"
+
#. Tag: para
+#: filters.xml:133
#, no-c-format
msgid ""
"In order to ensure that you are provided with currently effective records, "
@@ -138,7 +348,29 @@
"enregistrements actuellement effectifs, activez simplement le filtre sur la "
"session avant de récupérer des données des employés : "
+#. Tag: programlisting
+#: filters.xml:137
+#, fuzzy, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+msgstr ""
+"<![CDATA[Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();\n"
+"]]>"
+
#. Tag: para
+#: filters.xml:139
#, no-c-format
msgid ""
"Even though a salary constraint was mentioned explicitly on the results in "
@@ -152,6 +384,7 @@
"salaire supérieur à un million de dollars. "
#. Tag: para
+#: filters.xml:144
#, no-c-format
msgid ""
"If you want to use filters with outer joining, either through HQL or load "
@@ -166,6 +399,7 @@
"d'abord, suivi du(des) nom(s) de colonne après l'opérateur. "
#. Tag: para
+#: filters.xml:149
#, no-c-format
msgid ""
"After being defined, a filter might be attached to multiple entities and/or "
@@ -180,7 +414,20 @@
"<literal><filter-def/></literal> permet de définir une condition par "
"défaut, soit en tant qu'attribut, soit comme CDATA. "
+#. Tag: programlisting
+#: filters.xml:155
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</filter-"
+"def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:157
#, no-c-format
msgid ""
"This default condition will be used whenever the filter is attached to "
@@ -194,15 +441,12 @@
"faisant partie de la pièce attachée du filtre qui surcharge la condition par "
"défaut dans ce cas particulier. "
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
+#~ msgid "This filter can then be attached to a class:"
+#~ msgstr "Puis, ce filtre peut être attaché à une classe : "
+#~ msgid "Or, to a collection:"
+#~ msgstr "Ou bien, à une collection :"
+
#~ msgid ""
#~ "<![CDATA[<class name=\"myClass\" ...>\n"
#~ " ...\n"
@@ -226,107 +470,3 @@
#~ " <filter name=\"myFilter\" condition=\":myFilterParam = "
#~ "MY_FILTERED_COLUMN\"/>\n"
#~ "</set>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-#~ msgstr ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/performance.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/performance.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/performance.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: performance\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 09:38+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,16 +17,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "Améliorer les performances"
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "Stratégies de chargement"
#. Tag: para
+#: performance.xml:36
#, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve "
@@ -42,11 +45,13 @@
"<literal>Criteria</literal> particulière."
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 définit les stratégies de chargement suivantes :"
#. Tag: para
+#: performance.xml:46
#, no-c-format
msgid ""
"<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated "
@@ -58,6 +63,7 @@
"utilisant un <literal>OUTER JOIN</literal>. "
#. Tag: para
+#: performance.xml:53
#, no-c-format
msgid ""
"<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is "
@@ -72,6 +78,7 @@
"sera exécuté que lorsque vous accéderez réellement à l'association."
#. Tag: para
+#: performance.xml:61
#, no-c-format
msgid ""
"<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> "
@@ -88,6 +95,7 @@
"accéderez réellement à l'association. "
#. Tag: para
+#: performance.xml:70
#, no-c-format
msgid ""
"<emphasis>Batch fetching</emphasis>: an optimization strategy for select "
@@ -101,11 +109,13 @@
"spécifiant une liste de clés primaires ou de clés étrangères. "
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "Hibernate fait également la distinction entre :"
#. Tag: para
+#: performance.xml:81
#, no-c-format
msgid ""
"<emphasis>Immediate fetching</emphasis>: an association, collection or "
@@ -116,6 +126,7 @@
"cet élément est chargé. "
#. Tag: para
+#: performance.xml:87
#, no-c-format
msgid ""
"<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when "
@@ -127,6 +138,7 @@
"(il s'agit du mode de chargement par défaut pour les collections). "
#. Tag: para
+#: performance.xml:93
#, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements "
@@ -141,6 +153,7 @@
"collections). "
#. Tag: para
+#: performance.xml:101
#, no-c-format
msgid ""
"<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched "
@@ -152,6 +165,7 @@
"est appelée sur l'objet associé."
#. Tag: para
+#: performance.xml:107
#, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is "
@@ -170,6 +184,7 @@
"compilation et est rarement nécessaire. "
#. Tag: para
+#: performance.xml:117
#, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued "
@@ -182,6 +197,7 @@
"est rarement nécessaire. "
#. Tag: para
+#: performance.xml:124
#, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when</emphasis> is the "
@@ -200,11 +216,13 @@
"classe particulière. "
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "Travailler avec des associations chargées en différé"
#. Tag: para
+#: performance.xml:134
#, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
@@ -217,6 +235,7 @@
"associations dans la plupart des applications. "
#. Tag: para
+#: performance.xml:138
#, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate "
@@ -229,6 +248,7 @@
"de granularité plus fin). "
#. Tag: para
+#: performance.xml:142
#, no-c-format
msgid ""
"Please be aware that access to a lazy association outside of the context of "
@@ -237,7 +257,25 @@
"L'accès à une association définie comme \"différé\", hors du contexte d'une "
"session Hibernate ouverte, entraîne une exception. Par exemple : "
+#. Tag: programlisting
+#: performance.xml:146
+#, no-c-format
+msgid ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+
#. Tag: para
+#: performance.xml:148
#, no-c-format
msgid ""
"Since the permissions collection was not initialized when the "
@@ -254,6 +292,7 @@
"transaction. "
#. Tag: para
+#: performance.xml:155
#, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
@@ -272,6 +311,7 @@
"chaque transaction."
#. Tag: para
+#: performance.xml:162
#, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
@@ -288,11 +328,13 @@
"objet simple ou vers une collection. "
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "Personnalisation des stratégies de chargement"
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
@@ -302,7 +344,25 @@
"du N+1 selects, ainsi vous souhaiterez peut-être activer le chargement par "
"jointure dans les fichiers de mappage :"
+#. Tag: programlisting
+#: performance.xml:176
+#, no-c-format
+msgid ""
+"<set name=\"permissions\"\n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:178
+#, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch</literal> strategy defined in the mapping document "
@@ -312,23 +372,27 @@
"dans les fichiers de mappage affecte :"
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr ""
"La récupération via <literal>get()</literal> ou <literal>load()</literal>"
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr ""
"La récupération implicite lorsque l'on navigue à travers une association"
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr "Les requêtes par <literal>Criteria</literal>"
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr ""
@@ -336,6 +400,7 @@
"literal>"
#. Tag: para
+#: performance.xml:204
#, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
@@ -347,6 +412,7 @@
"l'exécution de plusieurs selects successifs pour une seule requête HQL. "
#. Tag: para
+#: performance.xml:209
#, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
@@ -365,6 +431,7 @@
"utiliserez la méthode <literal>setFetchMode(FetchMode.JOIN)</literal>."
#. Tag: para
+#: performance.xml:216
#, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get()</literal> "
@@ -376,7 +443,18 @@
"pouvez juste utiliser une requête de type <literal>Criteria</literal> comme "
"par exemple : "
+#. Tag: programlisting
+#: performance.xml:220
+#, no-c-format
+msgid ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:222
#, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
@@ -386,6 +464,7 @@
"mappage appellent un \"fetch plan\" ou \"plan de chargement\"."
#. Tag: para
+#: performance.xml:225
#, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
@@ -395,11 +474,13 @@
"selects est d'utiliser le cache de second niveau. "
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "Proxies pour des associations vers un seul objet "
#. Tag: para
+#: performance.xml:232
#, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
@@ -418,6 +499,7 @@
"du bytecode (à l'aide de l'excellente librairie CGLIB)."
#. Tag: para
+#: performance.xml:239
#, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
@@ -429,6 +511,7 @@
"associations <literal>many-to-one</literal> et <literal>one-to-one</literal>."
#. Tag: para
+#: performance.xml:244
#, no-c-format
msgid ""
"The mapping file may declare an interface to use as the proxy interface for "
@@ -446,6 +529,7 @@
"persistantes !</emphasis>."
#. Tag: para
+#: performance.xml:251
#, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
@@ -454,7 +538,20 @@
"Il y a quelques précautions à prendre lorsque l'on étend cette approche à "
"des classes polymorphiques, par exemple : "
+#. Tag: programlisting
+#: performance.xml:254
+#, no-c-format
+msgid ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat</literal> will never be castable to "
@@ -465,14 +562,41 @@
"être \"castées\" en <literal>DomesticCat</literal>, même si l'instance sous-"
"jacente est une instance de <literal>DomesticCat</literal> :"
+#. Tag: programlisting
+#: performance.xml:260
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr ""
"Deuxièmement, il est possible de casser la notion de <literal>==</literal> "
"des proxies. "
+#. Tag: programlisting
+#: performance.xml:265
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+msgstr ""
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
@@ -483,7 +607,16 @@
"deux références à deux objets proxies différents, l'instance sous-jacente "
"sera quand même le même objet :"
+#. Tag: programlisting
+#: performance.xml:271
+#, no-c-format
+msgid ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+
#. Tag: para
+#: performance.xml:273
#, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or "
@@ -494,6 +627,7 @@
"<literal>final</literal>. "
#. Tag: para
+#: performance.xml:276
#, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
@@ -507,6 +641,7 @@
"classe proxy est en réalité une sous-classe de la classe persistante. "
#. Tag: para
+#: performance.xml:281
#, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
@@ -525,7 +660,20 @@
"<literal>Cat</literal> et <literal>DomesticCatImpl</literal> implémente "
"l'interface <literal>DomesticCat</literal>. Par exemple :"
+#. Tag: programlisting
+#: performance.xml:289
+#, no-c-format
+msgid ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:291
#, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat</literal> and "
@@ -536,17 +684,30 @@
"<literal>DomesticCat</literal> peuvent être retournées par <literal>load()</"
"literal> ou par <literal>iterate()</literal>."
+#. Tag: programlisting
+#: performance.xml:295
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr "Remarque"
#. Tag: para
+#: performance.xml:300
#, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr "<literal>list()</literal> ne retourne pas les proxies normalement."
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
@@ -558,6 +719,7 @@
"et non <literal>CatImpl</literal>."
#. Tag: para
+#: performance.xml:308
#, no-c-format
msgid ""
"Certain operations do <emphasis>not</emphasis> require proxy initialization:"
@@ -566,6 +728,7 @@
"l'initialisation du proxy :"
#. Tag: para
+#: performance.xml:313
#, no-c-format
msgid ""
"<literal>equals()</literal>: if the persistent class does not override "
@@ -575,6 +738,7 @@
"<literal>equals()</literal> "
#. Tag: para
+#: performance.xml:318
#, no-c-format
msgid ""
"<literal>hashCode()</literal>: if the persistent class does not override "
@@ -584,11 +748,13 @@
"<literal>hashCode()</literal> "
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "La méthode getter de l'identifiant "
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()</"
@@ -598,6 +764,7 @@
"ou <literal>hashCode()</literal>."
#. Tag: para
+#: performance.xml:330
#, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default "
@@ -612,11 +779,13 @@
"en une initialisation du proxy. "
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "Initialisation des collections et des proxies"
#. Tag: para
+#: performance.xml:340
#, no-c-format
msgid ""
"A <literal>LazyInitializationException</literal> will be thrown by Hibernate "
@@ -631,6 +800,7 @@
"vers le proxy, est dans l'état \"détaché\". "
#. Tag: para
+#: performance.xml:346
#, no-c-format
msgid ""
"Sometimes a proxy or collection needs to be initialized before closing the "
@@ -647,6 +817,7 @@
"code et n'est pas approprié pour le code générique. "
#. Tag: para
+#: performance.xml:353
#, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize()</literal> and "
@@ -666,6 +837,7 @@
"literal> a le même effet sur la collection kittens. "
#. Tag: para
+#: performance.xml:362
#, no-c-format
msgid ""
"Another option is to keep the <literal>Session</literal> open until all "
@@ -686,6 +858,7 @@
"initialisée. Il y a deux moyens de maîtriser ce problème : "
#. Tag: para
+#: performance.xml:372
#, no-c-format
msgid ""
"In a web-based application, a servlet filter can be used to close the "
@@ -709,6 +882,7 @@
"Hibernate pour des exemples sur le modèle \"Open Session in View\". "
#. Tag: para
+#: performance.xml:385
#, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
@@ -739,6 +913,7 @@
"<emphasis>Session Facade</emphasis>. "
#. Tag: para
+#: performance.xml:401
#, no-c-format
msgid ""
"You can also attach a previously loaded object to a new <literal>Session</"
@@ -755,6 +930,7 @@
"ad hoc. "
#. Tag: para
+#: performance.xml:410
#, no-c-format
msgid ""
"Sometimes you do not want to initialize a large collection, but still need "
@@ -766,6 +942,7 @@
"ensemble de ses données."
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid ""
"You can use a collection filter to get the size of a collection without "
@@ -774,7 +951,16 @@
"Vous pouvez utiliser un filtre de collection pour récupérer sa taille sans "
"l'initialiser :"
+#. Tag: programlisting
+#: performance.xml:417
+#, no-c-format
+msgid ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+msgstr ""
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid ""
"The <literal>createFilter()</literal> method is also used to efficiently "
@@ -785,12 +971,22 @@
"récupérer efficacement des sous-ensembles d'une collection sans avoir besoin "
"de l'initialiser dans son ensemble :"
+#. Tag: programlisting
+#: performance.xml:423
+#, no-c-format
+msgid ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "Utiliser le chargement par lot"
#. Tag: para
+#: performance.xml:429
#, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
@@ -807,6 +1003,7 @@
"collection."
#. Tag: para
+#: performance.xml:434
#, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
@@ -833,7 +1030,14 @@
"size</literal> (taille du lot) dans le mappage de <literal>Person</"
"literal> : "
+#. Tag: programlisting
+#: performance.xml:447
+#, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:449
#, no-c-format
msgid ""
"Hibernate will now execute only three queries: the pattern is 10, 10, 5."
@@ -842,6 +1046,7 @@
"10, 10, et 5 entités. "
#. Tag: para
+#: performance.xml:452
#, no-c-format
msgid ""
"You can also enable batch fetching of collections. For example, if each "
@@ -861,7 +1066,19 @@
"collection <literal>cats</literal> dans le mappage de <literal>Person</"
"literal>, Hibernate pourra précharger les collections :"
+#. Tag: programlisting
+#: performance.xml:461
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:463
#, no-c-format
msgid ""
"With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 "
@@ -876,6 +1093,7 @@
"literal> particulière. "
#. Tag: para
+#: performance.xml:468
#, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
@@ -890,11 +1108,13 @@
"option pour des arbres principalement en lecture.) "
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "Utilisation du chargement par sous select"
#. Tag: para
+#: performance.xml:477
#, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
@@ -907,11 +1127,13 @@
"sans la possibilité de fragmenter le chargement."
#. Tag: title
+#: performance.xml:486
#, fuzzy, no-c-format
msgid "Fetch profiles"
msgstr "Stratégies de chargement"
#. Tag: para
+#: performance.xml:488
#, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
@@ -919,19 +1141,112 @@
"associated with the <interfacename>org.hibernate.SessionFactory</"
"interfacename> but enabled, by name, on the <interfacename>org.hibernate."
"Session</interfacename>. Once enabled on a <interfacename>org.hibernate."
-"Session</interfacename>, the fetch profile wull be in affect for that "
+"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session</interfacename> until it is explicitly "
"disabled."
msgstr ""
#. Tag: para
+#: performance.xml:498
#, no-c-format
msgid ""
-"So what does that mean? Well lets explain that by way of an example. Say we "
-"have the following mappings:"
+"So what does that mean? Well lets explain that by way of an example which "
+"show the different available approaches to configure a fetch profile:"
msgstr ""
+#. Tag: title
+#: performance.xml:503
+#, no-c-format
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+" @FetchProfile.FetchOverride(entity = Customer.class, association = "
+"\"orders\", mode = FetchMode.JOIN)\n"
+"})\n"
+"public class Customer {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" private long customerNumber;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Order> orders;\n"
+"\n"
+" // standard getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
+">\n"
+" </fetch-profile>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch association=\"orders\" style=\"join\"/>\n"
+" </fetch-profile>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:525
#, no-c-format
msgid ""
"Now normally when you get a reference to a particular customer, that "
@@ -940,23 +1255,39 @@
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
-"to use a fetch profile to achieve that. Just add the following to your "
-"mapping:"
+"to use a fetch profile to achieve that. The following code will load both "
+"the customer <emphasis>and</emphasis>their orders:"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: performance.xml:536
#, no-c-format
-msgid "or even:"
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFetchProfile( \"customer-with-orders\" ); // name matches "
+"from mapping\n"
+"Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
msgid ""
-"Now the following code will actually load both the customer <emphasis>and "
-"their orders</emphasis>:"
+"<classname>@FetchProfile </classname>definitions are global and it does not "
+"matter on which class you place them. You can place the "
+"<classname>@FetchProfile</classname> annotation either onto a class or "
+"package (package-info.java). In order to define multiple fetch profiles for "
+"the same class or package <classname>@FetchProfiles</classname> can be used."
msgstr ""
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
@@ -965,11 +1296,13 @@
msgstr ""
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "Utiliser le chargement en différé des propriétés"
#. Tag: para
+#: performance.xml:560
#, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
@@ -991,6 +1324,7 @@
"modèle de données ne peut pas être amélioré."
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy</literal> attribute "
@@ -1000,7 +1334,24 @@
"l'attribut <literal>lazy</literal> sur une propriété particulière du "
"mappage :"
+#. Tag: programlisting
+#: performance.xml:571
+#, no-c-format
+msgid ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:573
#, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
@@ -1013,13 +1364,36 @@
"et retombera dans le mode de chargement immédiat. "
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr ""
"Pour l'instrumentation du bytecode vous pouvez utiliser la tâche Ant "
"suivante :"
+#. Tag: programlisting
+#: performance.xml:579
+#, no-c-format
+msgid ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:581
#, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
@@ -1034,6 +1408,7 @@
"solution préférable. "
#. Tag: para
+#: performance.xml:586
#, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
@@ -1043,11 +1418,13 @@
"utilisant <literal>fetch all properties</literal> dans les requêtes HQL. "
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "Le cache de second niveau"
#. Tag: para
+#: performance.xml:594
#, no-c-format
msgid ""
"A Hibernate <literal>Session</literal> is a transaction-level cache of "
@@ -1068,15 +1445,17 @@
"configurés pour régulièrement expirer les données en cache). "
#. Tag: para
-#, no-c-format
+#: performance.xml:602
+#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property <literal>hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
-"integrations with the open-source cache providers that are listed below. You "
-"can also implement your own and plug it in as outlined above. Note that "
-"versions prior to 3.2 use EhCache as the default cache provider."
+"integrations with the open-source cache providers that are listed in <xref "
+"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
+"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
+"the default cache provider."
msgstr ""
"Vous pouvez choisir une autre implémentation en spécifiant le nom de la "
"classe qui implémente <literal>org.hibernate.cache.CacheProvider</literal> "
@@ -1088,157 +1467,398 @@
"EhCache comme le fournisseur de cache par défaut, ce qui n'est plus le cas. "
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "Fournisseurs de cache"
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "Cache"
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "Classe pourvoyeuse"
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "Type"
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "Cluster sécurisé"
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "Cache de requêtes supporté"
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Table de hachage (ne pas utiliser en production)"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:644
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "mémoire"
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674
+#: performance.xml:992 performance.xml:994 performance.xml:996
+#: performance.xml:1004 performance.xml:1006 performance.xml:1008
+#: performance.xml:1016 performance.xml:1018 performance.xml:1020
+#: performance.xml:1028 performance.xml:1030 performance.xml:1040
+#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
-msgstr "oui"
+msgid "<entry>yes</entry>"
+msgstr ""
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:656
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr "<literal>org.hibernate.cache.EhCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "mémoire, disque"
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:668
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr "<literal>org.hibernate.cache.OSCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:680
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "en cluster (multicast ip)"
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "oui (invalidation de cluster)"
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr "JBoss Cache 1.x"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:692
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr " org.hibernate.cache.TreeCacheProvider"
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "en cluster (multicast ip), transactionnel"
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "oui (réplication)"
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "oui (horloge sync. nécessaire)"
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr "JBoss Cache 2"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:704
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "<literal>org.hibernate.cache.jbc2.JBossCacheRegionFactory</literal>"
#. Tag: entry
+#: performance.xml:708
#, no-c-format
msgid "yes (replication or invalidation)"
msgstr "oui (replication ou invalidation)"
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "Mappages de Cache"
#. Tag: para
+#: performance.xml:719
#, no-c-format
msgid ""
-"The <literal><cache></literal> element of a class or collection "
-"mapping has the following form:"
+"As we have done in previous chapters we are looking at the two different "
+"possibiltites to configure caching. First configuration via annotations and "
+"then via Hibernate mapping files."
msgstr ""
-"L'élément <literal><cache></literal> d'une classe ou d'une collection "
-"a la forme suivante :"
#. Tag: para
+#: performance.xml:723
#, no-c-format
msgid ""
+"By default, entities are not part of the second level cache and we recommend "
+"you to stick to this setting. However, you can override this by setting the "
+"<literal>shared-cache-mode</literal> element in your <filename>persistence."
+"xml</filename> file or by using the <literal>javax.persistence.sharedCache."
+"mode </literal>property in your configuration. The following values are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid ""
+"<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): "
+"entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid ""
+"<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly "
+"marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid ""
+"<literal>ALL</literal>: all entities are always cached even if marked as non "
+"cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid ""
+"<literal>NONE</literal>: no entity are cached even if marked as cacheable. "
+"This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid ""
+"The cache concurrency strategy used by default can be set globaly via the "
+"<literal>hibernate.cache.default_cache_concurrency_strategy</literal> "
+"configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, fuzzy, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr "Les requêtes par <literal>Criteria</literal>"
+
+#. Tag: literal
+#: performance.xml:765
+#, fuzzy, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr "Les requêtes par <literal>Criteria</literal>"
+
+#. Tag: literal
+#: performance.xml:769
+#, fuzzy, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr "nonstrict-read-write (lecture-écriture non stricte)"
+
+#. Tag: literal
+#: performance.xml:773
+#, fuzzy, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr "Les requêtes par <literal>Criteria</literal>"
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid ""
+"It is recommended to define the cache concurrency strategy per entity rather "
+"than using a global one. Use the <classname>@org.hibernate.annotations."
+"Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid ""
+"Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+"@Entity \n"
+"@Cacheable\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid ""
+"Hibernate also let's you cache the content of a collection or the "
+"identifiers if the collection contains other entities. Use the "
+"<classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, fuzzy, no-c-format
+msgid "Caching collections using annotations"
+msgstr "Initialisation des collections et des proxies"
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+"@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: para
+#: performance.xml:802
+#, no-c-format
+msgid ""
+"shows the<literal> @org.hibernate.annotations.Cache</literal> annotations "
+"with its attributes. It allows you to define the caching strategy and region "
+"of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid ""
+"Let's now take a look at Hibernate mapping files. There the <literal><"
+"cache></literal> element of a class or collection mapping is used to "
+"configure the second level cache. Looking at <xref linkend=\"example-"
+"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, no-c-format
+msgid ""
+"<cache\n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
+msgid ""
"<literal>usage</literal> (required) specifies the caching strategy: "
"<literal>transactional</literal>, <literal>read-write</literal>, "
"<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
@@ -1249,6 +1869,7 @@
"literal>"
#. Tag: para
+#: performance.xml:874
#, no-c-format
msgid ""
"<literal>region</literal> (optional: defaults to the class or collection "
@@ -1259,6 +1880,7 @@
"cache de second niveau"
#. Tag: para
+#: performance.xml:880
#, no-c-format
msgid ""
"<literal>include</literal> (optional: defaults to <literal>all</literal>) "
@@ -1272,31 +1894,31 @@
"cache lorsque le chargement en différé des attributs est activé."
#. Tag: para
-#, no-c-format
+#: performance.xml:890
+#, fuzzy, no-c-format
msgid ""
-"Alternatively, you can specify <literal><class-cache></literal> and "
-"<literal><collection-cache></literal> elements in <literal>hibernate."
-"cfg.xml</literal>."
+"Alternatively to <literal><cache></literal>, you can use <literal><"
+"class-cache></literal> and <literal><collection-cache></literal> "
+"elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
"Alternativement (voir préférentiellement), vous pouvez spécifier les "
"éléments <literal><class-cache></literal> et <literal><collection-"
"cache></literal> dans <literal>hibernate.cfg.xml</literal>. "
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid ""
-"The <literal>usage</literal> attribute specifies a <emphasis>cache "
-"concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
-"L'attribut <literal>usage</literal> spécifie une <emphasis>stratégie de "
-"concurrence d'accès au cache</emphasis>."
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr "Stratégie : lecture seule"
#. Tag: para
+#: performance.xml:902
#, no-c-format
msgid ""
"If your application needs to read, but not modify, instances of a persistent "
@@ -1310,11 +1932,13 @@
"parfaitement sûre dans un cluster. "
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "Stratégie : lecture/écriture"
#. Tag: para
+#: performance.xml:911
#, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write</literal> "
@@ -1344,11 +1968,13 @@
"fournis. "
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr "Stratégie : lecture/écriture non stricte"
#. Tag: para
+#: performance.xml:929
#, no-c-format
msgid ""
"If the application only occasionally needs to update data (i.e. if it is "
@@ -1371,11 +1997,13 @@
"close()</literal> ou <literal>Session.disconnect()</literal>."
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "Stratégie : transactionelle"
#. Tag: para
+#: performance.xml:943
#, no-c-format
msgid ""
"The <literal>transactional</literal> cache strategy provides support for "
@@ -1389,11 +2017,13 @@
"spécifier <literal>hibernate.transaction.manager_lookup_class</literal>. "
#. Tag: title
+#: performance.xml:950
#, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "Support de stratégie de concurrence du fournisseur-cache"
#. Tag: para
+#: performance.xml:953
#, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
@@ -1403,6 +2033,7 @@
"de concurrence. "
#. Tag: para
+#: performance.xml:957
#, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
@@ -1413,36 +2044,43 @@
"de concurrence. "
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr "Support de stratégie de concurrence du cache"
#. Tag: entry
+#: performance.xml:978
#, no-c-format
-msgid "read-only"
-msgstr "read-only (lecture seule)"
+msgid "<entry>read-only</entry>"
+msgstr ""
#. Tag: entry
-#, no-c-format
-msgid "nonstrict-read-write"
+#: performance.xml:980
+#, fuzzy, no-c-format
+msgid "<entry>nonstrict-read-write</entry>"
msgstr "nonstrict-read-write (lecture-écriture non stricte)"
#. Tag: entry
+#: performance.xml:982
#, no-c-format
-msgid "read-write"
-msgstr "read-write (lecture-écriture)"
+msgid "<entry>read-write</entry>"
+msgstr ""
#. Tag: entry
-#, no-c-format
-msgid "transactional"
+#: performance.xml:984
+#, fuzzy, no-c-format
+msgid "<entry>transactional</entry>"
msgstr "transactional (transactionnel)"
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "Gérer les caches"
#. Tag: para
+#: performance.xml:1069
#, no-c-format
msgid ""
"Whenever you pass an object to <literal>save()</literal>, <literal>update()</"
@@ -1460,6 +2098,7 @@
"interne de la <literal>Session</literal>. "
#. Tag: para
+#: performance.xml:1076
#, no-c-format
msgid ""
"When <literal>flush()</literal> is subsequently called, the state of that "
@@ -1477,7 +2116,29 @@
"l'objet et ses collections dépendantes du cache de premier niveau de la "
"session. "
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid ""
+"Explcitly evicting a cached instance from the first level cache using "
+"<methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, no-c-format
+msgid ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session</literal> also provides a <literal>contains()</literal> "
@@ -1488,6 +2149,7 @@
"session. "
#. Tag: para
+#: performance.xml:1094
#, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear()</"
@@ -1497,6 +2159,7 @@
"()</literal> "
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
@@ -1508,7 +2171,28 @@
"la classe entière, d'une instance de collection ou du rôle entier d'une "
"collection."
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid ""
+"Second-level cache eviction via <methodname>SessionFactoty.evict() </"
+"methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, no-c-format
+msgid ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1110
#, no-c-format
msgid ""
"The <literal>CacheMode</literal> controls how a particular session interacts "
@@ -1518,6 +2202,7 @@
"particulière interagit avec le cache de second niveau :"
#. Tag: para
+#: performance.xml:1115
#, no-c-format
msgid ""
"<literal>CacheMode.NORMAL</literal>: will read items from and write items to "
@@ -1527,6 +2212,7 @@
"cache de second niveau "
#. Tag: para
+#: performance.xml:1120
#, no-c-format
msgid ""
"<literal>CacheMode.GET</literal>: will read items from the second-level "
@@ -1536,6 +2222,7 @@
"niveau mais ne les écrit pas sauf dans le cas d'une mise à jour des données "
#. Tag: para
+#: performance.xml:1126
#, no-c-format
msgid ""
"<literal>CacheMode.PUT</literal>: will write items to the second-level "
@@ -1545,6 +2232,7 @@
"second niveau mais ne les lit pas dans le cache de second niveau "
#. Tag: para
+#: performance.xml:1131
#, no-c-format
msgid ""
"<literal>CacheMode.REFRESH</literal>: will write items to the second-level "
@@ -1559,6 +2247,7 @@
"base de données. "
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
@@ -1568,7 +2257,28 @@
"dédiée aux requêtes, vous pouvez utiliser l'API <literal>Statistics</"
"literal> :"
+#. Tag: title
+#: performance.xml:1143
+#, fuzzy, no-c-format
+msgid ""
+"Browsing the second-level cache entries via the <classname>Statistics</"
+"classname> API"
+msgstr ""
+"Pour parcourir le contenu du cache de second niveau ou la région du cache "
+"dédiée aux requêtes, vous pouvez utiliser l'API <literal>Statistics</"
+"literal> :"
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, no-c-format
+msgid ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1149
#, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
@@ -1579,11 +2289,27 @@
"compréhensible pour l'utilisateur : "
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, no-c-format
+msgid ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr "Le cache de requêtes"
#. Tag: para
+#: performance.xml:1162
#, fuzzy, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
@@ -1594,11 +2320,13 @@
"Pour utiliser le cache de requêtes, vous devez d'abord l'activer : "
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr ""
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
@@ -1611,12 +2339,20 @@
"need to enable the query cache:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1177
+#, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr ""
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the "
@@ -1624,6 +2360,7 @@
msgstr ""
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding "
@@ -1632,10 +2369,11 @@
msgstr ""
#. Tag: para
+#: performance.xml:1194
#, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
-"timeouts is is very important that the cache timeout of the underlying cache "
+"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
@@ -1643,6 +2381,7 @@
msgstr ""
#. Tag: para
+#: performance.xml:1203
#, fuzzy, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
@@ -1659,6 +2398,7 @@
"requête est exécutée. "
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
@@ -1669,11 +2409,13 @@
msgstr ""
#. Tag: title
+#: performance.xml:1221
#, fuzzy, no-c-format
msgid "Query cache regions"
msgstr "Cache de requêtes supporté"
#. Tag: para
+#: performance.xml:1223
#, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
@@ -1684,7 +2426,21 @@
"vous pouvez spécifier une région de cache nommée pour une requête "
"particulière en appelant <literal>Query.setCacheRegion()</literal>. "
+#. Tag: programlisting
+#: performance.xml:1227
+#, no-c-format
+msgid ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1229
#, fuzzy, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
@@ -1707,11 +2463,13 @@
"méthode <literal>SessionFactory.evictQueries()</literal>."
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "Comprendre les performances des collections"
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
@@ -1723,31 +2481,37 @@
"en rapport aux collections en cours d'exécution."
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "Taxinomie"
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "Hibernate définit trois types de collections de base :"
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "les collections de valeurs"
#. Tag: para
+#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr "Association un-à-plusieurs "
#. Tag: para
+#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr "les associations plusieurs-à-plusieurs "
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
@@ -1765,21 +2529,25 @@
"les lignes des collections. Cela nous amène aux classifications suivantes :"
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "collections indexées"
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "ensembles (sets)"
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "sacs (bags)"
#. Tag: para
+#: performance.xml:1288
#, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
@@ -1797,6 +2565,7 @@
"supprimer. "
#. Tag: para
+#: performance.xml:1295
#, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key></literal> and "
@@ -1823,6 +2592,7 @@
"literal>). "
#. Tag: para
+#: performance.xml:1306
#, no-c-format
msgid ""
"<literal><idbag></literal> mappings define a surrogate key, so they "
@@ -1833,6 +2603,7 @@
"jour. En fait il s'agit du meilleur cas de mise à jour d'une collection."
#. Tag: para
+#: performance.xml:1309
#, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
@@ -1849,6 +2620,7 @@
"collection chaque fois qu'elle change. Ce qui peut être très inefficace. "
#. Tag: para
+#: performance.xml:1316
#, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
@@ -1862,6 +2634,7 @@
"localise les lignes individuelles de la collection). "
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
@@ -1870,6 +2643,7 @@
"plus efficaces pour la mise à jour "
#. Tag: para
+#: performance.xml:1326
#, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
@@ -1882,6 +2656,7 @@
"d'éléments. "
#. Tag: para
+#: performance.xml:1330
#, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
@@ -1901,6 +2676,7 @@
"Une fois de plus, ce cas ne s'applique pas aux associations un-à-plusieurs. "
#. Tag: para
+#: performance.xml:1338
#, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
@@ -1917,6 +2693,7 @@
"sémantique des ensembles est la plus naturelle dans le modèle relationnel. "
#. Tag: para
+#: performance.xml:1344
#, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
@@ -1933,12 +2710,14 @@
"tout simplement pas dans ces cas-là. "
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr ""
"Les sacs et les listes sont les plus efficaces pour les collections inverses"
#. Tag: para
+#: performance.xml:1354
#, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
@@ -1961,12 +2740,25 @@
"literal> (contrairement au <literal>Set</literal>). Cela peut rendre le code "
"suivant beaucoup plus rapide :"
+#. Tag: programlisting
+#: performance.xml:1365
+#, no-c-format
+msgid ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "Suppression en un coup"
#. Tag: para
+#: performance.xml:1371
#, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
@@ -1982,6 +2774,7 @@
"fait ! "
#. Tag: para
+#: performance.xml:1377
#, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
@@ -1995,6 +2788,7 @@
"la collection ne soit un sac). Cela est préférable. "
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
@@ -2005,11 +2799,13 @@
"moyens de procéder."
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr "effacer dix-huit lignes une à une puis en insérer trois"
#. Tag: para
+#: performance.xml:1394
#, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE</literal> and insert "
@@ -2019,6 +2815,7 @@
"puis insérer les cinq éléments restant (un à un) "
#. Tag: para
+#: performance.xml:1400
#, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
@@ -2031,6 +2828,7 @@
"de bases de données plutôt aléatoire, etc...). "
#. Tag: para
+#: performance.xml:1404
#, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
@@ -2043,6 +2841,7 @@
"avec tous les éléments restants. "
#. Tag: para
+#: performance.xml:1409
#, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
@@ -2052,11 +2851,13 @@
"qui sont mappées avec <literal>inverse=\"true\"</literal>. "
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "Moniteur de performance"
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
@@ -2070,11 +2871,13 @@
"<literal>SessionFactory</literal>."
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "Suivi d'une SessionFactory"
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory</literal> metrics in two ways. Your "
@@ -2087,6 +2890,7 @@
"literal> vous-même."
#. Tag: para
+#: performance.xml:1430
#, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
@@ -2099,7 +2903,38 @@
"un seul MBean pour toutes vos <literal>SessionFactory</literal> ou un par "
"fabrique. Voici un code qui montre un exemple de configuration minimaliste : "
+#. Tag: programlisting
+#: performance.xml:1435
+#, no-c-format
+msgid ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, no-c-format
+msgid ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1439
#, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
@@ -2109,6 +2944,7 @@
"literal> :"
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics</literal> "
@@ -2118,6 +2954,7 @@
"generate_statistics</literal> à <literal>false</literal>"
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> "
@@ -2127,6 +2964,7 @@
"literal> ou <literal>hibernateStatsBean.setStatisticsEnabled(true)</literal>"
#. Tag: para
+#: performance.xml:1458
#, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear()</"
@@ -2139,11 +2977,13 @@
"literal>."
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "Métriques"
#. Tag: para
+#: performance.xml:1466
#, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
@@ -2157,6 +2997,7 @@
"de l'interface <literal>Statistics</literal> dans trois catégories : "
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid ""
"Metrics related to the general <literal>Session</literal> usage, such as "
@@ -2167,6 +3008,7 @@
"récupérées, etc..."
#. Tag: para
+#: performance.xml:1479
#, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
@@ -2176,6 +3018,7 @@
"leur ensemble (métriques globales aka)."
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
@@ -2185,6 +3028,7 @@
"ou une région de cache particulière."
#. Tag: para
+#: performance.xml:1489
#, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
@@ -2201,6 +3045,7 @@
"n'offre qu'une précision de l'ordre de 10 secondes. "
#. Tag: para
+#: performance.xml:1495
#, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
@@ -2224,7 +3069,30 @@
"literal> pour plus d'informations. Le code ci-dessous montre un exemple "
"simple : "
+#. Tag: programlisting
+#: performance.xml:1506
+#, no-c-format
+msgid ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1508
#, no-c-format
msgid ""
"You can work on all entities, collections, queries and region caches, by "
@@ -2240,7 +3108,30 @@
"<literal>getCollectionRoleNames()</literal>, et "
"<literal>getSecondLevelCacheRegionNames()</literal>. "
+#~ msgid "yes"
+#~ msgstr "oui"
+
#~ msgid ""
+#~ "The <literal><cache></literal> element of a class or collection "
+#~ "mapping has the following form:"
+#~ msgstr ""
+#~ "L'élément <literal><cache></literal> d'une classe ou d'une "
+#~ "collection a la forme suivante :"
+
+#~ msgid ""
+#~ "The <literal>usage</literal> attribute specifies a <emphasis>cache "
+#~ "concurrency strategy</emphasis>."
+#~ msgstr ""
+#~ "L'attribut <literal>usage</literal> spécifie une <emphasis>stratégie de "
+#~ "concurrence d'accès au cache</emphasis>."
+
+#~ msgid "read-only"
+#~ msgstr "read-only (lecture seule)"
+
+#~ msgid "read-write"
+#~ msgstr "read-write (lecture-écriture)"
+
+#~ msgid ""
#~ "This setting creates two new cache regions: one holding cached query "
#~ "result sets (<literal>org.hibernate.cache.StandardQueryCache</literal>), "
#~ "the other holding timestamps of the most recent updates to queryable "
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/persistent_classes.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/persistent_classes.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/persistent_classes.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: persistent_classes\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 09:39+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,18 +17,20 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "Classes persistantes"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:34
+#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
-"application). Not all instances of a persistent class are considered to be "
-"in the persistent state. For example, an instance can instead be transient "
-"or detached."
+"application). The term \"persistent\" here means that the classes are able "
+"to be persisted, not that they are in the persistent state (see <xref "
+"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"Les classes persistantes sont les classes d'une application qui implémentent "
"les entités d'un problème métier (par ex. Client et Commande dans une "
@@ -37,13 +39,15 @@
"instance peut être éphémère (transient) ou détachée."
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:41
+#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
-"these rules are hard requirements. Indeed, Hibernate3 assumes very little "
+"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
-"in other ways (using trees of <literal>Map</literal> instances, for example)."
+"in other ways (using trees of <interfacename>java.util.Map</interfacename> "
+"instances, for example)."
msgstr ""
"Hibernate fonctionne de manière optimale lorsque ces classes suivent "
"quelques règles simples, aussi connues comme le modèle de programmation "
@@ -54,20 +58,103 @@
"<literal>Map</literal>, par exemple."
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "Un exemple simple de POJO"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
#, no-c-format
+msgid "Simple POJO representing a cat"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:53
+#, no-c-format
msgid ""
-"Most Java applications require a persistent class representing felines. For "
-"example:"
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+"private Long id; // identifier\n"
+"\n"
+"private Date birthdate;\n"
+"private Color color;\n"
+"private char sex;\n"
+"private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+"\n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() );\n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
msgstr ""
-"Toute bonne application Java nécessite une classe persistante représentant "
-"les félins. Par exemple :"
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
@@ -77,19 +164,21 @@
"les sections qui suivent :"
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "Implémenter un constructeur sans argument"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:64
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> has a no-argument constructor. All persistent classes "
-"must have a default constructor (which can be non-public) so that Hibernate "
-"can instantiate them using <literal>Constructor.newInstance()</literal>. It "
-"is recommended that you have a default constructor with at least "
-"<emphasis>package</emphasis> visibility for runtime proxy generation in "
-"Hibernate."
+"<classname>Cat</classname> has a no-argument constructor. All persistent "
+"classes must have a default constructor (which can be non-public) so that "
+"Hibernate can instantiate them using <literal><classname>java.lang.reflect."
+"Constructor</classname>.newInstance()</literal>. It is recommended that this "
+"constructor be defined with at least <emphasis>package</emphasis> visibility "
+"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat</literal> a un constructeur sans argument. Toutes les classes "
"persistantes doivent avoir un constructeur par défaut (lequel peut ne pas "
@@ -100,73 +189,42 @@
"dans Hibernate. "
#. Tag: title
-#, no-c-format
-msgid "Provide an identifier property (optional)"
+#: persistent_classes.xml:74
+#, fuzzy, no-c-format
+msgid "Provide an identifier property"
msgstr "Fournir une propriété d'identifiant (optionnel)"
#. Tag: para
+#: persistent_classes.xml:77
#, no-c-format
msgid ""
-"<literal>Cat</literal> has a property called <literal>id</literal>. This "
-"property maps to the primary key column of a database table. The property "
-"might have been called anything, and its type might have been any primitive "
-"type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or "
-"<literal>java.util.Date</literal>. If your legacy database table has "
-"composite keys, you can use a user-defined class with properties of these "
-"types (see the section on composite identifiers later in the chapter.)"
+"Historically this was considered option. While still not (yet) enforced, "
+"this should be considered a deprecated feature as it will be completely "
+"required to provide a identifier property in an upcoming release."
msgstr ""
-"<literal>Cat</literal> possède une propriété appelée <literal>id</literal>. "
-"Cette propriété mappe la valeur de la colonne de clé primaire de la table "
-"d'une base de données. La propriété aurait pu s'appeler autrement, et son "
-"type aurait pu être n'importe quel type primitif, n'importe quel "
-"\"encapsuleur\" de type primitif, <literal>java.lang.String</literal> ou "
-"<literal>java.util.Date</literal>. (Si votre base de données héritée possède "
-"des clés composites, elles peuvent être mappées en utilisant une classe "
-"définie par l'utilisateur et possédant les propriétés associées aux types de "
-"la clé composite - voir la section concernant les identifiants composites "
-"ultérieurement). "
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
msgid ""
-"The identifier property is strictly optional. You can leave them off and let "
-"Hibernate keep track of object identifiers internally. We do not recommend "
-"this, however."
+"<classname>Cat</classname> has a property named <literal>id</literal>. This "
+"property maps to the primary key column(s) of the underlying database table. "
+"The type of the identifier property can be any \"basic\" type (see <xref "
+"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
+"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
-"La propriété d'identifiant est strictement optionnelle. Vous pouvez "
-"l'oublier et laisser Hibernate s'occuper des identifiants de l'objet en "
-"interne. Toutefois, ce n'est pas recommandé. "
#. Tag: para
+#: persistent_classes.xml:92
#, no-c-format
msgid ""
-"In fact, some functionality is available only to classes that declare an "
-"identifier property:"
+"Identifiers do not necessarily need to identify column(s) in the database "
+"physically defined as a primary key. They should just identify columns that "
+"can be used to uniquely identify rows in the underlying table."
msgstr ""
-"En fait, quelques fonctionnalités ne sont disponibles que pour les classes "
-"déclarant un identifiant de propriété : "
#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Transitive reattachment for detached objects (cascade update or cascade "
-"merge) - see <xref linkend=\"objectstate-transitive\" />"
-msgstr ""
-"Pour les rattachements transitifs pour les objets détachés (mise à jour en "
-"cascade ou fusion en cascade) - consultez <xref linkend=\"objectstate-"
-"transitive\" />"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
-msgstr "<literal>Session.saveOrUpdate()</literal>"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>Session.merge()</literal>"
-msgstr "<literal>Session.merge()</literal>"
-
-#. Tag: para
+#: persistent_classes.xml:99
#, no-c-format
msgid ""
"We recommend that you declare consistently-named identifier properties on "
@@ -177,57 +235,118 @@
"(c'est-à-dire non primitif). "
#. Tag: title
-#, no-c-format
-msgid "Prefer non-final classes (optional)"
+#: persistent_classes.xml:107
+#, fuzzy, no-c-format
+msgid "Prefer non-final classes (semi-optional)"
msgstr "Favoriser les classes non finales (optionnel)"
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
msgid ""
-"A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon "
-"the persistent class being either non-final, or the implementation of an "
-"interface that declares all public methods."
+"A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), "
+"depends upon the persistent class being either non-final, or the "
+"implementation of an interface that declares all public methods. You can "
+"persist <literal>final</literal> classes that do not implement an interface "
+"with Hibernate; you will not, however, be able to use proxies for lazy "
+"association fetching which will ultimately limit your options for "
+"performance tuning. To persist a <literal>final</literal> class which does "
+"not implement a \"full\" interface you must disable proxy generation. See "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
+"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
+"ann\"/>."
msgstr ""
-"Une fonctionnalité clé de Hibernate, les <emphasis>proxies</emphasis>, "
-"nécessitent que la classe persistante soit non finale ou qu'elle soit "
-"l'implémentation d'une interface qui déclare toutes les méthodes publiques."
+#. Tag: title
+#: persistent_classes.xml:121
+#, no-c-format
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:122
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:126
+#, no-c-format
+msgid "Disabling proxies in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:127
+#, no-c-format
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:130
#, no-c-format
msgid ""
-"You can persist <literal>final</literal> classes that do not implement an "
-"interface with Hibernate. You will not, however, be able to use proxies for "
-"lazy association fetching which will ultimately limit your options for "
-"performance tuning."
+"If the <literal>final</literal> class does implement a proper interface, you "
+"could alternatively tell Hibernate to use the interface instead when "
+"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
+"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
+"final-example-proxy-interface-ann\"/>."
msgstr ""
-"Vous pouvez persister, grâce à Hibernate, les classes <literal>final</"
-"literal> qui n'implémentent pas d'interface, mais vous ne pourrez pas "
-"utiliser les proxies pour les chargements d'associations paresseux - ce qui "
-"limitera vos possibilités d'ajustement des performances. "
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:139
#, no-c-format
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:144
+#, no-c-format
+msgid "Proxying an interface in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:145
+#, no-c-format
msgid ""
-"You should also avoid declaring <literal>public final</literal> methods on "
-"the non-final classes. If you want to use a class with a <literal>public "
-"final</literal> method, you must explicitly disable proxying by setting "
-"<literal>lazy=\"false\"</literal>."
+"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
+"ICat { ... }]]>"
msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:148
+#, fuzzy, no-c-format
+msgid ""
+"You should also avoid declaring <literal>public final</literal> methods as "
+"this will again limit the ability to generate <emphasis>proxies</emphasis> "
+"from this class. If you want to use a class with <literal>public final</"
+"literal> methods, you must explicitly disable proxying. Again, see <xref "
+"linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/"
+">."
+msgstr ""
"Vous devriez aussi éviter de déclarer des méthodes <literal>public final</"
"literal> sur des classes non-finales. Si vous voulez utiliser une classe "
"avec une méthode <literal>public final</literal>, vous devez explicitement "
"désactiver les proxies en paramétrant <literal>lazy=\"false\"</literal>. "
#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr ""
"Déclarer les accesseurs et mutateurs des attributs persistants (optionnel)"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:160
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> declares accessor methods for all its persistent "
+"<classname>Cat</classname> declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
@@ -246,22 +365,26 @@
"champs pour des propriétés particulières, si besoin est. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:169
+#, fuzzy, no-c-format
msgid ""
-"Properties need <emphasis>not</emphasis> be declared public - Hibernate can "
-"persist a property with a default, <literal>protected</literal> or "
-"<literal>private</literal> get / set pair."
+"Properties need <emphasis>not</emphasis> be declared public. Hibernate can "
+"persist a property declared with <literal>package</literal>, "
+"<literal>protected</literal> or <literal>private</literal> visibility as "
+"well."
msgstr ""
"Les propriétés <emphasis>n'ont pas</emphasis> à être déclarées publiques - "
"Hibernate peut persister une propriété avec une paire de getter/setter par "
"défault, <literal>protected</literal> ou <literal> private</literal>. "
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "Implémenter l'héritage"
#. Tag: para
+#: persistent_classes.xml:180
#, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
@@ -271,7 +394,26 @@
"hérite sa propriété d'identifiant de la classe mère <literal>Cat</literal>. "
"Par exemple :"
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:188
#, no-c-format
msgid ""
"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
@@ -279,6 +421,7 @@
"Implémenter <literal>equals()</literal> et <literal>hashCode()</literal> "
#. Tag: para
+#: persistent_classes.xml:191
#, no-c-format
msgid ""
"You have to override the <literal>equals()</literal> and <literal>hashCode()"
@@ -288,6 +431,7 @@
"<literal>hashCode()</literal> si vous :"
#. Tag: para
+#: persistent_classes.xml:196
#, no-c-format
msgid ""
"intend to put instances of persistent classes in a <literal>Set</literal> "
@@ -299,11 +443,13 @@
"associations pluri-valuées); <emphasis>et</emphasis>"
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "avez l'intention d'utiliser le rattachement d'instances détachées"
#. Tag: para
+#: persistent_classes.xml:206
#, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
@@ -320,6 +466,7 @@
"correcte pour les <literal>Set</literal> s. "
#. Tag: para
+#: persistent_classes.xml:212
#, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()</literal>/"
@@ -356,6 +503,7 @@
"l'égalité d'un objet. "
#. Tag: para
+#: persistent_classes.xml:228
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
@@ -372,11 +520,41 @@
"une clé métier, une clé qui identifierait notre instance dans le monde réel "
"(une clé candidate <emphasis>naturelle</emphasis>) : "
+#. Tag: programlisting
+#: persistent_classes.xml:235
+#, no-c-format
+msgid ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:237
#, fuzzy, no-c-format
msgid ""
"A business key does not have to be as solid as a database primary key "
-"candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable "
+"candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable "
"or unique properties are usually good candidates for a business key."
msgstr ""
"Notez qu'une clé métier ne doit pas être solide comme une clé primaire de "
@@ -385,26 +563,30 @@
"pour une clé métier. "
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr "Modèles dynamiques"
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr "Remarque"
-#. Tag: para
+#. Tag: emphasis
+#: persistent_classes.xml:249
#, fuzzy, no-c-format
msgid ""
-"<emphasis>The following features are currently considered experimental and "
-"may change in the near future.</emphasis>"
+"The following features are currently considered experimental and may change "
+"in the near future."
msgstr ""
"<emphasis>Notez que les fonctionnalités suivantes sont actuellement "
"considérées comme expérimentales et pourront changer dans un futur proche.</"
"emphasis>"
#. Tag: para
+#: persistent_classes.xml:253
#, no-c-format
msgid ""
"Persistent entities do not necessarily have to be represented as POJO "
@@ -421,12 +603,13 @@
"de classes persistantes, seulement des fichiers de mappage. "
#. Tag: para
+#: persistent_classes.xml:259
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactory</"
"literal> using the <literal>default_entity_mode</literal> configuration "
-"option (see <xref linkend=\"configuration-optional-properties\" />)."
+"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"Par défaut, Hibernate fonctionne en mode POJO normal. Vous pouvez paramétrer "
"un mode de représentation d'entité par défaut pour une "
@@ -435,6 +618,7 @@
"\"configuration-optional-properties\" />)."
#. Tag: para
+#: persistent_classes.xml:265
#, no-c-format
msgid ""
"The following examples demonstrate the representation using <literal>Map</"
@@ -446,7 +630,47 @@
"<literal>entity-name</literal> doit être déclaré au lieu (ou en plus) d'un "
"nom de classe :"
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:272
#, no-c-format
msgid ""
"Even though associations are declared using target class names, the target "
@@ -457,6 +681,7 @@
"dynamique au lieu d'un POJO. "
#. Tag: para
+#: persistent_classes.xml:276
#, no-c-format
msgid ""
"After setting the default entity mode to <literal>dynamic-map</literal> for "
@@ -468,7 +693,34 @@
"l'exécution fonctionner avec des <literal>Map</literal> s de <literal>Map</"
"literal> s : "
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, no-c-format
+msgid ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:283
#, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
@@ -487,6 +739,7 @@
"domaine plus tard. "
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session</"
@@ -495,7 +748,25 @@
"Les modes de représentation d'une entité peuvent aussi être configurés en se "
"basant sur <literal>Session</literal> :"
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, no-c-format
+msgid ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:295
#, no-c-format
msgid ""
"Please note that the call to <literal>getSession()</literal> using an "
@@ -517,31 +788,35 @@
"transaction et de la connexion à l'unité de travail primaire. "
#. Tag: para
+#: persistent_classes.xml:304
#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
-"<xref linkend=\"xml\" />."
+"<xref linkend=\"xml\"/>."
msgstr ""
"Pour plus d'informations à propos de la représentation XML, veuillez "
"consulter <xref linkend=\"xml\" />."
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizers"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:312
+#, fuzzy, no-c-format
msgid ""
-"<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO "
-"through its constructor. It also knows how to access the POJO properties "
-"using the defined property accessors."
+"<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-"
+"interfaces are responsible for managing a particular representation of a "
+"piece of data given that representation's <classname>org.hibernate."
+"EntityMode</classname>. If a given piece of data is thought of as a data "
+"structure, then a tuplizer is the thing that knows how to create such a data "
+"structure, how to extract values from such a data structure and how to "
+"inject values into such a data structure. For example, for the POJO entity "
+"mode, the corresponding tuplizer knows how create the POJO through its "
+"constructor. It also knows how to access the POJO properties using the "
+"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer</literal>, et ses sous-interfaces, "
"sont responsables de la gestion d'une représentation particulière d'un "
@@ -555,34 +830,45 @@
"les accesseurs de la propriété définie. "
#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
+msgid "There are two (high-level) types of Tuplizers:"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:326
+#, no-c-format
msgid ""
-"There are two high-level types of Tuplizers, represented by the <literal>org."
-"hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate."
-"tuple.component.ComponentTuplizer</literal> interfaces. "
-"<literal>EntityTuplizer</literal>s are responsible for managing the above "
-"mentioned contracts in regards to entities, while "
-"<literal>ComponentTuplizer</literal>s do the same for components."
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"which is responsible for managing the above mentioned contracts in regards "
+"to entities"
msgstr ""
-"Il y a deux types de Tuplizers de haut niveau, représentés par les "
-"interfaces <literal>org.hibernate.tuple.EntityTuplizer</literal> et "
-"<literal>org.hibernate.tuple.ComponentTuplizer</literal>. Les "
-"<literal>EntityTuplizer</literal> s sont responsables de la gestion des "
-"contrats mentionnés ci-dessus pour les entités, alors que les "
-"<literal>ComponentTuplizer</literal> s s'occupent des composants."
#. Tag: para
+#: persistent_classes.xml:332
#, no-c-format
msgid ""
-"Users can also plug in their own tuplizers. Perhaps you require that a "
-"<literal>java.util.Map</literal> implementation other than <literal>java."
-"util.HashMap</literal> be used while in the dynamic-map entity-mode. Or "
-"perhaps you need to define a different proxy generation strategy than the "
-"one used by default. Both would be achieved by defining a custom tuplizer "
-"implementation. Tuplizer definitions are attached to the entity or component "
-"mapping they are meant to manage. Going back to the example of our customer "
-"entity:"
+"<interfacename>org.hibernate.tuple.component.ComponentTuplizer</"
+"interfacename> which does the same for components"
msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:340
+#, fuzzy, no-c-format
+msgid ""
+"Users can also plug in their own tuplizers. Perhaps you require that "
+"<interfacename>java.util.Map</interfacename> implementation other than "
+"<classname>java.util.HashMap</classname> be used while in the dynamic-map "
+"entity-mode. Or perhaps you need to define a different proxy generation "
+"strategy than the one used by default. Both would be achieved by defining a "
+"custom tuplizer implementation. Tuplizer definitions are attached to the "
+"entity or component mapping they are meant to manage. Going back to the "
+"example of our <classname>Customer</classname> entity, <xref linkend="
+"\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom "
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
+"\"/> shows how to do the same in <literal>hbm.xml</literal>"
+msgstr ""
"Les utilisateurs peuvent aussi brancher leurs propres tuplizers. Il vous "
"faudra peut-être utiliser une implémentation de <literal>java.util.Map</"
"literal> autre que <literal>java.util.HashMap</literal> dans le mode "
@@ -594,26 +880,83 @@
"notre entité utilisateur : "
#. Tag: title
+#: persistent_classes.xml:353
#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class entity-name=\"Customer\">\n"
+" <!--\n"
+" Override the dynamic-map entity-mode\n"
+" tuplizer for the customer entity\n"
+" -->\n"
+" <tuplizer entity-mode=\"dynamic-map\"\n"
+" class=\"CustomMapTuplizerImpl\"/>\n"
+"\n"
+" <id name=\"id\" type=\"long\" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <!-- other properties -->\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
+#, no-c-format
msgid "EntityNameResolvers"
msgstr "EntityNameResolvers"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:365
+#, fuzzy, no-c-format
msgid ""
-"The <interfacename>org.hibernate.EntityNameResolver</interfacename> "
-"interface is a contract for resolving the entity name of a given entity "
-"instance. The interface defines a single method "
-"<methodname>resolveEntityName</methodname> which is passed the entity "
-"instance and is expected to return the appropriate entity name (null is "
-"allowed and would indicate that the resolver does not know how to resolve "
-"the entity name of the given entity instance). Generally speaking, an "
-"<interfacename>org.hibernate.EntityNameResolver</interfacename> is going to "
-"be most useful in the case of dynamic models. One example might be using "
-"proxied interfaces as your domain model. The hibernate test suite has an "
-"example of this exact style of usage under the <package>org.hibernate.test."
-"dynamicentity.tuplizer2</package>. Here is some of the code from that "
-"package for illustration."
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> is a "
+"contract for resolving the entity name of a given entity instance. The "
+"interface defines a single method <methodname>resolveEntityName</methodname> "
+"which is passed the entity instance and is expected to return the "
+"appropriate entity name (null is allowed and would indicate that the "
+"resolver does not know how to resolve the entity name of the given entity "
+"instance). Generally speaking, an <interfacename>org.hibernate."
+"EntityNameResolver</interfacename> is going to be most useful in the case of "
+"dynamic models. One example might be using proxied interfaces as your domain "
+"model. The hibernate test suite has an example of this exact style of usage "
+"under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. "
+"Here is some of the code from that package for illustration."
msgstr ""
"L'interface <interfacename>org.hibernate.EntityNameResolver</interfacename> "
"représente un contrat pour résoudre le nom de l'entité d'une instance "
@@ -629,7 +972,138 @@
"hibernate.test.dynamicentity.tuplizer2</package>. Vous trouverez ci dessous "
"une illustration du code de ce package."
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, no-c-format
+msgid ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an\n"
+" * interface as the domain model and simply store persistent state in an "
+"internal\n"
+" * Map. This is an extremely trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" *\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names\n"
+" * should be resolved. Since this particular impl can handle resolution for "
+"all of our\n"
+" * entities we want to take advantage of the fact that SessionFactoryImpl "
+"keeps these\n"
+" * in a Set so that we only ever have one instance registered. Why? Well, "
+"when it\n"
+" * comes time to resolve an entity name, Hibernate must iterate over all the "
+"registered\n"
+" * resolvers. So keeping that number down helps that process be as speedy "
+"as possible.\n"
+" * Hence the equals and hashCode implementations as is\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ..."
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
msgid ""
"In order to register an <interfacename>org.hibernate.EntityNameResolver</"
@@ -639,17 +1113,19 @@
"interfacename>, les utilisateurs doivent soit :"
#. Tag: para
+#: persistent_classes.xml:383
#, fuzzy, no-c-format
msgid ""
-"Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link>, implementing the <methodname>getEntityNameResolvers</methodname> "
-"method."
+"Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers"
+"\"/>), implementing the <methodname>getEntityNameResolvers</methodname> "
+"method"
msgstr ""
"Implémenter un <xref linkend=\"persistent-classes-tuplizers\" /> "
"personnalisé, en implémentant la méthode <methodname>getEntityNameResolvers</"
"methodname>."
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</"
@@ -661,3 +1137,100 @@
"classname> (qui est la classe d'implémentation de <interfacename>org."
"hibernate.SessionFactory</interfacename>) à l'aide de la méthode "
"<methodname>registerEntityNameResolver</methodname>."
+
+#~ msgid ""
+#~ "Most Java applications require a persistent class representing felines. "
+#~ "For example:"
+#~ msgstr ""
+#~ "Toute bonne application Java nécessite une classe persistante "
+#~ "représentant les félins. Par exemple :"
+
+#~ msgid ""
+#~ "<literal>Cat</literal> has a property called <literal>id</literal>. This "
+#~ "property maps to the primary key column of a database table. The property "
+#~ "might have been called anything, and its type might have been any "
+#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
+#~ "String</literal> or <literal>java.util.Date</literal>. If your legacy "
+#~ "database table has composite keys, you can use a user-defined class with "
+#~ "properties of these types (see the section on composite identifiers later "
+#~ "in the chapter.)"
+#~ msgstr ""
+#~ "<literal>Cat</literal> possède une propriété appelée <literal>id</"
+#~ "literal>. Cette propriété mappe la valeur de la colonne de clé primaire "
+#~ "de la table d'une base de données. La propriété aurait pu s'appeler "
+#~ "autrement, et son type aurait pu être n'importe quel type primitif, "
+#~ "n'importe quel \"encapsuleur\" de type primitif, <literal>java.lang."
+#~ "String</literal> ou <literal>java.util.Date</literal>. (Si votre base de "
+#~ "données héritée possède des clés composites, elles peuvent être mappées "
+#~ "en utilisant une classe définie par l'utilisateur et possédant les "
+#~ "propriétés associées aux types de la clé composite - voir la section "
+#~ "concernant les identifiants composites ultérieurement). "
+
+#~ msgid ""
+#~ "The identifier property is strictly optional. You can leave them off and "
+#~ "let Hibernate keep track of object identifiers internally. We do not "
+#~ "recommend this, however."
+#~ msgstr ""
+#~ "La propriété d'identifiant est strictement optionnelle. Vous pouvez "
+#~ "l'oublier et laisser Hibernate s'occuper des identifiants de l'objet en "
+#~ "interne. Toutefois, ce n'est pas recommandé. "
+
+#~ msgid ""
+#~ "In fact, some functionality is available only to classes that declare an "
+#~ "identifier property:"
+#~ msgstr ""
+#~ "En fait, quelques fonctionnalités ne sont disponibles que pour les "
+#~ "classes déclarant un identifiant de propriété : "
+
+#, fuzzy
+#~ msgid ""
+#~ "Transitive reattachment for detached objects (cascade update or cascade "
+#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
+#~ msgstr ""
+#~ "Pour les rattachements transitifs pour les objets détachés (mise à jour "
+#~ "en cascade ou fusion en cascade) - consultez <xref linkend=\"objectstate-"
+#~ "transitive\" />"
+
+#, fuzzy
+#~ msgid "<literal>Session.saveOrUpdate()</literal>"
+#~ msgstr "<literal>Session.saveOrUpdate()</literal>"
+
+#, fuzzy
+#~ msgid "<literal>Session.merge()</literal>"
+#~ msgstr "<literal>Session.merge()</literal>"
+
+#~ msgid ""
+#~ "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends "
+#~ "upon the persistent class being either non-final, or the implementation "
+#~ "of an interface that declares all public methods."
+#~ msgstr ""
+#~ "Une fonctionnalité clé de Hibernate, les <emphasis>proxies</emphasis>, "
+#~ "nécessitent que la classe persistante soit non finale ou qu'elle soit "
+#~ "l'implémentation d'une interface qui déclare toutes les méthodes "
+#~ "publiques."
+
+#~ msgid ""
+#~ "You can persist <literal>final</literal> classes that do not implement an "
+#~ "interface with Hibernate. You will not, however, be able to use proxies "
+#~ "for lazy association fetching which will ultimately limit your options "
+#~ "for performance tuning."
+#~ msgstr ""
+#~ "Vous pouvez persister, grâce à Hibernate, les classes <literal>final</"
+#~ "literal> qui n'implémentent pas d'interface, mais vous ne pourrez pas "
+#~ "utiliser les proxies pour les chargements d'associations paresseux - ce "
+#~ "qui limitera vos possibilités d'ajustement des performances. "
+
+#~ msgid ""
+#~ "There are two high-level types of Tuplizers, represented by the "
+#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal> "
+#~ "interfaces. <literal>EntityTuplizer</literal>s are responsible for "
+#~ "managing the above mentioned contracts in regards to entities, while "
+#~ "<literal>ComponentTuplizer</literal>s do the same for components."
+#~ msgstr ""
+#~ "Il y a deux types de Tuplizers de haut niveau, représentés par les "
+#~ "interfaces <literal>org.hibernate.tuple.EntityTuplizer</literal> et "
+#~ "<literal>org.hibernate.tuple.ComponentTuplizer</literal>. Les "
+#~ "<literal>EntityTuplizer</literal> s sont responsables de la gestion des "
+#~ "contrats mentionnés ci-dessus pour les entités, alors que les "
+#~ "<literal>ComponentTuplizer</literal> s s'occupent des composants."
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/preface.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/preface.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: Preface\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 09:43+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,19 +17,24 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr "Préface"
#. Tag: para
+#: preface.xml:35
#, fuzzy, no-c-format
msgid ""
-"Working with object-oriented software and a relational database can be "
-"cumbersome and time consuming in today's enterprise environments. Hibernate "
-"is an Object/Relational Mapping tool for Java environments. The term Object/"
-"Relational Mapping (ORM) refers to the technique of mapping a data "
-"representation from an object model to a relational data model with a SQL-"
-"based schema."
+"Working with both Object-Oriented software and Relational Databases can be "
+"cumbersome and time consuming. Development costs are significantly higher "
+"due to a paradigm mismatch between how data is represented in objects versus "
+"relational databases. Hibernate is an Object/Relational Mapping solution for "
+"Java environments. The term Object/Relational Mapping refers to the "
+"technique of mapping a data representation from an object model to a "
+"relational data model with a SQL-based schema; see <ulink url=\"http://en."
+"wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/"
+"Object-relational_mapping</ulink> for a discussion."
msgstr ""
"Travailler avec des logiciels orientés-objet et une base de données "
"relationnelle peut sembler parfois lourd et coûteux en temps dans les "
@@ -40,8 +45,32 @@
"d'objet vers un modèle de données relationnelles dans un schéma basé-SQL."
#. Tag: para
+#: preface.xml:46
#, no-c-format
msgid ""
+"While having a strong background in SQL is not required to use Hibernate, "
+"having a basic understanding of the concepts can greatly help you understand "
+"Hibernate more fully and quickly. Probably the single best background is an "
+"understanding of data modeling principles. You might want to consider these "
+"resources as a good starting point:"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:54
+#, no-c-format
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:59
+#, no-c-format
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
+
+#. Tag: para
+#: preface.xml:66
+#, no-c-format
+msgid ""
"Hibernate not only takes care of the mapping from Java classes to database "
"tables (and from Java data types to SQL data types), but also provides data "
"query and retrieval facilities. It can also significantly reduce development "
@@ -54,17 +83,29 @@
"passé à traiter des données manuellement dans SQL ou JDBC."
#. Tag: para
+#: preface.xml:72
#, no-c-format
msgid ""
-"Hibernate's goal is to relieve the developer from 95 percent of common data "
-"persistence related programming tasks. Hibernate may not be the best "
-"solution for data-centric applications that only use stored-procedures to "
-"implement the business logic in the database, it is most useful with object-"
-"oriented domain models and business logic in the Java-based middle-tier. "
-"However, Hibernate can certainly help you to remove or encapsulate vendor-"
-"specific SQL code and will help with the common task of result set "
-"translation from a tabular representation to a graph of objects."
+"Hibernate’s design goal is to relieve the developer from 95% of common data "
+"persistence-related programming tasks by eliminating the need for manual, "
+"hand-crafted data processing using SQL and JDBC. However, unlike many other "
+"persistence solutions, Hibernate does not hide the power of SQL from you and "
+"guarantees that your investment in relational technology and knowledge is as "
+"valid as always."
msgstr ""
+
+#. Tag: para
+#: preface.xml:79
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate may not be the best solution for data-centric applications that "
+"only use stored-procedures to implement the business logic in the database, "
+"it is most useful with object-oriented domain models and business logic in "
+"the Java-based middle-tier. However, Hibernate can certainly help you to "
+"remove or encapsulate vendor-specific SQL code and will help with the common "
+"task of result set translation from a tabular representation to a graph of "
+"objects."
+msgstr ""
"Le but d'Hibernate est de libérer le développeur de 95 pour cent des tâches "
"de programmation liées à la persistance de données communes. Hibernate n'est "
"peut-être pas la meilleure solution pour les applications centrées-données "
@@ -77,6 +118,7 @@
"d'un tableau de représentation vers un graphe d'objets. "
#. Tag: para
+#: preface.xml:88
#, no-c-format
msgid ""
"If you are new to Hibernate and Object/Relational Mapping or even Java, "
@@ -86,9 +128,10 @@
"Relationnel ou même Java, veuillez suivre les étapes suivantes :"
#. Tag: para
+#: preface.xml:95
#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step "
+"Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step "
"instructions. The source code for the tutorial is included in the "
"distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
@@ -97,15 +140,17 @@
"distribution du répertoire <literal>doc/reference/tutorial/</literal>. "
#. Tag: para
+#: preface.xml:103
#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"architecture\" /> to understand the environments where "
+"Read <xref linkend=\"architecture\"/> to understand the environments where "
"Hibernate can be used."
msgstr ""
"Veuillez lire <xref linkend=\"architecture\" /> pour comprendre dans quels "
"environnements Hibernate peuvent-être utilisés."
#. Tag: para
+#: preface.xml:109
#, no-c-format
msgid ""
"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
@@ -124,13 +169,15 @@
"et sous Windows, tapez <literal>build eg</literal>."
#. Tag: para
+#: preface.xml:120
#, fuzzy, no-c-format
msgid ""
"Use this reference documentation as your primary source of information. "
"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
"more help with application design, or if you prefer a step-by-step tutorial. "
-"Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download "
-"the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+"Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and "
+"download the example application from <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>."
msgstr ""
"Utiliser cette documentation de référence en tant que source primaire "
"d'information. Vous pourrez lire <emphasis>Hibernate in Action</emphasis> "
@@ -140,11 +187,13 @@
"et décharger l'exemple d'application pour Hibernate en action."
#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr "Les questions FAQ sont traitées sur le site Hibernate."
#. Tag: para
+#: preface.xml:135
#, fuzzy, no-c-format
msgid ""
"Links to third party demos, examples, and tutorials are maintained on the "
@@ -154,6 +203,7 @@
"à partir du site Hibernate."
#. Tag: para
+#: preface.xml:141
#, no-c-format
msgid ""
"The Community Area on the Hibernate website is a good resource for design "
@@ -165,31 +215,91 @@
"diverses d'intégration (Tomcat, JBoss AS, Struts, EJB, etc.)."
#. Tag: para
+#: preface.xml:149
#, no-c-format
msgid ""
-"If you have questions, use the user forum linked on the Hibernate website. "
-"We also provide a JIRA issue tracking system for bug reports and feature "
-"requests. If you are interested in the development of Hibernate, join the "
-"developer mailing list. If you are interested in translating this "
-"documentation into your language, contact us on the developer mailing list."
+"There are a number of ways to become involved in the Hibernate community, "
+"including"
msgstr ""
-"Si vous avez des questions, participez au forum utilisateur sur le site "
-"Hibernate. Nous proposons également des systèmes de traçage JIRA pour les "
-"rapports de bogues et les demandes sur les fonctionalités. Si vous êtes "
-"intéressé à participer au développement d'Hibernate, veuillez rejoindre la "
-"liste de distribution électronique des développeurs. "
#. Tag: para
+#: preface.xml:153
#, no-c-format
msgid ""
-"Commercial development support, production support, and training for "
-"Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
-"SupportTraining/). Hibernate is a Professional Open Source project and a "
-"critical component of the JBoss Enterprise Middleware System (JEMS) suite of "
-"products."
+"Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/"
+"issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
msgstr ""
-"Le support pour le développement commercial, le support production, et la "
-"formation Hibernate sont disponibles à travers JBoss Inc. (voir http://www."
-"hibernate.org/SupportTraining/). Hibernate est un projet professionnel en "
-"source ouverte et un composant critique de la suite de produits JBoss "
-"Enterprise Middleware System (JEMS). "
+
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid ""
+"Trying your hand at fixing some bugs or implementing enhancements. Again, "
+"see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate."
+"org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid ""
+"<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/"
+"community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid ""
+"There are forums for users to ask questions and receive help from the "
+"community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid ""
+"There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat"
+"\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid ""
+"Helping improve or translate this documentation. Contact us on the developer "
+"mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
+
+#~ msgid ""
+#~ "If you have questions, use the user forum linked on the Hibernate "
+#~ "website. We also provide a JIRA issue tracking system for bug reports and "
+#~ "feature requests. If you are interested in the development of Hibernate, "
+#~ "join the developer mailing list. If you are interested in translating "
+#~ "this documentation into your language, contact us on the developer "
+#~ "mailing list."
+#~ msgstr ""
+#~ "Si vous avez des questions, participez au forum utilisateur sur le site "
+#~ "Hibernate. Nous proposons également des systèmes de traçage JIRA pour les "
+#~ "rapports de bogues et les demandes sur les fonctionalités. Si vous êtes "
+#~ "intéressé à participer au développement d'Hibernate, veuillez rejoindre "
+#~ "la liste de distribution électronique des développeurs. "
+
+#~ msgid ""
+#~ "Commercial development support, production support, and training for "
+#~ "Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
+#~ "SupportTraining/). Hibernate is a Professional Open Source project and a "
+#~ "critical component of the JBoss Enterprise Middleware System (JEMS) suite "
+#~ "of products."
+#~ msgstr ""
+#~ "Le support pour le développement commercial, le support production, et la "
+#~ "formation Hibernate sont disponibles à travers JBoss Inc. (voir http://"
+#~ "www.hibernate.org/SupportTraining/). Hibernate est un projet "
+#~ "professionnel en source ouverte et un composant critique de la suite de "
+#~ "produits JBoss Enterprise Middleware System (JEMS). "
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/query_sql.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/query_sql.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/query_sql.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: query_sql\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 09:47+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,11 +17,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr "SQL natif"
#. Tag: para
+#: query_sql.xml:33
#, no-c-format
msgid ""
"You can also express queries in the native SQL dialect of your database. "
@@ -38,6 +40,7 @@
"directement sur SQL/JDBC vers Hibernate. "
#. Tag: para
+#: query_sql.xml:39
#, no-c-format
msgid ""
"Hibernate3 allows you to specify handwritten SQL, including stored "
@@ -48,11 +51,13 @@
"suppression et chargement. "
#. Tag: title
+#: query_sql.xml:43
#, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr "Utiliser une requête <literal>SQLQuery</literal>"
#. Tag: para
+#: query_sql.xml:45
#, no-c-format
msgid ""
"Execution of native SQL queries is controlled via the <literal>SQLQuery</"
@@ -66,18 +71,29 @@
"pour les requêtes."
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr "Requêtes scalaires"
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr ""
"La requête SQL la plus basique permet de récupérer une liste de (valeurs) "
"scalaires."
+#. Tag: programlisting
+#: query_sql.xml:56
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:58
#, no-c-format
msgid ""
"These will return a List of Object arrays (Object[]) with scalar values for "
@@ -90,6 +106,7 @@
"valeurs scalaires retournées. "
#. Tag: para
+#: query_sql.xml:63
#, no-c-format
msgid ""
"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or "
@@ -100,22 +117,36 @@
"simplement pour être plus explicite dans ce qui est retourné, vous pouvez "
"utiliser <literal>addScalar()</literal>. "
+#. Tag: programlisting
+#: query_sql.xml:67
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr "Cette requête spécifie :"
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr "la chaîne de requêtes SQL"
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr "les colonnes et les types retournés"
#. Tag: para
+#: query_sql.xml:81
#, no-c-format
msgid ""
"This will return Object arrays, but now it will not use "
@@ -134,6 +165,7 @@
"colonnes listées."
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
msgid ""
"It is possible to leave out the type information for all or some of the "
@@ -142,7 +174,18 @@
"Il est possible de ne pas définir l'information sur le type pour toutes ou "
"une partie des scalaires."
+#. Tag: programlisting
+#: query_sql.xml:92
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:94
#, no-c-format
msgid ""
"This is essentially the same query as before, but now "
@@ -154,6 +197,7 @@
"NAME et BIRTHDATE alors que le type de ID est explicitement spécifié. "
#. Tag: para
+#: query_sql.xml:99
#, no-c-format
msgid ""
"How the java.sql.Types returned from ResultSetMetaData is mapped to "
@@ -167,11 +211,13 @@
"<literal>registerHibernateType</literal> dans le Dialect. "
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr "Requêtes d'entités"
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
msgid ""
"The above queries were all about returning scalar values, basically "
@@ -184,12 +230,23 @@
"montre comment récupérer des entités depuis une requête native SQL, grâce à "
"<literal>addEntity()</literal>."
+#. Tag: programlisting
+#: query_sql.xml:114
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr "L'entité retournée par la requête"
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
msgid ""
"Assuming that Cat is mapped as a class with the columns ID, NAME and "
@@ -201,6 +258,7 @@
"une entité Cat."
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
msgid ""
"If the entity is mapped with a <literal>many-to-one</literal> to another "
@@ -218,17 +276,28 @@
"comme dans l'exemple suivant avec le <literal>many-to-one</literal> vers "
"<literal>Dog</literal>:"
+#. Tag: programlisting
+#: query_sql.xml:140
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr "Ceci permet à cat.getDog() de fonctionner normalement."
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr "Gérer les associations et collections"
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
msgid ""
"It is possible to eagerly join in the <literal>Dog</literal> to avoid the "
@@ -241,7 +310,18 @@
"base de données. Ceci est effectué via la méthode <literal>addJoin()</"
"literal>, qui vous permet de joindre une association ou collection."
+#. Tag: programlisting
+#: query_sql.xml:153
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:155
#, no-c-format
msgid ""
"In this example, the returned <literal>Cat</literal>'s will have their "
@@ -259,7 +339,18 @@
"collections, par ex. si le <literal>Cat</literal> a un un-à-plusieurs vers "
"<literal>Dog</literal>. "
+#. Tag: programlisting
+#: query_sql.xml:163
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:165
#, no-c-format
msgid ""
"At this stage you are reaching the limits of what is possible with native "
@@ -274,11 +365,13 @@
"plus suffisants."
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr "Retour d'entités multiples"
#. Tag: para
+#: query_sql.xml:175
#, no-c-format
msgid ""
"Until now, the result set column names are assumed to be the same as the "
@@ -293,6 +386,7 @@
"peuvent apparaître dans plus d'une table. "
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
msgid ""
"Column alias injection is needed in the following query (which most likely "
@@ -301,7 +395,18 @@
"L'injection d'alias de colonne est requise pour la requête suivante (qui "
"risque de ne pas fonctionner) :"
+#. Tag: programlisting
+#: query_sql.xml:183
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:185
#, no-c-format
msgid ""
"The query was intended to return two Cat instances per row: a cat and its "
@@ -319,13 +424,25 @@
"et \"NAME\"). "
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
msgstr ""
"La forme suivante n'est pas vulnérable à la duplication des noms de "
"colonnes :"
+#. Tag: programlisting
+#: query_sql.xml:195
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
msgid ""
"the SQL query string, with placeholders for Hibernate to inject column "
@@ -335,11 +452,13 @@
"colonnes"
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr "les entités retournées par la requête"
#. Tag: para
+#: query_sql.xml:210
#, no-c-format
msgid ""
"The {cat.*} and {mother.*} notation used above is a shorthand for \"all "
@@ -360,12 +479,28 @@
"que nous pouvons aussi utiliser les alias de propriété dans la clause where "
"si désiré. "
+#. Tag: programlisting
+#: query_sql.xml:219
+#, no-c-format
+msgid ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr "Références d'alias et de propriété"
#. Tag: para
+#: query_sql.xml:224
#, no-c-format
msgid ""
"In most cases the above alias injection is needed. For queries relating to "
@@ -380,6 +515,7 @@
"l'injection des alias appropriés. "
#. Tag: para
+#: query_sql.xml:229
#, no-c-format
msgid ""
"The following table shows the different ways you can use the alias "
@@ -393,180 +529,213 @@
"lorsqu'ils seront utilisés. "
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr "Nom d'injection d'alias"
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr "Description"
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr "Syntaxe"
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr "Exemple"
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr "Une propriété simple"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:258
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+msgid "{[aliasname].[propertyname]"
msgstr "<literal>{[aliasname].[propertyname]</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:260
#, fuzzy, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "A_NAME as {item.name}"
+msgstr "<literal>A_NAME as {item.name}</literal>"
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr "Une propriété composite"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:266
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:268
#, fuzzy, no-c-format
-msgid ""
-"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
-"literal>"
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
msgstr ""
"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
"literal>"
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr "Discriminateur d'une entité"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:275
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].class}"
+msgstr "<literal>{[aliasname].class}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:277
#, fuzzy, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "DISC as {item.class}"
+msgstr "<literal>DISC as {item.class}</literal>"
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr "Toutes les propriétés d'une entité"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].*}"
+msgstr "<literal>{[aliasname].*}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:285
#, no-c-format
-msgid "<literal>{item.*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{item.*}"
+msgstr ""
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr "La clé d'une collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:291
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].key}"
+msgstr "<literal>{[aliasname].key}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:293
#, fuzzy, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "ORGID as {coll.key}"
+msgstr "<literal>ORGID as {coll.key}</literal>"
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr "L'id d'une collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:299
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].id}"
+msgstr "<literal>{[aliasname].id}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:301
#, fuzzy, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "EMPID as {coll.id}"
+msgstr "<literal>EMPID as {coll.id}</literal>"
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr "L'élément d'une collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:307
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].element}"
+msgstr "<literal>{[aliasname].element}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:309
#, fuzzy, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "XID as {coll.element}"
+msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry
+#: query_sql.xml:313
#, no-c-format
msgid "property of the element in the collection"
msgstr "Propriété de l'élément dans une collection "
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:315
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+msgid "{[aliasname].element.[propertyname]}"
msgstr "<literal>{[aliasname].element.[propertyname]}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:317
#, fuzzy, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
-msgstr "<literal>NAME as {coll.element.name}</literal>"
+msgid "NAME as {coll.element.name}"
+msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr "Toutes les propriétés d'un élément dans la collection"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:323
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].element.*}"
+msgstr "<literal>{[aliasname].element.*}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:325
#, fuzzy, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "{coll.element.*}"
+msgstr "<literal>{coll.element.*}</literal>"
#. Tag: entry
+#: query_sql.xml:329
#, fuzzy, no-c-format
msgid "All properties of the collection"
msgstr "Toutes les propriétés d'une collection"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{coll.*}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:333
+#, fuzzy, no-c-format
+msgid "{coll.*}"
+msgstr "<literal>{coll.element.*}</literal>"
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr "Retour d'entités non gérées"
#. Tag: para
+#: query_sql.xml:344
#, no-c-format
msgid ""
"It is possible to apply a ResultTransformer to native SQL queries, allowing "
@@ -575,12 +744,22 @@
"Il est possible d'appliquer un ResultTransformer à une requête native SQL. "
"Ce qui permet, par exemple, de retourner des entités non gérées. "
+#. Tag: programlisting
+#: query_sql.xml:347
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr "un transformateur de résultat"
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
msgid ""
"The above query will return a list of <literal>CatDTO</literal> which has "
@@ -592,11 +771,13 @@
"été injectées dans leurs propriétés ou champs correspondants."
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr "Gérer l'héritage"
#. Tag: para
+#: query_sql.xml:369
#, no-c-format
msgid ""
"Native SQL queries which query for entities that are mapped as part of an "
@@ -608,35 +789,90 @@
"base et de toutes ses sous classes. "
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr "Paramètres"
#. Tag: para
+#: query_sql.xml:377
#, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr ""
"Les requêtes natives SQL supportent aussi bien les paramètres de position "
"que les paramètres nommés : "
+#. Tag: programlisting
+#: query_sql.xml:380
+#, no-c-format
+msgid ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr "Requêtes SQL nommées"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:387
+#, fuzzy, no-c-format
msgid ""
-"Named SQL queries can be defined in the mapping document and called in "
-"exactly the same way as a named HQL query. In this case, you do "
-"<emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
+"Named SQL queries can also be defined in the mapping document and called in "
+"exactly the same way as a named HQL query (see <xref linkend=\"objectstate-"
+"querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> "
+"need to call <literal>addEntity()</literal>."
msgstr ""
"Les requêtes SQL nommées peuvent être définies dans le document de mapping "
"et appelées exactement de la même manière qu'une requête HQL nommée. Dans ce "
"cas, nous <emphasis>n'avons pas besoin</emphasis> d'appeler "
"<literal>addEntity()</literal>. "
+#. Tag: title
+#: query_sql.xml:394
+#, no-c-format
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:397
+#, no-c-format
+msgid ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, no-c-format
+msgid ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:406
#, no-c-format
msgid ""
"The <literal><return-join></literal> element is use to join "
@@ -647,7 +883,36 @@
"collection></literal> sont respectivement utilisés pour lier des "
"associations et définir des requêtes qui initialisent des collections,"
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, no-c-format
+msgid ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
msgid ""
"A named SQL query may return a scalar value. You must declare the column "
@@ -658,7 +923,27 @@
"spécifier l'alias de colonne et le type Hibernate utilisant l'élément "
"<literal><return-scalar></literal> :"
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name, \n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:426
#, no-c-format
msgid ""
"You can externalize the resultset mapping information in a <literal><"
@@ -671,7 +956,39 @@
"différentes requêtes nommées, soit à travers l'API "
"<literal>setResultSetMapping()</literal>. "
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, no-c-format
+msgid ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:438
#, no-c-format
msgid ""
"You can, alternatively, use the resultset mapping information in your hbm "
@@ -681,13 +998,340 @@
"résultats dans vos fichiers hbm directement dans le code java. "
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, no-c-format
+msgid ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid ""
+"So far we have only looked at externalizing SQL queries using Hibernate "
+"mapping files. The same concept is also available with anntations and is "
+"called named native queries. You can use <classname>@NamedNativeQuery</"
+"classname> (<classname>@NamedNativeQueries</classname>) in conjunction with "
+"<literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</"
+"literal>). Like <literal>@NamedQuery</literal>, "
+"<classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</"
+"literal> can be defined at class level, but their scope is global to the "
+"application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid ""
+"shows how 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. "
+"In the example 2 entities, <literal>Night</literal> and <literal>Area</"
+"literal>, are returned and each property is declared and associated to a "
+"column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid ""
+"In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set "
+"mapping is implicit. We only describe the entity class of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid ""
+"Finally, 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. This can be seen in "
+"<xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid ""
+"Named SQL query using <classname>@NamedNativeQuery</classname> together with "
+"<classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+" resultSetMapping=\"joinMapping\")\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"implicit\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", \n"
+" query=\"select * from SpaceShip\", \n"
+" resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column = \"name\"),\n"
+" @FieldResult(name=\"model\", column = \"model\"),\n"
+" @FieldResult(name=\"speed\", column = \"speed\"),\n"
+" @FieldResult(name=\"captain.firstname\", column = "
+"\"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column = \"lastn"
+"\"),\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"
+"@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
+#: query_sql.xml:510
+#, no-c-format
+msgid ""
+"If you retrieve a single entity using the default mapping, you can specify "
+"the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip"
+"\", resultClass=SpaceShip.class)\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+"@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension"
+"\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension "
+"from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr ""
"Utilisation de return-property pour spécifier explicitement les noms des "
"colonnes/alias"
#. Tag: para
+#: query_sql.xml:538
#, no-c-format
msgid ""
"You can explicitly tell Hibernate what column aliases to use with "
@@ -699,7 +1343,25 @@
"syntaxe <literal>{}</literal> pour laisser Hibernate injecter ses propres "
"alias. Par exemple :"
+#. Tag: programlisting
+#: query_sql.xml:543
+#, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:545
#, no-c-format
msgid ""
"<literal><return-property></literal> also works with multiple columns. "
@@ -711,7 +1373,29 @@
"literal> qui ne permet pas une fine granularité des propriétés multi-"
"colonnes. "
+#. Tag: programlisting
+#: query_sql.xml:550
+#, no-c-format
+msgid ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:552
#, no-c-format
msgid ""
"In this example <literal><return-property></literal> was used in "
@@ -724,6 +1408,7 @@
"veulent référencer les colonnes et les propriétés. "
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
msgid ""
"If your mapping has a discriminator you must use <literal><return-"
@@ -733,11 +1418,13 @@
"discriminator></literal> pour spécifier la colonne discriminante."
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr "Utilisation de procédures stockées pour les requêtes"
#. Tag: para
+#: query_sql.xml:565
#, no-c-format
msgid ""
"Hibernate3 provides support for queries via stored procedures and functions. "
@@ -753,14 +1440,55 @@
"fonctionner avec Hibernate. Voici un exemple d'une telle procédure stockée "
"en Oracle 9 et version supérieure : "
+#. Tag: programlisting
+#: query_sql.xml:571
+#, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr ""
"Pour utiliser cette requête dans Hibernate vous avez besoin de la mapper via "
"une requête nommée."
+#. Tag: programlisting
+#: query_sql.xml:576
+#, no-c-format
+msgid ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:578
#, no-c-format
msgid ""
"Stored procedures currently only return scalars and entities. <literal><"
@@ -772,11 +1500,13 @@
"<literal><load-collection></literal> ne sont pas supportés. "
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr "Règles/limitations lors de l'utilisation des procédures stockées"
#. Tag: para
+#: query_sql.xml:585
#, no-c-format
msgid ""
"You cannot use stored procedures with Hibernate unless you follow some "
@@ -795,6 +1525,7 @@
"pour les procédures stockées. "
#. Tag: para
+#: query_sql.xml:593
#, no-c-format
msgid ""
"Stored procedure queries cannot be paged with <literal>setFirstResult()/"
@@ -804,6 +1535,7 @@
"<literal>setFirstResult()/setMaxResults()</literal>. "
#. Tag: para
+#: query_sql.xml:596
#, no-c-format
msgid ""
"The recommended call form is standard SQL92: <literal>{ ? = call functionName"
@@ -816,11 +1548,13 @@
"pas supportée."
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr "Pour Oracle les règles suivantes sont applicables :"
#. Tag: para
+#: query_sql.xml:605
#, no-c-format
msgid ""
"A function must return a result set. The first parameter of a procedure must "
@@ -836,11 +1570,13 @@
"type <literal>REF CURSOR</literal>, consultez la documentation Oracle. "
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr "Pour Sybase ou MS SQL server les règles suivantes sont applicables :"
#. Tag: para
+#: query_sql.xml:618
#, no-c-format
msgid ""
"The procedure must return a result set. Note that since these servers can "
@@ -855,6 +1591,7 @@
"reste sera ignoré. "
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
msgid ""
"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it "
@@ -865,76 +1602,175 @@
"obligation."
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr "SQL personnalisé pour créer, mettre à jour et effacer"
#. Tag: para
+#: query_sql.xml:638
#, no-c-format
msgid ""
"Hibernate3 can use custom SQL for create, update, and delete operations. The "
"SQL can be overridden at the statement level or inidividual column level. "
"This section describes statement overrides. For columns, see <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-"
+"annotations\"/> shows how to define custom SQL operatons using annotations."
msgstr ""
+#. Tag: title
+#: query_sql.xml:646
+#, no-c-format
+msgid "Custom CRUD via annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:648
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"@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"
+"@Loader(namedQuery = \"chaos\")\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
-#, fuzzy, no-c-format
+#: query_sql.xml:651
+#, no-c-format
msgid ""
-"The class and collection persisters in Hibernate already contain a set of "
-"configuration time generated strings (insertsql, deletesql, updatesql etc.). "
-"The mapping tags <literal><sql-insert></literal>, <literal><sql-"
-"delete></literal>, and <literal><sql-update></literal> override "
-"these strings:"
+"<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can "
+"be achieved using Hibernate mapping files and the <literal><sql-insert>"
+"</literal>, <literal><sql-update></literal> and <literal><sql-"
+"delete></literal> nodes. This can be seen in <xref linkend=\"example-"
+"custom-crdu-via-xml\"/>."
msgstr ""
-"Hibernate3 peut utiliser des expressions SQL personnalisées pour des "
-"opérations de création, de mise à jour, et de suppression. Les objets "
-"persistants les classes et les collections dans Hibernate contiennent déjà "
-"un ensemble de chaînes de caractères générées lors de la configuration "
-"(insertsql, deletesql, updatesql, etc). Les balises de mappage <literal><"
-"sql-insert></literal>, <literal><sql-delete></literal>, et "
-"<literal><sql-update></literal> surchargent ces chaînes de caractères :"
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:666
#, no-c-format
msgid ""
-"The SQL is directly executed in your database, so you can use any dialect "
-"you like. This will reduce the portability of your mapping if you use "
-"database specific SQL."
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to <constant>true</constant>. In "
+"annotations as well as in xml."
msgstr ""
-"Le SQL est directement exécuté dans votre base de données, donc vous êtes "
-"libre d'utiliser le dialecte que vous souhaitez. Cela réduira bien sûr la "
-"portabilité de votre mappage si vous utilisez du SQL spécifique à votre base "
-"de données. "
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
msgid ""
-"Stored procedures are supported if the <literal>callable</literal> attribute "
-"is set:"
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
msgstr ""
-"Les procédures stockées sont supportées si l'attribut <literal>callable</"
-"literal> est paramétré :"
#. Tag: para
+#: query_sql.xml:675
#, no-c-format
msgid ""
-"The order of the positional parameters is vital, as they must be in the same "
-"sequence as Hibernate expects them."
+"none: no check is performed: the store procedure is expected to fail upon "
+"issues"
msgstr ""
-"L'ordre des paramètres de position est essentiel, car ils doivent être dans "
-"la séquence attendue par Hibernate. "
#. Tag: para
+#: query_sql.xml:680
#, no-c-format
+msgid "count: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:685
+#, no-c-format
msgid ""
-"You can view 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 view the expected sequence, do not include "
-"your custom SQL in the mapping files, as this will override the Hibernate "
-"generated static SQL."
+"param: like COUNT but using an output parameter rather that the standard "
+"mechanism"
msgstr ""
+
+#. Tag: para
+#: query_sql.xml:690
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal> parameter "
+"which is again available in annoations as well as in xml."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:693
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations respectively xml nodes to "
+"override the collection related statements -see <xref linkend=\"example-"
+"overriding-sql-collections-annotations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:698
+#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?"
+"\")\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:705
+#, fuzzy, no-c-format
+msgid ""
+"The parameter order is important and is defined by the order Hibernate "
+"handles 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 or mapping files "
+"as that will override the Hibernate generated static sql)"
+msgstr ""
"Vous pouvez voir l'ordre attendu en activant la journalisation de débogage "
"pour le niveau <literal>org.hibernate.persister.entity</literal>. Avec ce "
"niveau activé, Hibernate imprimera le SQL statique qui est utilisé pour "
@@ -944,13 +1780,69 @@
"Hibernate."
#. Tag: para
+#: query_sql.xml:715
#, no-c-format
msgid ""
-"The stored procedures are in most cases required to return the number of "
-"rows inserted, updated and deleted, as Hibernate has some runtime checks for "
-"the success of the statement. Hibernate always registers the first statement "
-"parameter as a numeric output parameter for the CUD operations:"
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>@org.hibernate.annotations.Table</literal> and either (or all) "
+"attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
msgstr ""
+
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"@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"
+" sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values"
+"(upper(?), ?)\") )\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:726
+#, no-c-format
+msgid ""
+"The previous example also shows that you can give a comment to a given table "
+"(primary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:731
+#, fuzzy, no-c-format
+msgid ""
+"The SQL is directly executed in your database, so you can use any dialect "
+"you like. This will, however, reduce the portability of your mapping if you "
+"use database specific SQL."
+msgstr ""
+"Le SQL est directement exécuté dans votre base de données, donc vous êtes "
+"libre d'utiliser le dialecte que vous souhaitez. Cela réduira bien sûr la "
+"portabilité de votre mappage si vous utilisez du SQL spécifique à votre base "
+"de données. "
+
+#. Tag: para
+#: query_sql.xml:736
+#, fuzzy, no-c-format
+msgid ""
+"Last but not least, stored procedures are in most cases required to return "
+"the number of rows inserted, updated and deleted. Hibernate always registers "
+"the first statement parameter as a numeric output parameter for the CUD "
+"operations:"
+msgstr ""
"Les procédures stockées sont dans la plupart des cas (lire : il vaut mieux "
"le faire) requises pour retourner le nombre de lignes insérées/mises à jour/"
"supprimées, puisque Hibernate vérifie plusieurs fois le succès de "
@@ -959,21 +1851,62 @@
"CUD : "
#. Tag: title
+#: query_sql.xml:742
#, no-c-format
+msgid "Stored procedures and their return value"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:744
+#, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
msgid "Custom SQL for loading"
msgstr "SQL personnalisé pour le chargement"
#. Tag: para
+#: query_sql.xml:751
#, no-c-format
msgid ""
"You can also declare your own SQL (or HQL) queries for entity loading. As "
"with inserts, updates, and deletes, this can be done at the individual "
-"column level as described in <xref linkend=\"mapping-column-read-and-write"
-"\" /> or at the statement level. Here is an example of a statement level "
+"column level as described in <xref linkend=\"mapping-column-read-and-write\"/"
+"> or at the statement level. Here is an example of a statement level "
"override:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:757
+#, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:759
#, no-c-format
msgid ""
"This is just a named query declaration, as discussed earlier. You can "
@@ -982,18 +1915,58 @@
"Ceci est juste une déclaration de requête nommée, comme vu précédemment. "
"Vous pouvez référencer cette requête nommée dans un mappage de classe : "
+#. Tag: programlisting
+#: query_sql.xml:762
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:764
#, no-c-format
msgid "This even works with stored procedures."
msgstr "Ceci fonctionne même avec des procédures stockées."
#. Tag: para
+#: query_sql.xml:766
#, no-c-format
msgid "You can even define a query for collection loading:"
msgstr ""
"Vous pouvez même définir une requête pour le chargement d'une collection : "
+#. Tag: programlisting
+#: query_sql.xml:768
+#, no-c-format
+msgid ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:770
+#, no-c-format
+msgid ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:772
#, no-c-format
msgid ""
"You can also define an entity loader that loads a collection by join "
@@ -1002,56 +1975,121 @@
"Vous pourriez même définir un chargeur d'entité qui charge une collection "
"par jointure : "
-#~ msgid ""
-#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
-#~ msgstr ""
-#~ "Vous pouvez aussi déclarer vos propres requêtes SQL (ou HQL) pour le "
-#~ "chargement d'entité : "
+#. Tag: programlisting
+#: query_sql.xml:775
+#, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+msgstr ""
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid ""
+"The annotation equivalent <literal><loader></literal> is the @Loader "
+"annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/"
+">."
+msgstr ""
+
#, fuzzy
-#~ msgid "A_NAME as {item.name}"
-#~ msgstr "<literal>A_NAME as {item.name}</literal>"
+#~ msgid "<literal>A_NAME as {item.name}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].class}"
-#~ msgstr "<literal>{[aliasname].class}</literal>"
+#~ msgid "<literal>{[aliasname].class}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid "DISC as {item.class}"
-#~ msgstr "<literal>DISC as {item.class}</literal>"
+#~ msgid "<literal>DISC as {item.class}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].*}"
-#~ msgstr "<literal>{[aliasname].*}</literal>"
+#~ msgid "<literal>{[aliasname].*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
+#~ msgid "<literal>{item.*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
+
#, fuzzy
-#~ msgid "{[aliasname].key}"
-#~ msgstr "<literal>{[aliasname].key}</literal>"
+#~ msgid "<literal>{[aliasname].key}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid "ORGID as {coll.key}"
-#~ msgstr "<literal>ORGID as {coll.key}</literal>"
+#~ msgid "<literal>ORGID as {coll.key}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].id}"
-#~ msgstr "<literal>{[aliasname].id}</literal>"
+#~ msgid "<literal>{[aliasname].id}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid "EMPID as {coll.id}"
-#~ msgstr "<literal>EMPID as {coll.id}</literal>"
+#~ msgid "<literal>EMPID as {coll.id}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].element}"
-#~ msgstr "<literal>{[aliasname].element}</literal>"
+#~ msgid "<literal>{[aliasname].element}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid "XID as {coll.element}"
-#~ msgstr "<literal>XID as {coll.element}</literal>"
+#~ msgid "<literal>XID as {coll.element}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].element.*}"
-#~ msgstr "<literal>{[aliasname].element.*}</literal>"
+#~ msgid "<literal>NAME as {coll.element.name}</literal>"
+#~ msgstr "<literal>NAME as {coll.element.name}</literal>"
#, fuzzy
-#~ msgid "{coll.element.*}"
-#~ msgstr "<literal>{coll.element.*}</literal>"
+#~ msgid "<literal>{[aliasname].element.*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
+
+#, fuzzy
+#~ msgid "<literal>{coll.element.*}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
+
+#~ msgid "<literal>{coll.*}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
+
+#, fuzzy
+#~ msgid ""
+#~ "The class and collection persisters in Hibernate already contain a set of "
+#~ "configuration time generated strings (insertsql, deletesql, updatesql "
+#~ "etc.). The mapping tags <literal><sql-insert></literal>, "
+#~ "<literal><sql-delete></literal>, and <literal><sql-update></"
+#~ "literal> override these strings:"
+#~ msgstr ""
+#~ "Hibernate3 peut utiliser des expressions SQL personnalisées pour des "
+#~ "opérations de création, de mise à jour, et de suppression. Les objets "
+#~ "persistants les classes et les collections dans Hibernate contiennent "
+#~ "déjà un ensemble de chaînes de caractères générées lors de la "
+#~ "configuration (insertsql, deletesql, updatesql, etc). Les balises de "
+#~ "mappage <literal><sql-insert></literal>, <literal><sql-delete>"
+#~ "</literal>, et <literal><sql-update></literal> surchargent ces "
+#~ "chaînes de caractères :"
+
+#~ msgid ""
+#~ "Stored procedures are supported if the <literal>callable</literal> "
+#~ "attribute is set:"
+#~ msgstr ""
+#~ "Les procédures stockées sont supportées si l'attribut <literal>callable</"
+#~ "literal> est paramétré :"
+
+#~ msgid ""
+#~ "The order of the positional parameters is vital, as they must be in the "
+#~ "same sequence as Hibernate expects them."
+#~ msgstr ""
+#~ "L'ordre des paramètres de position est essentiel, car ils doivent être "
+#~ "dans la séquence attendue par Hibernate. "
+
+#~ msgid ""
+#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
+#~ msgstr ""
+#~ "Vous pouvez aussi déclarer vos propres requêtes SQL (ou HQL) pour le "
+#~ "chargement d'entité : "
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/session_api.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/session_api.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/session_api.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: session_api\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:48\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 09:57+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,11 +17,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "Travailler avec des objets"
#. Tag: para
+#: session_api.xml:33
#, no-c-format
msgid ""
"Hibernate is a full object/relational mapping solution that not only shields "
@@ -40,6 +42,7 @@
"persistance dans les applications Java."
#. Tag: para
+#: session_api.xml:40
#, no-c-format
msgid ""
"In other words, Hibernate application developers should always think about "
@@ -55,16 +58,19 @@
"lors du réglage de la performance de leur système."
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "États des objets Hibernate"
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr "Hibernate définit et prend en charge les états d'objets suivants :"
#. Tag: para
+#: session_api.xml:53
#, no-c-format
msgid ""
"<emphasis>Transient</emphasis> - an object is transient if it has just been "
@@ -87,6 +93,7 @@
"exécutées pour cette transistion)."
#. Tag: para
+#: session_api.xml:65
#, no-c-format
msgid ""
"<emphasis>Persistent</emphasis> - a persistent instance has a representation "
@@ -109,6 +116,7 @@
"rendu éphémère. "
#. Tag: para
+#: session_api.xml:77
#, no-c-format
msgid ""
"<emphasis>Detached</emphasis> - a detached instance is an object that has "
@@ -133,6 +141,7 @@
"unité de travail du point de vue de l'utilisateur. "
#. Tag: para
+#: session_api.xml:90
#, no-c-format
msgid ""
"We will now discuss the states and state transitions (and the Hibernate "
@@ -142,11 +151,13 @@
"d'état (et des méthodes Hibernate qui déclenchent une transition)."
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "Rendre des objets persistants"
#. Tag: para
+#: session_api.xml:97
#, fuzzy, no-c-format
msgid ""
"Newly instantiated instances of a persistent class are considered "
@@ -158,7 +169,19 @@
"rendre une instance éphémère <emphasis>persistante</emphasis> en l'associant "
"à une session :"
+#. Tag: programlisting
+#: session_api.xml:102
+#, no-c-format
+msgid ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:104
#, no-c-format
msgid ""
"If <literal>Cat</literal> has a generated identifier, the identifier is "
@@ -180,6 +203,7 @@
"première ébauche d'EJB3. "
#. Tag: para
+#: session_api.xml:115
#, no-c-format
msgid ""
"<literal>persist()</literal> makes a transient instance persistent. However, "
@@ -199,6 +223,7 @@
"conversations dans un contexte de session/persistance étendu."
#. Tag: para
+#: session_api.xml:126
#, no-c-format
msgid ""
"<literal>save()</literal> does guarantee to return an identifier. If an "
@@ -215,6 +240,7 @@
"contexte de session/persistance étendu."
#. Tag: para
+#: session_api.xml:135
#, no-c-format
msgid ""
"Alternatively, you can assign the identifier using an overloaded version of "
@@ -223,7 +249,21 @@
"Alternativement, vous pouvez assigner l'identifiant en utilisant une version "
"surchargée de <literal>save()</literal>. "
+#. Tag: programlisting
+#: session_api.xml:138
+#, no-c-format
+msgid ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:140
#, no-c-format
msgid ""
"If the object you make persistent has associated objects (e.g. the "
@@ -244,6 +284,7 @@
"mauvais ordre. "
#. Tag: para
+#: session_api.xml:148
#, no-c-format
msgid ""
"Usually you do not bother with this detail, as you will normally use "
@@ -260,11 +301,13 @@
"transitive est traitée plus loin dans ce chapitre. "
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr "Chargement d'un objet"
#. Tag: para
+#: session_api.xml:159
#, no-c-format
msgid ""
"The <literal>load()</literal> methods of <literal>Session</literal> provide "
@@ -278,13 +321,40 @@
"chargera l'état dans une instance nouvellement instanciée de cette classe, "
"dans un état persistant. "
+#. Tag: programlisting
+#: session_api.xml:165
+#, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, no-c-format
+msgid ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr ""
"Alternativement, vous pouvez charger un état dans une instance donnée :"
+#. Tag: programlisting
+#: session_api.xml:171
+#, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:173
#, no-c-format
msgid ""
"Be aware that <literal>load()</literal> will throw an unrecoverable "
@@ -307,6 +377,7 @@
"pour le mapping de la classe. "
#. Tag: para
+#: session_api.xml:182
#, no-c-format
msgid ""
"If you are not certain that a matching row exists, you should use the "
@@ -318,7 +389,20 @@
"données immédiatement et retourne null s'il n'y a pas de ligne "
"correspondante. "
+#. Tag: programlisting
+#: session_api.xml:186
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:188
#, no-c-format
msgid ""
"You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</"
@@ -329,7 +413,14 @@
"FOR UPDATE</literal>, en utilisant un <literal>LockMode</literal>. Voir la "
"documentation de l'API pour plus d'informations. "
+#. Tag: programlisting
+#: session_api.xml:192
+#, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:194
#, no-c-format
msgid ""
"Any associated instances or contained collections will <emphasis>not</"
@@ -343,6 +434,7 @@
"ou <literal>all</literal> en tant que style de cascade pour l'association."
#. Tag: para
+#: session_api.xml:199
#, no-c-format
msgid ""
"It is possible to re-load an object and all its collections at any time, "
@@ -354,13 +446,23 @@
"lorsque des \"triggers\" de base de données sont utilisés pour initialiser "
"certaines propriétés de l'objet."
+#. Tag: programlisting
+#: session_api.xml:204
+#, no-c-format
+msgid ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:206
#, fuzzy, no-c-format
msgid ""
"How much does Hibernate load from the database and how many SQL "
"<literal>SELECT</literal>s will it use? This depends on the "
"<emphasis>fetching strategy</emphasis>. This is explained in <xref linkend="
-"\"performance-fetching\" />."
+"\"performance-fetching\"/>."
msgstr ""
"Combien de données Hibernate charge-t-il de la base de données et combien de "
"<literal>SELECT</literal>s utilisera-t-il ? Cela dépend de la "
@@ -368,11 +470,13 @@
"<xref linkend=\"performance-fetching\" />."
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "Requêtage"
#. Tag: para
+#: session_api.xml:215
#, no-c-format
msgid ""
"If you do not know the identifiers of the objects you are looking for, you "
@@ -392,11 +496,13 @@
"objets. "
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "Exécution de requêtes"
#. Tag: para
+#: session_api.xml:226
#, no-c-format
msgid ""
"HQL and native SQL queries are represented with an instance of <literal>org."
@@ -411,7 +517,38 @@
"l'exécution de la requête réelle. Vous obtenez toujours une <literal>Query</"
"literal> en utilisant la <literal>Session</literal> courante : "
+#. Tag: programlisting
+#: session_api.xml:232
+#, no-c-format
+msgid ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:234
#, no-c-format
msgid ""
"A query is usually executed by invoking <literal>list()</literal>. The "
@@ -434,11 +571,13 @@
"<literal>Set</literal>. "
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "Itération de résultats"
#. Tag: para
+#: session_api.xml:246
#, no-c-format
msgid ""
"Occasionally, you might be able to achieve better performance by executing "
@@ -462,12 +601,33 @@
"retourne seulement les identifiants, et <emphasis>n</emphasis> selects "
"supplémentaires pour initialiser les instances réelles. "
+#. Tag: programlisting
+#: session_api.xml:257
+#, no-c-format
+msgid ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "Requêtes qui retournent des tuples"
#. Tag: para
+#: session_api.xml:263
#, no-c-format
msgid ""
"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
@@ -476,12 +636,32 @@
"Les requêtes d'Hibernate retournent parfois des tuples d'objets, auquel cas "
"chaque tuple est retourné comme un tableau : "
+#. Tag: programlisting
+#: session_api.xml:266
+#, no-c-format
+msgid ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "Résultats scalaires"
#. Tag: para
+#: session_api.xml:272
#, no-c-format
msgid ""
"Queries can specify a property of a class in the <literal>select</literal> "
@@ -493,12 +673,34 @@
"d'aggrégat SQL. Les propriétés ou les aggrégats sont considérés comme des "
"résultats \"scalaires\" (et non des entités dans un état persistant). "
+#. Tag: programlisting
+#: session_api.xml:277
+#, no-c-format
+msgid ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "Lier des paramètres"
#. Tag: para
+#: session_api.xml:283
#, no-c-format
msgid ""
"Methods on <literal>Query</literal> are provided for binding values to named "
@@ -515,6 +717,7 @@
"caractères de la requête. Les avantages des paramètres nommés sont : "
#. Tag: para
+#: session_api.xml:292
#, no-c-format
msgid ""
"named parameters are insensitive to the order they occur in the query string"
@@ -523,21 +726,60 @@
"apparaissent dans la chaîne de la requête"
#. Tag: para
+#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "ils peuvent apparaître plusieurs fois dans la même requête "
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "ils sont auto-documentés"
+#. Tag: programlisting
+#: session_api.xml:305
+#, no-c-format
+msgid ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, no-c-format
+msgid ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, no-c-format
+msgid ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "Pagination"
#. Tag: para
+#: session_api.xml:315
#, no-c-format
msgid ""
"If you need to specify bounds upon your result set, that is, the maximum "
@@ -549,7 +791,18 @@
"récupérer) vous utiliserez des méthodes de l'interface <literal>Query</"
"literal> : "
+#. Tag: programlisting
+#: session_api.xml:320
+#, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
msgid ""
"Hibernate knows how to translate this limit query into the native SQL of "
@@ -559,11 +812,13 @@
"votre SGBD."
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr "Itération \"scrollable\""
#. Tag: para
+#: session_api.xml:329
#, no-c-format
msgid ""
"If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the "
@@ -576,7 +831,37 @@
"pour obtenir un objet <literal>ScrollableResults</literal>, qui permettra "
"une navigation flexible dans les résultats de la requête. "
+#. Tag: programlisting
+#: session_api.xml:334
+#, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:336
#, no-c-format
msgid ""
"Note that an open database connection and cursor is required for this "
@@ -589,29 +874,108 @@
"de pagination hors ligne. "
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "Externaliser des requêtes nommées"
#. Tag: para
+#: session_api.xml:345
#, no-c-format
msgid ""
-"You can also define named queries in the mapping document. Remember to use a "
-"<literal>CDATA</literal> section if your query contains characters that "
-"could be interpreted as markup."
+"Queries can also be configured as so called named queries using annotations "
+"or Hibernate mapping documents. <literal>@NamedQuery</literal> and "
+"<literal>@NamedQueries</literal> can be defined at the class level as seen "
+"in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: session_api.xml:361
+#, fuzzy, no-c-format
+msgid ""
+"Using a mapping document can be configured using the <literal><query></"
+"literal> node. Remember to use a <literal>CDATA</literal> section if your "
+"query contains characters that could be interpreted as markup."
+msgstr ""
"Vous pouvez aussi définir des requêtes nommées dans le document de mapping. "
"Souvenez-vous d'utiliser une section <literal>CDATA</literal> si votre "
"requête contient des caractères qui pourraient être interprétés comme des "
"éléments XML."
-#. Tag: para
+#. Tag: title
+#: session_api.xml:367
#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+msgid "Defining a named query using <literal><query></literal>"
msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, no-c-format
+msgid ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:373
+#, fuzzy, no-c-format
+msgid ""
+"Parameter binding and executing is done programatically as seen in <xref "
+"linkend=\"example-parameter-binding-named-query\"/>."
+msgstr ""
"La liaison de paramètres et l'exécution sont effectués par programmation :"
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, no-c-format
+msgid ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:382
#, no-c-format
msgid ""
"The actual program code is independent of the query language that is used. "
@@ -624,6 +988,7 @@
"dans les fichiers de mapping. "
#. Tag: para
+#: session_api.xml:387
#, no-c-format
msgid ""
"Also note that a query declaration inside a <literal><hibernate-"
@@ -640,11 +1005,13 @@
"Cat.ByNameAndMaximumWeight</literal>. "
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "Filtrer des collections"
#. Tag: para
+#: session_api.xml:399
#, no-c-format
msgid ""
"A collection <emphasis>filter</emphasis> is a special type of query that can "
@@ -656,7 +1023,20 @@
"chaîne de requêtes peut se référer à <literal>this</literal>, correspondant "
"à l'élément de la collection courant. "
+#. Tag: programlisting
+#: session_api.xml:404
+#, no-c-format
+msgid ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:406
#, no-c-format
msgid ""
"The returned collection is considered a bag that is a copy of the given "
@@ -669,6 +1049,7 @@
"comportement attendu."
#. Tag: para
+#: session_api.xml:411
#, no-c-format
msgid ""
"Observe that filters do not require a <literal>from</literal> clause, "
@@ -679,7 +1060,18 @@
"literal> (bien qu'ils puissent en avoir une si besoin est). Les filtres ne "
"sont pas limités à retourner des éléments de la collection eux-mêmes. "
+#. Tag: programlisting
+#: session_api.xml:415
+#, no-c-format
+msgid ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:417
#, no-c-format
msgid ""
"Even an empty filter query is useful, e.g. to load a subset of elements in a "
@@ -688,12 +1080,24 @@
"Même une requête de filtre vide est utile, par exemple pour charger un sous-"
"ensemble d'éléments dans une énorme collection : "
+#. Tag: programlisting
+#: session_api.xml:420
+#, no-c-format
+msgid ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr "Requêtes par critères"
#. Tag: para
+#: session_api.xml:426
#, no-c-format
msgid ""
"HQL is extremely powerful, but some developers prefer to build queries "
@@ -706,22 +1110,35 @@
"plutôt que de construire des chaînes de requêtes. Hibernate fournit une API "
"intuitive de requête <literal>Criteria</literal> pour ces cas :"
+#. Tag: programlisting
+#: session_api.xml:431
+#, no-c-format
+msgid ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:433
#, fuzzy, no-c-format
msgid ""
"The <literal>Criteria</literal> and the associated <literal>Example</"
-"literal> API are discussed in more detail in <xref linkend=\"querycriteria"
-"\" />."
+"literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"
+">."
msgstr ""
"L'API <literal>Criteria</literal> et l'API<literal>Example</literal> associé "
"sont traités plus en détail dans <xref linkend=\"querycriteria\" />."
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "Requêtes en SQL natif"
#. Tag: para
+#: session_api.xml:441
#, no-c-format
msgid ""
"You can express a query in SQL, using <literal>createSQLQuery()</literal> "
@@ -737,23 +1154,49 @@
"literal> JDBC. Si vous choisissez d'utiliser l'API Hibernate, vous devez "
"mettre les alias SQL entre accolades : "
+#. Tag: programlisting
+#: session_api.xml:448
+#, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE "
+"ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:452
#, fuzzy, no-c-format
msgid ""
"SQL queries can contain named and positional parameters, just like Hibernate "
"queries. More information about native SQL queries in Hibernate can be found "
-"in <xref linkend=\"querysql\" />."
+"in <xref linkend=\"querysql\"/>."
msgstr ""
"Les requêtes SQL peuvent contenir des paramètres nommés et positionnels, "
"comme les requêtes Hibernate. Vous trouverez plus d'informations à propos "
"des requêtes SQL natives dans Hibernate dans <xref linkend=\"querysql\" />."
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr "Modifier des objets persistants"
#. Tag: para
+#: session_api.xml:461
#, no-c-format
msgid ""
"<emphasis>Transactional persistent instances</emphasis> (i.e. objects "
@@ -778,7 +1221,17 @@
"de le manipuler directement, tant que la <literal>Session</literal> est "
"ouverte : "
+#. Tag: programlisting
+#: session_api.xml:473
+#, no-c-format
+msgid ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:475
#, no-c-format
msgid ""
"Sometimes this programming model is inefficient, as it requires in the same "
@@ -793,6 +1246,7 @@
"instances détachées. "
#. Tag: para
+#: session_api.xml:481
#, fuzzy, no-c-format
msgid ""
"Hibernate does not offer its own API for direct execution of "
@@ -804,7 +1258,7 @@
"the notion of mass operations conflicts with object/relational mapping for "
"online transaction processing-oriented applications. Future versions of "
"Hibernate can, however, provide special mass operation functions. See <xref "
-"linkend=\"batch\" /> for some possible batch operation tricks."
+"linkend=\"batch\"/> for some possible batch operation tricks."
msgstr ""
"Notez que Hibernate n'offre par sa propre API pour l'exécution directe "
"d'expressions <literal>UPDATE</literal> ou <literal>DELETE</literal>. "
@@ -820,11 +1274,13 @@
"possibles d'opérations groupées. "
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr "Modifier des objets détachés"
#. Tag: para
+#: session_api.xml:499
#, no-c-format
msgid ""
"Many applications need to retrieve an object in one transaction, send it to "
@@ -841,6 +1297,7 @@
"versionnées pour assurer l'isolation des \"longues\" unités de travail."
#. Tag: para
+#: session_api.xml:505
#, no-c-format
msgid ""
"Hibernate supports this model by providing for reattachment of detached "
@@ -851,7 +1308,25 @@
"détachées en utilisant des méthodes <literal>Session.update()</literal> ou "
"<literal>Session.merge()</literal> :"
+#. Tag: programlisting
+#: session_api.xml:509
+#, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
msgid ""
"If the <literal>Cat</literal> with identifier <literal>catId</literal> had "
@@ -863,6 +1338,7 @@
"l'application a essayé de le rattacher, une exception aurait été levée."
#. Tag: para
+#: session_api.xml:516
#, no-c-format
msgid ""
"Use <literal>update()</literal> if you are certain that the session does not "
@@ -883,13 +1359,14 @@
"exécutée. "
#. Tag: para
+#: session_api.xml:524
#, fuzzy, no-c-format
msgid ""
"The application should individually <literal>update()</literal> detached "
"instances that are reachable from the given detached instance "
"<emphasis>only</emphasis> if it wants their state to be updated. This can be "
"automated using <emphasis>transitive persistence</emphasis>. See <xref "
-"linkend=\"objectstate-transitive\" /> for more information."
+"linkend=\"objectstate-transitive\"/> for more information."
msgstr ""
"L'application devrait individuellement <literal>update()</literal> (NdT : "
"mettre à jour) les instances détachées accessibles depuis l'instance "
@@ -899,6 +1376,7 @@
"\"objectstate-transitive\" /> pour plus d'informations."
#. Tag: para
+#: session_api.xml:530
#, no-c-format
msgid ""
"The <literal>lock()</literal> method also allows an application to "
@@ -909,7 +1387,20 @@
"associer un objet avec une nouvelle session. Cependant, l'instance détachée "
"doit être non modifiée."
+#. Tag: programlisting
+#: session_api.xml:534
+#, no-c-format
+msgid ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:536
#, no-c-format
msgid ""
"Note that <literal>lock()</literal> can be used with various "
@@ -923,20 +1414,23 @@
"n'est pas le seul cas d'utilisation pour <literal>lock()</literal>. "
#. Tag: para
+#: session_api.xml:541
#, fuzzy, no-c-format
msgid ""
"Other models for long units of work are discussed in <xref linkend="
-"\"transactions-optimistic\" />."
+"\"transactions-optimistic\"/>."
msgstr ""
"D'autres modèles pour de longues unités de travail sont traités dans <xref "
"linkend=\"transactions-optimistic\" />."
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr "Détection automatique d'un état"
#. Tag: para
+#: session_api.xml:548
#, no-c-format
msgid ""
"Hibernate users have requested a general purpose method that either saves a "
@@ -950,7 +1444,26 @@
"associées à l'identifiant courant. La méthode <literal>saveOrUpdate()</"
"literal> implémente cette fonctionnalité."
+#. Tag: programlisting
+#: session_api.xml:554
+#, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
msgid ""
"The usage and semantics of <literal>saveOrUpdate()</literal> seems to be "
@@ -968,6 +1481,7 @@
"applications n'utiliseront jamais ces méthodes."
#. Tag: para
+#: session_api.xml:563
#, no-c-format
msgid ""
"Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are "
@@ -977,26 +1491,31 @@
"literal> sont utilisées dans le scénario suivant :"
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr "l'application charge un objet dans la première session"
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr "l'objet est passé à la couche utilisateur"
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr "certaines modifications sont effectuées sur l'objet"
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr "l'objet est retourné à la couche logique métier"
#. Tag: para
+#: session_api.xml:585
#, no-c-format
msgid ""
"the application persists these modifications by calling <literal>update()</"
@@ -1006,16 +1525,19 @@
"literal> dans une seconde session"
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr "<literal>saveOrUpdate()</literal> s'utilise dans le cas suivant :"
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr "si l'objet est déjà persistant dans cette session, ne rien faire"
#. Tag: para
+#: session_api.xml:599
#, no-c-format
msgid ""
"if another object associated with the session has the same identifier, throw "
@@ -1025,6 +1547,7 @@
"exception"
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
msgstr ""
@@ -1032,6 +1555,7 @@
"literal>"
#. Tag: para
+#: session_api.xml:609
#, no-c-format
msgid ""
"if the object's identifier has the value assigned to a newly instantiated "
@@ -1041,6 +1565,7 @@
"instancié, appeler <literal>save()</literal>"
#. Tag: para
+#: session_api.xml:614
#, no-c-format
msgid ""
"if the object is versioned by a <literal><version></literal> or "
@@ -1054,16 +1579,19 @@
"instancié, appeler <literal>save()</literal> "
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
msgstr "sinon mettre à jour l'objet avec <literal>update()</literal>"
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr "et <literal>merge()</literal> est très différent :"
#. Tag: para
+#: session_api.xml:630
#, no-c-format
msgid ""
"if there is a persistent instance with the same identifier currently "
@@ -1075,6 +1603,7 @@
"persistante"
#. Tag: para
+#: session_api.xml:636
#, no-c-format
msgid ""
"if there is no persistent instance currently associated with the session, "
@@ -1085,11 +1614,13 @@
"persistante"
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr "l'instance persistante est retournée"
#. Tag: para
+#: session_api.xml:646
#, no-c-format
msgid ""
"the given instance does not become associated with the session, it remains "
@@ -1098,11 +1629,13 @@
"l'instance donnée ne devient pas associée à la session, elle reste détachée"
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr "Suppression d'objets persistants"
#. Tag: para
+#: session_api.xml:655
#, no-c-format
msgid ""
"<literal>Session.delete()</literal> will remove an object's state from the "
@@ -1115,7 +1648,14 @@
"référence vers un objet effacé. Il est préférable de penser à <literal>delete"
"()</literal> comme rendant une instance persistante éphémère. "
+#. Tag: programlisting
+#: session_api.xml:660
+#, no-c-format
+msgid "sess.delete(cat);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:662
#, no-c-format
msgid ""
"You can delete objects in any order, without risk of foreign key constraint "
@@ -1130,11 +1670,13 @@
"parent, mais oubliez d'effacer les enfants. "
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "Réplication d'objets entre deux entrepôts de données"
#. Tag: para
+#: session_api.xml:672
#, no-c-format
msgid ""
"It is sometimes useful to be able to take a graph of persistent instances "
@@ -1145,7 +1687,27 @@
"persistantes et de les rendre persistantes dans un entrepôt différent, sans "
"regénérer les valeurs des identifiants. "
+#. Tag: programlisting
+#: session_api.xml:676
+#, no-c-format
+msgid ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:678
#, no-c-format
msgid ""
"The <literal>ReplicationMode</literal> determines how <literal>replicate()</"
@@ -1156,6 +1718,7 @@
"données. "
#. Tag: para
+#: session_api.xml:684
#, no-c-format
msgid ""
"<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is "
@@ -1165,6 +1728,7 @@
"ligne existante dans la base de données avec le même identifiant "
#. Tag: para
+#: session_api.xml:689
#, no-c-format
msgid ""
"<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing "
@@ -1174,6 +1738,7 @@
"existante dans la base de données avec le même identifiant "
#. Tag: para
+#: session_api.xml:694
#, no-c-format
msgid ""
"<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there "
@@ -1183,6 +1748,7 @@
"une ligne dans la base de données avec le même identifiant "
#. Tag: para
+#: session_api.xml:700
#, no-c-format
msgid ""
"<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its "
@@ -1194,6 +1760,7 @@
"ignore l'objet "
#. Tag: para
+#: session_api.xml:706
#, no-c-format
msgid ""
"Usecases for this feature include reconciling data entered into different "
@@ -1208,11 +1775,13 @@
"ACID, et plus."
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr "Flush de la session"
#. Tag: para
+#: session_api.xml:715
#, no-c-format
msgid ""
"Sometimes the <literal>Session</literal> will execute the SQL statements "
@@ -1226,27 +1795,32 @@
"survient par défaut aux points suivants : "
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr "avant certaines exécutions de requête"
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr ""
"lors d'un appel à <literal>org.hibernate.Transaction.commit()</literal>"
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr "lors d'un appel à <literal>Session.flush()</literal>"
#. Tag: para
+#: session_api.xml:736
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "Les expressions SQL sont effectuées dans l'ordre suivant : "
#. Tag: para
+#: session_api.xml:740
#, no-c-format
msgid ""
"all entity insertions in the same order the corresponding objects were saved "
@@ -1256,26 +1830,31 @@
"correspondants sauvegardés par l'appel à <literal>Session.save()</literal> "
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr "mise à jour des entités"
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr "suppression des collections"
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr "suppression, mise à jour et insertion des éléments des collections"
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr "insertion des collections"
#. Tag: para
+#: session_api.xml:761
#, no-c-format
msgid ""
"all entity deletions in the same order the corresponding objects were "
@@ -1286,6 +1865,7 @@
"</literal> "
#. Tag: para
+#: session_api.xml:766
#, no-c-format
msgid ""
"An exception is that objects using <literal>native</literal> ID generation "
@@ -1295,6 +1875,7 @@
"literal> d'identifiants sont insérés lorsqu'ils sont sauvegardés."
#. Tag: para
+#: session_api.xml:769
#, no-c-format
msgid ""
"Except when you explicitly <literal>flush()</literal>, there are absolutely "
@@ -1311,6 +1892,7 @@
"jamais de données périmées, ni des données fausses. "
#. Tag: para
+#: session_api.xml:776
#, fuzzy, no-c-format
msgid ""
"It is possible to change the default behavior so that flush occurs less "
@@ -1320,7 +1902,7 @@
"never flush unless <literal>flush()</literal> is called explicitly. The last "
"mode is useful for long running units of work, where a <literal>Session</"
"literal> is kept open and disconnected for a long time (see <xref linkend="
-"\"transactions-optimistic-longsession\" />)."
+"\"transactions-optimistic-longsession\"/>)."
msgstr ""
"Il est possible de changer le comportement par défaut, donc que le flush se "
"produise moins fréquemment. La classe <literal>FlushMode</literal> définit "
@@ -1332,13 +1914,34 @@
"<literal>Session</literal> est gardée ouverte et déconnectée pour un long "
"moment (voir <xref linkend=\"transactions-optimistic-longsession\" />)."
+#. Tag: programlisting
+#: session_api.xml:786
+#, no-c-format
+msgid ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:788
#, fuzzy, no-c-format
msgid ""
"During flush, an exception might occur (e.g. if a DML operation violates a "
"constraint). Since handling exceptions involves some understanding of "
"Hibernate's transactional behavior, we discuss it in <xref linkend="
-"\"transactions\" />."
+"\"transactions\"/>."
msgstr ""
"Durant le flush, une exception peut se produire (par exemple, si une "
"opération de la DML viole une contrainte). Les exceptions de gestion "
@@ -1346,11 +1949,13 @@
"Hibernate, le sujet sera donc abordé dans <xref linkend=\"transactions\" />."
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr "Persistance transitive"
#. Tag: para
+#: session_api.xml:797
#, no-c-format
msgid ""
"It is quite cumbersome to save, delete, or reattach individual objects, "
@@ -1362,6 +1967,7 @@
"est une relation parent/enfant. Considérez l'exemple suivant :"
#. Tag: para
+#: session_api.xml:802
#, no-c-format
msgid ""
"If the children in a parent/child relationship would be value typed (e.g. a "
@@ -1385,6 +1991,7 @@
"de données. "
#. Tag: para
+#: session_api.xml:812
#, no-c-format
msgid ""
"Now consider the same scenario with parent and child objects being entities, "
@@ -1405,6 +2012,7 @@
"accessibilité</emphasis> par défaut. "
#. Tag: para
+#: session_api.xml:820
#, no-c-format
msgid ""
"For each basic operation of the Hibernate session - including "
@@ -1423,12 +2031,26 @@
"voulez qu'une opération soit cascadée le long d'une association, vous devez "
"l'indiquer dans le document de mappage. Par exemple :"
+#. Tag: programlisting
+#: session_api.xml:828
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr "Les styles de cascade peuvent être combinés :"
+#. Tag: programlisting
+#: session_api.xml:832
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:834
#, no-c-format
msgid ""
"You can even use <literal>cascade=\"all\"</literal> to specify that "
@@ -1442,30 +2064,133 @@
"literal> spécifie qu'aucune opération ne sera cascadée. "
#. Tag: para
+#: session_api.xml:839
#, no-c-format
msgid ""
+"In case you are using annotatons you probably have noticed the "
+"<literal>cascade</literal> attribute taking an array of "
+"<classname>CascadeType</classname> as a value. The cascade concept in JPA is "
+"very is similar to the transitive persistence and cascading of operations as "
+"described above, but with slightly different semantics and cascading types:"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:848
+#, no-c-format
+msgid ""
+"<literal>CascadeType.PERSIST</literal>: cascades the persist (create) "
+"operation to associated entities persist() is called or if the entity is "
+"managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:854
+#, no-c-format
+msgid ""
+"<literal>CascadeType.MERGE</literal>: cascades the merge operation to "
+"associated entities if merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:860
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REMOVE</literal>: cascades the remove operation to "
+"associated entities if delete() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:865
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to "
+"associated entities if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:870
+#, no-c-format
+msgid ""
+"<literal>CascadeType.DETACH:</literal> cascades the detach operation to "
+"associated entities if detach() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:875
+#, fuzzy, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr "<literal>saveOrUpdate()</literal> s'utilise dans le cas suivant :"
+
+#. Tag: para
+#: session_api.xml:880
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc..."
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:884
+#, no-c-format
+msgid ""
"A special cascade style, <literal>delete-orphan</literal>, applies only to "
"one-to-many associations, and indicates that the <literal>delete()</literal> "
"operation should be applied to any child object that is removed from the "
-"association."
+"association. Using annotations there is no <literal>CascadeType.DELETE-"
+"ORPHAN</literal> equivalent. Instead you can use the attribute "
+"<literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-"
+"many-with-orphan-removal\"/>. If an entity is removed from a "
+"<classname>@OneToMany</classname> collection or an associated entity is "
+"dereferenced from a <classname>@OneToOne</classname> association, this "
+"associated entity can be marked for deletion if <literal>orphanRemoval</"
+"literal> is set to true."
msgstr ""
-"Un style de cascade spécial, <literal>delete-orphan</literal>, s'applique "
-"seulement aux associations un-à-plusieurs, et indique que l'opération "
-"<literal>delete()</literal> devrait être appliquée à tout enfant supprimé de "
-"l'association."
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+"@Entity \n"
+"public class Customer {\n"
+" private Set<Order> orders;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+" public Set<Order> getOrders() { return orders; }\n"
+"\n"
+" public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+"\n"
+" [...]\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Order { ... }\n"
+"\n"
+"Customer customer = em.find(Customer.class, 1l);\n"
+"Order order = em.find(Order.class, 1l);\n"
+"customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:903
#, no-c-format
msgid "Recommendations:"
msgstr "Recommandations :"
#. Tag: para
-#, no-c-format
+#: session_api.xml:907
+#, fuzzy, no-c-format
msgid ""
-"It does not usually make sense to enable cascade on a <literal><many-to-"
-"one></literal> or <literal><many-to-many></literal> association. "
-"Cascade is often useful for <literal><one-to-one></literal> and "
-"<literal><one-to-many></literal> associations."
+"It does not usually make sense to enable cascade on a many-to-one or many-to-"
+"many association. In fact the <literal>@ManyToOne</literal> and "
+"<literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</"
+"literal> attribute. Cascading is often useful for one-to-one and one-to-many "
+"associations."
msgstr ""
"Cela n'a généralement aucun sens d'activer la cascade sur une association "
"<literal><many-to-one></literal> ou <literal><many-to-many></"
@@ -1474,17 +2199,20 @@
"literal>. "
#. Tag: para
-#, no-c-format
+#: session_api.xml:915
+#, fuzzy, no-c-format
msgid ""
"If the child object's lifespan is bounded by the lifespan of the parent "
"object, make it a <emphasis>life cycle object</emphasis> by specifying "
-"<literal>cascade=\"all,delete-orphan\"</literal>."
+"<literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany"
+"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
msgstr ""
"Si la durée de vie de l'objet enfant est liée à la durée de vie de l'objet "
"parent, faites-en un <emphasis>objet du cycle de vie</emphasis> en "
"spécifiant <literal>cascade=\"all,delete-orphan\"</literal>. "
#. Tag: para
+#: session_api.xml:923
#, no-c-format
msgid ""
"Otherwise, you might not need cascade at all. But if you think that you will "
@@ -1499,6 +2227,7 @@
"literal>. "
#. Tag: para
+#: session_api.xml:931
#, no-c-format
msgid ""
"Mapping an association (either a single valued association, or a collection) "
@@ -1513,15 +2242,16 @@
"jour/suppression de l'enfant ou des enfants."
#. Tag: para
-#, no-c-format
+#: session_api.xml:937
+#, fuzzy, no-c-format
msgid ""
"Furthermore, a mere reference to a child from a persistent parent will "
"result in save/update of the child. This metaphor is incomplete, however. A "
"child which becomes unreferenced by its parent is <emphasis>not</emphasis> "
-"automatically deleted, except in the case of a <literal><one-to-many></"
-"literal> association mapped with <literal>cascade=\"delete-orphan\"</"
-"literal>. The precise semantics of cascading operations for a parent/child "
-"relationship are as follows:"
+"automatically deleted, except in the case of a one-to-many association "
+"mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise "
+"semantics of cascading operations for a parent/child relationship are as "
+"follows:"
msgstr ""
"Par ailleurs, une simple référence à un enfant d'un parent persistant aura "
"pour conséquence la sauvegarde/mise à jour de l'enfant. Cette métaphore est "
@@ -1532,6 +2262,7 @@
"opérations de cascade pour une relation parent/enfant est la suivante : "
#. Tag: para
+#: session_api.xml:948
#, no-c-format
msgid ""
"If a parent is passed to <literal>persist()</literal>, all children are "
@@ -1541,6 +2272,7 @@
"passés à <literal>persist()</literal>"
#. Tag: para
+#: session_api.xml:953
#, no-c-format
msgid ""
"If a parent is passed to <literal>merge()</literal>, all children are passed "
@@ -1550,6 +2282,7 @@
"passés à <literal>merge()</literal>"
#. Tag: para
+#: session_api.xml:958
#, no-c-format
msgid ""
"If a parent is passed to <literal>save()</literal>, <literal>update()</"
@@ -1561,6 +2294,7 @@
"à <literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:964
#, no-c-format
msgid ""
"If a transient or detached child becomes referenced by a persistent parent, "
@@ -1570,6 +2304,7 @@
"il est passé à <literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:970
#, no-c-format
msgid ""
"If a parent is deleted, all children are passed to <literal>delete()</"
@@ -1579,6 +2314,7 @@
"literal>"
#. Tag: para
+#: session_api.xml:975
#, no-c-format
msgid ""
"If a child is dereferenced by a persistent parent, <emphasis>nothing special "
@@ -1592,6 +2328,7 @@
"literal> soit paramétré, auquel cas l'enfant \"orphelin\" est supprimé."
#. Tag: para
+#: session_api.xml:983
#, no-c-format
msgid ""
"Finally, note that cascading of operations can be applied to an object graph "
@@ -1610,11 +2347,13 @@
"associées accessibles lors du flush de la <literal>Session</literal>. "
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr "Utilisation des méta-données"
#. Tag: para
+#: session_api.xml:995
#, no-c-format
msgid ""
"Hibernate requires a rich meta-level model of all entity and value types. "
@@ -1633,6 +2372,7 @@
"les types de valeurs immutables et, éventuellement, les entités associées). "
#. Tag: para
+#: session_api.xml:1002
#, no-c-format
msgid ""
"Hibernate exposes metadata via the <literal>ClassMetadata</literal> and "
@@ -1644,3 +2384,35 @@
"literal> et <literal>CollectionMetadata</literal> et la hiérarchie "
"<literal>Type</literal>. Les instances des interfaces de méta-données "
"peuvent être obtenues à partir de la <literal>SessionFactory</literal>. "
+
+#. Tag: programlisting
+#: session_api.xml:1007
+#, no-c-format
+msgid ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
+msgstr ""
+
+#~ msgid ""
+#~ "A special cascade style, <literal>delete-orphan</literal>, applies only "
+#~ "to one-to-many associations, and indicates that the <literal>delete()</"
+#~ "literal> operation should be applied to any child object that is removed "
+#~ "from the association."
+#~ msgstr ""
+#~ "Un style de cascade spécial, <literal>delete-orphan</literal>, s'applique "
+#~ "seulement aux associations un-à-plusieurs, et indique que l'opération "
+#~ "<literal>delete()</literal> devrait être appliquée à tout enfant supprimé "
+#~ "de l'association."
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/tutorial.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/tutorial.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/tutorial.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: tutorial\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-05 10:08+1000\n"
"Last-Translator: Corina Roe <croe at redhat.com>\n"
"Language-Team: French <i18 at redhat.com>\n"
@@ -17,11 +17,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr "Tutoriel"
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
msgid ""
"Intended for new users, this chapter provides an step-by-step introduction "
@@ -38,6 +40,7 @@
"répertoire source du projet. "
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
msgid ""
"This tutorial expects the user have knowledge of both Java and SQL. If you "
@@ -50,6 +53,7 @@
"d'aborder Hibernate."
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
msgid ""
"The distribution contains another example application under the "
@@ -59,11 +63,13 @@
"le répertoire source du projet <filename>tutorial/eg</filename>."
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr "Section 1 - Première application Hibernate"
#. Tag: para
+#: tutorial.xml:64
#, no-c-format
msgid ""
"For this example, we will set up a small database application that can store "
@@ -74,6 +80,7 @@
"informations à propos des hôtes de ces événements."
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
msgid ""
"Although you can use whatever database you feel comfortable using, we will "
@@ -87,11 +94,13 @@
"configuration de n'importe quel serveur de base de données particulière."
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr "Configuration"
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
msgid ""
"The first thing we need to do is to set up the development environment. We "
@@ -114,6 +123,7 @@
"filename> et <filename>src/main/webapp</filename>."
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
msgid ""
"We will be using Maven in this tutorial, taking advantage of its transitive "
@@ -124,11 +134,65 @@
"de gestion de dépendances transitives, ainsi que de la capacité des nombreux "
"IDE à installer automatiquement un projet sur la base du descripteur Maven."
+#. Tag: programlisting
+#: tutorial.xml:97
+#, no-c-format
+msgid ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:100
#, fuzzy, no-c-format
msgid ""
"It is not a requirement to use Maven. If you wish to use something else to "
-"build this tutoial (such as Ant), the layout will remain the same. The only "
+"build this tutorial (such as Ant), the layout will remain the same. The only "
"change is that you will need to manually account for all the needed "
"dependencies. If you use something like <ulink url=\"http://ant.apache.org/"
"ivy/\">Ivy</ulink> providing transitive dependency management you would "
@@ -158,6 +222,7 @@
"gestionnaires de journalisation slf4j."
#. Tag: para
+#: tutorial.xml:117
#, no-c-format
msgid ""
"Save this file as <filename>pom.xml</filename> in the project root directory."
@@ -166,11 +231,13 @@
"répertoire root du projet."
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr "La première classe"
#. Tag: para
+#: tutorial.xml:126
#, no-c-format
msgid ""
"Next, we create a class that represents the event we want to store in the "
@@ -180,7 +247,50 @@
"stocker dans notre base de données. Il s'agit d'une simple classe JavaBean "
"avec quelques propriétés :"
+#. Tag: programlisting
+#: tutorial.xml:131
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:133
#, no-c-format
msgid ""
"This class uses standard JavaBean naming conventions for property getter and "
@@ -196,6 +306,7 @@
"le bénéfice des méthodes d'accès est la robustesse pour la refonte de code. "
#. Tag: para
+#: tutorial.xml:141
#, no-c-format
msgid ""
"The <literal>id</literal> property holds a unique identifier value for a "
@@ -226,6 +337,7 @@
"l'ajuster à la conception de votre application. "
#. Tag: para
+#: tutorial.xml:156
#, no-c-format
msgid ""
"The no-argument constructor is a requirement for all persistent classes; "
@@ -241,6 +353,7 @@
"récupération efficace des données sans instrumentation du bytecode. "
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
msgid ""
"Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</"
@@ -250,11 +363,13 @@
"hibernate/tutorial/domain</filename>."
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr "Le fichier de mappage"
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
msgid ""
"Hibernate needs to know how to load and store objects of the persistent "
@@ -268,12 +383,28 @@
"base de données, et les colonnes de cette table à utiliser."
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr ""
"La structure basique de ce fichier de mappage ressemble à ce qui suit :"
+#. Tag: programlisting
+#: tutorial.xml:185
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:187
#, no-c-format
msgid ""
"Hibernate DTD is sophisticated. You can use it for auto-completion of XML "
@@ -297,6 +428,7 @@
"la distribution Hibernate)."
#. Tag: para
+#: tutorial.xml:200
#, no-c-format
msgid ""
"We will omit the DTD declaration in future examples to shorten the code. It "
@@ -306,6 +438,7 @@
"raccourcir le code. Évidemment il n'est pas optionnel. "
#. Tag: para
+#: tutorial.xml:206
#, no-c-format
msgid ""
"Between the two <literal>hibernate-mapping</literal> tags, include a "
@@ -319,7 +452,21 @@
"ne sont pas des entités mère) ont besoin d'un mappage vers une table de la "
"base de données SQL :"
+#. Tag: programlisting
+#: tutorial.xml:213
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:215
#, no-c-format
msgid ""
"So far we have told Hibernate how to persist and load object of class "
@@ -338,7 +485,23 @@
"de génération d'identifiant Hibernate pour la colonne de la clé primaire "
"subrogée : "
+#. Tag: programlisting
+#: tutorial.xml:225
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
msgid ""
"The <literal>id</literal> element is the declaration of the identifier "
@@ -356,6 +519,7 @@
"table <literal>EVENTS</literal> contient la valeur de clé primaire."
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
msgid ""
"The nested <literal>generator</literal> element specifies the identifier "
@@ -376,17 +540,18 @@
"points d'extension d'Hibernate et vous pouvez plug-in votre propre stratégie."
#. Tag: para
+#: tutorial.xml:249
#, fuzzy, no-c-format
msgid ""
"<literal>native</literal> is no longer consider the best strategy in terms "
-"of portability. for further discussion, see <xref linkend=\"portability-idgen"
-"\" />"
+"of portability. for further discussion, see"
msgstr ""
"<literal>native</literal> n'est plus considéré comme la meilleure stratégie "
"en terme de portabilité. Pour obtenir davantage d'explications, voir <xref "
"linkend=\"portability-idgen\" />"
#. Tag: para
+#: tutorial.xml:255
#, no-c-format
msgid ""
"Lastly, we need to tell Hibernate about the remaining entity class "
@@ -396,7 +561,26 @@
"classe dans le fichier de mappage. Par défaut, aucune propriété de la classe "
"n'est considérée comme persistante : "
+#. Tag: programlisting
+#: tutorial.xml:261
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:263
#, no-c-format
msgid ""
"Similar to the <literal>id</literal> element, the <literal>name</literal> "
@@ -412,6 +596,7 @@
"<literal>getTitle()/setTitle()</literal>. "
#. Tag: para
+#: tutorial.xml:274
#, no-c-format
msgid ""
"Why does the <literal>date</literal> property mapping include the "
@@ -430,6 +615,7 @@
"différent pour le mappage. "
#. Tag: para
+#: tutorial.xml:284
#, no-c-format
msgid ""
"The <literal>title</literal> mapping also lacks a <literal>type</literal> "
@@ -466,6 +652,7 @@
"un convertisseur <literal>timestamp</literal>. "
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
msgid ""
"Hibernate makes this mapping type determination using reflection when the "
@@ -479,6 +666,7 @@
"importante, vous devriez considérer définir explicitement quel type utiliser."
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
msgid ""
"Save this mapping file as <filename>src/main/resources/org/hibernate/"
@@ -488,11 +676,13 @@
"hibernate/tutorial/domain/Event.hbm.xml</filename>."
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr "Configuration d'Hibernate"
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
msgid ""
"At this point, you should have the persistent class and its mapping file in "
@@ -505,11 +695,13 @@
"\"server mode\""
#. Tag: para
+#: tutorial.xml:324
#, fuzzy, no-c-format
msgid "We do this do that the data remains between runs."
msgstr "xxx"
#. Tag: para
+#: tutorial.xml:329
#, no-c-format
msgid ""
"We will utilize the Maven exec plugin to launch the HSQLDB server by "
@@ -530,6 +722,7 @@
"<filename>target/data</filename> et redémarrez HSQL DB."
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
msgid ""
"Hibernate will be connecting to the database on behalf of your application, "
@@ -551,6 +744,7 @@
"utiliserons le pool de connexions intégré Hibernate pour ce tutoriel."
#. Tag: para
+#: tutorial.xml:351
#, fuzzy, no-c-format
msgid ""
"The built-in Hibernate connection pool is in no way intended for production "
@@ -560,6 +754,7 @@
"environnements de production."
#. Tag: para
+#: tutorial.xml:357
#, no-c-format
msgid ""
"For Hibernate's configuration, we can use a simple <literal>hibernate."
@@ -573,7 +768,57 @@
"complète par programmation. La plupart des utilisateurs préfèrent le fichier "
"de configuration XML : "
+#. Tag: programlisting
+#: tutorial.xml:363
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr ""
@@ -581,6 +826,7 @@
"différente."
#. Tag: para
+#: tutorial.xml:369
#, no-c-format
msgid ""
"You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory "
@@ -595,6 +841,7 @@
"de configuration différents (pour un démarrage plus facile)."
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
msgid ""
"The first four <literal>property</literal> elements contain the necessary "
@@ -607,16 +854,18 @@
"Hibernate va générer. "
#. Tag: para
+#: tutorial.xml:383
#, fuzzy, no-c-format
msgid ""
"In most cases, Hibernate is able to properly determine which dialect to use. "
-"See <xref linkend=\"portability-dialectresolver\" /> for more information."
+"See <xref linkend=\"portability-dialectresolver\"/> for more information."
msgstr ""
"Hibernate est capable de déterminer correctement quel dialecte utiliser dans "
"la plupart des cas. Voir <xref linkend=\"portability-dialectresolver\" /> "
"pour obtenir davantage d'informations. "
#. Tag: para
+#: tutorial.xml:389
#, no-c-format
msgid ""
"Hibernate's automatic session management for persistence contexts is "
@@ -637,6 +886,7 @@
"classes persistantes."
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
msgid ""
"Save this file as <filename>hibernate.cfg.xml</filename> into the "
@@ -646,11 +896,13 @@
"dans le répertoire <filename>src/main/resources</filename>."
#. Tag: title
+#: tutorial.xml:406
#, no-c-format
msgid "Building with Maven"
msgstr "Construction avec Maven"
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
msgid ""
"We will now build the tutorial with Maven. You will need to have Maven "
@@ -668,12 +920,43 @@
"d'abord, exécutons <literal>compile</literal> pour s'assurer que nous "
"pouvons tout compiler jusqu'à maintenant :"
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+"<![CDATA[[hibernateTutorial]$ mvn compile\n"
+"[INFO] Scanning for projects...\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Building First Hibernate Tutorial\n"
+"[INFO] task-segment: [compile]\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] [resources:resources]\n"
+"[INFO] Using default encoding to copy filtered resources.\n"
+"[INFO] [compiler:compile]\n"
+"[INFO] Compiling 1 source file to /home/steve/projects/sandbox/"
+"hibernateTutorial/target/classes\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] BUILD SUCCESSFUL\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Total time: 2 seconds\n"
+"[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+"[INFO] Final Memory: 5M/547M\n"
+"[INFO] "
+"------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr "Démarrage et aides"
#. Tag: para
+#: tutorial.xml:425
#, no-c-format
msgid ""
"It is time to load and store some <literal>Event</literal> objects, but "
@@ -698,6 +981,7 @@
"interfacename> est un objet global \"thread-safe\", instancié une seule fois."
#. Tag: para
+#: tutorial.xml:439
#, no-c-format
msgid ""
"We will create a <literal>HibernateUtil</literal> helper class that takes "
@@ -708,7 +992,42 @@
"s'occupe du démarrage et rend la gestion des <interfacename>org.hibernate."
"SessionFactory</interfacename> plus facile. "
+#. Tag: programlisting
+#: tutorial.xml:445
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.util;\n"
+"\n"
+"import org.hibernate.SessionFactory;\n"
+"import org.hibernate.cfg.Configuration;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory = buildSessionFactory"
+"();\n"
+"\n"
+" private static SessionFactory buildSessionFactory() {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" return new Configuration().configure().buildSessionFactory();\n"
+" }\n"
+" catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
msgid ""
"Save this code as <filename>src/main/java/org/hibernate/tutorial/util/"
@@ -718,6 +1037,7 @@
"tutorial/util/HibernateUtil.java</filename>"
#. Tag: para
+#: tutorial.xml:452
#, no-c-format
msgid ""
"This class not only produces the global <interfacename>org.hibernate."
@@ -736,6 +1056,7 @@
"<literal>SessionFactory</literal> depuis JNDI dans un serveur d'applications."
#. Tag: para
+#: tutorial.xml:461
#, no-c-format
msgid ""
"If you give the <interfacename>org.hibernate.SessionFactory</interfacename> "
@@ -753,6 +1074,7 @@
"expliquées plus loin."
#. Tag: para
+#: tutorial.xml:470
#, no-c-format
msgid ""
"You now need to configure a logging system. Hibernate uses commons logging "
@@ -775,6 +1097,7 @@
"démarrage de Hibernate est affiché sur la sortie standard."
#. Tag: para
+#: tutorial.xml:480
#, no-c-format
msgid ""
"The tutorial infrastructure is complete and you are now ready to do some "
@@ -784,14 +1107,16 @@
"effectuer un travail réel avec Hibernate. "
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr "Charger et stocker des objets"
#. Tag: para
-#, no-c-format
+#: tutorial.xml:490
+#, fuzzy, no-c-format
msgid ""
-"We are now ready to start doing some real worjk with Hibernate. Let's start "
+"We are now ready to start doing some real work with Hibernate. Let's start "
"by writing an <literal>EventManager</literal> class with a <literal>main()</"
"literal> method:"
msgstr ""
@@ -799,7 +1124,49 @@
"Nous écrivons une classe <literal>EventManager</literal> avec une méthode "
"<literal>main()</literal> : "
+#. Tag: programlisting
+#: tutorial.xml:496
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial;\n"
+"\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.*;\n"
+"\n"
+"import org.hibernate.tutorial.domain.Event;\n"
+"import org.hibernate.tutorial.util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:498
#, no-c-format
msgid ""
"In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</"
@@ -813,10 +1180,11 @@
"dans la base de données."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:505
+#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> is designed to represent a "
-"single unit of work (a single atmoic piece of work to be performed). For now "
+"single unit of work (a single atomic piece of work to be performed). For now "
"we will keep things simple and assume a one-to-one granularity between a "
"Hibernate <interface>org.hibernate.Session</interface> and a database "
"transaction. To shield our code from the actual underlying transaction "
@@ -834,6 +1202,7 @@
"utiliser JTA."
#. Tag: para
+#: tutorial.xml:518
#, no-c-format
msgid ""
"What does <literal>sessionFactory.getCurrentSession()</literal> do? First, "
@@ -856,6 +1225,7 @@
"courante est liée au thread Java courant qui exécute notre application."
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
msgid ""
"Hibernate offers three methods of current session tracking. The \"thread\" "
@@ -869,6 +1239,7 @@
"suivi de session courant est abordé plus en détail par la suite."
#. Tag: para
+#: tutorial.xml:541
#, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> begins when the first call to "
@@ -890,6 +1261,7 @@
"travail. "
#. Tag: para
+#: tutorial.xml:554
#, no-c-format
msgid ""
"Related to the unit of work scope, should the Hibernate <interface>org."
@@ -918,9 +1290,10 @@
"application (web) est affichée plus loin dans ce tutoriel. "
#. Tag: para
+#: tutorial.xml:571
#, fuzzy, no-c-format
msgid ""
-"See <xref linkend=\"transactions\" /> for more information about transaction "
+"See <xref linkend=\"transactions\"/> for more information about transaction "
"handling and demarcation. The previous example also skipped any error "
"handling and rollback."
msgstr ""
@@ -929,6 +1302,7 @@
"erreurs et rollback dans l'exemple précédent."
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
msgid ""
"To run this, we will make use of the Maven exec plugin to call our class "
@@ -941,6 +1315,7 @@
"\" -Dexec.args=\"store\"</command>"
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
msgstr ""
@@ -948,6 +1323,7 @@
"commencer."
#. Tag: para
+#: tutorial.xml:589
#, no-c-format
msgid ""
"You should see Hibernate starting up and, depending on your configuration, "
@@ -957,32 +1333,77 @@
"beaucoup de traces sur la sortie. À la fin, vous trouverez la ligne "
"suivante :"
+#. Tag: programlisting
+#: tutorial.xml:594
+#, no-c-format
+msgid ""
+"<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) "
+"values (?, ?, ?)]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:596
#, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr "C'est l' <literal>INSERT</literal> exécutée par Hibernate."
#. Tag: para
+#: tutorial.xml:600
#, no-c-format
msgid "To list stored events an option is added to the main method:"
msgstr ""
"Maintenant nous aimerions aussi lister les événements stockés, donc nous "
"ajoutons une option à la méthode principale : "
+#. Tag: programlisting
+#: tutorial.xml:604
+#, no-c-format
+msgid ""
+"<![CDATA[ if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+" else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\n"
+" \"Event: \" + theEvent.getTitle() + \" Time: \" + "
+"theEvent.getDate()\n"
+" );\n"
+" }\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:606
#, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr ""
"Nous ajoutons aussi une nouvelle méthode <literal>listEvents()</literal> : "
+#. Tag: programlisting
+#: tutorial.xml:610
+#, no-c-format
+msgid ""
+"<![CDATA[ private List listEvents() {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+" session.getTransaction().commit();\n"
+" return result;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:612
#, fuzzy, no-c-format
msgid ""
"Here, we are using a Hibernate Query Language (HQL) query to load all "
"existing <literal>Event</literal> objects from the database. Hibernate will "
"generate the appropriate SQL, send it to the database and populate "
"<literal>Event</literal> objects with the data. You can create more complex "
-"queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
+"queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
msgstr ""
"Ici nous utilisons une requête HQL (Hibernate Query Language) pour charger "
"tous les objets <literal>Event</literal> existants de la base de données. "
@@ -992,6 +1413,7 @@
"\"queryhql\" /> pour obtenir davantage d'informations."
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
msgid ""
"Now we can call our new functionality, again using the Maven exec plugin: "
@@ -1003,11 +1425,13 @@
"\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"list\"</command>"
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr "Section 2 - Mapper des associations"
#. Tag: para
+#: tutorial.xml:632
#, no-c-format
msgid ""
"So far we have mapped a single persistent entity class to a table in "
@@ -1021,17 +1445,40 @@
"stockerons une liste d'événements auxquels ils participent."
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr "Mapper la classe Person"
#. Tag: para
+#: tutorial.xml:642
#, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
msgstr ""
"La première version de la classe <literal>Person</literal> est simple : "
+#. Tag: programlisting
+#: tutorial.xml:646
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
msgid ""
"Save this to a file named <filename>src/main/java/org/hibernate/tutorial/"
@@ -1041,6 +1488,7 @@
"tutorial/domain/Person.java</filename>"
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
msgid ""
"Next, create the new mapping file as <filename>src/main/resources/org/"
@@ -1049,13 +1497,41 @@
"Puis, créez le nouveau fichier de mappage <filename>src/main/resources/org/"
"hibernate/tutorial/domain/Person.hbm.xml</filename>"
+#. Tag: programlisting
+#: tutorial.xml:658
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr ""
"Finalement, ajoutez le nouveau mappage à la configuration d'Hibernate :"
+#. Tag: programlisting
+#: tutorial.xml:664
+#, no-c-format
+msgid ""
+"<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:666
#, no-c-format
msgid ""
"Create an association between these two entities. Persons can participate in "
@@ -1068,11 +1544,13 @@
"traiter sont : direction, cardinalité et comportement de la collection. "
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr "Une association unidirectionnelle basée sur Set"
#. Tag: para
+#: tutorial.xml:678
#, no-c-format
msgid ""
"By adding a collection of events to the <literal>Person</literal> class, you "
@@ -1091,7 +1569,26 @@
"contiendra pas d'éléments dupliqués et l'ordre ne nous importe pas pour ces "
"exemples :"
+#. Tag: programlisting
+#: tutorial.xml:689
+#, no-c-format
+msgid ""
+"<![CDATA[public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:691
#, no-c-format
msgid ""
"Before mapping this association, let's consider the other side. We could "
@@ -1115,7 +1612,28 @@
"côtés, est appelée <emphasis>plusieurs-à-plusieurs</emphasis>. Par "
"conséquent nous utilisons un mappage Hibernate plusieurs-à-plusieurs :"
+#. Tag: programlisting
+#: tutorial.xml:704
+#, no-c-format
+msgid ""
+"<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:706
#, no-c-format
msgid ""
"Hibernate supports a broad range of collection mappings, a <literal>set</"
@@ -1143,16 +1661,38 @@
"votre collection (c'est-à-dire : la classe de l'autre côté de la collection)."
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr "Le schéma de base de données pour ce mappage est donc :"
+#. Tag: programlisting
+#: tutorial.xml:726
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr "Travailler avec l'association"
#. Tag: para
+#: tutorial.xml:733
#, no-c-format
msgid ""
"Now we will bring some people and events together in a new method in "
@@ -1161,7 +1701,25 @@
"Réunissons quelques personnes et quelques événements dans une nouvelle "
"méthode dans <literal>EventManager</literal> : "
+#. Tag: programlisting
+#: tutorial.xml:737
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:739
#, no-c-format
msgid ""
"After loading a <literal>Person</literal> and an <literal>Event</literal>, "
@@ -1197,6 +1755,7 @@
"de données."
#. Tag: para
+#: tutorial.xml:758
#, no-c-format
msgid ""
"You can load person and event in different units of work. Or you can modify "
@@ -1212,7 +1771,43 @@
"emphasis>). Vous pouvez même modifier une collection lorsqu'elle est "
"détachée :"
+#. Tag: programlisting
+#: tutorial.xml:767
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p."
+"events where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use "
+"it detached\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory()."
+"getCurrentSession();\n"
+" session2.beginTransaction();\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:769
#, no-c-format
msgid ""
"The call to <literal>update</literal> makes a detached object persistent "
@@ -1228,6 +1823,7 @@
"modification effectuées sur une collection de cet objet entité."
#. Tag: para
+#: tutorial.xml:778
#, no-c-format
msgid ""
"This is not much use in our example, but it is an important concept you can "
@@ -1246,7 +1842,22 @@
"devrez peut-être modifier certaines méthodes précédentes pour retourner ces "
"identifiants) :"
+#. Tag: programlisting
+#: tutorial.xml:786
+#, no-c-format
+msgid ""
+"<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
+"());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" "
+"+ eventId);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:788
#, no-c-format
msgid ""
"This is an example of an association between two equally important classes : "
@@ -1278,6 +1889,7 @@
"ou <literal>MonetaryAmount</literal>, par exemple. "
#. Tag: para
+#: tutorial.xml:806
#, no-c-format
msgid ""
"You can also design a collection of value types. This is conceptually "
@@ -1289,11 +1901,13 @@
"entités, mais très ressemblant dans Java. "
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr "Collection de valeurs"
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
msgid ""
"Let's add a collection of email addresses to the <literal>Person</literal> "
@@ -1304,12 +1918,39 @@
"qui sera représenté en tant que <interfacename>java.util.Set</interfacename> "
"d'instance <classname>java.lang.String</classname> :"
+#. Tag: programlisting
+#: tutorial.xml:823
+#, no-c-format
+msgid ""
+"<![CDATA[ private Set emailAddresses = new HashSet();\n"
+"\n"
+" public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+" }\n"
+"\n"
+" public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:825
#, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr "Le mappage de ce <literal>Set</literal> : "
+#. Tag: programlisting
+#: tutorial.xml:829
+#, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+" </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:831
#, no-c-format
msgid ""
"The difference compared with the earlier mapping is the use of the "
@@ -1337,11 +1978,39 @@
"valeurs de <literal>String</literal> seront réellement stockées. "
#. Tag: para
+#: tutorial.xml:847
#, no-c-format
msgid "Here is the updated schema:"
msgstr "Considérons le schéma mis à jour : "
+#. Tag: programlisting
+#: tutorial.xml:851
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
+"*PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:853
#, no-c-format
msgid ""
"You can see that the primary key of the collection table is in fact a "
@@ -1356,6 +2025,7 @@
"Java. "
#. Tag: para
+#: tutorial.xml:859
#, no-c-format
msgid ""
"You can now try to add elements to this collection, just like we did before "
@@ -1365,7 +2035,27 @@
"juste comme nous l'avons fait auparavant en liant des personnes et des "
"événements. C'est le même code dans Java. "
+#. Tag: programlisting
+#: tutorial.xml:864
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addEmailToPerson(Long personId, String "
+"emailAddress) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" // adding to the emailAddress collection might trigger a lazy load "
+"of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:866
#, no-c-format
msgid ""
"This time we did not use a <emphasis>fetch</emphasis> query to initialize "
@@ -1377,11 +2067,13 @@
"SQL et tentez d'optimiser ce cas avec un chargement agressif."
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr "Associations bidirectionnelles"
#. Tag: para
+#: tutorial.xml:877
#, no-c-format
msgid ""
"Next you will map a bi-directional association. You will make the "
@@ -1395,6 +2087,7 @@
"pas, nous avons toujours une pluralité plusieurs-à-plusieurs. "
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
msgid ""
"A relational database is more flexible than a network programming language, "
@@ -1406,6 +2099,7 @@
"les données peuvent être vues et récupérées de toutes les manières possibles."
#. Tag: para
+#: tutorial.xml:893
#, no-c-format
msgid ""
"First, add a collection of participants to the <literal>Event</literal> "
@@ -1414,7 +2108,23 @@
"D'abord, ajoutez une collection de participants à la classe <literal>Event</"
"literal> : "
+#. Tag: programlisting
+#: tutorial.xml:898
+#, no-c-format
+msgid ""
+"<![CDATA[ private Set participants = new HashSet();\n"
+"\n"
+" public Set getParticipants() {\n"
+" return participants;\n"
+" }\n"
+"\n"
+" public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:900
#, no-c-format
msgid ""
"Now map this side of the association in <literal>Event.hbm.xml</literal>."
@@ -1422,7 +2132,19 @@
"Maintenant mappez ce côté de l'association aussi, dans <literal>Event.hbm."
"xml</literal>. "
+#. Tag: programlisting
+#: tutorial.xml:904
+#, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse="
+"\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+" </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:906
#, no-c-format
msgid ""
"These are normal <literal>set</literal> mappings in both mapping documents. "
@@ -1440,6 +2162,7 @@
"mappage de la collection des <literal>Event</literal>s. "
#. Tag: para
+#: tutorial.xml:914
#, no-c-format
msgid ""
"What this means is that Hibernate should take the other side, the "
@@ -1454,11 +2177,13 @@
"est créé. "
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr "Travailler avec des liens bidirectionnels"
#. Tag: para
+#: tutorial.xml:925
#, no-c-format
msgid ""
"First, keep in mind that Hibernate does not affect normal Java semantics. "
@@ -1483,6 +2208,7 @@
"ne devriez jamais oublier de le faire. "
#. Tag: para
+#: tutorial.xml:935
#, no-c-format
msgid ""
"Many developers program defensively and create link management methods to "
@@ -1492,7 +2218,31 @@
"méthodes de gestion de lien pour affecter correctement les deux côtés, par "
"exemple dans <literal>Person</literal> :"
+#. Tag: programlisting
+#: tutorial.xml:940
+#, no-c-format
+msgid ""
+"<![CDATA[ protected Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"\n"
+" public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+" }\n"
+"\n"
+" public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:942
#, no-c-format
msgid ""
"The get and set methods for the collection are now protected. This allows "
@@ -1507,6 +2257,7 @@
"faire de même avec la collection de l'autre côté. "
#. Tag: para
+#: tutorial.xml:949
#, no-c-format
msgid ""
"What about the <literal>inverse</literal> mapping attribute? For you, and "
@@ -1539,11 +2290,13 @@
"plusieurs, vous pouvez choisir n'importe quel côté, il n'y pas de différence."
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr "Section 3 - L'application web EventManager"
#. Tag: para
+#: tutorial.xml:967
#, no-c-format
msgid ""
"A Hibernate web application uses <literal>Session</literal> and "
@@ -1560,11 +2313,13 @@
"pour saisir de nouveaux évènements. "
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr "Écrire la servlet de base"
#. Tag: para
+#: tutorial.xml:977
#, no-c-format
msgid ""
"First we need create our basic processing servlet. Since our servlet only "
@@ -1575,7 +2330,52 @@
"que les requêtes HTTP <literal>GET</literal>, la méthode à implémenter est "
"donc <literal>doGet()</literal> :"
+#. Tag: programlisting
+#: tutorial.xml:983
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.web;\n"
+"\n"
+"// Imports\n"
+"\n"
+"public class EventManagerServlet extends HttpServlet {\n"
+"\n"
+" protected void doGet(\n"
+" HttpServletRequest request,\n"
+" HttpServletResponse response) throws ServletException, "
+"IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy"
+"\" );\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().commit();\n"
+" }\n"
+" catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().rollback();\n"
+" if ( ServletException.class.isInstance( ex ) ) {\n"
+" throw ( ServletException ) ex;\n"
+" }\n"
+" else {\n"
+" throw new ServletException( ex );\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
msgid ""
"Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/"
@@ -1585,6 +2385,7 @@
"web/EventManagerServlet.java</filename>"
#. Tag: para
+#: tutorial.xml:990
#, no-c-format
msgid ""
"The pattern applied here is called <emphasis>session-per-request</emphasis>. "
@@ -1604,6 +2405,7 @@
"mode auto-commit dans les applications). "
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
msgid ""
"Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> "
@@ -1618,6 +2420,7 @@
"automatiquement attachée au thread Java courant."
#. Tag: para
+#: tutorial.xml:1006
#, no-c-format
msgid ""
"Next, the possible actions of the request are processed and the response "
@@ -1627,6 +2430,7 @@
"HTML est rendue. Nous y reviendrons ultérieurement. "
#. Tag: para
+#: tutorial.xml:1011
#, no-c-format
msgid ""
"Finally, the unit of work ends when processing and rendering are complete. "
@@ -1649,18 +2453,57 @@
"servlets pour le rendu de vos vues. "
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr "Traiter et interpréter"
#. Tag: para
+#: tutorial.xml:1027
#, no-c-format
msgid ""
"Now you can implement the processing of the request and the rendering of the "
"page."
msgstr "Implémentons l'exécution de la requête et le rendu de la page. "
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, no-c-format
+msgid ""
+"<![CDATA[ // Write HTML header\n"
+" PrintWriter out = response.getWriter();\n"
+" out.println(\"<html><head><title>Event Manager</title></head><body>"
+"\");\n"
+"\n"
+" // Handle actions\n"
+" if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date.</i></"
+"b>\");\n"
+" }\n"
+" else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse"
+"(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>\");\n"
+" }\n"
+" }\n"
+"\n"
+" // Print page\n"
+" printEventForm(out);\n"
+" listEvents(out, dateFormatter);\n"
+"\n"
+" // Write HTML footer\n"
+" out.println(\"</body></html>\");\n"
+" out.flush();\n"
+" out.close();]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1033
#, no-c-format
msgid ""
"This coding style, with a mix of Java and HTML, would not scale in a more "
@@ -1678,7 +2521,25 @@
"évènements de la base de données. La première méthode est triviale et ne "
"fait que sortir de l'HTML :"
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, no-c-format
+msgid ""
+"<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
+"\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
msgid ""
"The <literal>listEvents()</literal> method uses the Hibernate "
@@ -1687,7 +2548,38 @@
"La méthode <literal>listEvents()</literal> utilise la <literal>Session</"
"literal> Hibernate liée au thread courant pour exécuter la requête :"
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, no-c-format
+msgid ""
+"<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
+"dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" Iterator it = result.iterator();\n"
+" while (it.hasNext()) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate()) "
+"+ \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
msgid ""
"Finally, the <literal>store</literal> action is dispatched to the "
@@ -1698,7 +2590,23 @@
"<literal>createAndStoreEvent()</literal>, qui utilise aussi la "
"<literal>Session</literal> du thread courant:"
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, no-c-format
+msgid ""
+"<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) "
+"{\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1060
#, no-c-format
msgid ""
"The servlet is now complete. A request to the servlet will be processed in a "
@@ -1720,11 +2628,13 @@
"dans une couche DAO. Consultez le wiki Hibernate pour plus d'exemples. "
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr "Déployer et tester"
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
msgid ""
"To deploy this application for testing we must create a Web ARchive (WAR). "
@@ -1735,7 +2645,32 @@
"créer un WAR (Web ARchive). Tout d'abord, nous devons définir le descripteur "
"WAR en tant que <filename>src/main/webapp/WEB-INF/web.xml</filename>"
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/"
+"xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
+"servlet-class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1084
#, no-c-format
msgid ""
"To build and deploy call <literal>mvn package</literal> in your project "
@@ -1747,10 +2682,11 @@
"le répertoire <literal>webapp</literal> de Tomcat. "
#. Tag: para
+#: tutorial.xml:1091
#, fuzzy, no-c-format
msgid ""
"If you do not have Tomcat installed, download it from <ulink url=\"http://"
-"tomcat.apache.org/\" /> and follow the installation instructions. Our "
+"tomcat.apache.org/\"></ulink> and follow the installation instructions. Our "
"application requires no changes to the standard Tomcat configuration."
msgstr ""
"Si vous n'avez pas installé Tomcat, téléchargez-le de <ulink url=\"http://"
@@ -1758,6 +2694,7 @@
"à modifier la configuration Tomcat pour déployer cette application."
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
msgid ""
"Once deployed and Tomcat is running, access the application at "
@@ -1775,11 +2712,13 @@
"vérifier qu'aucune exception ne survienne."
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr "Résumé"
#. Tag: para
+#: tutorial.xml:1114
#, no-c-format
msgid ""
"This tutorial covered the basics of writing a simple standalone Hibernate "
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/author_group.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/author_group.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/author_group.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-04T04:51:21\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-07-14 19:55+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
@@ -13,137 +13,215 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
+msgid ""
+"<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</"
+"surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
+msgid ""
+"<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
+msgid "Graphic Design"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
+msgid ""
+"<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> "
+"<email>kreimer at bbs.frc.utn.edu.ar</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
+msgid ""
+"<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></"
+"othercredit>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
+msgid ""
+"<firstname>Alvaro</firstname> <surname>Netto</surname> "
+"<email>alvaronetto at cetip.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
+msgid ""
+"<firstname>Anderson</firstname> <surname>Braulio</surname> "
+"<email>andersonbraulio at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
+msgid ""
+"<firstname>Daniel Vieira</firstname> <surname>Costa</surname> "
+"<email>danielvc at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
+msgid ""
+"<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco."
+"gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
+msgid ""
+"<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
+msgid ""
+"<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> "
+"<email>luizcarlos_rodrigues at yahoo.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
+msgid ""
+"<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel."
+"castelo at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
+msgid ""
+"<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail."
+"com</email>"
msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
+msgid ""
+"<firstname>Pablo L.</firstname> <surname>de Miranda</surname> "
+"<email>pablolmiranda at gmail.com</email>"
msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
+msgid ""
+"<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail."
+"com</email>"
msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid ""
+"<firstname>Rogério</firstname> <surname>Araújo</surname> "
+"<email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid ""
+"<firstname>Wanderson</firstname> <surname>Siqueira</surname> "
+"<email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid ""
+"<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> "
+"<orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</"
+"contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/basic_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/basic_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/basic_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-06 10:49+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,29 +14,151 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "基本的な O/R マッピング"
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "マッピング定義"
#. Tag: para
+#: basic_mapping.xml:36
#, no-c-format
+msgid "Object/relational mappings can be defined in three approaches:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:41
+#, no-c-format
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:46
+#, no-c-format
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
msgid ""
-"Object/relational mappings are usually defined in an XML document. The "
-"mapping document is designed to be readable and hand-editable. The mapping "
-"language is Java-centric, meaning that mappings are constructed around "
-"persistent class declarations and not table declarations."
+"Annotations are split in two categories, the logical mapping annotations "
+"(describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid ""
+"JPA annotations are in the <literal>javax.persistence.*</literal> package. "
+"Hibernate specific extensions are in <literal>org.hibernate.annotations.*</"
+"literal>. You favorite IDE can auto-complete annotations and their "
+"attributes for you (even without a specific \"JPA\" plugin, since JPA "
+"annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
+#, fuzzy, no-c-format
+msgid "Here is an example of mapping"
+msgstr "サンプルのマッピングから始めましょう:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"@Entity \n"
+"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
+"discriminatorType=CHAR)\n"
+"public class Cat {\n"
+" \n"
+" @Id @GeneratedValue\n"
+" public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public BigDecimal getWeight() { return weight; }\n"
+" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+" private BigDecimal weight;\n"
+"\n"
+" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+" public Date getBirthdate() { return birthdate; }\n"
+" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+" private Date birthdate;\n"
+"\n"
+" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+" @NotNull @Column(updatable=false)\n"
+" public ColorType getColor() { return color; }\n"
+" public void setColor(ColorType color) { this.color = color; }\n"
+" private ColorType color;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public String getSex() { return sex; }\n"
+" public void setSex(String sex) { this.sex = sex; }\n"
+" private String sex;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public Integer getLitterId() { return litterId; }\n"
+" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+" private Integer litterId;\n"
+"\n"
+" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+" public Cat getMother() { return mother; }\n"
+" public void setMother(Cat mother) { this.mother = mother; }\n"
+" private Cat mother;\n"
+"\n"
+" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+" public Set<Cat> getKittens() { return kittens; }\n"
+" public void setKittens(Set<Cat> kittens) { this.kittens = "
+"kittens; }\n"
+" private Set<Cat> kittens = new HashSet<Cat>();\n"
+"}\n"
+"\n"
+"@Entity @DiscriminatorValue(\"D\")\n"
+"public class DomesticCat extends Cat {\n"
+"\n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name }\n"
+" private String name;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Dog { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:73
+#, fuzzy, no-c-format
+msgid ""
+"The legacy hbm.xml approach uses an XML schema designed to be readable and "
+"hand-editable. The mapping language is Java-centric, meaning that mappings "
+"are constructed around persistent class declarations and not table "
+"declarations."
+msgstr ""
"オブジェクト/リレーショナルマッピングは通常 XML ドキュメントで定義します。"
"マッピングドキュメントは、読みやすく手作業で編集しやすいようにデザインされて"
"います。マッピング言語は Java 中心、つまりテーブル定義ではなく永続クラスの定"
"義に基づいて構築されています。"
#. Tag: para
+#: basic_mapping.xml:78
#, no-c-format
msgid ""
"Please note that even though many Hibernate users choose to write the XML by "
@@ -48,18 +170,157 @@
"ルがいくつか存在することを覚えておいてください。"
#. Tag: para
+#: basic_mapping.xml:82
#, no-c-format
msgid "Here is an example mapping:"
msgstr "サンプルのマッピングから始めましょう:"
+#. Tag: programlisting
+#: basic_mapping.xml:84
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" \n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+" \n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\" \n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\" \n"
+" not-null=\"true\" \n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\" \n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\" \n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:86
+#, fuzzy, no-c-format
msgid ""
-"We will now discuss the content of the mapping document. We will only "
-"describe, however, the document elements and attributes that are used by "
-"Hibernate at runtime. The mapping document also contains some extra optional "
-"attributes and elements that affect the database schemas exported by the "
-"schema export tool (for example, the <literal> not-null</literal> attribute)."
+"We will now discuss the concepts of the mapping documents (both annotations "
+"and XML). We will only describe, however, the document elements and "
+"attributes that are used by Hibernate at runtime. The mapping document also "
+"contains some extra optional attributes and elements that affect the "
+"database schemas exported by the schema export tool (for example, the "
+"<literal> not-null</literal> attribute)."
msgstr ""
"マッピングドキュメントの内容を説明します。ただし、ここでは Hibernate が実行時"
"に使うドキュメント要素と属性についてのみ説明します。マッピングドキュメント"
@@ -68,226 +329,458 @@
"キーマに影響を与えるものです。"
#. Tag: title
+#: basic_mapping.xml:94
+#, fuzzy, no-c-format
+msgid "Entity"
+msgstr "identity"
+
+#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "Doctype"
-msgstr "Doctype"
+msgid ""
+"An entity is a regular Java object (aka POJO) which will be persisted by "
+"Hibernate."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:99
#, no-c-format
msgid ""
-"All XML mappings should declare the doctype shown. The actual DTD can be "
-"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
-"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
-"will always look for the DTD in its classpath first. If you experience "
-"lookups of the DTD using an Internet connection, check the DTD declaration "
-"against the contents of your classpath."
+"To mark an object as an entity in annotations, use the <classname>@Entity</"
+"classname> annotation."
msgstr ""
-"XML マッピングでは、お見せしたようなドキュメント型を必ず定義すべきです。実際"
-"の DTD は、上記の URL の <literal>hibernate-x.x.x/src/org/hibernate</"
-"literal> ディレクトリ、または <literal>hibernate.jar</literal> 内にありま"
-"す。 Hibernate は常に、そのクラスパス内で DTD を探し始めます。インターネット"
-"にある DTD ファイルを探そうとしたなら、クラスパスの内容を見て、 DTD 宣言を確"
-"認してください。"
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:102
#, no-c-format
-msgid "EntityResolver"
-msgstr "エンティティリゾルバ"
+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
+#: basic_mapping.xml:104
#, no-c-format
msgid ""
-"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
-"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
-"implementation with the SAXReader it uses to read in the xml files. This "
-"custom <literal>EntityResolver</literal> recognizes two different systemId "
-"namespaces:"
+"That's pretty much it, the rest is optional. There are however any options "
+"to tweak your entity mapping, let's explore them."
msgstr ""
-"前述したように、 Hibernate はまずクラスパス内で DTD を解決しようとします。 "
-"<literal>org.xml.sax.EntityResolver</literal> のカスタム実装を XML ファイルを"
-"読み込むための SAXReader に登録することによって、 DTD を解決します。このカス"
-"タムの <literal>EntityResolver</literal> は2つの異なるシステム ID 名前空間を"
-"認識します。"
#. Tag: para
+#: basic_mapping.xml:107
#, no-c-format
msgid ""
-"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
-"encounters a systemId starting with <literal>http://hibernate.sourceforge."
-"net/</literal>. The resolver attempts to resolve these entities via the "
-"classloader which loaded the Hibernate classes."
+"<classname>@Table</classname> lets you define the table the entity will be "
+"persisted into. If undefined, the table name is the unqualified class name "
+"of the entity. You can also optionally define the catalog, the schema as "
+"well as unique constraints on the table."
msgstr ""
-"<literal>hibernate namespace</literal> は、リゾルバが <literal>http://"
-"hibernate.sourceforge.net/</literal> で始まるシステム ID に到達したときに認識"
-"されます。そしてリゾルバは、 Hibernate のクラスをロードしたクラスローダを用い"
-"て、これらのエンティティを解決しようとします。"
+#. Tag: programlisting
+#: basic_mapping.xml:112
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"TBL_FLIGHT\", \n"
+" schema=\"AIR_COMMAND\", \n"
+" uniqueConstraints=\n"
+" @UniqueConstraint(\n"
+" name=\"flight_number\", \n"
+" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+"public class Flight implements Serializable {\n"
+" @Column(name=\"comp_prefix\")\n"
+" public String getCompagnyPrefix() { return companyPrefix; }\n"
+"\n"
+" @Column(name=\"flight_number\")\n"
+" public String getNumber() { return number; }\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:114
#, no-c-format
msgid ""
-"a <literal>user namespace</literal> is recognized whenever the resolver "
-"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
-"The resolver will attempt to resolve these entities via (1) the current "
-"thread context classloader and (2) the classloader which loaded the "
-"Hibernate classes."
+"The constraint name is optional (generated if left undefined). The column "
+"names composing the constraint correspond to the column names as defined "
+"before the Hibernate <classname>NamingStrategy</classname> is applied."
msgstr ""
-"<literal>user namespace</literal> は、リゾルバが URL プロトコルの "
-"<literal>classpath://</literal> を使ったシステム ID に到達したときに、認識さ"
-"れます。そしてリゾルバは、 (1) カレントスレッドのコンテキストクラスローダー、"
-"または (2) Hibernate のクラスをロードしたクラスローダを使って、これらのエン"
-"ティティを解決しようとします。"
#. Tag: para
+#: basic_mapping.xml:119
#, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
-msgstr "下記は、ユーザー名前空間を使った例です:"
+msgid ""
+"<literal>@Entity.name</literal> lets you define the shortcut name of the "
+"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
+"class name of the class."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:123
+#, no-c-format
+msgid ""
+"Hibernate goes beyond the JPA specification and provide additional "
+"configurations. Some of them are hosted on <classname>@org.hibernate."
+"annotations.Entity</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:129
#, fuzzy, no-c-format
msgid ""
-"Where <literal>types.xml</literal> is a resource in the <literal>your."
-"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
-"custom\">typedef</link>."
+"<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> "
+"(defaults to false): specifies that <literal>INSERT</literal> / "
+"<literal>UPDATE</literal> SQL should be generated at runtime and contain "
+"only the columns whose values are not null. The <literal>dynamic-update</"
+"literal> and <literal>dynamic-insert</literal> settings are not inherited by "
+"subclasses. Although these settings can increase performance in some cases, "
+"they can actually decrease performance in others."
msgstr ""
-"ここで <literal>types.xml</literal> は <literal>your.domain</literal> パッ"
-"ケージ内のリソースであり、カスタム型定義 <xref linkend=\"mapping-types-custom"
-"\"/> を含みます。"
+"<literal>dynamic-update</literal> と <literal>dynamic-insert</literal> の設定"
+"はサブクラスに継承されません。そのため <literal><subclass></literal> "
+"や <literal><joined-subclass></literal> 要素を指定することも出来ます。"
+"これらの設定はパフォーマンスを向上させる事もありますが、落とすこともあります"
+"ので、慎重に使用してください。"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:140
#, fuzzy, no-c-format
-msgid "Hibernate-mapping"
-msgstr "hibernate-mapping"
+msgid ""
+"<literal>selectBeforeUpdate</literal> (defaults to false): specifies that "
+"Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</"
+"literal> unless it is certain that an object is actually modified. Only when "
+"a transient object has been associated with a new session using "
+"<literal>update()</literal>, will Hibernate perform an extra SQL "
+"<literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is "
+"actually required. Use of <literal>select-before-update</literal> will "
+"usually decrease performance. It is useful to prevent a database update "
+"trigger being called unnecessarily if you reattach a graph of detached "
+"instances to a <literal>Session</literal>."
+msgstr ""
+"<literal>select-before-update</literal> (オプション、デフォルトは "
+"<literal>false</literal>): オブジェクトが変更されたのが確実でないならば、 "
+"Hibernate が SQL の <literal>UPDATE</literal> を <emphasis>決して実行しない</"
+"emphasis> ことを指定します。ある特定の場合(実際的には、一時オブジェクトが "
+"<literal>update()</literal> を使い、新しいセッションと関連付けられた時だ"
+"け)、 <literal>UPDATE</literal> が実際に必要かどうかを決定するために、 "
+"Hibernate が余分な SQL の <literal>SELECT</literal> 文を実行することを意味し"
+"ます。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:154
+#, fuzzy, no-c-format
msgid ""
-"This element has several optional attributes. The <literal>schema</literal> "
-"and <literal>catalog</literal> attributes specify that tables referred to in "
-"this mapping belong to the named schema and/or catalog. If they are "
-"specified, tablenames will be qualified by the given schema and catalog "
-"names. If they are missing, tablenames will be unqualified. The "
-"<literal>default-cascade</literal> attribute specifies what cascade style "
-"should be assumed for properties and collections that do not specify a "
-"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
-"literal> attribute allows you to use unqualified class names in the query "
-"language."
+"<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): "
+"determines whether implicit or explicit query polymorphisms is used. "
+"<emphasis>Implicit</emphasis> polymorphisms means that instances of the "
+"class will be returned by a query that names any superclass or implemented "
+"interface or class, and that instances of any subclass of the class will be "
+"returned by a query that names the class itself. <emphasis>Explicit</"
+"emphasis> polymorphisms means that class instances will be returned only by "
+"queries that explicitly name that class. Queries that name the class will "
+"return only instances of subclasses mapped. For most purposes, the default "
+"<literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit "
+"polymorphisms is useful when two different classes are mapped to the same "
+"table This allows a \"lightweight\" class that contains a subset of the "
+"table columns."
msgstr ""
-"この要素にはいくつかオプション属性があります。 <literal>schema</literal> 属性"
-"と <literal>catalog</literal> 属性は、このマッピングが参照するテーブルが、こ"
-"の属性によって指定されたスキーマと(または)カタログに属することを指定します。"
-"この属性が指定されると、テーブル名は与えられたスキーマ名とカタログ名で修飾さ"
-"れます。これらの属性が指定されていなければ、テーブル名は修飾されません。 "
-"<literal>default-cascade</literal> 属性は、 <literal>cascade</literal> 属性を"
-"指定していないプロパティやコレクションに、どのカスケードスタイルを割り当てる"
-"かを指定します。 <literal>auto-import</literal> 属性は、クエリ言語内で修飾さ"
-"れていないクラス名を、デフォルトで使えるようにします。"
+" <emphasis>暗黙的</emphasis> ポリモーフィズムとは、次の二つを意味しています。"
+"一つはクラスのインスタンスが、スーパークラスや実装したインターフェース、また"
+"そのクラスを指定するクエリによって返されることで、もう一つはそのクラスのサブ"
+"クラスのインスタンスが、そのクラス自身を指定したクエリによって返されることで"
+"す。また、 <emphasis>明示的</emphasis> ポリモーフィズムとは、次の二つを意味し"
+"ています。一つはクラスのインスタンスが、そのクラスを明示的に指定したクエリに"
+"よってのみ返されることで、もう一つはクラスを指定したクエリが、 <literal><"
+"class></literal> 要素の中で <literal><subclass></literal> や "
+"<literal><joined-subclass></literal> とマッピングされているサブクラスの"
+"インスタンスだけを返すことです。ほとんどの用途ではデフォルトの "
+"<literal>polymorphism=\"implicit\"</literal> が適切です。明示的なポリモーフィ"
+"ズムは、2つの違ったクラスが同じテーブルにマッピングされているときに有用です "
+"(これによってテーブルカラムのサブセットを含む、「軽量な」クラスが可能になり"
+"ます)。"
#. Tag: para
-#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
-msgstr "<literal>schema</literal>(オプション):データベーススキーマの名前。"
+#: basic_mapping.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"<literal>persister</literal>: specifies a custom <literal>ClassPersister</"
+"literal>. The <literal>persister</literal> attribute lets you customize the "
+"persistence strategy used for the class. You can, for example, specify your "
+"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
+"or you can even provide a completely new implementation of the interface "
+"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
+"for example, persistence via stored procedure calls, serialization to flat "
+"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
+"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgstr ""
+"<literal>persister</literal> 属性を指定することで、クラスの永続化戦略をカスタ"
+"マイズできます。例えば <literal>org.hibernate.persister.EntityPersister</"
+"literal> 自身のサブクラスを指定したり、また例えばストアドプロシージャコール、"
+"フラットファイルへシリアライズ、 LDAP などを通した永続性を実装する "
+"<literal>org.hibernate.persister.ClassPersister</literal> インターフェースの"
+"完全に新しい実装を提供できます。簡単な例として <literal>org.hibernate.test."
+"CustomPersister</literal> を参照してください(これは <literal>Hashtable</"
+"literal> の「永続化」です)。"
#. Tag: para
+#: basic_mapping.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): "
+"determines the optimistic locking strategy. If you enable "
+"<literal>dynamicUpdate</literal>, you will have a choice of optimistic "
+"locking strategies:"
+msgstr ""
+"<literal>dynamic-update</literal> を有効にすれば、楽観ロック戦略を選ぶことに"
+"なります:"
+
+#. Tag: para
+#: basic_mapping.xml:192
#, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
+msgid "<literal>version</literal>: check the version/timestamp columns"
msgstr ""
-"<literal>catalog</literal> (オプション):データベースカタログの名前。"
+"<literal>version</literal> バージョン/タイムスタンプカラムをチェックします。"
#. Tag: para
+#: basic_mapping.xml:197
#, no-c-format
+msgid "<literal>all</literal>: check all columns"
+msgstr "<literal>all</literal> すべてのカラムをチェックします。"
+
+#. Tag: para
+#: basic_mapping.xml:201
+#, no-c-format
msgid ""
-"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
-"literal>): a default cascade style."
+"<literal>dirty</literal>: check the changed columns, allowing some "
+"concurrent updates"
msgstr ""
-"<literal>default-cascade</literal> (オプション - デフォルトは "
-"<literal>none</literal>): デフォルトのカスケードスタイル。"
+"<literal>dirty</literal> 変更したカラムをチェックし、同時更新できるようにしま"
+"す。"
#. Tag: para
+#: basic_mapping.xml:206
#, no-c-format
+msgid "<literal>none</literal>: do not use optimistic locking"
+msgstr "<literal>none</literal> 楽観ロックを使用しません。"
+
+#. Tag: para
+#: basic_mapping.xml:211
+#, no-c-format
msgid ""
-"<literal>default-access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing all properties. "
-"It can be a custom implementation of <literal>PropertyAccessor</literal>."
+"It is <emphasis>strongly</emphasis> recommended that you use version/"
+"timestamp columns for optimistic locking with Hibernate. This strategy "
+"optimizes performance and correctly handles modifications made to detached "
+"instances (i.e. when <literal>Session.merge()</literal> is used)."
msgstr ""
-"<literal>default-access</literal> (オプション - デフォルトは "
-"<literal>property</literal> ): Hibernate がプロパティにアクセスする際に取る"
-"べき戦略。 <literal>PropertyAccessor</literal> を実装することでカスタマイズ可"
-"能。"
+"Hibernate で楽観的ロック戦略を使うなら、バージョン/タイムスタンプカラムを使う"
+"ことを <emphasis>非常に</emphasis> 強くお勧めします。楽観的ロックはパフォーマ"
+"ンスの観点からも最適であり、さらに分離インスタンスへの修正 (つまり "
+"<literal>Session.marge()</literal> が使われるとき) を正確に扱うことのできる"
+"唯一の戦略でもあります。"
#. Tag: para
+#: basic_mapping.xml:220
#, no-c-format
msgid ""
-"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
-"literal>): the default value for unspecified <literal>lazy</literal> "
-"attributes of class and collection mappings."
+"Be sure to import <classname>@javax.persistence.Entity</classname> to mark a "
+"class as an entity. It's a common mistake to import <classname>@org."
+"hibernate.annotations.Entity</classname> by accident."
msgstr ""
-"<literal>default-lazy</literal> (オプション - デフォルトは <literal>true</"
-"literal> ): <literal>lazy</literal> 属性が指定されていないクラスやコレクショ"
-"ンマッピングに対するデフォルト値。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:227
+#, fuzzy, no-c-format
msgid ""
-"<literal>auto-import</literal> (optional - defaults to <literal>true</"
-"literal>): specifies whether we can use unqualified class names of classes "
-"in this mapping in the query language."
+"Some entities are not mutable. They cannot be updated or deleted by the "
+"application. This allows Hibernate to make some minor performance "
+"optimizations.. Use the <classname>@Immutable</classname> annotation."
msgstr ""
-"<literal>auto-import</literal> (オプション - デフォルトは <literal>true</"
-"literal>):クエリ言語内で、(このマッピング内のクラスの)修飾されていないク"
-"ラス名を使えるかどうかを指定します。"
+"<literal>mutable=\"false\"</literal> 指定をした不変クラスは、アプリケーション"
+"による更新や削除が出来ないことがあります。これにより、 Hibernate がパフォーマ"
+"ンスを少し改善します。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:232
+#, fuzzy, no-c-format
msgid ""
-"<literal>package</literal> (optional): specifies a package prefix to use for "
-"unqualified class names in the mapping document."
+"You can also alter how Hibernate deals with lazy initialization for this "
+"class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false "
+"to disable lazy fetching (not recommended). You can also specify an "
+"interface to use for lazy initializing proxies (defaults to the class "
+"itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. "
+"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
+"the named interface. The persistent object will load when a method of the "
+"proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
-"<literal>package</literal> (オプション): マッピングドキュメント内で修飾されて"
-"いないクラス名に対して割り当てる、パッケージの接頭辞 (prefix) を指定します。"
+"オプションの <literal>proxy</literal> 属性により、クラスの永続インスタンスの"
+"遅延初期化が可能になります。 Hibernate は最初に、指定したインターフェースを実"
+"装した CGLIB プロキシを返します。実際の永続オブジェクトはプロキシのメソッドを"
+"呼び出すときにロードします。以下の「遅延初期化のためのプロキシ」を参照してく"
+"ださい。"
#. Tag: para
+#: basic_mapping.xml:243
#, no-c-format
msgid ""
-"If you have two persistent classes with the same unqualified name, you "
-"should set <literal>auto-import=\"false\"</literal>. An exception will "
-"result if you attempt to assign two classes to the same \"imported\" name."
+"<classname>@BatchSize</classname> specifies a \"batch size\" for fetching "
+"instances of this class by identifier. Not yet loaded instances are loaded "
+"batch-size at a time (default 1)."
msgstr ""
-"(修飾されていない)同じ名前の永続クラスが2つあるなら、 <literal>auto-import="
-"\"false\"</literal> を設定すべきです。2つのクラスに\"インポートされた\"同じ名"
-"前を割り当てようとすると、 Hibernate は例外を送出します。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:247
+#, fuzzy, no-c-format
msgid ""
-"The <literal>hibernate-mapping</literal> element allows you to nest several "
-"persistent <literal><class></literal> mappings, as shown above. It is, "
-"however, good practice (and expected by some tools) to map only a single "
-"persistent class, or a single class hierarchy, in one mapping file and name "
-"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
-"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
-"<literal>Animal.hbm.xml</literal>."
+"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
+"objects of this class. Use <classname>@Where</classname> for that."
msgstr ""
-"<literal>hibernate-mapping</literal> 要素は、最初の例で示したようにいくつかの"
-"永続 <literal><class></literal> マッピングをネストできます。しかし、1"
-"つのマッピングファイルではただひとつの永続クラス(またはひとつのクラス階層)に"
-"マッピングするようにし、さらに永続スーパークラスの後で指定するべきでしょう(い"
-"くつかのツールはこのようなマッピングファイルを想定しています)。例えば次のよう"
-"になります。: <literal>Cat.hbm.xml</literal> , <literal>Dog.hbm.xml</"
-"literal> , または継承を使うなら <literal>Animal.hbm.xml</literal> 。"
+"<literal>where</literal> (オプション): このクラスのオブジェクトを検索する"
+"ときに使用する、任意の SQL の <literal>WHERE</literal> 条件を指定します。"
-#. Tag: title
-#, no-c-format
-msgid "Class"
-msgstr "Class"
+#. Tag: para
+#: basic_mapping.xml:251
+#, fuzzy, no-c-format
+msgid ""
+"In the same vein, <classname>@Check</classname> lets you define an SQL "
+"expression used to generate a multi-row <emphasis>check</emphasis> "
+"constraint for automatic schema generation."
+msgstr ""
+"<literal>check</literal> (オプション):自動的にスキーマを生成するために、複"
+"数行の <emphasis>check</emphasis> 制約を生成する SQL 式。"
#. Tag: para
+#: basic_mapping.xml:255
+#, fuzzy, no-c-format
+msgid ""
+"There is no difference between a view and a base table for a Hibernate "
+"mapping. This is transparent at the database level, although some DBMS do "
+"not support views properly, especially with updates. Sometimes you want to "
+"use a view, but you cannot create one in the database (i.e. with a legacy "
+"schema). In this case, you can map an immutable and read-only entity to a "
+"given SQL subselect expression using <classname>@org.hibernate.annotations."
+"Subselect</classname>:"
+msgstr ""
+"Hibernate のマッピングにとってビューと普通のテーブルの間に違いはなく、データ"
+"ベースレベルでは透過的です(ただしビューを完全にはサポートしていない DBMS も"
+"あります。特に、更新のあるビューに対してはそうです)。ビューを使いたくても、"
+"データベースで作成できないことがあります(例えば、レガシースキーマの場合)。"
+"この場合には、不変かつ読み取り専用のエンティティに与えられた SQL の副問合せ文"
+"をマップできます:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:263
+#, fuzzy, no-c-format
+msgid ""
+"@Entity\n"
+"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+" + \"from item \"\n"
+" + \"join bid on bid.item_id = item.id \"\n"
+" + \"group by item.name\")\n"
+"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+"public class Summary {\n"
+" @Id\n"
+" public String getId() { return id; }\n"
+" ...\n"
+"}"
+msgstr ""
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
+
+#. Tag: para
+#: basic_mapping.xml:265
#, no-c-format
msgid ""
-"You can declare a persistent class using the <literal>class</literal> "
-"element. For example:"
+"Declare the tables to synchronize this entity with, ensuring that auto-flush "
+"happens correctly and that queries against the derived entity do not return "
+"stale data. The <literal><subselect></literal> is available both as an "
+"attribute and a nested mapping element."
+msgstr ""
+"テーブルをこのエンティティと同期するように定義してください。オートフラッシュ"
+"が確実に起こるように、また導出エンティティに対するクエリが古いデータを返さな"
+"いようにするためです。 <literal><subselect></literal> は属性とネストし"
+"たマッピング属性のどちらでも利用できます。"
+
+#. Tag: para
+#: basic_mapping.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"We will now explore the same options using the hbm.xml structure. You can "
+"declare a persistent class using the <literal>class</literal> element. For "
+"example:"
msgstr "<literal>class</literal> 要素を使って、永続クラスを宣言できます:"
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, fuzzy, no-c-format
+msgid ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:323
#, no-c-format
msgid ""
"<literal>name</literal> (optional): the fully qualified Java class name of "
@@ -299,6 +792,7 @@
"ティティに対するマッピングとして扱われます。"
#. Tag: para
+#: basic_mapping.xml:330
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to the unqualified class "
@@ -308,6 +802,7 @@
"名):データベーステーブルの名前。"
#. Tag: para
+#: basic_mapping.xml:335
#, no-c-format
msgid ""
"<literal>discriminator-value</literal> (optional - defaults to the class "
@@ -320,6 +815,7 @@
"<literal>null</literal> か <literal>not null</literal> のいずれかを取ります。"
#. Tag: para
+#: basic_mapping.xml:343
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -330,6 +826,7 @@
"定します。"
#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): overrides the schema name specified by "
@@ -339,6 +836,7 @@
"mapping></literal> 要素で指定したスキーマ名をオーバーライドします。"
#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
#, no-c-format
msgid ""
"<literal>catalog</literal> (optional): overrides the catalog name specified "
@@ -348,6 +846,7 @@
"mapping></literal> 要素で指定したカタログ名をオーバーライドします。"
#. Tag: para
+#: basic_mapping.xml:361
#, no-c-format
msgid ""
"<literal>proxy</literal> (optional): specifies an interface to use for lazy "
@@ -357,6 +856,7 @@
"フェースを指定します。永続化するクラス名そのものを指定することも可能です。"
#. Tag: para
+#: basic_mapping.xml:367
#, no-c-format
msgid ""
"<literal>dynamic-update</literal> (optional - defaults to <literal>false</"
@@ -368,6 +868,7 @@
"<literal>UPDATE</literal> 文を、実行時に生成することを指定します。"
#. Tag: para
+#: basic_mapping.xml:374
#, no-c-format
msgid ""
"<literal>dynamic-insert</literal> (optional - defaults to <literal>false</"
@@ -379,6 +880,7 @@
"literal> 文を、実行時に生成することを指定します。"
#. Tag: para
+#: basic_mapping.xml:381
#, no-c-format
msgid ""
"<literal>select-before-update</literal> (optional - defaults to "
@@ -399,10 +901,11 @@
"ます。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:393
+#, fuzzy, no-c-format
msgid ""
-"<literal>polymorphism</literal> (optional - defaults to <literal>implicit</"
-"literal>): determines whether implicit or explicit query polymorphism is "
+"<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</"
+"literal>): determines whether implicit or explicit query polymorphisms is "
"used."
msgstr ""
"<literal>polymorphism</literal> (オプション、デフォルトでは "
@@ -410,6 +913,7 @@
"クエリポリモーフィズムを使うか決定します。"
#. Tag: para
+#: basic_mapping.xml:399
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -420,6 +924,7 @@
"ときに使用する、任意の SQL の <literal>WHERE</literal> 条件を指定します。"
#. Tag: para
+#: basic_mapping.xml:405
#, no-c-format
msgid ""
"<literal>persister</literal> (optional): specifies a custom "
@@ -429,6 +934,7 @@
"<literal>ClassPersister</literal> を指定します。"
#. Tag: para
+#: basic_mapping.xml:410
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): "
@@ -440,6 +946,7 @@
"ズ」を指定します。"
#. Tag: para
+#: basic_mapping.xml:416
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>version</"
@@ -449,6 +956,7 @@
"<literal>version</literal> ): 楽観ロック戦略を決定します。"
#. Tag: para
+#: basic_mapping.xml:422
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional): lazy fetching can be disabled by setting "
@@ -458,14 +966,15 @@
"設定することで、遅延フェッチができなくなります。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:427
+#, fuzzy, no-c-format
msgid ""
"<literal>entity-name</literal> (optional - defaults to the class name): "
"Hibernate3 allows a class to be mapped multiple times, potentially to "
"different tables. It also allows entity mappings that are represented by "
"Maps or XML at the Java level. In these cases, you should provide an "
"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
-"classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
+"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
"<literal>entity-name</literal> (オプション、デフォルトはクラス名): "
"Hibernate3 ではクラスが複数回マッピングでき(場合によっては違うテーブルに対し"
@@ -475,6 +984,7 @@
"<xref linkend=\"xml\"/> を参照してください。"
#. Tag: para
+#: basic_mapping.xml:437
#, no-c-format
msgid ""
"<literal>check</literal> (optional): an SQL expression used to generate a "
@@ -485,6 +995,7 @@
"数行の <emphasis>check</emphasis> 制約を生成する SQL 式。"
#. Tag: para
+#: basic_mapping.xml:443
#, no-c-format
msgid ""
"<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. "
@@ -501,6 +1012,7 @@
"的な位置を表しています。"
#. Tag: para
+#: basic_mapping.xml:452
#, fuzzy, no-c-format
msgid ""
"<literal>subselect</literal> (optional): maps an immutable and read-only "
@@ -513,6 +1025,7 @@
"せん。より詳しい情報は下記を参照してください。"
#. Tag: para
+#: basic_mapping.xml:459
#, no-c-format
msgid ""
"<literal>abstract</literal> (optional): is used to mark abstract "
@@ -522,6 +1035,7 @@
"</literal> 階層内の抽象スーパークラスにマークするために使います。"
#. Tag: para
+#: basic_mapping.xml:466
#, no-c-format
msgid ""
"It is acceptable for the named persistent class to be an interface. You can "
@@ -537,303 +1051,1264 @@
"literal> を使ってクラス名を指定してください。"
#. Tag: para
+#: basic_mapping.xml:472
#, no-c-format
+msgid "Here is how to do a virtual view (subselect) in XML:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:474
+#, fuzzy, no-c-format
msgid ""
-"Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated "
-"or deleted by the application. This allows Hibernate to make some minor "
-"performance optimizations."
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"<literal>mutable=\"false\"</literal> 指定をした不変クラスは、アプリケーション"
-"による更新や削除が出来ないことがあります。これにより、 Hibernate がパフォーマ"
-"ンスを少し改善します。"
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
#. Tag: para
+#: basic_mapping.xml:476
#, no-c-format
msgid ""
-"The optional <literal>proxy</literal> attribute enables lazy initialization "
-"of persistent instances of the class. Hibernate will initially return CGLIB "
-"proxies that implement the named interface. The persistent object will load "
-"when a method of the proxy is invoked. See \"Initializing collections and "
-"proxies\" below."
+"The <literal><subselect></literal> is available both as an attribute "
+"and a nested mapping element."
msgstr ""
-"オプションの <literal>proxy</literal> 属性により、クラスの永続インスタンスの"
-"遅延初期化が可能になります。 Hibernate は最初に、指定したインターフェースを実"
-"装した CGLIB プロキシを返します。実際の永続オブジェクトはプロキシのメソッドを"
-"呼び出すときにロードします。以下の「遅延初期化のためのプロキシ」を参照してく"
-"ださい。"
+#. Tag: title
+#: basic_mapping.xml:481
+#, fuzzy, no-c-format
+msgid "Identifiers"
+msgstr "識別子の割り当て"
+
#. Tag: para
+#: basic_mapping.xml:483
+#, fuzzy, no-c-format
+msgid ""
+"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
+"the database table. Most classes will also have a JavaBeans-style property "
+"holding the unique identifier of an instance."
+msgstr ""
+"マップされたクラスはデータベーステーブルの主キーカラムを定義 <emphasis>しなけ"
+"ればなりません</emphasis> 。ほとんどのクラスにはインスタンスのユニークな識別"
+"子を保持する JavaBeans スタイルのプロパティも持っています。 <literal><"
+"id></literal> 要素は、そのプロパティから主キーカラムへのマッピングを定義し"
+"ます。"
+
+#. Tag: para
+#: basic_mapping.xml:488
#, no-c-format
+msgid "Mark the identifier property with <classname>@Id</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
msgid ""
-"<emphasis>Implicit</emphasis> polymorphism means that instances of the class "
-"will be returned by a query that names any superclass or implemented "
-"interface or class, and that instances of any subclass of the class will be "
-"returned by a query that names the class itself. <emphasis>Explicit</"
-"emphasis> polymorphism means that class instances will be returned only by "
-"queries that explicitly name that class. Queries that name the class will "
-"return only instances of subclasses mapped inside this <literal><class>"
-"</literal> declaration as a <literal><subclass></literal> or "
-"<literal><joined-subclass></literal>. For most purposes, the default "
-"<literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit "
-"polymorphism is useful when two different classes are mapped to the same "
-"table This allows a \"lightweight\" class that contains a subset of the "
-"table columns."
+"@Entity\n"
+"public class Person {\n"
+" @Id Integer getId() { ... }\n"
+" ...\n"
+"}"
msgstr ""
-" <emphasis>暗黙的</emphasis> ポリモーフィズムとは、次の二つを意味しています。"
-"一つはクラスのインスタンスが、スーパークラスや実装したインターフェース、また"
-"そのクラスを指定するクエリによって返されることで、もう一つはそのクラスのサブ"
-"クラスのインスタンスが、そのクラス自身を指定したクエリによって返されることで"
-"す。また、 <emphasis>明示的</emphasis> ポリモーフィズムとは、次の二つを意味し"
-"ています。一つはクラスのインスタンスが、そのクラスを明示的に指定したクエリに"
-"よってのみ返されることで、もう一つはクラスを指定したクエリが、 <literal><"
-"class></literal> 要素の中で <literal><subclass></literal> や "
-"<literal><joined-subclass></literal> とマッピングされているサブクラスの"
-"インスタンスだけを返すことです。ほとんどの用途ではデフォルトの "
-"<literal>polymorphism=\"implicit\"</literal> が適切です。明示的なポリモーフィ"
-"ズムは、2つの違ったクラスが同じテーブルにマッピングされているときに有用です "
-"(これによってテーブルカラムのサブセットを含む、「軽量な」クラスが可能になり"
-"ます)。"
#. Tag: para
+#: basic_mapping.xml:493
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><id></literal> element which defines the "
+"mapping from that property to the primary key column."
+msgstr ""
+"<literal><column></literal> タグで、プロパティを複数のカラムへマッピン"
+"グできることに注目してください。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:509
+#, fuzzy, no-c-format
+msgid ""
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
+msgstr ""
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
+
+#. Tag: para
+#: basic_mapping.xml:513
#, no-c-format
msgid ""
-"The <literal>persister</literal> attribute lets you customize the "
-"persistence strategy used for the class. You can, for example, specify your "
-"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
-"or you can even provide a completely new implementation of the interface "
-"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
-"for example, persistence via stored procedure calls, serialization to flat "
-"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
-"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+"<literal>name</literal> (optional): the name of the identifier property."
+msgstr "<literal>name</literal>(オプション):識別子プロパティの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
+#, no-c-format
+msgid ""
+"<literal>type</literal> (optional): a name that indicates the Hibernate type."
+msgstr "<literal>type</literal>(オプション): Hibernate の型を示す名前。"
+
+#. Tag: para
+#: basic_mapping.xml:523
+#, no-c-format
+msgid ""
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the primary key column."
msgstr ""
-"<literal>persister</literal> 属性を指定することで、クラスの永続化戦略をカスタ"
-"マイズできます。例えば <literal>org.hibernate.persister.EntityPersister</"
-"literal> 自身のサブクラスを指定したり、また例えばストアドプロシージャコール、"
-"フラットファイルへシリアライズ、 LDAP などを通した永続性を実装する "
-"<literal>org.hibernate.persister.ClassPersister</literal> インターフェースの"
-"完全に新しい実装を提供できます。簡単な例として <literal>org.hibernate.test."
-"CustomPersister</literal> を参照してください(これは <literal>Hashtable</"
-"literal> の「永続化」です)。"
+"<literal>column</literal>(オプション - デフォルトはプロパティ名): 主キーカ"
+"ラムの名前。"
#. Tag: para
+#: basic_mapping.xml:528
#, no-c-format
msgid ""
-"The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> "
-"settings are not inherited by subclasses, so they can also be specified on "
-"the <literal><subclass></literal> or <literal><joined-subclass></"
-"literal> elements. Although these settings can increase performance in some "
-"cases, they can actually decrease performance in others."
+"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
+"value): an identifier property value that indicates an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session."
msgstr ""
-"<literal>dynamic-update</literal> と <literal>dynamic-insert</literal> の設定"
-"はサブクラスに継承されません。そのため <literal><subclass></literal> "
-"や <literal><joined-subclass></literal> 要素を指定することも出来ます。"
-"これらの設定はパフォーマンスを向上させる事もありますが、落とすこともあります"
-"ので、慎重に使用してください。"
+"<literal>unsaved-value</literal>(オプション - デフォルトの値は "
+"sensible ): インスタンスが新しくインスタンス化された (セーブされていない)"
+"ことを示す、識別子プロパティの値。以前の Session でセーブまたはロードされた分"
+"離インスタンスと区別するために使います。"
#. Tag: para
+#: basic_mapping.xml:536
#, no-c-format
msgid ""
-"Use of <literal>select-before-update</literal> will usually decrease "
-"performance. It is useful to prevent a database update trigger being called "
-"unnecessarily if you reattach a graph of detached instances to a "
-"<literal>Session</literal>."
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing the property "
+"value."
msgstr ""
-"<literal>select-before-update</literal> の使用は通常パフォーマンスを落としま"
-"す。もし <literal>Session</literal> へ分離インスタンスのグラフを再追加するな"
-"ら、データベース更新のトリガを不必要に呼び出すのを避けるという点で、非常に有"
-"用です。"
+"<literal>access</literal> (オプション - デフォルトは <literal>property</"
+"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
msgid ""
-"If you enable <literal>dynamic-update</literal>, you will have a choice of "
-"optimistic locking strategies:"
+"If the <literal>name</literal> attribute is missing, it is assumed that the "
+"class has no identifier property."
msgstr ""
-"<literal>dynamic-update</literal> を有効にすれば、楽観ロック戦略を選ぶことに"
-"なります:"
+"<literal>name</literal> 属性がなければ、クラスには識別子プロパティがないもの"
+"とみなされます。"
#. Tag: para
+#: basic_mapping.xml:546
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>unsaved-value</literal> attribute is almost never needed in "
+"Hibernate3 and indeed has no corresponding element in annotations."
+msgstr ""
+"<literal>unsaved-value</literal> 属性は Hibernate3 ではほとんどの場合、必要で"
+"はありません。"
+
+#. Tag: para
+#: basic_mapping.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"You can also declare the identifier as a composite identifier. This allows "
+"access to legacy data with composite keys. Its use is strongly discouraged "
+"for anything else."
+msgstr ""
+"複合キーを持つレガシーデータにアクセスできるように、 <literal><composite-"
+"id></literal> という代替のマッピング定義があります。しかし他の用途への使用"
+"は全くおすすめできません。"
+
+#. Tag: title
+#: basic_mapping.xml:555
+#, fuzzy, no-c-format
+msgid "Composite identifier"
+msgstr "識別子の割り当て"
+
+#. Tag: para
+#: basic_mapping.xml:557
#, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
+msgid "You can define a composite primary key through several syntaxes:"
msgstr ""
-"<literal>version</literal> バージョン/タイムスタンプカラムをチェックします。"
#. Tag: para
+#: basic_mapping.xml:562
#, no-c-format
-msgid "<literal>all</literal>: check all columns"
-msgstr "<literal>all</literal> すべてのカラムをチェックします。"
+msgid ""
+"use a component type to represent the identifier and map it as a property in "
+"the entity: you then annotated the property as <classname>@EmbeddedId</"
+"classname>. The component type has to be <classname>Serializable</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:569
#, no-c-format
msgid ""
-"<literal>dirty</literal>: check the changed columns, allowing some "
-"concurrent updates"
+"map multiple properties as <classname>@Id</classname> properties: the "
+"identifier type is then the entity class itself and needs to be "
+"<classname>Serializable</classname>. This approach is unfortunately not "
+"standard and only supported by Hibernate."
msgstr ""
-"<literal>dirty</literal> 変更したカラムをチェックし、同時更新できるようにしま"
-"す。"
#. Tag: para
+#: basic_mapping.xml:577
#, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
-msgstr "<literal>none</literal> 楽観ロックを使用しません。"
+msgid ""
+"map multiple properties as <classname>@Id</classname> properties and declare "
+"an external class to be the identifier type. This class, which needs to be "
+"<classname>Serializable</classname>, is declared on the entity via the "
+"<classname>@IdClass</classname> annotation. The identifier type must contain "
+"the same properties as the identifier properties of the entity: each "
+"property name must be the same, its type must be the same as well if the "
+"entity property is of a basic type, its type must be the type of the primary "
+"key of the associated entity if the entity property is an association "
+"(either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</"
+"classname>)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:592
#, no-c-format
msgid ""
-"It is <emphasis>strongly</emphasis> recommended that you use version/"
-"timestamp columns for optimistic locking with Hibernate. This strategy "
-"optimizes performance and correctly handles modifications made to detached "
-"instances (i.e. when <literal>Session.merge()</literal> is used)."
+"As you can see the last case is far from obvious. It has been inherited from "
+"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
+"to use it (for simplicity sake)."
msgstr ""
-"Hibernate で楽観的ロック戦略を使うなら、バージョン/タイムスタンプカラムを使う"
-"ことを <emphasis>非常に</emphasis> 強くお勧めします。楽観的ロックはパフォーマ"
-"ンスの観点からも最適であり、さらに分離インスタンスへの修正 (つまり "
-"<literal>Session.marge()</literal> が使われるとき) を正確に扱うことのできる"
-"唯一の戦略でもあります。"
#. Tag: para
+#: basic_mapping.xml:596
#, no-c-format
+msgid "Let's explore all three cases using examples."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:599
+#, no-c-format
+msgid "id as a property using a component type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:601
+#, no-c-format
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
msgid ""
-"There is no difference between a view and a base table for a Hibernate "
-"mapping. This is transparent at the database level, although some DBMS do "
-"not support views properly, especially with updates. Sometimes you want to "
-"use a view, but you cannot create one in the database (i.e. with a legacy "
-"schema). In this case, you can map an immutable and read-only entity to a "
-"given SQL subselect expression:"
+"@Entity\n"
+"class User {\n"
+" @EmbeddedId\n"
+" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
+"\")\n"
+" UserId id;\n"
+"\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
msgstr ""
-"Hibernate のマッピングにとってビューと普通のテーブルの間に違いはなく、データ"
-"ベースレベルでは透過的です(ただしビューを完全にはサポートしていない DBMS も"
-"あります。特に、更新のあるビューに対してはそうです)。ビューを使いたくても、"
-"データベースで作成できないことがあります(例えば、レガシースキーマの場合)。"
-"この場合には、不変かつ読み取り専用のエンティティに与えられた SQL の副問合せ文"
-"をマップできます:"
#. Tag: para
+#: basic_mapping.xml:606
#, no-c-format
msgid ""
-"Declare the tables to synchronize this entity with, ensuring that auto-flush "
-"happens correctly and that queries against the derived entity do not return "
-"stale data. The <literal><subselect></literal> is available both as an "
-"attribute and a nested mapping element."
+"You can notice that the <classname>UserId</classname> class is serializable. "
+"To override the column mapping, use <classname>@AttributeOverride</"
+"classname>."
msgstr ""
-"テーブルをこのエンティティと同期するように定義してください。オートフラッシュ"
-"が確実に起こるように、また導出エンティティに対するクエリが古いデータを返さな"
-"いようにするためです。 <literal><subselect></literal> は属性とネストし"
-"たマッピング属性のどちらでも利用できます。"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:610
+#, no-c-format
+msgid ""
+"An embedded id can itself contains the primary key of an associated entity."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"\n"
+" @MapsId(\"userId\")\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" @OneToOne User user;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" UserId userId;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:615
+#, no-c-format
+msgid ""
+"In the embedded id object, the association is represented as the identifier "
+"of the associated entity. But you can link its value to a regular "
+"association in the entity via the <classname>@MapsId</classname> annotation. "
+"The <classname>@MapsId</classname> value correspond to the property name of "
+"the embedded id object containing the associated entity's identifier. In the "
+"database, it means that the <literal>Customer.user</literal> and the "
+"<literal>CustomerId.userId</literal> properties share the same underlying "
+"column (<literal>user_fk</literal> in this case)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:627
+#, no-c-format
+msgid ""
+"The component type used as identifier must implement <methodname>equals()</"
+"methodname> and <methodname>hashCode()</methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:632
+#, no-c-format
+msgid ""
+"In practice, your code only sets the <literal>Customer.user</literal> "
+"property and the user id value is copied by Hibernate into the "
+"<literal>CustomerId.userId</literal> property."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:638
+#, no-c-format
+msgid ""
+"The id value can be copied as late as flush time, don't rely on it until "
+"after flush time."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:642
+#, no-c-format
+msgid ""
+"While not supported in JPA, Hibernate lets you place your association "
+"directly in the embedded id component (instead of having to use the "
+"<classname>@MapsId</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:648
+#, no-c-format
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:651
#, fuzzy, no-c-format
-msgid "id"
-msgstr "uuid"
+msgid ""
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" node=\"element-name|.\">\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
+msgstr ""
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|.\"\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
#. Tag: para
+#: basic_mapping.xml:653
#, no-c-format
+msgid "First a simple example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
msgid ""
-"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
-"the database table. Most classes will also have a JavaBeans-style property "
-"holding the unique identifier of an instance. The <literal><id></"
-"literal> element defines the mapping from that property to the primary key "
-"column."
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"</class>"
msgstr ""
-"マップされたクラスはデータベーステーブルの主キーカラムを定義 <emphasis>しなけ"
-"ればなりません</emphasis> 。ほとんどのクラスにはインスタンスのユニークな識別"
-"子を保持する JavaBeans スタイルのプロパティも持っています。 <literal><"
-"id></literal> 要素は、そのプロパティから主キーカラムへのマッピングを定義し"
-"ます。"
#. Tag: para
+#: basic_mapping.xml:657
#, no-c-format
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
msgid ""
-"<literal>name</literal> (optional): the name of the identifier property."
-msgstr "<literal>name</literal>(オプション):識別子プロパティの名前。"
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"\n"
+" <many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" </many-to-one>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:662
#, no-c-format
+msgid "Notice a few things in the previous example:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:666
+#, no-c-format
msgid ""
-"<literal>type</literal> (optional): a name that indicates the Hibernate type."
-msgstr "<literal>type</literal>(オプション): Hibernate の型を示す名前。"
+"the order of the properties (and column) matters. It must be the same "
+"between the association and the primary key of the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:672
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to the property name): the "
-"name of the primary key column."
+"the many to one uses the same columns as the primary key and thus must be "
+"marked as read only (<literal>insertable</literal> and <literal>updatable</"
+"literal> to false)."
msgstr ""
-"<literal>column</literal>(オプション - デフォルトはプロパティ名): 主キーカ"
-"ラムの名前。"
#. Tag: para
+#: basic_mapping.xml:679
#, no-c-format
msgid ""
-"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
-"value): an identifier property value that indicates an instance is newly "
-"instantiated (unsaved), distinguishing it from detached instances that were "
-"saved or loaded in a previous session."
+"unlike with <classname>@MapsId</classname>, the id value of the associated "
+"entity is not transparently copied, check the <literal>foreign</literal> id "
+"generator for more information."
msgstr ""
-"<literal>unsaved-value</literal>(オプション - デフォルトの値は "
-"sensible ): インスタンスが新しくインスタンス化された (セーブされていない)"
-"ことを示す、識別子プロパティの値。以前の Session でセーブまたはロードされた分"
-"離インスタンスと区別するために使います。"
#. Tag: para
+#: basic_mapping.xml:686
#, no-c-format
msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing the property "
-"value."
+"The last example shows how to map association directly in the embedded id "
+"component."
msgstr ""
-"<literal>access</literal> (オプション - デフォルトは <literal>property</"
-"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:691
#, no-c-format
msgid ""
-"If the <literal>name</literal> attribute is missing, it is assumed that the "
-"class has no identifier property."
+"This is the recommended approach to map composite identifier. The following "
+"options should not be considered unless some constraint are present."
msgstr ""
-"<literal>name</literal> 属性がなければ、クラスには識別子プロパティがないもの"
-"とみなされます。"
+#. Tag: title
+#: basic_mapping.xml:697
+#, no-c-format
+msgid "Multiple id properties without identifier type"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:699
#, no-c-format
msgid ""
-"The <literal>unsaved-value</literal> attribute is almost never needed in "
-"Hibernate3."
+"Another, arguably more natural, approach is to place <classname>@Id</"
+"classname> on multiple properties of your entity. This approach is only "
+"supported by Hibernate (not JPA compliant) but does not require an extra "
+"embeddable component."
msgstr ""
-"<literal>unsaved-value</literal> 属性は Hibernate3 ではほとんどの場合、必要で"
-"はありません。"
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:706
#, no-c-format
msgid ""
-"There is an alternative <literal><composite-id></literal> declaration "
-"that allows access to legacy data with composite keys. Its use is strongly "
-"discouraged for anything else."
+"In this case <classname>Customer</classname> is its own identifier "
+"representation: it must implement <classname>Serializable</classname> and "
+"must implement <methodname>equals()</methodname> and <methodname>hashCode()</"
+"methodname>."
msgstr ""
-"複合キーを持つレガシーデータにアクセスできるように、 <literal><composite-"
-"id></literal> という代替のマッピング定義があります。しかし他の用途への使用"
-"は全くおすすめできません。"
+#. Tag: para
+#: basic_mapping.xml:712
+#, no-c-format
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id>\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:718
#, no-c-format
-msgid "Generator"
-msgstr "ジェネレータ"
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:721
#, no-c-format
msgid ""
-"The optional <literal><generator></literal> child element names a Java "
-"class used to generate unique identifiers for instances of the persistent "
-"class. If any parameters are required to configure or initialize the "
-"generator instance, they are passed using the <literal><param></"
-"literal> element."
+"<classname>@IdClass</classname> on an entity points to the class (component) "
+"representing the identifier of the class. The properties marked "
+"<classname>@Id</classname> on the entity must have their corresponding "
+"property on the <classname>@IdClass</classname>. The return type of search "
+"twin property must be either identical for basic properties or must "
+"correspond to the identifier class of the associated entity for an "
+"association."
msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:730
+#, no-c-format
+msgid ""
+"This approach is inherited from the EJB 2 days and we recommend against its "
+"use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" UserId user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:737
+#, no-c-format
+msgid ""
+"<classname>Customer</classname> and <classname>CustomerId</classname> do "
+"have the same properties <literal>customerNumber</literal> as well as "
+"<literal>user</literal>. <classname>CustomerId</classname> must be "
+"<classname>Serializable</classname> and implement <classname>equals()</"
+"classname> and <classname>hashCode()</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:745
+#, no-c-format
+msgid ""
+"While not JPA standard, Hibernate let's you declare the vanilla associated "
+"property in the <classname>@IdClass</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:751
+#, no-c-format
+msgid ""
+"This feature is of limited interest though as you are likely to have chosen "
+"the <classname>@IdClass</classname> approach to stay JPA compliant or you "
+"have a quite twisted mind."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:762
+#, fuzzy, no-c-format
+msgid "Identifier generator"
+msgstr "識別子の getter メソッド"
+
+#. Tag: para
+#: basic_mapping.xml:764
+#, no-c-format
+msgid ""
+"Hibernate can generate and populate identifier values for you automatically. "
+"This is the recommended approach over \"business\" or \"natural\" id "
+"(especially composite ids)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:768
+#, no-c-format
+msgid ""
+"Hibernate offers various generation strategies, let's explore the most "
+"common ones first that happens to be standardized by JPA:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:774
+#, fuzzy, no-c-format
+msgid ""
+"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
+msgstr ""
+"DB2, MySQL, MS SQL Server, Sybase, HypersonicSQL の識別子カラムをサポートしま"
+"す。返される識別子の型は <literal>long</literal> , <literal>short</"
+"literal> , <literal>int</literal> のいずれかです。"
+
+#. Tag: para
+#: basic_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo "
+"algorithm to efficiently generate identifiers of type <literal>long</"
+"literal>, <literal>short</literal> or <literal>int</literal>, given a named "
+"database sequence."
+msgstr ""
+"<literal>long</literal> , <literal>short</literal> , <literal>int</literal> "
+"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。指定されたデータ"
+"ベースシーケンスを与えます。"
+
+#. Tag: para
+#: basic_mapping.xml:788
+#, fuzzy, no-c-format
+msgid ""
+"TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in "
+"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
+"type <literal>long</literal>, <literal>short</literal> or <literal>int</"
+"literal>, given a table and column as a source of hi values. The hi/lo "
+"algorithm generates identifiers that are unique only for a particular "
+"database."
+msgstr ""
+"<literal>long</literal> , <literal>short</literal> , <literal>int</literal> "
+"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。 hi 値のソースとし"
+"て、テーブルとカラムを与えます(デフォルトではそれぞれ "
+"<literal>hibernate_unique_key</literal> と <literal>next_hi</literal> )。 hi/"
+"lo アルゴリズムは特定のデータベースに対してのみユニークな識別子を生成します。"
+
+#. Tag: para
+#: basic_mapping.xml:798
+#, fuzzy, no-c-format
+msgid ""
+"AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or "
+"<literal>TABLE</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"使用するデータベースの性能により <literal>identity</literal> 、 "
+"<literal>sequence</literal> 、 <literal>hilo</literal> のいずれかが選ばれま"
+"す。"
+
+#. Tag: para
+#: basic_mapping.xml:805
+#, no-c-format
+msgid ""
+"We recommend all new projects to use the new enhanced identifier generators. "
+"They are deactivated by default for entities using annotations but can be "
+"activated using <code>hibernate.id.new_generator_mappings=true</code>. These "
+"new generators are more efficient and closer to the JPA 2 specification "
+"semantic."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:812
+#, no-c-format
+msgid ""
+"However they are not backward compatible with existing Hibernate based "
+"application (if a sequence or a table is used for id generation). See "
+"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
+"to activate them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:818
+#, no-c-format
+msgid ""
+"To mark an id property as generated, use the <classname>@GeneratedValue</"
+"classname> annotation. You can specify the strategy used (default to "
+"<literal>AUTO</literal>) by setting <literal>strategy</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue\n"
+" Integer getId() { ... };\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Invoice {\n"
+" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+" Integer getId() { ... };\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid ""
+"<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional "
+"configurations that you can set using <classname>@SequenceGenerator</"
+"classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
+#, fuzzy, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr "<literal>name</literal>:プロパティ名。"
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> / <literal>sequenceName</literal>: name of the "
+"table or the sequence (defaulting respectively to "
+"<literal>hibernate_sequences</literal> and <literal>hibernate_sequence</"
+"literal>)"
+msgstr ""
+"<literal>column</literal>(オプション - デフォルトは <literal>class</"
+"literal> ): 識別カラムの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:843
+#, fuzzy, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr "<literal>sequence-identity</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, fuzzy, no-c-format
+msgid ""
+"<literal>initialValue</literal>: the value from which the id is to start "
+"generating"
+msgstr "<literal>table</literal> :結合したテーブルの名前"
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid ""
+"<literal>allocationSize</literal>: the amount to increment by when "
+"allocating id numbers from the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid ""
+"In addition, the <classname>TABLE</classname> strategy also let you "
+"customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
+#, fuzzy, no-c-format
+msgid ""
+"<literal>pkColumnName</literal>: the column name containing the entity "
+"identifier"
+msgstr "<literal>name</literal>:プロパティ名。"
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, fuzzy, no-c-format
+msgid ""
+"<literal>valueColumnName</literal>: the column name containing the "
+"identifier value"
+msgstr "<literal>name</literal>(オプション):識別子プロパティの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:873
+#, fuzzy, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr "<literal>id-type</literal>: 識別子の型。"
+
+#. Tag: para
+#: basic_mapping.xml:878
+#, no-c-format
+msgid ""
+"<literal>uniqueConstraints</literal>: any potential column constraint on the "
+"table containing the ids"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:883
+#, no-c-format
+msgid ""
+"To link a table or sequence generator definition with an actual generated "
+"property, use the same name in both the definition <literal>name</literal> "
+"and the generator value <literal>generator</literal> as shown below."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+"@Id \n"
+"@GeneratedValue(\n"
+" strategy=GenerationType.SEQUENCE, \n"
+" generator=\"SEQ_GEN\")\n"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:890
+#, no-c-format
+msgid ""
+"The scope of a generator definition 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 in "
+"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
+"\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+"@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"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:898
+#, no-c-format
+msgid ""
+"If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used "
+"to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</"
+"literal> are application level generators."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:904
+#, no-c-format
+msgid ""
+"Package level definition is not supported by the JPA specification. However, "
+"you can use the <literal>@GenericGenerator</literal> at the package level "
+"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:910
+#, no-c-format
+msgid ""
+"These are the four standard JPA generators. Hibernate goes beyond that and "
+"provide additional generators or additional options as we will see below. "
+"You can also write your own custom identifier generator by implementing "
+"<classname>org.hibernate.id.IdentifierGenerator</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:916
+#, no-c-format
+msgid ""
+"To define a custom generator, use the <classname>@GenericGenerator</"
+"classname> annotation (and its plural counter part "
+"<classname>@GenericGenerators</classname>) that describes the class of the "
+"identifier generator or its short cut name (as described below) and a list "
+"of key/value parameters. When using <classname>@GenericGenerator</classname> "
+"and assigning it via <classname>@GeneratedValue.generator</classname>, the "
+"<classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+"@GenericGenerator(\n"
+" name=\"trigger-generated\", \n"
+" strategy = \"select\",\n"
+" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+")\n"
+"public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, fuzzy, no-c-format
+msgid ""
+"The hbm.xml approach uses the optional <literal><generator></literal> "
+"child element inside <literal><id></literal>. If any parameters are "
+"required to configure or initialize the generator instance, they are passed "
+"using the <literal><param></literal> element."
+msgstr ""
"オプションの <literal><generator></literal> 子要素は、永続クラスのイン"
"スタンスのユニークな識別子を生成するために使う、 Java クラスを指定します。"
"ジェネレータインスタンスの設定、もしくは初期化にパラメータが必要であれば、 "
"<literal><param></literal> 要素を使って渡すことができます。"
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+
+#. Tag: title
+#: basic_mapping.xml:937
+#, no-c-format
+msgid "Various additional generators"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:939
#, no-c-format
msgid ""
"All generators implement the interface <literal>org.hibernate.id."
@@ -848,12 +2323,14 @@
"Hibernate は組み込みの実装をいくつも用意しています。組み込みのジェネレータに"
"は以下のショートカット名があります:"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>increment</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:946
+#, no-c-format
+msgid "increment"
+msgstr "increment"
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
msgid ""
"generates identifiers of type <literal>long</literal>, <literal>short</"
@@ -866,12 +2343,14 @@
"いときだけユニークです。 <emphasis>クラスタ内では使わないでください</"
"emphasis> 。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>identity</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:958
+#, no-c-format
+msgid "identity"
+msgstr "identity"
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
msgid ""
"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
@@ -882,12 +2361,14 @@
"す。返される識別子の型は <literal>long</literal> , <literal>short</"
"literal> , <literal>int</literal> のいずれかです。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>sequence</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:969
+#, no-c-format
+msgid "sequence"
+msgstr "sequence"
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
msgid ""
"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
@@ -898,12 +2379,14 @@
"レータを使用します。返される識別子の型は <literal>long</literal> , "
"<literal>short</literal> , <literal>int</literal> のいずれかです。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>hilo</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:980
+#, no-c-format
+msgid "hilo"
+msgstr "hilo"
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -919,12 +2402,14 @@
"<literal>hibernate_unique_key</literal> と <literal>next_hi</literal> )。 hi/"
"lo アルゴリズムは特定のデータベースに対してのみユニークな識別子を生成します。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>seqhilo</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:996
+#, no-c-format
+msgid "seqhilo"
+msgstr "seqhilo"
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -935,39 +2420,122 @@
"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。指定されたデータ"
"ベースシーケンスを与えます。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
#, fuzzy, no-c-format
-msgid "<literal>uuid</literal>"
-msgstr "<literal>sequence-identity</literal>"
+msgid "uuid"
+msgstr "guid"
#. Tag: para
+#: basic_mapping.xml:1010
#, no-c-format
msgid ""
-"uses a 128-bit UUID algorithm to generate identifiers of type string that "
-"are unique within a network (the IP address is used). The UUID is encoded as "
-"a string of 32 hexadecimal digits in length."
+"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
+"represented as a string of 32 hexidecimal digits. Users can also configure "
+"it to use a separator (config parameter \"separator\") which separates the "
+"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
+"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
+"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
+"discussed below."
msgstr ""
-"( IP アドレスが使用される)ネットワーク内でユニークな文字列型の識別子を生成す"
-"るために、 128 ビットの UUID アルゴリズムを使用します。 UUID は長さ 32 の 16 "
-"進数字の文字列としてエンコードされます。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1023
#, fuzzy, no-c-format
-msgid "<literal>guid</literal>"
-msgstr "<literal>sequence-identity</literal>"
+msgid "uuid2"
+msgstr "guid"
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
+msgid ""
+"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
+"\"version\" (the RFC term) generated depends on the pluggable \"generation "
+"strategy\" used (see below). Capable of generating values as <classname>java."
+"util.UUID</classname>, <classname>java.lang.String</classname> or as a byte "
+"array of length 16 (<literal>byte[16]</literal>). The \"generation strategy"
+"\" is defined by the interface <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
+"configuration parameters for defining which generation strategy to use:"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1038
+#, no-c-format
+msgid "uuid_gen_strategy_class"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1041
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1047
+#, no-c-format
+msgid "uuid_gen_strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1050
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the "
+"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
+"<methodname>randomUUID</methodname> method of <classname>java.util.UUID</"
+"classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - "
+"generates \"version 1\" UUID values, using IP address since mac address not "
+"available. If you need mac address to be used, consider leveraging one of "
+"the existing third party UUID generators which sniff out mac address and "
+"integrating it via the <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
+"time of this writing include <ulink url=\"http://johannburkard.de/software/"
+"uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url="
+"\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/"
+"sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, no-c-format
+msgid "guid"
+msgstr "guid"
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
msgstr ""
"MS SQL サーバーと MySQL でデータベースが生成する GUID 文字列を使用します。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>native</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1094
+#, no-c-format
+msgid "native"
+msgstr "native"
#. Tag: para
+#: basic_mapping.xml:1097
#, no-c-format
msgid ""
"selects <literal>identity</literal>, <literal>sequence</literal> or "
@@ -978,12 +2546,14 @@
"<literal>sequence</literal> 、 <literal>hilo</literal> のいずれかが選ばれま"
"す。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>assigned</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1105
+#, no-c-format
+msgid "assigned"
+msgstr "assigned"
#. Tag: para
+#: basic_mapping.xml:1108
#, no-c-format
msgid ""
"lets the application assign an identifier to the object before <literal>save"
@@ -994,12 +2564,14 @@
"別子を代入できるようにします。 <literal><generator></literal> 要素が指"
"定されていなければ、これがデフォルトの戦略になります。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>select</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1117
+#, no-c-format
+msgid "select"
+msgstr "select"
#. Tag: para
+#: basic_mapping.xml:1120
#, no-c-format
msgid ""
"retrieves a primary key, assigned by a database trigger, by selecting the "
@@ -1008,12 +2580,14 @@
"あるユニークキーによる行の選択と主キーの値の復元により、データベーストリガが"
"割り当てた主キーを取得します。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>foreign</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1127
+#, no-c-format
+msgid "foreign"
+msgstr "foreign"
#. Tag: para
+#: basic_mapping.xml:1130
#, no-c-format
msgid ""
"uses the identifier of another associated object. It is usually used in "
@@ -1023,12 +2597,14 @@
"他の関連オブジェクトの識別子を使います。普通は、 <literal><one-to-one>"
"</literal> 主キー関連と組み合わせて使います。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1138
+#, fuzzy, no-c-format
+msgid "sequence-identity"
msgstr "<literal>sequence-identity</literal>"
#. Tag: para
+#: basic_mapping.xml:1141
#, no-c-format
msgid ""
"a specialized sequence generation strategy that utilizes a database sequence "
@@ -1046,11 +2622,13 @@
"さい。"
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "Hi/lo アルゴリズム"
#. Tag: para
+#: basic_mapping.xml:1157
#, no-c-format
msgid ""
"The <literal>hilo</literal> and <literal>seqhilo</literal> generators "
@@ -1065,7 +2643,46 @@
"テーブルを必要とします。2番目の実装は、 Oracle スタイルのシーケンスを使います"
"(サポートされている場合)。"
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:1167
#, no-c-format
msgid ""
"Unfortunately, you cannot use <literal>hilo</literal> when supplying your "
@@ -1081,11 +2698,13 @@
"切に設定しなければなりません。"
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "UUID アルゴリズム"
#. Tag: para
+#: basic_mapping.xml:1177
#, no-c-format
msgid ""
"The UUID contains: IP address, startup time of the JVM that is accurate to a "
@@ -1099,11 +2718,13 @@
"JNI が使えないときの最良の方法です。"
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "識別子カラムとシーケンス"
#. Tag: para
+#: basic_mapping.xml:1187
#, no-c-format
msgid ""
"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
@@ -1118,7 +2739,40 @@
"<literal>sequence</literal> スタイルのキー生成が使えます。どちらの戦略も、新"
"しいオブジェクトを挿入するために、 SQL クエリを2つ必要とします。"
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:1199
#, no-c-format
msgid ""
"For cross-platform development, the <literal>native</literal> strategy will, "
@@ -1132,20 +2786,22 @@
"に依存します。"
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "識別子の割り当て"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1209
+#, fuzzy, no-c-format
msgid ""
"If you want the application to assign identifiers, as opposed to having "
"Hibernate generate them, you can use the <literal>assigned</literal> "
"generator. This special generator uses the identifier value already assigned "
"to the object's identifier property. The generator is used when the primary "
"key is a natural key instead of a surrogate key. This is the default "
-"behavior if you do not specify a <literal><generator></literal> "
-"element."
+"behavior if you do not specify <classname>@GeneratedValue</classname> nor "
+"<literal><generator></literal> elements."
msgstr ""
"アプリケーションに識別子を割り当てさせたいのであれば( Hibernate が生成するも"
"のではなく)、 <literal>assigned</literal> ジェネレータを使うことができます。"
@@ -1155,6 +2811,7 @@
"合のデフォルトの動作になります。"
#. Tag: para
+#: basic_mapping.xml:1218
#, no-c-format
msgid ""
"The <literal>assigned</literal> generator makes Hibernate use "
@@ -1171,11 +2828,13 @@
"データベースを調べます。"
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "トリガにより割り当てられた主キー"
#. Tag: para
+#: basic_mapping.xml:1228
#, no-c-format
msgid ""
"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
@@ -1183,7 +2842,26 @@
"レガシースキーマのためにのみ指定します( Hibernate はトリガを使って DDL を生成"
"しません)。"
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+
#. Tag: para
+#: basic_mapping.xml:1233
#, no-c-format
msgid ""
"In the above example, there is a unique valued property named "
@@ -1197,11 +2875,102 @@
"キーがあります。"
#. Tag: title
+#: basic_mapping.xml:1241
+#, no-c-format
+msgid "Identity copy (foreign generator)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1243
+#, no-c-format
+msgid ""
+"Finally, you can ask Hibernate to copy the identifier from another "
+"associated entity. In the Hibernate jargon, it is known as a foreign "
+"generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumn(name = \"person_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1250
#, fuzzy, no-c-format
+msgid "Or alternatively"
+msgstr "メタデータの代替手段"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id Integer id;\n"
+"\n"
+" @MapsId @OneToOne\n"
+" @JoinColumn(name = \"patient_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Person {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1254
+#, no-c-format
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"MedicalHistory\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">patient</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
+">\n"
+"</class>"
+msgstr ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, fuzzy, no-c-format
msgid "Enhanced identifier generators"
msgstr "識別子の getter メソッド"
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
msgid ""
"Starting with release 3.2.3, there are 2 new generators which represent a re-"
@@ -1214,6 +2983,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
msgid ""
"The first of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1235,6 +3005,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1291
#, fuzzy, no-c-format
msgid ""
"<literal>sequence_name</literal> (optional, defaults to "
@@ -1245,6 +3016,7 @@
"literal> ): 識別カラムの名前。"
#. Tag: para
+#: basic_mapping.xml:1297
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional, defaults to <literal>1</"
@@ -1254,6 +3026,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1304
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1263,6 +3036,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1312
#, fuzzy, no-c-format
msgid ""
"<literal>force_table_use</literal> (optional - defaults to <literal>false</"
@@ -1274,6 +3048,7 @@
"Hibernate が使用できる識別カラムの指定を「強制」します。"
#. Tag: para
+#: basic_mapping.xml:1319
#, fuzzy, no-c-format
msgid ""
"<literal>value_column</literal> (optional - defaults to <literal>next_val</"
@@ -1284,16 +3059,17 @@
"literal> ): 識別カラムの名前。"
#. Tag: para
+#: basic_mapping.xml:1326
#, fuzzy, no-c-format
msgid ""
"<literal>optimizer</literal> (optional - defaults to <literal>none</"
-"literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" /"
-">"
+"literal>): See"
msgstr ""
-"<literal>type</literal> (オプション - デフォルトは <literal>integer</"
-"literal> ):バージョン番号の型。"
+"<literal>cascade</literal>(オプション - デフォルトは <literal>none</"
+"literal> ): カスケードのスタイル。"
#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
msgid ""
"The second of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1309,6 +3085,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1345
#, fuzzy, no-c-format
msgid ""
"<literal>table_name</literal> (optional - defaults to "
@@ -1318,6 +3095,7 @@
"literal> ):バージョン番号の型。"
#. Tag: para
+#: basic_mapping.xml:1351
#, fuzzy, no-c-format
msgid ""
"<literal>value_column_name</literal> (optional - defaults to "
@@ -1328,6 +3106,7 @@
"literal> ): 識別カラムの名前。"
#. Tag: para
+#: basic_mapping.xml:1357
#, no-c-format
msgid ""
"<literal>segment_column_name</literal> (optional - defaults to "
@@ -1337,6 +3116,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1365
#, fuzzy, no-c-format
msgid ""
"<literal>segment_value</literal> (optional - defaults to <literal>default</"
@@ -1347,6 +3127,7 @@
"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
+#: basic_mapping.xml:1372
#, fuzzy, no-c-format
msgid ""
"<literal>segment_value_length</literal> (optional - defaults to "
@@ -1357,6 +3138,7 @@
"literal> ): 識別カラムの名前。"
#. Tag: para
+#: basic_mapping.xml:1378
#, fuzzy, no-c-format
msgid ""
"<literal>initial_value</literal> (optional - defaults to <literal>1</"
@@ -1366,6 +3148,7 @@
"literal> ):バージョン番号の型。"
#. Tag: para
+#: basic_mapping.xml:1384
#, fuzzy, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1375,20 +3158,23 @@
"literal> ):バージョン番号の型。"
#. Tag: para
+#: basic_mapping.xml:1390
#, fuzzy, no-c-format
msgid ""
-"<literal>optimizer</literal> (optional - defaults to <literal></literal>): "
-"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+"<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): "
+"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
"<literal>type</literal> (オプション - デフォルトは <literal>integer</"
"literal> ):バージョン番号の型。"
#. Tag: title
+#: basic_mapping.xml:1397
#, fuzzy, no-c-format
msgid "Identifier generator optimization"
msgstr "識別子の getter メソッド"
#. Tag: para
+#: basic_mapping.xml:1399
#, no-c-format
msgid ""
"For identifier generators that store values in the database, it is "
@@ -1396,11 +3182,12 @@
"a new identifier value. Instead, you can group a bunch of them in memory and "
"only hit the database when you have exhausted your in-memory value group. "
"This is the role of the pluggable optimizers. Currently only the two "
-"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> "
+"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
"support this operation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
msgid ""
"<literal>none</literal> (generally this is the default if no optimizer was "
@@ -1409,6 +3196,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
msgid ""
"<literal>hilo</literal>: applies a hi/lo algorithm around the database "
@@ -1420,6 +3208,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
msgid ""
"<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this "
@@ -1431,291 +3220,211 @@
msgstr ""
#. Tag: title
-#, no-c-format
-msgid "composite-id"
-msgstr "composite-id"
+#: basic_mapping.xml:1441
+#, fuzzy, no-c-format
+msgid "Partial identifier generation"
+msgstr "識別子の getter メソッド"
#. Tag: para
+#: basic_mapping.xml:1443
#, no-c-format
msgid ""
-"A table with a composite key can be mapped with multiple properties of the "
-"class as identifier properties. The <literal><composite-id></literal> "
-"element accepts <literal><key-property></literal> property mappings "
-"and <literal><key-many-to-one></literal> mappings as child elements."
+"Hibernate supports the automatic generation of some of the identifier "
+"properties. Simply use the <classname>@GeneratedValue</classname> annotation "
+"on one or several id properties."
msgstr ""
-"複合キーのあるテーブルに対し、識別子プロパティとしてクラスの複数のプロパティ"
-"をマッピングすることができます。 <literal><composite-id></literal> 要素"
-"は、子要素として <literal><key-property></literal> プロパティマッピング"
-"と <literal><key-many-to-one></literal> マッピングを受け入れます。"
#. Tag: para
+#: basic_mapping.xml:1449
#, no-c-format
msgid ""
-"The persistent class <emphasis>must</emphasis> override <literal>equals()</"
-"literal> and <literal>hashCode()</literal> to implement composite identifier "
-"equality. It must also implement <literal>Serializable</literal>."
+"The Hibernate team has always felt such a construct as fundamentally wrong. "
+"Try hard to fix your data model before using this feature."
msgstr ""
-"複合識別子の等価性を実装するためには、永続クラスが <literal>equals()</"
-"literal> と <literal>hashCode()</literal> をオーバーライド <emphasis>しなけれ"
-"ばなりません</emphasis> 。 また <literal>Serializable</literal> も実装しなけ"
-"ればいけません。"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1454
#, no-c-format
msgid ""
-"Unfortunately, this approach means that a persistent object is its own "
-"identifier. There is no convenient \"handle\" other than the object itself. "
-"You must instantiate an instance of the persistent class itself and populate "
-"its identifier properties before you can <literal>load()</literal> the "
-"persistent state associated with a composite key. We call this approach an "
-"<emphasis>embedded</emphasis> composite identifier, and discourage it for "
-"serious applications."
+"@Entity\n"
+"public class CustomerInventory implements Serializable {\n"
+" @Id\n"
+" @TableGenerator(name = \"inventory\",\n"
+" table = \"U_SEQUENCES\",\n"
+" pkColumnName = \"S_ID\",\n"
+" valueColumnName = \"S_NEXTNUM\",\n"
+" pkColumnValue = \"inventory\",\n"
+" allocationSize = 1000)\n"
+" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
+"\")\n"
+" Integer id;\n"
+"\n"
+"\n"
+" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+" Customer customer;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @Id\n"
+" private int id;\n"
+"}"
msgstr ""
-"残念ながら複合識別子のためのこの方法は、永続オブジェクトが自身の識別子である"
-"ことを意味しています。オブジェクト自身を識別子とする以外に便利な「扱い方」は"
-"ありません。複合キーに関連した永続状態を <literal>load()</literal> 出来るよう"
-"になる前に、永続クラス自身をインスタンス化し、識別子プロパティを設定しなけれ"
-"ばなりません。 <emphasis> 組み込みの</emphasis> 複合識別子と呼ばれるこのアプ"
-"ローチは、本格的なアプリケーションには向いていません。"
#. Tag: para
+#: basic_mapping.xml:1456
#, no-c-format
msgid ""
-"A second approach is what we call a <emphasis>mapped</emphasis> composite "
-"identifier, where the identifier properties named inside the <literal><"
-"composite-id></literal> element are duplicated on both the persistent "
-"class and a separate identifier class."
+"You can also generate properties inside an <classname>@EmbeddedId</"
+"classname> class."
msgstr ""
-"2つ目の方法は <emphasis>マップされた</emphasis> 複合識別子と呼ばれるもので、 "
-"<literal><composite-id></literal>エレメント内で指定した識別プロパティが"
-"永続クラスと分離した識別子クラスの両方に重複して存在します。"
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:1462
#, no-c-format
-msgid ""
-"In this example, both the composite identifier class, <literal>MedicareId</"
-"literal>, and the entity class itself have properties named "
-"<literal>medicareNumber</literal> and <literal>dependent</literal>. The "
-"identifier class must override <literal>equals()</literal> and "
-"<literal>hashCode()</literal> and implement <literal>Serializable</literal>. "
-"The main disadvantage of this approach is code duplication."
+msgid "Optimistic locking properties (optional)"
msgstr ""
-"この例では、複合識別子クラス( <literal>MedicareId</literal> )とエンティティ"
-"クラス自身の両方が、 <literal>medicareNumber</literal> と "
-"<literal>dependent</literal> という名前のプロパティを持ちます。識別子クラス"
-"は、 <literal>equals()</literal> と <literal>hashCode()</literal> をオーバラ"
-"イドし、 <literal>Serializable</literal> を実装しなくてはなりません。この方法"
-"には、明らかにコードが重複するという不都合があります。"
#. Tag: para
+#: basic_mapping.xml:1464
#, no-c-format
msgid ""
-"The following attributes are used to specify a mapped composite identifier:"
-msgstr "次の属性はマッピングした複合識別子を指定するために使用します:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>mapped</literal> (optional - defaults to <literal>false</literal>): "
-"indicates that a mapped composite identifier is used, and that the contained "
-"property mappings refer to both the entity class and the composite "
-"identifier class."
+"When using long transactions or conversations that span several database "
+"transactions, it is useful to store versioning data to ensure that if the "
+"same entity is updated by two conversations, the last to commit changes will "
+"be informed and not override the other conversation's work. It guarantees "
+"some isolation while still allowing for good scalability and works "
+"particularly well in read-often write-sometimes situations."
msgstr ""
-"<literal>mapped</literal> (オプション、デフォルトは <literal>false</"
-"literal> ): マッピングした複合識別子が使用されることと、包含されたプロパティ"
-"のマッピングが、エンティティクラスと複合識別子クラスの両方を参照することを示"
-"します。"
#. Tag: para
+#: basic_mapping.xml:1472
#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - but required for a mapped composite "
-"identifier): the class used as a composite identifier."
+msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
-"<literal>class</literal> (オプション、ただしマッピングした複合識別子には必"
-"須): 複合識別子として使用するクラス。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1475
+#, fuzzy, no-c-format
msgid ""
-"We will describe a third, even more convenient approach, where the composite "
-"identifier is implemented as a component class in <xref linkend=\"components-"
-"compositeid\" />. The attributes described below apply only to this "
-"alternative approach:"
+"A version or timestamp property should never be null for a detached "
+"instance. Hibernate will detect any instance with a null version or "
+"timestamp as transient, irrespective of what other <literal>unsaved-value</"
+"literal> strategies are specified. <emphasis>Declaring a nullable version or "
+"timestamp property is an easy way to avoid problems with transitive "
+"reattachment in Hibernate. It is especially useful for people using assigned "
+"identifiers or composite keys</emphasis>."
msgstr ""
-"3つ目のさらに便利な方法は、複合識別子を <xref linkend=\"components-"
-"compositeid\"/> のコンポーネントクラスとして実装することです。下で記述してい"
-"る属性は、この代替方法にのみ適用されます:"
+"バージョンやタイムスタンプのプロパティは、分離されたインスタンスに対して "
+"null であってはなりません。そのためどのような <literal>unsaved-value</"
+"literal> 戦略が指定されても、 Hibernate は null のバージョンやタイムスタンプ"
+"を持ったすべてのインスタンスを、一時的なものであると判断します。 <emphasis> "
+"null を許容するバージョンやタイムスタンプのプロパティを定義することは、 "
+"Hibernate において過渡的に一時オブジェクトとすることを防ぐ簡単な方法です。特"
+"に識別子の割り当てや複合キーを使用しているときには特に有用です。</emphasis>"
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>name</literal> (optional - required for this approach): a property "
-"of component type that holds the composite identifier. Please see chapter 9 "
-"for more information."
-msgstr ""
-"<literal>name</literal> (オプション、このアプローチでは必須): 複合識別子を保"
-"持するコンポーネントタイプのプロパティ(9章を参照してください)。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate uses for accessing the property value."
-msgstr ""
-"<literal>access</literal> (オプション - デフォルトは <literal>property</"
-"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the component class used as a composite "
-"identifier. Please see the next section for more information."
-msgstr ""
-"<literal>class</literal> (オプション - デフォルトはリフレクションにより決定"
-"されるプロパティの型): 複合識別子として使われるコンポーネントのクラス(次の"
-"節を見てください)。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The third approach, an <emphasis>identifier component</emphasis>, is "
-"recommended for almost all applications."
-msgstr ""
-"この3つ目の方法は <emphasis> 識別子コンポーネント</emphasis> と呼び、ほとんど"
-"すべてのアプリケーションに対して推奨する方法です。"
-
#. Tag: title
+#: basic_mapping.xml:1485
#, no-c-format
-msgid "Discriminator"
-msgstr "discriminator"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The <literal><discriminator></literal> element is required for "
-"polymorphic persistence using the table-per-class-hierarchy mapping "
-"strategy. It declares a discriminator column of the table. The discriminator "
-"column contains marker values that tell the persistence layer what subclass "
-"to instantiate for a particular row. A restricted set of types can be used: "
-"<literal>string</literal>, <literal>character</literal>, <literal>integer</"
-"literal>, <literal>byte</literal>, <literal>short</literal>, "
-"<literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</"
-"literal>."
+msgid "Version number"
msgstr ""
-"<literal><discriminator></literal> 要素は、 table-per-class-hierarchy "
-"マッピング戦略を使うポリモーフィックな永続化に必要であり、テーブルの識別カラ"
-"ムを定義します。識別カラムは、ある行に対して永続層がどのサブクラスをインスタ"
-"ンス化するかを伝えるマーカー値を含んでいます。以下のような型に制限されます: "
-"<literal>string</literal> , <literal>character</literal> , <literal>integer</"
-"literal>, <literal>byte</literal> , <literal>short</literal> , "
-"<literal>boolean</literal> , <literal>yes_no</literal> , "
-"<literal>true_false</literal>."
#. Tag: para
+#: basic_mapping.xml:1487
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
-"the name of the discriminator column."
+"You can add optimistic locking capability to an entity using the "
+"<literal>@Version</literal> annotation:"
msgstr ""
-"<literal>column</literal>(オプション - デフォルトは <literal>class</"
-"literal> ): 識別カラムの名前。"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1490
#, no-c-format
msgid ""
-"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
-"a name that indicates the Hibernate type"
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
msgstr ""
-"<literal>type</literal> (オプション - デフォルトは <literal>string</"
-"literal> ): Hibernate の型を示す名前。"
#. Tag: para
+#: basic_mapping.xml:1492
#, no-c-format
msgid ""
-"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
-"\"forces\" Hibernate to specify the allowed discriminator values, even when "
-"retrieving all instances of the root class."
+"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 ""
-"<literal>force</literal> (オプション - デフォルトは <literal>false</"
-"literal> ): ルートクラスのすべてのインスタンスを検索する場合であっても、 "
-"Hibernate が使用できる識別カラムの指定を「強制」します。"
#. Tag: para
+#: basic_mapping.xml:1497
#, no-c-format
msgid ""
-"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
-"set this to <literal>false</literal> if your discriminator column is also "
-"part of a mapped composite identifier. It tells Hibernate not to include the "
-"column in SQL <literal>INSERTs</literal>."
+"The version column may be a numeric. Hibernate supports any kind of type "
+"provided that you define and implement the appropriate "
+"<classname>UserVersionType</classname>."
msgstr ""
-"<literal>insert</literal> (オプション - デフォルトは <literal>true</"
-"literal> ): もし識別カラムがマッピングする複合識別子の一部ならば、 "
-"<literal>false</literal> と設定してください。 (Hibernate に SQL の "
-"<literal>INSERT</literal> 内のカラムを含ませないよう伝えます。)"
#. Tag: para
+#: basic_mapping.xml:1501
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
-"executed when a type has to be evaluated. It allows content-based "
-"discrimination."
+"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>LockModeType."
+"OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType."
+"PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
-"<literal>formula</literal> (オプション) 型が評価されるときに実行される任意の "
-"SQL 式。コンテンツベースの識別を可能にします。"
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
msgid ""
-"Actual values of the discriminator column are specified by the "
-"<literal>discriminator-value</literal> attribute of the <literal><"
-"class></literal> and <literal><subclass></literal> elements."
+"If the version number is generated by the database (via a trigger for "
+"example), make sure to use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"識別カラムの実際の値は、 <literal><class></literal> と <literal><"
-"subclass></literal> 要素の <literal>discriminator-value</literal> 属性で指"
-"定されます。"
#. Tag: para
+#: basic_mapping.xml:1511
#, no-c-format
-msgid ""
-"The <literal>force</literal> attribute is only useful if the table contains "
-"rows with \"extra\" discriminator values that are not mapped to a persistent "
-"class. This will not usually be the case."
+msgid "To declare a version property in hbm.xml, use:"
msgstr ""
-"永続クラスへマッピングされない「余分な」識別値を持つ行がテーブルにあれば、(そ"
-"のときに限り) <literal>force</literal> 属性は有効です。ただし、普通はそうい"
-"うことはありません。"
-#. Tag: para
-#, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:1530
+#, fuzzy, no-c-format
msgid ""
-"The <literal>formula</literal> attribute allows you to declare an arbitrary "
-"SQL expression that will be used to evaluate the type of a row. For example:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
msgstr ""
-"<literal>formula</literal> 属性を使うと、行の型を評価するために任意の SQL 式"
-"を宣言できます:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
-#. Tag: title
-#, no-c-format
-msgid "Version (optional)"
-msgstr "version(オプション)"
-
#. Tag: para
+#: basic_mapping.xml:1534
#, no-c-format
msgid ""
-"The <literal><version></literal> element is optional and indicates "
-"that the table contains versioned data. This is particularly useful if you "
-"plan to use <emphasis>long transactions</emphasis>. See below for more "
-"information:"
-msgstr ""
-"<literal><version></literal> 要素はオプションであり、テーブルがバージョ"
-"ンデータを含むことを示します。これは <emphasis>ロングトランザクション</"
-"emphasis> を使うつもりなら、特に役立ちます(以下を参照してください)。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of the column holding the version number."
msgstr ""
@@ -1723,12 +3432,14 @@
"ン番号を保持するカラムの名前。"
#. Tag: para
+#: basic_mapping.xml:1540
#, no-c-format
msgid ""
"<literal>name</literal>: the name of a property of the persistent class."
msgstr "<literal>name</literal> :永続クラスのプロパティの名前。"
#. Tag: para
+#: basic_mapping.xml:1545
#, no-c-format
msgid ""
"<literal>type</literal> (optional - defaults to <literal>integer</literal>): "
@@ -1738,6 +3449,7 @@
"literal> ):バージョン番号の型。"
#. Tag: para
+#: basic_mapping.xml:1551
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -1747,6 +3459,7 @@
"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
+#: basic_mapping.xml:1557
#, fuzzy, no-c-format
msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</"
@@ -1763,6 +3476,7 @@
"ます。)"
#. Tag: para
+#: basic_mapping.xml:1567
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -1776,6 +3490,7 @@
"を参照してください。"
#. Tag: para
+#: basic_mapping.xml:1575
#, no-c-format
msgid ""
"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
@@ -1788,56 +3503,89 @@
"す。もしデータベースカラムのデフォルト値が <literal>0</literal> と定義される"
"ときには、 <literal>false</literal> に設定すると良いでしょう。"
+#. Tag: title
+#: basic_mapping.xml:1586
+#, fuzzy, no-c-format
+msgid "Timestamp"
+msgstr "timestamp(オプション)"
+
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1588
+#, fuzzy, no-c-format
msgid ""
-"Version numbers can be of Hibernate type <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> or <literal>calendar</literal>."
+"Alternatively, you can use a timestamp. Timestamps are a less safe "
+"implementation of optimistic locking. However, sometimes the application "
+"might use the timestamps in other ways."
msgstr ""
-"バージョン番号は Hibernate の <literal>long</literal> 、 <literal>integer</"
-"literal> 、 <literal>short</literal> 、 <literal>timestamp</literal> 、 "
-"<literal>calendar</literal> 型のいずれかです。"
+"オプションの <literal><timestamp></literal> 要素は、テーブルがタイムス"
+"タンプデータを含むことを示します。これはバージョン付けの代わりの方法として用"
+"意されています。タイムスタンプはもともと楽観的ロックにおける安全性の低い実装"
+"です。しかしアプリケーションはタイムスタンプを異なる用途で使うこともあるかも"
+"しれません。"
#. Tag: para
-#, fuzzy, no-c-format
+#: basic_mapping.xml:1592
+#, no-c-format
msgid ""
-"A version or timestamp property should never be null for a detached "
-"instance. Hibernate will detect any instance with a null version or "
-"timestamp as transient, irrespective of what other <literal>unsaved-value</"
-"literal> strategies are specified. <emphasis>Declaring a nullable version or "
-"timestamp property is an easy way to avoid problems with transitive "
-"reattachment in Hibernate. It is especially useful for people using assigned "
-"identifiers or composite keys</emphasis>."
+"Simply mark a property of type <classname>Date</classname> or "
+"<classname>Calendar</classname> as <classname>@Version</classname>."
msgstr ""
-"バージョンやタイムスタンプのプロパティは、分離されたインスタンスに対して "
-"null であってはなりません。そのためどのような <literal>unsaved-value</"
-"literal> 戦略が指定されても、 Hibernate は null のバージョンやタイムスタンプ"
-"を持ったすべてのインスタンスを、一時的なものであると判断します。 <emphasis> "
-"null を許容するバージョンやタイムスタンプのプロパティを定義することは、 "
-"Hibernate において過渡的に一時オブジェクトとすることを防ぐ簡単な方法です。特"
-"に識別子の割り当てや複合キーを使用しているときには特に有用です。</emphasis>"
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:1596
#, no-c-format
-msgid "Timestamp (optional)"
-msgstr "timestamp(オプション)"
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" public Date getLastUpdate() { ... }\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1598
#, no-c-format
msgid ""
-"The optional <literal><timestamp></literal> element indicates that the "
-"table contains timestamped data. This provides an alternative to versioning. "
-"Timestamps are a less safe implementation of optimistic locking. However, "
-"sometimes the application might use the timestamps in other ways."
+"Like version numbers, the timestamp can be generated by the database instead "
+"of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"オプションの <literal><timestamp></literal> 要素は、テーブルがタイムス"
-"タンプデータを含むことを示します。これはバージョン付けの代わりの方法として用"
-"意されています。タイムスタンプはもともと楽観的ロックにおける安全性の低い実装"
-"です。しかしアプリケーションはタイムスタンプを異なる用途で使うこともあるかも"
-"しれません。"
#. Tag: para
+#: basic_mapping.xml:1602
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr ""
+"例えば、もし以下のような <literal><properties></literal> マッピングが"
+"あった場合:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
+#, fuzzy, no-c-format
+msgid ""
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+msgstr ""
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:1624
#, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -1847,6 +3595,7 @@
"タンプを保持するカラムの名前。"
#. Tag: para
+#: basic_mapping.xml:1630
#, no-c-format
msgid ""
"<literal>name</literal>: the name of a JavaBeans style property of Java type "
@@ -1858,8 +3607,20 @@
"前。"
#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380
+#: basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
#, no-c-format
msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the property value."
+msgstr ""
+"<literal>access</literal> (オプション - デフォルトは <literal>property</"
+"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
+
+#. Tag: para
+#: basic_mapping.xml:1642
+#, no-c-format
+msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>null</"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
@@ -1873,6 +3634,7 @@
"literal> と指定すると、識別子プロパティの値が使われます。)"
#. Tag: para
+#: basic_mapping.xml:1652
#, no-c-format
msgid ""
"<literal>source</literal> (optional - defaults to <literal>vm</literal>): "
@@ -1895,6 +3657,7 @@
"もあります (例えば Oracle 8 )。"
#. Tag: para
+#: basic_mapping.xml:1665
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -1908,11 +3671,13 @@
"参照してください。"
#. Tag: title
+#: basic_mapping.xml:1675
#, no-c-format
msgid "Note"
msgstr "注記"
#. Tag: para
+#: basic_mapping.xml:1677
#, no-c-format
msgid ""
"<literal><Timestamp></literal> is equivalent to <literal><version "
@@ -1926,20 +3691,846 @@
"</literal> と等価であることに注意してください。"
#. Tag: title
+#: basic_mapping.xml:1686
#, no-c-format
msgid "Property"
msgstr "property"
#. Tag: para
+#: basic_mapping.xml:1688
#, no-c-format
msgid ""
+"You need to decide which property needs to be made persistent in a given "
+"entity. This differs slightly between the annotation driven metadata and the "
+"hbm.xml files."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1693
+#, no-c-format
+msgid "Property mapping with annotations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1695
+#, no-c-format
+msgid ""
+"In the annotations world, every non static non transient property (field or "
+"method depending on the access type) of an entity 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."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1702
+#, no-c-format
+msgid ""
+"The <literal>@Basic</literal> annotation allows you to declare the fetching "
+"strategy for a property. If set to <literal>LAZY</literal>, specifies that "
+"this property should be fetched lazily when the instance variable is first "
+"accessed. It requires build-time bytecode instrumentation, if your classes "
+"are not instrumented, property level lazy loading is silently ignored. The "
+"default is <literal>EAGER</literal>. You can also mark a property as not "
+"optional thanks to the <classname>@Basic.optional</classname> attribute. "
+"This will ensure that the underlying column are not nullable (if possible). "
+"Note that a better approach is to use the <classname>@NotNull</classname> "
+"annotation of the Bean Validation specification."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1715
+#, no-c-format
+msgid "Let's look at a few examples:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+"@Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property \n"
+"\n"
+"@Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1719
+#, 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 Hibernate. <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). The recommended alternative is to "
+"use the projection capability of JP-QL (Java Persistence Query Language) or "
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1732
+#, no-c-format
+msgid ""
+"JPA support property mapping of all basic types supported by Hibernate (all "
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> "
+"annotation as shown in the <literal>note</literal> property example."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1742
+#, no-c-format
+msgid ""
+"In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
+#, 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 <classname>Serializable</classname> type "
+"will be persisted in a Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
+#, 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
+#: basic_mapping.xml:1768
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1770
+#, no-c-format
+msgid ""
+"You can also manually specify a type using the <literal>@org.hibernate."
+"annotations.Type</literal> and some parameters if needed. <classname>@Type."
+"type</classname> could be:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
+#, no-c-format
+msgid ""
+"The name of a Hibernate basic type: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgstr ""
+"Hibernate の基本型の名前(例 <literal>integer, string, character, date, "
+"timestamp, float, binary, serializable, object, blob</literal> )。"
+
+#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
+#, no-c-format
+msgid ""
+"The name of a Java class with a default basic type: <literal>int, float, "
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal> etc."
+msgstr ""
+"デフォルトの基本型の Java クラス名 (例 <literal>int, float, char, java.lang."
+"String, java.util.Date, java.lang.Integer, java.sql.Clob</literal> )。"
+
+#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
+#, no-c-format
+msgid "The name of a serializable Java class."
+msgstr "シリアライズ可能な Java クラスの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
+#, no-c-format
+msgid ""
+"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
+"literal> etc."
+msgstr ""
+"カスタム型のクラス名(例 <literal>com.illflow.type.MyCustomType</"
+"literal> )。"
+
+#. Tag: para
+#: basic_mapping.xml:1798
+#, fuzzy, no-c-format
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4."
+msgstr ""
+"型を指定しなければ、 Hibernate は正しい Hibernate の型を推測するために、指定"
+"されたプロパティに対してリフレクションを使います。 Hibernate はルール2, 3, 4"
+"をその順序に使い、 getter プロパティの返り値のクラスの名前を解釈しようとしま"
+"す。しかしこれで常に十分であるとは限りません。場合によっては、 "
+"<literal>type</literal> 属性が必要な場合があります。 (例えば "
+"<literal>Hibernate.DATE</literal> と <literal>Hibernate.TIMESTAMP</literal> "
+"を区別するため、またはカスタム型を指定するためなどです。)"
+
+#. Tag: para
+#: basic_mapping.xml:1803
+#, no-c-format
+msgid ""
+"<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when "
+"defined at the class level). If the type is used on a single entity, you can "
+"place the definition on the entity itself. Otherwise, it is recommended to "
+"place the definition at the package level. In the example below, when "
+"Hibernate encounters a property of class <literal>PhoneNumer</literal>, it "
+"delegates the persistence strategy to the custom mapping type "
+"<literal>PhoneNumberType</literal>. However, properties belonging to other "
+"classes, too, can delegate their persistence strategy to "
+"<literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</"
+"literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1819
+#, 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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+"@TypeDef(\n"
+" name = \"phoneNumber\",\n"
+" defaultForType = PhoneNumber.class,\n"
+" typeClass = PhoneNumberType.class\n"
+")\n"
+"\n"
+"@Entity\n"
+"public class ContactDetails {\n"
+" [...]\n"
+" private PhoneNumber localPhoneNumber;\n"
+" @Type(type=\"phoneNumber\")\n"
+" private OverseasPhoneNumber overseasPhoneNumber;\n"
+" [...]\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1826
+#, no-c-format
+msgid ""
+"The following example shows the usage of the <literal>parameters</literal> "
+"attribute to customize the TypeDef."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
+#, 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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+"@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
+#: basic_mapping.xml:1840
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1842
+#, no-c-format
+msgid ""
+"By default the access type of a class hierarchy is defined by the position "
+"of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> "
+"annotations. If these annotations are on a field, then only fields are "
+"considered for persistence and the state is accessed via the field. If there "
+"annotations are on a getter, then only the getters are considered for "
+"persistence and the state is accessed via the getter/setter. That works well "
+"in practice and is the recommended approach."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1850
+#, no-c-format
+msgid ""
+"The placement of annotations within a class hierarchy has to be consistent "
+"(either field or on property) to be able to determine the default access "
+"type. It is recommended to stick to one single annotation placement strategy "
+"throughout your whole application."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1857
+#, no-c-format
+msgid "However in some situations, you need to:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1861
+#, no-c-format
+msgid "force the access type of the entity hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1865
+#, no-c-format
+msgid "override the access type of a specific entity in the class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1870
+#, no-c-format
+msgid "override the access type of an embeddable type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid ""
+"The best use case is an embeddable class used by several entities that might "
+"not use the same access type. In this case it is better to force the access "
+"type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid ""
+"To force the access type on a given class, use the <classname>@Access</"
+"classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" @Embedded private Address address;\n"
+" public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class User {\n"
+" private Long id;\n"
+" @Id public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" private Address address;\n"
+" @Embedded public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"@Access(AcessType.PROPERTY)\n"
+"public class Address {\n"
+" private String street1;\n"
+" public String getStreet1() { return street1; }\n"
+" public void setStreet1() { this.street1 = street1; }\n"
+"\n"
+" private hashCode; //not persistent\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid ""
+"You can also override the access type of a single property while keeping the "
+"other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+" @Transient private String userId;\n"
+" @Transient private String orderId;\n"
+"\n"
+" @Access(AccessType.PROPERTY)\n"
+" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid ""
+"In this example, the default access type is <classname>FIELD</classname> "
+"except for the <literal>orderNumber</literal> property. Note that the "
+"corresponding field, if any must be marked as <classname>@Transient</"
+"classname> or <code>transient</code>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1896
+#, no-c-format
+msgid "@org.hibernate.annotations.AccessType"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1898
+#, no-c-format
+msgid ""
+"The annotation <classname>@org.hibernate.annotations.AccessType</classname> "
+"should be considered deprecated for FIELD and PROPERTY access. It is still "
+"useful however if you need to use a custom access type."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1907
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1909
+#, 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
+#: basic_mapping.xml:1914
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "<literal>sequence-identity</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "<literal>sequence-identity</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "<literal>sequence-identity</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "<literal>sequence-identity</literal>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, fuzzy, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the property "
+"name)"
+msgstr "<literal>name</literal>(オプション):識別子プロパティの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal> (オプション):カラムにユニーク制約をつける DDL の生"
+"成を可能にします。また、 <literal>property-ref</literal> のターゲットとするこ"
+"ともできます。"
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, fuzzy, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable (default "
+"true)."
+msgstr "<literal>name</literal>(オプション):識別子プロパティの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column will be "
+"part of the insert statement (default true)"
+msgstr "<literal>name</literal>(オプション):識別子プロパティの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2008
+#, fuzzy, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will be "
+"part of the update statement (default true)"
+msgstr ""
+"<literal>catalog</literal> (オプション):データベースカタログの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL "
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default "
+"primary table)"
+msgstr ""
+"<literal>catalog</literal> (オプション):データベースカタログの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional): column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional): column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional): column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>Serializable</"
+"classname>, it is mapped as <classname>@Basic</classname> in a column "
+"holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>java.sql.Clob</"
+"classname> or <classname>java.sql.Blob</classname>, it is mapped as "
+"<classname>@Lob</classname> with the appropriate <classname>LobType</"
+"classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, no-c-format
+msgid ""
"The <literal><property></literal> element declares a persistent "
"JavaBean style property of the class."
msgstr ""
"<literal><property></literal> 要素は、クラスの永続的な JavaBean スタイ"
"ルのプロパティを定義します。"
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, fuzzy, no-c-format
+msgid ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+msgstr ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:2129
#, no-c-format
msgid ""
"<literal>name</literal>: the name of the property, with an initial lowercase "
@@ -1947,6 +4538,7 @@
msgstr "<literal>name</literal>: 小文字で始まるプロパティ名。"
#. Tag: para
+#: basic_mapping.xml:2134
#, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -1958,6 +4550,7 @@
"column></literal> 要素でも指定できます。"
#. Tag: para
+#: basic_mapping.xml:2146
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -1975,6 +4568,7 @@
"ティが可能になります。"
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -1986,6 +4580,7 @@
"ングがありません。"
#. Tag: para
+#: basic_mapping.xml:2169
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
@@ -1997,6 +4592,7 @@
"取得するよう指定します。 (バイトコード実装を作成する時間が必要になります)。"
#. Tag: para
+#: basic_mapping.xml:2176
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2008,6 +4604,7 @@
"ともできます。"
#. Tag: para
+#: basic_mapping.xml:2183
#, fuzzy, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2017,6 +4614,7 @@
"成を可能にします。"
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2030,6 +4628,7 @@
"きかを決定します。"
#. Tag: para
+#: basic_mapping.xml:2196
#, fuzzy, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2042,46 +4641,15 @@
"す。 <xref linkend=\"mapping-generated\"/> 生成プロパティを参照してください。"
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr "<emphasis>typename</emphasis> には以下の値が可能です:"
#. Tag: para
+#: basic_mapping.xml:2230
#, no-c-format
msgid ""
-"The name of a Hibernate basic type: <literal>integer, string, character, "
-"date, timestamp, float, binary, serializable, object, blob</literal> etc."
-msgstr ""
-"Hibernate の基本型の名前(例 <literal>integer, string, character, date, "
-"timestamp, float, binary, serializable, object, blob</literal> )。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The name of a Java class with a default basic type: <literal>int, float, "
-"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
-"literal> etc."
-msgstr ""
-"デフォルトの基本型の Java クラス名 (例 <literal>int, float, char, java.lang."
-"String, java.util.Date, java.lang.Integer, java.sql.Clob</literal> )。"
-
-#. Tag: para
-#, no-c-format
-msgid "The name of a serializable Java class."
-msgstr "シリアライズ可能な Java クラスの名前。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
-"literal> etc."
-msgstr ""
-"カスタム型のクラス名(例 <literal>com.illflow.type.MyCustomType</"
-"literal> )。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
@@ -2099,6 +4667,7 @@
"を区別するため、またはカスタム型を指定するためなどです。)"
#. Tag: para
+#: basic_mapping.xml:2239
#, no-c-format
msgid ""
"The <literal>access</literal> attribute allows you to control how Hibernate "
@@ -2118,6 +4687,7 @@
"クセスに独自の戦略を指定することができます。"
#. Tag: para
+#: basic_mapping.xml:2248
#, no-c-format
msgid ""
"A powerful feature is derived properties. These properties are by definition "
@@ -2130,7 +4700,26 @@
"のプロパティはインスタンスをロードする SQL クエリの <literal>SELECT</"
"literal> 句のサブクエリに変換されます:"
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+
#. Tag: para
+#: basic_mapping.xml:2256
#, no-c-format
msgid ""
"You can reference the entity table by not declaring an alias on a particular "
@@ -2144,30 +4733,1955 @@
"literal> マッピング要素を使えることにも注意してください。"
#. Tag: title
+#: basic_mapping.xml:2265
#, no-c-format
-msgid "Many-to-one"
-msgstr "many-to-one"
+msgid "Embedded objects (aka components)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2267
+#, fuzzy, no-c-format
+msgid ""
+"Embeddable objects (or components) are objects whose properties are mapped "
+"to the same table as the owning entity's table. Components can, in turn, "
+"declare their own properties, components or collections"
+msgstr ""
+"<literal><component></literal> 要素は、子オブジェクトのプロパティを親ク"
+"ラスのテーブルのカラムへマッピングします。コンポーネントは自分のプロパティ、"
+"コンポーネント、コレクションの順に定義できます。以下の「コンポーネント」を見"
+"てください。"
+
+#. Tag: para
+#: basic_mapping.xml:2272
#, no-c-format
msgid ""
-"An ordinary association to another persistent class is declared using a "
-"<literal>many-to-one</literal> element. The relational model is a many-to-"
-"one association; a foreign key in one table is referencing the primary key "
-"column(s) of the target table."
+"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 ""
-"他の永続クラスへの通常の関連は <literal>many-to-one</literal> 要素を使って定"
-"義します。リレーショナルモデルは多対一関連です。つまりあるテーブルの外部キー"
-"は、ターゲットとなるテーブルの主キーカラムを参照しています。"
+#. Tag: programlisting
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
#, no-c-format
+msgid ""
+"An embeddable object inherits the access type of its owning entity (note "
+"that you can override that using the <literal>@Access</literal> annotation)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2290
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded "
+"objects of embedded objects is through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2305
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column = @Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
+"(name=\"nat_Iso2\") ),\n"
+" @AttributeOverride(name=\"nationality.name\", column = @Column"
+"(name=\"nat_CountryName\") )\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2307
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports something that is not explicitly supported by "
+"the JPA 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
+#: basic_mapping.xml:2313
+#, no-c-format
+msgid ""
+"You can also use association annotations in an embeddable object (ie "
+"<literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, "
+"<classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To "
+"override the association columns you can use <literal>@AssociationOverride</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2319
+#, 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 as several embedded objects "
+"would share the same set of columns. In plain JPA, you need to override at "
+"least one set of columns. Hibernate, however, allows you to enhance the "
+"default naming mechanism through the <classname>NamingStrategy</classname> "
+"interface. You can write a strategy that prevent name clashing in such a "
+"situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an "
+"example of this."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2329
+#, no-c-format
+msgid ""
+"If a property of the embedded object points back to the owning entity, "
+"annotate it with the <classname>@Parent</classname> annotation. Hibernate "
+"will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
+#, fuzzy, no-c-format
+msgid ""
+"<component\n"
+" name=\"propertyName\"\n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+msgstr ""
+"<component \n"
+" name=\"propertyName\" \n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+" \n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+
+#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
+#, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr "<literal>name</literal>:プロパティ名。"
#. Tag: para
+#: basic_mapping.xml:2364
#, no-c-format
msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the component (child) class."
+msgstr ""
+"<literal>class</literal> (オプション - デフォルトはリフレクションにより決定"
+"されるプロパティの型): コンポーネント(子)クラスの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
+#, no-c-format
+msgid ""
+"<literal>insert</literal>: do the mapped columns appear in SQL "
+"<literal>INSERTs</literal>?"
+msgstr ""
+"<literal>insert</literal>:マッピングされたカラムが SQL の <literal>INSERT</"
+"literal> に現れるようにするかどうかを指定します。"
+
+#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
+#, no-c-format
+msgid ""
+"<literal>update</literal>: do the mapped columns appear in SQL "
+"<literal>UPDATEs</literal>?"
+msgstr ""
+"<literal>update</literal>:マッピングされたカラムが SQL の <literal>UPDATE</"
+"literal> に現れるようにするかどうかを指定します。"
+
+#. Tag: para
+#: basic_mapping.xml:2386
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this component should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal> (オプション - デフォルトは <literal>false</"
+"literal> ): インスタンス変数に最初にアクセスしたときに、コンポーネントを遅延"
+"してフェッチするよう指定します。 (バイトコード実装を作成する時間が必要になり"
+"ます)"
+
+#. Tag: para
+#: basic_mapping.xml:2393
+#, no-c-format
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this component either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal> (オプション - デフォルトは <literal>true</"
+"literal> ): このプロパティの更新に、楽観ロックの取得を要求するかどうかを指定"
+"します。言い換えれば、このプロパティがダーティであるときにバージョンを増やす"
+"べきかを決定します。"
+
+#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that a unique constraint exists upon all mapped columns of the "
+"component."
+msgstr ""
+"<literal>unique</literal> (オプション - デフォルトは <literal>false</"
+"literal> ): コンポーネントのすべてのマッピングするカラムに、ユニーク制約が存"
+"在するかを指定します。"
+
+#. Tag: para
+#: basic_mapping.xml:2408
+#, no-c-format
+msgid ""
+"The child <literal><property></literal> tags map properties of the "
+"child class to table columns."
+msgstr ""
+"子の <literal><property></literal> タグで、子のクラスのプロパティをテー"
+"ブルカラムにマッピングします。"
+
+#. Tag: para
+#: basic_mapping.xml:2411
+#, no-c-format
+msgid ""
+"The <literal><component></literal> element allows a <literal><"
+"parent></literal> subelement that maps a property of the component class "
+"as a reference back to the containing entity."
+msgstr ""
+"<literal><component></literal> 要素は、親エンティティへ戻る参照として、"
+"コンポーネントのクラスのプロパティをマッピングする <literal><parent></"
+"literal> サブ要素を許可します。"
+
+#. Tag: para
+#: basic_mapping.xml:2415
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><dynamic-component></literal> element allows a "
+"<literal>Map</literal> to be mapped as a component, where the property names "
+"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
+"more information. This feature is not supported in annotations."
+msgstr ""
+"<literal><dynamic-component></literal> 要素は、 <literal>Map</literal> "
+"がコンポーネントとしてマッピングされることを可能にします。プロパティ名は map "
+"のキーを参照します。<xref linkend=\"components-dynamic\"/> を参照してくださ"
+"い。"
+
+#. Tag: title
+#: basic_mapping.xml:2423
+#, no-c-format
+msgid "Inheritance strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2425
+#, no-c-format
+msgid ""
+"Java is a language supporting polymorphism: a class can inherit from "
+"another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2431
+#, no-c-format
+msgid ""
+"Single table per class hierarchy strategy: a single table hosts all the "
+"instances of a class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2436
+#, no-c-format
+msgid ""
+"Joined subclass strategy: one table per class and subclass is present and "
+"each table persist the properties specific to a given subclass. The state of "
+"the entity is then stored in its corresponding class table and all its "
+"superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2443
+#, no-c-format
+msgid ""
+"Table per class strategy: one table per concrete class and subclass is "
+"present and each table persist the properties of the class and its "
+"superclasses. The state of the entity is then stored entirely in the "
+"dedicated table for its class."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2453
+#, no-c-format
+msgid ""
+"With this approach the properties of all the subclasses in a given mapped "
+"class hierarchy are stored in a single table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2456
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass declares its own persistent properties and subclasses. Version "
+"and id properties are assumed to be inherited from the root class. Each "
+"subclass in a hierarchy must define a unique discriminator value. If this is "
+"not specified, the fully qualified Java class name is used."
+msgstr ""
+"各サブクラスでは、永続プロパティとサブクラスを定義します。 <literal><"
+"version></literal> と <literal><id></literal> プロパティは、ルートク"
+"ラスから継承されると仮定されます。階層構造におけるサブクラスは、ユニークな "
+"<literal>discriminator-value</literal> を定義しなければなりません。 none が指"
+"定されると、完全修飾された Java クラス名が使われます。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: basic_mapping.xml:2464
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
+"<literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+"最後にポリモーフィックな永続化には、ルートの永続クラスの各サブクラスの定義が"
+"必要です。 table-per-class-hierarchy マッピング戦略では、 <literal><"
+"subclass></literal> 定義が使われます。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, fuzzy, no-c-format
+msgid ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+msgstr ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
+#, no-c-format
+msgid ""
+"<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr "<literal>name</literal>:サブクラスの完全修飾されたクラス名。"
+
+#. Tag: para
+#: basic_mapping.xml:2488
+#, no-c-format
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses."
+msgstr ""
+"<literal>discriminator-value</literal>(オプション - デフォルトはクラス"
+"名): 個々のサブクラスを区別するための値。"
+
+#. Tag: para
+#: basic_mapping.xml:2494
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface used for "
+"lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (オプション): 遅延初期化プロキシに使用するクラスやイ"
+"ンターフェースを指定します。"
+
+#. Tag: para
+#: basic_mapping.xml:2499
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (オプション、デフォルトは <literal>true</literal> ): "
+"<literal>lazy=\"false\"</literal> とすると、遅延フェッチが使用できません。"
+
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, fuzzy, no-c-format
+msgid ""
+"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
+">."
+msgstr ""
+"継承のマッピングに関する情報は <xref linkend=\"inheritance\"/> を参照してくだ"
+"さい。"
+
+#. Tag: title
+#: basic_mapping.xml:2511
+#, no-c-format
+msgid "Discriminator"
+msgstr "discriminator"
+
+#. Tag: para
+#: basic_mapping.xml:2513
+#, fuzzy, no-c-format
+msgid ""
+"Discriminators are required for polymorphic persistence using the table-per-"
+"class-hierarchy mapping strategy. It declares a discriminator column of the "
+"table. The discriminator column contains marker values that tell the "
+"persistence layer what subclass to instantiate for a particular row. A "
+"restricted set of types can be used: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+"<literal><discriminator></literal> 要素は、 table-per-class-hierarchy "
+"マッピング戦略を使うポリモーフィックな永続化に必要であり、テーブルの識別カラ"
+"ムを定義します。識別カラムは、ある行に対して永続層がどのサブクラスをインスタ"
+"ンス化するかを伝えるマーカー値を含んでいます。以下のような型に制限されます: "
+"<literal>string</literal> , <literal>character</literal> , <literal>integer</"
+"literal>, <literal>byte</literal> , <literal>short</literal> , "
+"<literal>boolean</literal> , <literal>yes_no</literal> , "
+"<literal>true_false</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2523
+#, no-c-format
+msgid ""
+"Use the <classname>@DiscriminatorColumn</classname> to define the "
+"discriminator column as well as the discriminator type. Alternatively, you "
+"can also use <classname>@DiscriminatorFormula</classname> to express in SQL "
+"what would be in a virtual discriminator column. This is particularly handy "
+"when the discriminator value can be extracted from one or more columns of "
+"the table. Both <classname>@DiscriminatorColumn</classname> and "
+"<classname>@DiscriminatorFormula</classname> are to be set on the root "
+"entity (once per persisted hierarchy)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2534
+#, no-c-format
+msgid ""
+"Finally, use <classname>@DiscriminatorValue</classname> on each class of the "
+"hierarchy to specify the value stored in the discriminator column for a "
+"given entity. If you do not set <classname>@DiscriminatorValue</classname> "
+"on a class, the fully qualified class name is used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2542
+#, no-c-format
+msgid ""
+"In hbm.xml, the <literal><discriminator></literal> element is used to "
+"define the discriminator column or formula:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, fuzzy, no-c-format
+msgid ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+msgstr ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:2563
+#, no-c-format
+msgid ""
+"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
+"the name of the discriminator column."
+msgstr ""
+"<literal>column</literal>(オプション - デフォルトは <literal>class</"
+"literal> ): 識別カラムの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2569
+#, no-c-format
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
+"a name that indicates the Hibernate type"
+msgstr ""
+"<literal>type</literal> (オプション - デフォルトは <literal>string</"
+"literal> ): Hibernate の型を示す名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2575
+#, no-c-format
+msgid ""
+"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
+"\"forces\" Hibernate to specify the allowed discriminator values, even when "
+"retrieving all instances of the root class."
+msgstr ""
+"<literal>force</literal> (オプション - デフォルトは <literal>false</"
+"literal> ): ルートクラスのすべてのインスタンスを検索する場合であっても、 "
+"Hibernate が使用できる識別カラムの指定を「強制」します。"
+
+#. Tag: para
+#: basic_mapping.xml:2582
+#, no-c-format
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"set this to <literal>false</literal> if your discriminator column is also "
+"part of a mapped composite identifier. It tells Hibernate not to include the "
+"column in SQL <literal>INSERTs</literal>."
+msgstr ""
+"<literal>insert</literal> (オプション - デフォルトは <literal>true</"
+"literal> ): もし識別カラムがマッピングする複合識別子の一部ならば、 "
+"<literal>false</literal> と設定してください。 (Hibernate に SQL の "
+"<literal>INSERT</literal> 内のカラムを含ませないよう伝えます。)"
+
+#. Tag: para
+#: basic_mapping.xml:2590
+#, no-c-format
+msgid ""
+"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
+"executed when a type has to be evaluated. It allows content-based "
+"discrimination."
+msgstr ""
+"<literal>formula</literal> (オプション) 型が評価されるときに実行される任意の "
+"SQL 式。コンテンツベースの識別を可能にします。"
+
+#. Tag: para
+#: basic_mapping.xml:2597
+#, no-c-format
+msgid ""
+"Actual values of the discriminator column are specified by the "
+"<literal>discriminator-value</literal> attribute of the <literal><"
+"class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+"識別カラムの実際の値は、 <literal><class></literal> と <literal><"
+"subclass></literal> 要素の <literal>discriminator-value</literal> 属性で指"
+"定されます。"
+
+#. Tag: para
+#: basic_mapping.xml:2602
+#, no-c-format
+msgid ""
+"The <literal>force</literal> attribute is only useful if the table contains "
+"rows with \"extra\" discriminator values that are not mapped to a persistent "
+"class. This will not usually be the case."
+msgstr ""
+"永続クラスへマッピングされない「余分な」識別値を持つ行がテーブルにあれば、(そ"
+"のときに限り) <literal>force</literal> 属性は有効です。ただし、普通はそうい"
+"うことはありません。"
+
+#. Tag: para
+#: basic_mapping.xml:2607
+#, no-c-format
+msgid ""
+"The <literal>formula</literal> attribute allows you to declare an arbitrary "
+"SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+"<literal>formula</literal> 属性を使うと、行の型を評価するために任意の SQL 式"
+"を宣言できます:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, fuzzy, no-c-format
+msgid ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+msgstr ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, fuzzy, no-c-format
+msgid "Joined subclass strategy"
+msgstr "joined-subclass"
+
+#. Tag: para
+#: basic_mapping.xml:2618
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass can also be mapped to its own table. This is called the table-"
+"per-subclass mapping strategy. An inherited state is retrieved by joining "
+"with the table of the superclass. A discriminator column is not required for "
+"this mapping strategy. Each subclass must, however, declare a table column "
+"holding the object identifier. The primary key of this table is also a "
+"foreign key to the superclass table and described by the "
+"<classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></"
+"literal> element."
+msgstr ""
+"もう1つの方法として、各サブクラスを自身のテーブルへマッピングすることができま"
+"す (table-per-subclass mapping strategy)。継承した状態はスーパークラスのテー"
+"ブルを使った結合で検索します。 <literal><joined-subclass></literal> 要"
+"素を使用します。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
+#, no-c-format
+msgid ""
+"@Entity @Table(name=\"CATS\")\n"
+"@Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Cat implements Serializable { \n"
+" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+" String getId() { return id; }\n"
+"\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+"public class DomesticCat extends Cat { \n"
+" public String getName() { return name; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2631
+#, no-c-format
+msgid ""
+"The table name still defaults to the non qualified class name. Also if "
+"<classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / "
+"foreign key columns are assumed to have the same names as the primary key "
+"columns of the primary table of the superclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2638
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><joined-subclass></literal> element. For "
+"example:"
+msgstr "<literal>class</literal> 要素を使って、永続クラスを宣言できます:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, fuzzy, no-c-format
+msgid ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+msgstr ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
+#, no-c-format
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr "<literal>table</literal> :サブクラステーブルの名前。"
+
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface to use "
+"for lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (オプション): 遅延初期化プロキシに使用するクラスやイ"
+"ンターフェースを指定します。"
+
+#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (オプション、デフォルトは <literal>true</literal> ): "
+"<literal>lazy=\"false\"</literal> とすると、遅延フェッチが使用できません。"
+
+#. Tag: para
+#: basic_mapping.xml:2679
+#, no-c-format
+msgid ""
+"Use the <literal><key></literal> element to declare the primary key / "
+"foreign key column. The mapping at the start of the chapter would then be re-"
+"written as:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2692
+#, fuzzy, no-c-format
+msgid ""
+"A third option is to map only the concrete classes of an inheritance "
+"hierarchy to tables. This is called the table-per-concrete-class strategy. "
+"Each table defines all persistent states of the class, including the "
+"inherited state. In Hibernate, it is not necessary to explicitly map such "
+"inheritance hierarchies. You can map each class as a separate entity root. "
+"However, if you wish use polymorphic associations (e.g. an association to "
+"the superclass of your hierarchy), you need to use the union subclass "
+"mapping."
+msgstr ""
+"3つ目の選択肢は、継承階層の具象クラスのみをテーブルにマッピングすることです "
+"(the table-per-concrete-class 戦略)。それぞれのテーブルは継承の状態を含めすべ"
+"てのクラスの永続状態を定義します。 Hibernate ではその様な継承階層が必ずしも必"
+"要ではありません。単純にそれぞれのクラスを、別々の <literal><class></"
+"literal> 宣言を使ってマッピングすることができます。しかしポリモーフィックな関"
+"連 (例えば階層のスーパークラスへの関連) を使いたいなら、 <literal><union-"
+"subclass></literal> マッピングを使う必要があります。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2703
+#, no-c-format
+msgid "Or in hbm.xml:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, fuzzy, no-c-format
+msgid ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+msgstr ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid ""
+"No discriminator column or key column is required for this mapping strategy."
+msgstr "このマッピング戦略では識別カラムやキーカラムは必要ありません。"
+
+#. Tag: title
+#: basic_mapping.xml:2751
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2753
+#, 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>@MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
+#, 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
+#: basic_mapping.xml:2768
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as <literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2773
+#, no-c-format
+msgid ""
+"The default access type (field or methods) is used, unless you use the "
+"<literal>@Access</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2778
+#, 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
+#: basic_mapping.xml:2786
+#, 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
+#: basic_mapping.xml:2792
+#, 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
+#: basic_mapping.xml:2797
+#, 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
+#: basic_mapping.xml:2801
+#, 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( \n"
+" name=\"propulsion\", \n"
+" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+")\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2803
+#, 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
+#: basic_mapping.xml:2809
+#, 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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid ""
+"In hbm.xml, simply map the properties of the superclass in the <literal><"
+"class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2821
+#, no-c-format
+msgid "Mapping one entity to several tables"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2823
+#, no-c-format
+msgid ""
+"While not recommended for a fresh schema, some legacy databases force your "
+"to map a single entity on several tables."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2826
+#, no-c-format
+msgid ""
+"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>@JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2834
+#, 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
+#: basic_mapping.xml:2844
+#, no-c-format
+msgid ""
+"There is also additional tuning accessible via the <classname>@org.hibernate."
+"annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, fuzzy, 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 <classname>SELECT</classname> 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> (オプション - デフォルトは <literal>join</"
+"literal> ): <literal>join</literal> を設定した場合、 Hibernate はデフォルト"
+"で、クラスやスーパークラスで定義された <literal><join></literal> を検索"
+"するのに内部結合を使い、サブクラスで定義された <literal><join></"
+"literal> を検索するのに外部結合を使います。 <literal>select</literal> を設定"
+"した場合には、 Hibernate はサブクラスで定義された <literal><join></"
+"literal> の選択に順次選択を使います。この場合、行がサブクラスのインスタンスを"
+"代表することがわかった場合にのみ発行されます。内部結合はクラスやそのスーパー"
+"クラスで定義された <literal><join></literal> を検索するために使用しま"
+"す。"
+
+#. Tag: para
+#: basic_mapping.xml:2862
+#, fuzzy, 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> (オプション - デフォルトは <literal>false</"
+"literal> ): もし可能であれば、 Hibernate はこの結合で定義されているプロパティ"
+"に対し挿入や更新を行いません。"
+
+#. Tag: para
+#: basic_mapping.xml:2868
+#, fuzzy, 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> (オプション - デフォルトは <literal>false</"
+"literal> ): もし可能であれば、 Hibernate はこの結合で定義されたプロパティが "
+"null でない場合にのみ行を挿入し、そのプロパティの検索には常に外部結合を使用し"
+"ます。"
+
+#. Tag: para
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid ""
+"Make sure to use the secondary table name in the <methodname>appliesto</"
+"methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTable(name=\"Cat1\")\n"
+"@org.hibernate.annotations.Table(\n"
+" appliesTo=\"Cat1\",\n"
+" fetch=FetchMode.SELECT,\n"
+" optional=true)\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
+msgstr ""
+"例えば、もし以下のような <literal><properties></literal> マッピングが"
+"あった場合:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, fuzzy, no-c-format
+msgid ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+"\n"
+" <key ... />\n"
+"\n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+msgstr ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+" \n"
+" <key ... />\n"
+" \n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+
+#. Tag: para
+#: basic_mapping.xml:2907
+#, no-c-format
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr "<literal>table</literal> :結合したテーブルの名前"
+
+#. Tag: para
+#: basic_mapping.xml:2924
+#, no-c-format
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
+"if set to <literal>join</literal>, the default, Hibernate will use an inner "
+"join to retrieve a <literal><join></literal> defined by a class or its "
+"superclasses. It will use an outer join for a <literal><join></"
+"literal> defined by a subclass. If set to <literal>select</literal> then "
+"Hibernate will use a sequential select for a <literal><join></literal> "
+"defined on a subclass. This will be issued only if a row represents an "
+"instance of the subclass. Inner joins will still be used to retrieve a "
+"<literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+"<literal>fetch</literal> (オプション - デフォルトは <literal>join</"
+"literal> ): <literal>join</literal> を設定した場合、 Hibernate はデフォルト"
+"で、クラスやスーパークラスで定義された <literal><join></literal> を検索"
+"するのに内部結合を使い、サブクラスで定義された <literal><join></"
+"literal> を検索するのに外部結合を使います。 <literal>select</literal> を設定"
+"した場合には、 Hibernate はサブクラスで定義された <literal><join></"
+"literal> の選択に順次選択を使います。この場合、行がサブクラスのインスタンスを"
+"代表することがわかった場合にのみ発行されます。内部結合はクラスやそのスーパー"
+"クラスで定義された <literal><join></literal> を検索するために使用しま"
+"す。"
+
+#. Tag: para
+#: basic_mapping.xml:2939
+#, no-c-format
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will not insert or update the properties "
+"defined by this join."
+msgstr ""
+"<literal>inverse</literal> (オプション - デフォルトは <literal>false</"
+"literal> ): もし可能であれば、 Hibernate はこの結合で定義されているプロパティ"
+"に対し挿入や更新を行いません。"
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, no-c-format
+msgid ""
+"<literal>optional</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will insert a row only if the properties "
+"defined by this join are non-null. It will always use an outer join to "
+"retrieve the properties."
+msgstr ""
+"<literal>optional</literal> (オプション - デフォルトは <literal>false</"
+"literal> ): もし可能であれば、 Hibernate はこの結合で定義されたプロパティが "
+"null でない場合にのみ行を挿入し、そのプロパティの検索には常に外部結合を使用し"
+"ます。"
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, no-c-format
+msgid ""
+"For example, address information for a person can be mapped to a separate "
+"table while preserving value type semantics for all properties:"
+msgstr ""
+"例えば人のアドレスの情報を分離したテーブルにマッピングすることが可能です (す"
+"べてのプロパティに対して値型のセマンティクスを保持します):"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+msgstr ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, no-c-format
+msgid ""
+"This feature is often only useful for legacy data models. We recommend fewer "
+"tables than classes and a fine-grained domain model. However, it is useful "
+"for switching between inheritance mapping strategies in a single hierarchy, "
+"as explained later."
+msgstr ""
+"この特徴はしばしばレガシーデータモデルに対してのみ有用ですが、クラスよりも少"
+"ないテーブルと、きめの細かいドメインモデルを推奨します。しかし後で説明するよ"
+"うに、1つのクラス階層で継承のマッピング戦略を切り替える時には有用です。"
+
+#. Tag: title
+#: basic_mapping.xml:2967
+#, no-c-format
+msgid "Mapping one to one and one to many associations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2969
+#, no-c-format
+msgid ""
+"To link one entity to an other, you need to map the association property as "
+"a to one association. In the relational model, you can either use a foreign "
+"key or an association table, or (a bit less common) share the same primary "
+"key value between the two entities."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2974
+#, no-c-format
+msgid ""
+"To mark an association, use either <classname>@ManyToOne</classname> or "
+"<classname>@OnetoOne</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2978
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
+#, no-c-format
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than nothing will propagate certain operations to the "
+"associated object. The meaningful values are divided into three categories."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2992
+#, no-c-format
+msgid ""
+"basic operations, which include: <literal>persist, merge, delete, save-"
+"update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2998
+#, fuzzy, no-c-format
+msgid ""
+"special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+"関連が <literal>class</literal> の代わりに <literal>entity-name</literal> を"
+"使って、どのように指定されるのかに注目してください。"
+
+#. Tag: para
+#: basic_mapping.xml:3003
+#, no-c-format
+msgid ""
+"comma-separated combinations of operation names: <literal>cascade=\"persist,"
+"merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. "
+"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
+"that single valued many-to-one associations do not support orphan delete."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3012
+#, no-c-format
+msgid ""
+"By default, single point associations are eagerly fetched in JPA 2. You can "
+"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
+"LAZY) </classname>in which case Hibernate will proxy the association and "
+"load it when the state of the associated entity is reached. You can force "
+"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</"
+"classname>. In this case, the property is fetched lazily when the instance "
+"variable is first accessed. This requires build-time bytecode "
+"instrumentation. lazy=\"false\" specifies that the association will always "
+"be eagerly fetched."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid ""
+"With the default JPA options, single-ended associations are loaded with a "
+"subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used "
+"for <literal>EAGER</literal> associations. You can however adjust the "
+"fetching strategy, ie how data is fetched by using <literal>@Fetch</"
+"literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a "
+"select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, fuzzy, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr "ユニーク外部キー関連"
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, fuzzy, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+"他の永続クラスへの一対一関連は、<literal>one-to-one</literal> 要素で定義しま"
+"す。"
+
+#. Tag: para
+#: basic_mapping.xml:3041
+#, no-c-format
+msgid ""
+"<classname>@ManyToOne</classname> if several entities can point to the the "
+"target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3046
+#, no-c-format
+msgid ""
+"<classname>@OneToOne</classname> if only a single entity can point to the "
+"the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3051
+#, no-c-format
+msgid ""
+"and a foreign key in one table is referencing the primary key column(s) of "
+"the target table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3056
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default value"
+"(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"targetEntity=CompanyImpl.class )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3066
+#, no-c-format
+msgid ""
+"You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing "
+"the target entity table (through <literal>@JoinTable.inverseJoinColumns</"
+"literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3077
+#, no-c-format
+msgid ""
+"You can use a SQL fragment to simulate a physical join column using the "
+"<classname>@JoinColumnOrFormula</classname> / "
+"<classname>@JoinColumnOrformulas</classname> annotations (just like you can "
+"use a SQL fragment to simulate a property column via the "
+"<classname>@Formula</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" @ManyToOne\n"
+" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+" public Person getOwner() {\n"
+" return person;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid ""
+"You can mark an association as mandatory by using the "
+"<literal>optional=false</literal> attribute. We recommend to use Bean "
+"Validation's <classname>@NotNull</classname> annotation as a better "
+"alternative however. As a consequence, the foreign key column(s) will be "
+"marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid ""
+"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. 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."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3100
+#, no-c-format
+msgid "@NotFound annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when "
+"a given entity is deleted. In this case Hibernate generates a cascade delete "
+"constraint at the database level."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name using "
+"<literal>@ForeignKey</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3120
+#, fuzzy, no-c-format
+msgid "@ForeignKey annotation"
+msgstr "ユニーク外部キー関連"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @ForeignKey(name=\"FK_PARENT\")\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3125
+#, no-c-format
+msgid ""
+"Sometimes, you want to link one entity to an other not by the target entity "
+"primary key but by a different unique key. You can achieve that by "
+"referencing the unique key column(s) in <methodname>@JoinColumn."
+"referenceColumnName</methodname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Person {\n"
+" @Id Integer personNumber;\n"
+" String firstName;\n"
+" @Column(name=\"I\")\n"
+" String initial;\n"
+" String lastName;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Home {\n"
+" @ManyToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+" })\n"
+" Person owner\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3132
+#, no-c-format
+msgid ""
+"This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3135
+#, no-c-format
+msgid ""
+"In hbm.xml, mapping an association is similar. The main difference is that a "
+"<classname>@OneToOne</classname> is mapped as <literal><many-to-one "
+"unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional): the name of the foreign key column. "
"This can also be specified by nested <literal><column></literal> "
"element(s)."
@@ -2176,6 +6690,7 @@
"<literal><column></literal> カラムによっても指定されます。"
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, no-c-format
msgid ""
"<literal>class</literal> (optional - defaults to the property type "
@@ -2185,6 +6700,7 @@
"れるプロパティの型): 関連クラスの名前。"
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional): specifies which operations should be "
@@ -2194,6 +6710,7 @@
"へ、どの操作をカスケードするかを指定します。"
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional - defaults to <literal>select</literal>): "
@@ -2204,6 +6721,7 @@
"どちらかを選択します。"
#. Tag: para
+#: basic_mapping.xml:3209
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2221,6 +6739,7 @@
"プロパティが可能になります。"
#. Tag: para
+#: basic_mapping.xml:3219
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2232,6 +6751,7 @@
"す。"
#. Tag: para
+#: basic_mapping.xml:3232
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2245,6 +6765,7 @@
"す。"
#. Tag: para
+#: basic_mapping.xml:3240
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2254,6 +6775,7 @@
"許可する DDL の生成を可能にします。"
#. Tag: para
+#: basic_mapping.xml:3254
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2271,6 +6793,7 @@
"フェッチするよう指定します。"
#. Tag: para
+#: basic_mapping.xml:3264
#, no-c-format
msgid ""
"<literal>not-found</literal> (optional - defaults to <literal>exception</"
@@ -2284,6 +6807,7 @@
"います。"
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, no-c-format
msgid ""
"<literal>entity-name</literal> (optional): the entity name of the associated "
@@ -2292,6 +6816,7 @@
"<literal>entity-name</literal> (オプション):関連したクラスのエンティティ名。"
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2301,7 +6826,8 @@
"部キーに対して値を定義する SQL 式"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3284
+#, fuzzy, no-c-format
msgid ""
"Setting a value of the <literal>cascade</literal> attribute to any "
"meaningful value other than <literal>none</literal> will propagate certain "
@@ -2311,7 +6837,7 @@
"second, special values: <literal>delete-orphan</literal>; and third,"
"<literal>all</literal> comma-separated combinations of operation names: "
"<literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,"
-"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> "
+"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> "
"for a full explanation. Note that single valued, many-to-one and one-to-one, "
"associations do not support orphan delete."
msgstr ""
@@ -2327,13 +6853,23 @@
"delete) をサポートしていないことに注意してください。"
#. Tag: para
+#: basic_mapping.xml:3298
#, no-c-format
msgid ""
"Here is an example of a typical <literal>many-to-one</literal> declaration:"
msgstr ""
"典型的な <literal>many-to-one</literal> 宣言は次のようにシンプルです。:"
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3303
#, no-c-format
msgid ""
"The <literal>property-ref</literal> attribute should only be used for "
@@ -2351,18 +6887,41 @@
"てみてください。( <literal>unique</literal> 属性は SchemaExport ツールを使っ"
"た Hibernate の DDL 生成を制御します。)"
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+msgstr ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3313
#, no-c-format
msgid "Then the mapping for <literal>OrderItem</literal> might use:"
msgstr ""
"以下のように <literal>OrderItem</literal> に対してマッピングを使えます:"
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3318
#, no-c-format
msgid "This is not encouraged, however."
msgstr "しかし、これは決して推奨できません。"
#. Tag: para
+#: basic_mapping.xml:3320
#, no-c-format
msgid ""
"If the referenced unique key comprises multiple properties of the associated "
@@ -2374,6 +6933,7 @@
"ティをマッピングするべきです。"
#. Tag: para
+#: basic_mapping.xml:3324
#, no-c-format
msgid ""
"If the referenced unique key is the property of a component, you can specify "
@@ -2382,23 +6942,117 @@
"もし参照したユニークキーがコンポーネントのプロパティである場合は、プロパティ"
"のパスを指定できます:"
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+msgstr ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+
#. Tag: title
+#: basic_mapping.xml:3331
#, no-c-format
-msgid "One-to-one"
-msgstr "one-to-one"
+msgid "Sharing the primary key with the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3333
#, no-c-format
msgid ""
-"A one-to-one association to another persistent class is declared using a "
-"<literal>one-to-one</literal> element."
+"The second approach is to ensure an entity and its associated entity share "
+"the same primary key. In this case the primary key column is also a foreign "
+"key and there is no extra column. These associations are always one to one."
msgstr ""
-"他の永続クラスへの一対一関連は、<literal>one-to-one</literal> 要素で定義しま"
-"す。"
+#. Tag: title
+#: basic_mapping.xml:3339
+#, fuzzy, no-c-format
+msgid "One to One association"
+msgstr "ユニーク外部キー関連"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @MapsId\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"} \n"
+"\n"
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
msgid ""
+"Many people got confused by these primary key based one to one associations. "
+"They can only be lazily loaded if Hibernate knows that the other side of the "
+"association is always present. To indicate to Hibernate that it is the case, "
+"use <classname>@OneToOne(optional=false)</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3352
+#, no-c-format
+msgid "In hbm.xml, use the following mapping."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3377
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3397
+#, no-c-format
+msgid ""
"<literal>constrained</literal> (optional): specifies that a foreign key "
"constraint on the primary key of the mapped table and references the table "
"of the associated class. This option affects the order in which <literal>save"
@@ -2413,6 +7067,7 @@
"す (そしてスキーマエクスポートツールにも使われます)。"
#. Tag: para
+#: basic_mapping.xml:3413
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2424,6 +7079,7 @@
"す。"
#. Tag: para
+#: basic_mapping.xml:3426
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): almost all one-to-one associations "
@@ -2438,6 +7094,7 @@
"<literal>org.hibernate.test.onetooneformula</literal> を参照してください。)"
#. Tag: para
+#: basic_mapping.xml:3435
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2459,22 +7116,8 @@
"意してください。</emphasis>"
#. Tag: para
+#: basic_mapping.xml:3454
#, no-c-format
-msgid "There are two varieties of one-to-one associations:"
-msgstr "一対一関連には2種類あります:"
-
-#. Tag: para
-#, no-c-format
-msgid "primary key associations"
-msgstr "主キー関連"
-
-#. Tag: para
-#, no-c-format
-msgid "unique foreign key associations"
-msgstr "ユニーク外部キー関連"
-
-#. Tag: para
-#, no-c-format
msgid ""
"Primary key associations do not need an extra table column. If two rows are "
"related by the association, then the two table rows share the same primary "
@@ -2487,6 +7130,7 @@
"入しなければなりません。"
#. Tag: para
+#: basic_mapping.xml:3460
#, no-c-format
msgid ""
"For a primary key association, add the following mappings to "
@@ -2495,7 +7139,22 @@
"主キー関連を行うためには、以下のマッピングを <literal>Employee</literal> と "
"<literal>Person</literal> のそれぞれに追加してください。"
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+
#. Tag: para
+#: basic_mapping.xml:3468
#, no-c-format
msgid ""
"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
@@ -2506,7 +7165,36 @@
"実にしなければいけません。ここでは、 <literal>foreign</literal> という特殊な "
"Hibernate 識別子生成戦略を使います:"
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:3474
#, no-c-format
msgid ""
"A newly saved instance of <literal>Person</literal> is assigned the same "
@@ -2521,40 +7209,23 @@
"る <literal>Employee</literal> インスタンスとして同じ主キーが割り当てられま"
"す。"
-#. Tag: para
-#, no-c-format
-msgid ""
-"Alternatively, a foreign key with a unique constraint, from "
-"<literal>Employee</literal> to <literal>Person</literal>, can be expressed "
-"as:"
-msgstr ""
-"もう1つの方法として、 <literal>Employee</literal> から <literal>Person</"
-"literal> へのユニーク制約を使った外部キー関連は以下のように表現されます:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"This association can be made bidirectional by adding the following to the "
-"<literal>Person</literal> mapping:"
-msgstr ""
-"そしてこの関連は、以下の記述を <literal>Person</literal> のマッピングに追加す"
-"ることで双方向にすることができます:"
-
#. Tag: title
+#: basic_mapping.xml:3482
#, no-c-format
msgid "Natural-id"
msgstr "natural-id"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3484
+#, fuzzy, no-c-format
msgid ""
"Although we recommend the use of surrogate keys as primary keys, you should "
"try to identify natural keys for all entities. A natural key is a property "
"or combination of properties that is unique and non-null. It is also "
-"immutable. Map the properties of the natural key inside the <literal><"
-"natural-id></literal> element. Hibernate will generate the necessary "
-"unique key and nullability constraints and, as a result, your mapping will "
-"be more self-documenting."
+"immutable. Map the properties of the natural key as <classname>@NaturalId</"
+"classname> or map them inside the <literal><natural-id></literal> "
+"element. Hibernate will generate the necessary unique key and nullability "
+"constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
"主キーとして代理キーの使用を推奨しますが、すべてのエンティティに対して自然"
"キーを識別するようにすべきです。自然キーはユニークかつ非 null な一つのプロパ"
@@ -2563,9 +7234,62 @@
"Hibernate は必然的にユニークかつ null 値を許可する制約を生成し、こうしてマッ"
"ピングはより自己記述的になります。"
+#. Tag: programlisting
+#: basic_mapping.xml:3493
+#, 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
+#: basic_mapping.xml:3495
#, no-c-format
+msgid "Or in XML,"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3497
+#, fuzzy, no-c-format
msgid ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+msgstr ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+
+#. Tag: para
+#: basic_mapping.xml:3499
+#, no-c-format
+msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
"<literal>hashCode()</literal> to compare the natural key properties of the "
"entity."
@@ -2574,6 +7298,7 @@
"<literal>hashCode()</literal> の実装を強くお勧めします。"
#. Tag: para
+#: basic_mapping.xml:3503
#, no-c-format
msgid ""
"This mapping is not intended for use with entities that have natural primary "
@@ -2582,6 +7307,7 @@
"このマッピングは自然主キーを使ったエンティティでの使用を意図していません。"
#. Tag: para
+#: basic_mapping.xml:3508
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>false</"
@@ -2593,125 +7319,224 @@
"す。"
#. Tag: title
+#: basic_mapping.xml:3516
#, fuzzy, no-c-format
-msgid "Component and dynamic-component"
-msgstr "component, dynamic-component"
+msgid "<title>Any</title>"
+msgstr "<title>any</title>"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3518
+#, fuzzy, no-c-format
msgid ""
-"The <literal><component></literal> element maps properties of a child "
-"object to columns of the table of a parent class. Components can, in turn, "
-"declare their own properties, components or collections. See the \"Component"
-"\" examples below:"
+"There is one more type of property mapping. The <classname>@Any</classname> "
+"mapping defines a polymorphic association to classes from multiple tables. "
+"This type of mapping requires more than one column. The first column "
+"contains the type of the associated entity. The remaining columns contain "
+"the identifier. It is impossible to specify a foreign key constraint for "
+"this kind of association. This is not the usual way of mapping polymorphic "
+"associations and you should use this only in special cases. For example, for "
+"audit logs, user session data, etc."
msgstr ""
-"<literal><component></literal> 要素は、子オブジェクトのプロパティを親ク"
-"ラスのテーブルのカラムへマッピングします。コンポーネントは自分のプロパティ、"
-"コンポーネント、コレクションの順に定義できます。以下の「コンポーネント」を見"
-"てください。"
+"プロパティマッピングにはさらにもう1つの型があります。 <literal><any></"
+"literal> マッピング要素は、複数のテーブルからクラスへのポリモーフィックな関連"
+"を定義します。この型のマッピングには必ず複数のカラムが必要です。1番目のカラム"
+"は関連エンティティの型を保持します。残りのカラムは識別子を保持します。この種"
+"類の関連には外部キー制約を指定することはできません。そのためこれは最も使われ"
+"ることのない(ポリモーフィックな)関連のマッピング方法です。非常に特別な場合"
+"(例えば、検査ログやユーザーセッションデータなど)に限って、これを使うべきで"
+"す。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3528
+#, fuzzy, no-c-format
msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the name of the component (child) class."
+"The <classname>@Any</classname> 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. The <literal>metaType</"
+"literal> attribute allows the application to specify a custom type that maps "
+"database column values to persistent classes that have identifier properties "
+"of the type specified by <literal>idType</literal>. You must specify the "
+"mapping from values of the <literal>metaType</literal> to class names."
msgstr ""
-"<literal>class</literal> (オプション - デフォルトはリフレクションにより決定"
-"されるプロパティの型): コンポーネント(子)クラスの名前。"
+"<literal>meta-type</literal> により、アプリケーションはカスタム型を指定できま"
+"す。このカスタム型はデータベースカラムの値を、 <literal>id-type</literal> で"
+"指定した型の識別子プロパティを持った永続クラスへマッピングします。 meta-type "
+"の値からクラス名へのマッピングを指定しなければなりません。"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3538
#, no-c-format
msgid ""
-"<literal>insert</literal>: do the mapped columns appear in SQL "
-"<literal>INSERTs</literal>?"
+"@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 ""
-"<literal>insert</literal>:マッピングされたカラムが SQL の <literal>INSERT</"
-"literal> に現れるようにするかどうかを指定します。"
#. Tag: para
+#: basic_mapping.xml:3540
#, no-c-format
msgid ""
-"<literal>update</literal>: do the mapped columns appear in SQL "
-"<literal>UPDATEs</literal>?"
+"Note that <classname>@AnyDef</classname> can be mutualized and reused. It is "
+"recommended to place it as a package metadata in this case."
msgstr ""
-"<literal>update</literal>:マッピングされたカラムが SQL の <literal>UPDATE</"
-"literal> に現れるようにするかどうかを指定します。"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3544
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that this component should be fetched lazily when the instance "
-"variable is first accessed. It requires build-time bytecode instrumentation."
+"//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 ""
-"<literal>lazy</literal> (オプション - デフォルトは <literal>false</"
-"literal> ): インスタンス変数に最初にアクセスしたときに、コンポーネントを遅延"
-"してフェッチするよう指定します。 (バイトコード実装を作成する時間が必要になり"
-"ます)"
#. Tag: para
+#: basic_mapping.xml:3546
#, no-c-format
+msgid "The hbm.xml equivalent is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3548
+#, fuzzy, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this component either do or do not "
-"require acquisition of the optimistic lock. It determines if a version "
-"increment should occur when this property is dirty."
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
msgstr ""
-"<literal>optimistic-lock</literal> (オプション - デフォルトは <literal>true</"
-"literal> ): このプロパティの更新に、楽観ロックの取得を要求するかどうかを指定"
-"します。言い換えれば、このプロパティがダーティであるときにバージョンを増やす"
-"べきかを決定します。"
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
#. Tag: para
+#: basic_mapping.xml:3551
#, no-c-format
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3570
+#, fuzzy, no-c-format
msgid ""
-"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that a unique constraint exists upon all mapped columns of the "
-"component."
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
msgstr ""
-"<literal>unique</literal> (オプション - デフォルトは <literal>false</"
-"literal> ): コンポーネントのすべてのマッピングするカラムに、ユニーク制約が存"
-"在するかを指定します。"
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
#. Tag: para
+#: basic_mapping.xml:3574
#, no-c-format
+msgid "<literal>name</literal>: the property name."
+msgstr "<literal>name</literal>: プロパティ名。"
+
+#. Tag: para
+#: basic_mapping.xml:3578
+#, no-c-format
+msgid "<literal>id-type</literal>: the identifier type."
+msgstr "<literal>id-type</literal>: 識別子の型。"
+
+#. Tag: para
+#: basic_mapping.xml:3582
+#, no-c-format
msgid ""
-"The child <literal><property></literal> tags map properties of the "
-"child class to table columns."
+"<literal>meta-type</literal> (optional - defaults to <literal>string</"
+"literal>): any type that is allowed for a discriminator mapping."
msgstr ""
-"子の <literal><property></literal> タグで、子のクラスのプロパティをテー"
-"ブルカラムにマッピングします。"
+"<literal>meta-type</literal>(オプション - デフォルトは <literal>string</"
+"literal> ): ディスクリミネータマッピングで許された型。"
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
msgid ""
-"The <literal><component></literal> element allows a <literal><"
-"parent></literal> subelement that maps a property of the component class "
-"as a reference back to the containing entity."
+"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
+"the cascade style."
msgstr ""
-"<literal><component></literal> 要素は、親エンティティへ戻る参照として、"
-"コンポーネントのクラスのプロパティをマッピングする <literal><parent></"
-"literal> サブ要素を許可します。"
+"<literal>cascade</literal>(オプション - デフォルトは <literal>none</"
+"literal> ): カスケードのスタイル。"
#. Tag: para
+#: basic_mapping.xml:3599
#, no-c-format
msgid ""
-"The <literal><dynamic-component></literal> element allows a "
-"<literal>Map</literal> to be mapped as a component, where the property names "
-"refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for "
-"more information."
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property either do or do not "
+"require acquisition of the optimistic lock. It defines whether a version "
+"increment should occur if this property is dirty."
msgstr ""
-"<literal><dynamic-component></literal> 要素は、 <literal>Map</literal> "
-"がコンポーネントとしてマッピングされることを可能にします。プロパティ名は map "
-"のキーを参照します。<xref linkend=\"components-dynamic\"/> を参照してくださ"
-"い。"
+"<literal>optimistic-lock</literal> (オプション - デフォルトは <literal>true</"
+"literal> ): このプロパティの更新に楽観ロックの取得を要求するかどうかを指定し"
+"ます。言い換えれば、このプロパティがダーティであるときにバージョンを増やすべ"
+"きかを定義します。"
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
msgid "Properties"
msgstr "プロパティ"
#. Tag: para
+#: basic_mapping.xml:3612
#, no-c-format
msgid ""
"The <literal><properties></literal> element allows the definition of a "
@@ -2726,7 +7551,38 @@
"ことです。それはまた、複数カラムのユニーク制約を定義する簡単な方法でもありま"
"す。"
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, fuzzy, no-c-format
+msgid ""
+"<properties\n"
+" name=\"logicalName\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+msgstr ""
+"<properties \n"
+" name=\"logicalName\" \n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+" \n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+
#. Tag: para
+#: basic_mapping.xml:3636
#, no-c-format
msgid ""
"<literal>name</literal>: the logical name of the grouping. It is "
@@ -2736,6 +7592,7 @@
"<emphasis>ありません</emphasis> 。"
#. Tag: para
+#: basic_mapping.xml:3651
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2749,6 +7606,7 @@
"やすべきかを決定します。"
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
msgid ""
"For example, if we have the following <literal><properties></literal> "
@@ -2757,7 +7615,35 @@
"例えば、もし以下のような <literal><properties></literal> マッピングが"
"あった場合:"
+#. Tag: programlisting
+#: basic_mapping.xml:3669
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+"\n"
+" ...\n"
+" <properties name=\"name\"\n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+" ...\n"
+" <properties name=\"name\" \n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:3671
#, no-c-format
msgid ""
"You might have some legacy data association that refers to this unique key "
@@ -2766,9 +7652,37 @@
"主キーの代わりに <literal>Person</literal> テーブルのユニークキーへの参照を持"
"つ、レガシーデータの関連を持つかもしれません。:"
+#. Tag: programlisting
+#: basic_mapping.xml:3675
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"owner\"\n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+msgstr ""
+"<many-to-one name=\"person\" \n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+
#. Tag: para
+#: basic_mapping.xml:3678
#, no-c-format
msgid ""
+"When using annotations as a mapping strategy, such construct is not "
+"necessary as the binding between a column and its related column on the "
+"associated table is done directly"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3685
+#, no-c-format
+msgid ""
"The use of this outside the context of mapping legacy data is not "
"recommended."
msgstr ""
@@ -2776,263 +7690,289 @@
"せん。"
#. Tag: title
+#: basic_mapping.xml:3690
#, no-c-format
-msgid "Subclass"
-msgstr "subclass"
+msgid "Some hbm.xml specificities"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3692
#, no-c-format
msgid ""
-"Polymorphic persistence requires the declaration of each subclass of the "
-"root persistent class. For the table-per-class-hierarchy mapping strategy, "
-"the <literal><subclass></literal> declaration is used. For example:"
+"The hbm.xml structure has some specificities naturally not present when "
+"using annotations, let's describe them briefly."
msgstr ""
-"最後にポリモーフィックな永続化には、ルートの永続クラスの各サブクラスの定義が"
-"必要です。 table-per-class-hierarchy マッピング戦略では、 <literal><"
-"subclass></literal> 定義が使われます。"
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3696
#, no-c-format
-msgid ""
-"<literal>name</literal>: the fully qualified class name of the subclass."
-msgstr "<literal>name</literal>:サブクラスの完全修飾されたクラス名。"
+msgid "Doctype"
+msgstr "Doctype"
#. Tag: para
+#: basic_mapping.xml:3698
#, no-c-format
msgid ""
-"<literal>discriminator-value</literal> (optional - defaults to the class "
-"name): a value that distinguishes individual subclasses."
+"All XML mappings should declare the doctype shown. The actual DTD can be "
+"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
+"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
+"will always look for the DTD in its classpath first. If you experience "
+"lookups of the DTD using an Internet connection, check the DTD declaration "
+"against the contents of your classpath."
msgstr ""
-"<literal>discriminator-value</literal>(オプション - デフォルトはクラス"
-"名): 個々のサブクラスを区別するための値。"
+"XML マッピングでは、お見せしたようなドキュメント型を必ず定義すべきです。実際"
+"の DTD は、上記の URL の <literal>hibernate-x.x.x/src/org/hibernate</"
+"literal> ディレクトリ、または <literal>hibernate.jar</literal> 内にありま"
+"す。 Hibernate は常に、そのクラスパス内で DTD を探し始めます。インターネット"
+"にある DTD ファイルを探そうとしたなら、クラスパスの内容を見て、 DTD 宣言を確"
+"認してください。"
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3707
#, no-c-format
-msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface used for "
-"lazy initializing proxies."
-msgstr ""
-"<literal>proxy</literal> (オプション): 遅延初期化プロキシに使用するクラスやイ"
-"ンターフェースを指定します。"
+msgid "EntityResolver"
+msgstr "エンティティリゾルバ"
#. Tag: para
+#: basic_mapping.xml:3709
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
+"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
+"implementation with the SAXReader it uses to read in the xml files. This "
+"custom <literal>EntityResolver</literal> recognizes two different systemId "
+"namespaces:"
msgstr ""
-"<literal>lazy</literal> (オプション、デフォルトは <literal>true</literal> ): "
-"<literal>lazy=\"false\"</literal> とすると、遅延フェッチが使用できません。"
+"前述したように、 Hibernate はまずクラスパス内で DTD を解決しようとします。 "
+"<literal>org.xml.sax.EntityResolver</literal> のカスタム実装を XML ファイルを"
+"読み込むための SAXReader に登録することによって、 DTD を解決します。このカス"
+"タムの <literal>EntityResolver</literal> は2つの異なるシステム ID 名前空間を"
+"認識します。"
#. Tag: para
+#: basic_mapping.xml:3718
#, no-c-format
msgid ""
-"Each subclass declares its own persistent properties and subclasses. "
-"<literal><version></literal> and <literal><id></literal> "
-"properties are assumed to be inherited from the root class. Each subclass in "
-"a hierarchy must define a unique <literal>discriminator-value</literal>. If "
-"this is not specified, the fully qualified Java class name is used."
+"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
+"encounters a systemId starting with <literal>http://hibernate.sourceforge."
+"net/</literal>. The resolver attempts to resolve these entities via the "
+"classloader which loaded the Hibernate classes."
msgstr ""
-"各サブクラスでは、永続プロパティとサブクラスを定義します。 <literal><"
-"version></literal> と <literal><id></literal> プロパティは、ルートク"
-"ラスから継承されると仮定されます。階層構造におけるサブクラスは、ユニークな "
-"<literal>discriminator-value</literal> を定義しなければなりません。 none が指"
-"定されると、完全修飾された Java クラス名が使われます。"
+"<literal>hibernate namespace</literal> は、リゾルバが <literal>http://"
+"hibernate.sourceforge.net/</literal> で始まるシステム ID に到達したときに認識"
+"されます。そしてリゾルバは、 Hibernate のクラスをロードしたクラスローダを用い"
+"て、これらのエンティティを解決しようとします。"
#. Tag: para
+#: basic_mapping.xml:3726
#, no-c-format
msgid ""
-"For information about inheritance mappings see <xref linkend=\"inheritance"
-"\" />."
+"a <literal>user namespace</literal> is recognized whenever the resolver "
+"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
+"The resolver will attempt to resolve these entities via (1) the current "
+"thread context classloader and (2) the classloader which loaded the "
+"Hibernate classes."
msgstr ""
-"継承のマッピングに関する情報は <xref linkend=\"inheritance\"/> を参照してくだ"
-"さい。"
+"<literal>user namespace</literal> は、リゾルバが URL プロトコルの "
+"<literal>classpath://</literal> を使ったシステム ID に到達したときに、認識さ"
+"れます。そしてリゾルバは、 (1) カレントスレッドのコンテキストクラスローダー、"
+"または (2) Hibernate のクラスをロードしたクラスローダを使って、これらのエン"
+"ティティを解決しようとします。"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3735
#, no-c-format
-msgid "Joined-subclass"
-msgstr "joined-subclass"
+msgid "The following is an example of utilizing user namespacing:"
+msgstr "下記は、ユーザー名前空間を使った例です:"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3738
#, no-c-format
msgid ""
-"Each subclass can also be mapped to its own table. This is called the table-"
-"per-subclass mapping strategy. An inherited state is retrieved by joining "
-"with the table of the superclass. To do this you use the <literal><joined-"
-"subclass></literal> element. For example:"
+"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
msgstr ""
-"もう1つの方法として、各サブクラスを自身のテーブルへマッピングすることができま"
-"す (table-per-subclass mapping strategy)。継承した状態はスーパークラスのテー"
-"ブルを使った結合で検索します。 <literal><joined-subclass></literal> 要"
-"素を使用します。"
#. Tag: para
-#, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
-msgstr "<literal>table</literal> :サブクラステーブルの名前。"
-
-#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3740
+#, fuzzy, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface to use "
-"for lazy initializing proxies."
+"Where <literal>types.xml</literal> is a resource in the <literal>your."
+"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
+"custom\">typedef</link>."
msgstr ""
-"<literal>proxy</literal> (オプション): 遅延初期化プロキシに使用するクラスやイ"
-"ンターフェースを指定します。"
+"ここで <literal>types.xml</literal> は <literal>your.domain</literal> パッ"
+"ケージ内のリソースであり、カスタム型定義 <xref linkend=\"mapping-types-custom"
+"\"/> を含みます。"
+#. Tag: title
+#: basic_mapping.xml:3747
+#, fuzzy, no-c-format
+msgid "Hibernate-mapping"
+msgstr "hibernate-mapping"
+
#. Tag: para
+#: basic_mapping.xml:3749
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"This element has several optional attributes. The <literal>schema</literal> "
+"and <literal>catalog</literal> attributes specify that tables referred to in "
+"this mapping belong to the named schema and/or catalog. If they are "
+"specified, tablenames will be qualified by the given schema and catalog "
+"names. If they are missing, tablenames will be unqualified. The "
+"<literal>default-cascade</literal> attribute specifies what cascade style "
+"should be assumed for properties and collections that do not specify a "
+"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
+"literal> attribute allows you to use unqualified class names in the query "
+"language."
msgstr ""
-"<literal>lazy</literal> (オプション、デフォルトは <literal>true</literal> ): "
-"<literal>lazy=\"false\"</literal> とすると、遅延フェッチが使用できません。"
+"この要素にはいくつかオプション属性があります。 <literal>schema</literal> 属性"
+"と <literal>catalog</literal> 属性は、このマッピングが参照するテーブルが、こ"
+"の属性によって指定されたスキーマと(または)カタログに属することを指定します。"
+"この属性が指定されると、テーブル名は与えられたスキーマ名とカタログ名で修飾さ"
+"れます。これらの属性が指定されていなければ、テーブル名は修飾されません。 "
+"<literal>default-cascade</literal> 属性は、 <literal>cascade</literal> 属性を"
+"指定していないプロパティやコレクションに、どのカスケードスタイルを割り当てる"
+"かを指定します。 <literal>auto-import</literal> 属性は、クエリ言語内で修飾さ"
+"れていないクラス名を、デフォルトで使えるようにします。"
-#. Tag: para
-#, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:3778
+#, fuzzy, no-c-format
msgid ""
-"A discriminator column is not required for this mapping strategy. Each "
-"subclass must, however, declare a table column holding the object identifier "
-"using the <literal><key></literal> element. The mapping at the start "
-"of the chapter would then be re-written as:"
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
msgstr ""
-"このマッピング戦略には、識別カラムは必要ありません。しかし各サブクラスは "
-"<literal><key></literal> 要素を使い、オブジェクト識別子を保持するテーブ"
-"ルカラムを定義しなければなりません。この章の初めのマッピングは以下のように書"
-"き直せます:"
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3782
#, no-c-format
-msgid "Union-subclass"
-msgstr "union-subclass"
+msgid "<literal>schema</literal> (optional): the name of a database schema."
+msgstr "<literal>schema</literal>(オプション):データベーススキーマの名前。"
#. Tag: para
+#: basic_mapping.xml:3787
#, no-c-format
-msgid ""
-"A third option is to map only the concrete classes of an inheritance "
-"hierarchy to tables. This is called the table-per-concrete-class strategy. "
-"Each table defines all persistent states of the class, including the "
-"inherited state. In Hibernate, it is not necessary to explicitly map such "
-"inheritance hierarchies. You can map each class with a separate <literal><"
-"class></literal> declaration. However, if you wish use polymorphic "
-"associations (e.g. an association to the superclass of your hierarchy), you "
-"need to use the <literal><union-subclass></literal> mapping. For "
-"example:"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
msgstr ""
-"3つ目の選択肢は、継承階層の具象クラスのみをテーブルにマッピングすることです "
-"(the table-per-concrete-class 戦略)。それぞれのテーブルは継承の状態を含めすべ"
-"てのクラスの永続状態を定義します。 Hibernate ではその様な継承階層が必ずしも必"
-"要ではありません。単純にそれぞれのクラスを、別々の <literal><class></"
-"literal> 宣言を使ってマッピングすることができます。しかしポリモーフィックな関"
-"連 (例えば階層のスーパークラスへの関連) を使いたいなら、 <literal><union-"
-"subclass></literal> マッピングを使う必要があります。"
+"<literal>catalog</literal> (オプション):データベースカタログの名前。"
#. Tag: para
+#: basic_mapping.xml:3792
#, no-c-format
msgid ""
-"No discriminator column or key column is required for this mapping strategy."
-msgstr "このマッピング戦略では識別カラムやキーカラムは必要ありません。"
+"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
+"literal>): a default cascade style."
+msgstr ""
+"<literal>default-cascade</literal> (オプション - デフォルトは "
+"<literal>none</literal>): デフォルトのカスケードスタイル。"
-#. Tag: title
-#, no-c-format
-msgid "Join"
-msgstr "join"
-
#. Tag: para
+#: basic_mapping.xml:3797
#, no-c-format
msgid ""
-"Using the <literal><join></literal> element, it is possible to map "
-"properties of one class to several tables that have a one-to-one "
-"relationship. For example:"
+"<literal>default-access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing all properties. "
+"It can be a custom implementation of <literal>PropertyAccessor</literal>."
msgstr ""
-"テーブル間に一対一の関係があるとき、 <literal><join></literal> 要素を使"
-"うことで、1つのクラスのプロパティをいくつものテーブルにマッピングすることが"
-"できます。"
+"<literal>default-access</literal> (オプション - デフォルトは "
+"<literal>property</literal> ): Hibernate がプロパティにアクセスする際に取る"
+"べき戦略。 <literal>PropertyAccessor</literal> を実装することでカスタマイズ可"
+"能。"
#. Tag: para
+#: basic_mapping.xml:3804
#, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
-msgstr "<literal>table</literal> :結合したテーブルの名前"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"if set to <literal>join</literal>, the default, Hibernate will use an inner "
-"join to retrieve a <literal><join></literal> defined by a class or its "
-"superclasses. It will use an outer join for a <literal><join></"
-"literal> defined by a subclass. If set to <literal>select</literal> then "
-"Hibernate will use a sequential select for a <literal><join></literal> "
-"defined on a subclass. This will be issued only if a row represents an "
-"instance of the subclass. Inner joins will still be used to retrieve a "
-"<literal><join></literal> defined by the class and its superclasses."
+"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
+"literal>): the default value for unspecified <literal>lazy</literal> "
+"attributes of class and collection mappings."
msgstr ""
-"<literal>fetch</literal> (オプション - デフォルトは <literal>join</"
-"literal> ): <literal>join</literal> を設定した場合、 Hibernate はデフォルト"
-"で、クラスやスーパークラスで定義された <literal><join></literal> を検索"
-"するのに内部結合を使い、サブクラスで定義された <literal><join></"
-"literal> を検索するのに外部結合を使います。 <literal>select</literal> を設定"
-"した場合には、 Hibernate はサブクラスで定義された <literal><join></"
-"literal> の選択に順次選択を使います。この場合、行がサブクラスのインスタンスを"
-"代表することがわかった場合にのみ発行されます。内部結合はクラスやそのスーパー"
-"クラスで定義された <literal><join></literal> を検索するために使用しま"
-"す。"
+"<literal>default-lazy</literal> (オプション - デフォルトは <literal>true</"
+"literal> ): <literal>lazy</literal> 属性が指定されていないクラスやコレクショ"
+"ンマッピングに対するデフォルト値。"
#. Tag: para
+#: basic_mapping.xml:3811
#, no-c-format
msgid ""
-"<literal>inverse</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will not insert or update the properties "
-"defined by this join."
+"<literal>auto-import</literal> (optional - defaults to <literal>true</"
+"literal>): specifies whether we can use unqualified class names of classes "
+"in this mapping in the query language."
msgstr ""
-"<literal>inverse</literal> (オプション - デフォルトは <literal>false</"
-"literal> ): もし可能であれば、 Hibernate はこの結合で定義されているプロパティ"
-"に対し挿入や更新を行いません。"
+"<literal>auto-import</literal> (オプション - デフォルトは <literal>true</"
+"literal>):クエリ言語内で、(このマッピング内のクラスの)修飾されていないク"
+"ラス名を使えるかどうかを指定します。"
#. Tag: para
+#: basic_mapping.xml:3818
#, no-c-format
msgid ""
-"<literal>optional</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will insert a row only if the properties "
-"defined by this join are non-null. It will always use an outer join to "
-"retrieve the properties."
+"<literal>package</literal> (optional): specifies a package prefix to use for "
+"unqualified class names in the mapping document."
msgstr ""
-"<literal>optional</literal> (オプション - デフォルトは <literal>false</"
-"literal> ): もし可能であれば、 Hibernate はこの結合で定義されたプロパティが "
-"null でない場合にのみ行を挿入し、そのプロパティの検索には常に外部結合を使用し"
-"ます。"
+"<literal>package</literal> (オプション): マッピングドキュメント内で修飾されて"
+"いないクラス名に対して割り当てる、パッケージの接頭辞 (prefix) を指定します。"
#. Tag: para
+#: basic_mapping.xml:3825
#, no-c-format
msgid ""
-"For example, address information for a person can be mapped to a separate "
-"table while preserving value type semantics for all properties:"
+"If you have two persistent classes with the same unqualified name, you "
+"should set <literal>auto-import=\"false\"</literal>. An exception will "
+"result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
-"例えば人のアドレスの情報を分離したテーブルにマッピングすることが可能です (す"
-"べてのプロパティに対して値型のセマンティクスを保持します):"
+"(修飾されていない)同じ名前の永続クラスが2つあるなら、 <literal>auto-import="
+"\"false\"</literal> を設定すべきです。2つのクラスに\"インポートされた\"同じ名"
+"前を割り当てようとすると、 Hibernate は例外を送出します。"
#. Tag: para
+#: basic_mapping.xml:3830
#, no-c-format
msgid ""
-"This feature is often only useful for legacy data models. We recommend fewer "
-"tables than classes and a fine-grained domain model. However, it is useful "
-"for switching between inheritance mapping strategies in a single hierarchy, "
-"as explained later."
+"The <literal>hibernate-mapping</literal> element allows you to nest several "
+"persistent <literal><class></literal> mappings, as shown above. It is, "
+"however, good practice (and expected by some tools) to map only a single "
+"persistent class, or a single class hierarchy, in one mapping file and name "
+"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
+"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
+"<literal>Animal.hbm.xml</literal>."
msgstr ""
-"この特徴はしばしばレガシーデータモデルに対してのみ有用ですが、クラスよりも少"
-"ないテーブルと、きめの細かいドメインモデルを推奨します。しかし後で説明するよ"
-"うに、1つのクラス階層で継承のマッピング戦略を切り替える時には有用です。"
+"<literal>hibernate-mapping</literal> 要素は、最初の例で示したようにいくつかの"
+"永続 <literal><class></literal> マッピングをネストできます。しかし、1"
+"つのマッピングファイルではただひとつの永続クラス(またはひとつのクラス階層)に"
+"マッピングするようにし、さらに永続スーパークラスの後で指定するべきでしょう(い"
+"くつかのツールはこのようなマッピングファイルを想定しています)。例えば次のよう"
+"になります。: <literal>Cat.hbm.xml</literal> , <literal>Dog.hbm.xml</"
+"literal> , または継承を使うなら <literal>Animal.hbm.xml</literal> 。"
#. Tag: title
-#, no-c-format
-msgid "Key"
-msgstr ""
+#: basic_mapping.xml:3841
+#, fuzzy, no-c-format
+msgid "<title>Key</title>"
+msgstr "<title>key</title>"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3843
+#, fuzzy, no-c-format
msgid ""
-"The <literal><key></literal> element has featured a few times within "
+"The <literal><key></literal> element is featured a few times within "
"this guide. It appears anywhere the parent mapping element defines a join to "
"a new table that references the primary key of the original table. It also "
"defines the foreign key in the joined table:"
@@ -3041,7 +7981,30 @@
"しいテーブルへの結合を定義したり、結合テーブルで外部キーを定義したりする親要"
"素のどこにでも現れ、オリジナルテーブルの主キーを参照します。"
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, fuzzy, no-c-format
+msgid ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+msgstr ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:3874
#, no-c-format
msgid ""
"<literal>on-delete</literal> (optional - defaults to <literal>noaction</"
@@ -3053,6 +8016,7 @@
"定します。"
#. Tag: para
+#: basic_mapping.xml:3880
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): specifies that the foreign key "
@@ -3064,6 +8028,7 @@
"す)。"
#. Tag: para
+#: basic_mapping.xml:3886
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): specifies that the foreign key "
@@ -3075,6 +8040,7 @@
"ます)。"
#. Tag: para
+#: basic_mapping.xml:3892
#, no-c-format
msgid ""
"<literal>update</literal> (optional): specifies that the foreign key should "
@@ -3086,6 +8052,7 @@
"す)。"
#. Tag: para
+#: basic_mapping.xml:3898
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): specifies that the foreign key should "
@@ -3097,6 +8064,7 @@
"ます)。"
#. Tag: para
+#: basic_mapping.xml:3905
#, no-c-format
msgid ""
"For systems where delete performance is important, we recommend that all "
@@ -3114,6 +8082,7 @@
"るということに注意してください。"
#. Tag: para
+#: basic_mapping.xml:3913
#, no-c-format
msgid ""
"The <literal>not-null</literal> and <literal>update</literal> attributes are "
@@ -3128,51 +8097,13 @@
"カラムを宣言 <emphasis> しなくてはなりません</emphasis> 。"
#. Tag: title
-#, no-c-format
-msgid "Column and formula elements"
-msgstr "column と formula 要素"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Mapping elements which accept a <literal>column</literal> attribute will "
-"alternatively accept a <literal><column></literal> subelement. "
-"Likewise, <literal><formula></literal> is an alternative to the "
-"<literal>formula</literal> attribute. For example:"
-msgstr ""
-"<literal>column</literal> 属性を記述できる任意のマッピング要素はまた、 "
-"<literal><column></literal> サブ要素も記述できます。同様に "
-"<literal><formula></literal> も <literal>formula</literal> 属性の代替手"
-"段です。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Most of the attributes on <literal>column</literal> provide a means of "
-"tailoring the DDL during automatic schema generation. The <literal>read</"
-"literal> and <literal>write</literal> attributes allow you to specify custom "
-"SQL that Hibernate will use to access the column's value. For more on this, "
-"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
-"read and write expressions</link>."
-msgstr ""
-
-#. Tag: para
+#: basic_mapping.xml:3922
#, fuzzy, no-c-format
-msgid ""
-"The <literal>column</literal> and <literal>formula</literal> elements can "
-"even be combined within the same property or association mapping to express, "
-"for example, exotic join conditions."
-msgstr ""
-"同じプロパティや関連のマッピングの中で、 <literal>column</literal> と "
-"<literal>formula</literal> 属性を組み合わせることができます。例えば、特殊な結"
-"合条件などです。"
-
-#. Tag: title
-#, fuzzy, no-c-format
msgid "Import"
msgstr "import"
#. Tag: para
+#: basic_mapping.xml:3924
#, no-c-format
msgid ""
"If your application has two persistent classes with the same name, and you "
@@ -3187,13 +8118,35 @@
"たものであると明示できます。明示的にマッピングされていないクラスやインター"
"フェースでさえもインポートできます。"
+#. Tag: programlisting
+#: basic_mapping.xml:3930
+#, fuzzy, no-c-format
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3939
+#, fuzzy, no-c-format
+msgid ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+msgstr ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:3943
#, no-c-format
msgid ""
"<literal>class</literal>: the fully qualified class name of any Java class."
msgstr "<literal>class</literal>: Java クラスの完全修飾されたクラス名。"
#. Tag: para
+#: basic_mapping.xml:3948
#, no-c-format
msgid ""
"<literal>rename</literal> (optional - defaults to the unqualified class "
@@ -3202,98 +8155,124 @@
"<literal>rename</literal> (オプション - デフォルトは修飾されていないクラス"
"名): クエリ言語で使われる名前。"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3956
#, no-c-format
-msgid "Any"
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:3962
+#, no-c-format
+msgid "Column and formula elements"
+msgstr "column と formula 要素"
+
#. Tag: para
+#: basic_mapping.xml:3964
#, no-c-format
msgid ""
-"There is one more type of property mapping. The <literal><any></"
-"literal> mapping element defines a polymorphic association to classes from "
-"multiple tables. This type of mapping requires more than one column. The "
-"first column contains the type of the associated entity. The remaining "
-"columns contain the identifier. It is impossible to specify a foreign key "
-"constraint for this kind of association. This is not the usual way of "
-"mapping polymorphic associations and you should use this only in special "
-"cases. For example, for audit logs, user session data, etc."
+"Mapping elements which accept a <literal>column</literal> attribute will "
+"alternatively accept a <literal><column></literal> subelement. "
+"Likewise, <literal><formula></literal> is an alternative to the "
+"<literal>formula</literal> attribute. For example:"
msgstr ""
-"プロパティマッピングにはさらにもう1つの型があります。 <literal><any></"
-"literal> マッピング要素は、複数のテーブルからクラスへのポリモーフィックな関連"
-"を定義します。この型のマッピングには必ず複数のカラムが必要です。1番目のカラム"
-"は関連エンティティの型を保持します。残りのカラムは識別子を保持します。この種"
-"類の関連には外部キー制約を指定することはできません。そのためこれは最も使われ"
-"ることのない(ポリモーフィックな)関連のマッピング方法です。非常に特別な場合"
-"(例えば、検査ログやユーザーセッションデータなど)に限って、これを使うべきで"
-"す。"
+"<literal>column</literal> 属性を記述できる任意のマッピング要素はまた、 "
+"<literal><column></literal> サブ要素も記述できます。同様に "
+"<literal><formula></literal> も <literal>formula</literal> 属性の代替手"
+"段です。"
-#. Tag: para
-#, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:3970
+#, fuzzy, no-c-format
msgid ""
-"The <literal>meta-type</literal> attribute allows the application to specify "
-"a custom type that maps database column values to persistent classes that "
-"have identifier properties of the type specified by <literal>id-type</"
-"literal>. You must specify the mapping from values of the meta-type to class "
-"names."
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"\n"
+" read=\"SQL expression\"\n"
+" write=\"SQL expression\"/>"
msgstr ""
-"<literal>meta-type</literal> により、アプリケーションはカスタム型を指定できま"
-"す。このカスタム型はデータベースカラムの値を、 <literal>id-type</literal> で"
-"指定した型の識別子プロパティを持った永続クラスへマッピングします。 meta-type "
-"の値からクラス名へのマッピングを指定しなければなりません。"
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"/>"
-#. Tag: para
-#, no-c-format
-msgid "<literal>name</literal>: the property name."
-msgstr "<literal>name</literal>: プロパティ名。"
+#. Tag: programlisting
+#: basic_mapping.xml:3972
+#, fuzzy, no-c-format
+msgid "<formula>SQL expression</formula>"
+msgstr "<formula>SQL expression</formula>"
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "<literal>id-type</literal>: the identifier type."
-msgstr "<literal>id-type</literal>: 識別子の型。"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>meta-type</literal> (optional - defaults to <literal>string</"
-"literal>): any type that is allowed for a discriminator mapping."
+"Most of the attributes on <literal>column</literal> provide a means of "
+"tailoring the DDL during automatic schema generation. The <literal>read</"
+"literal> and <literal>write</literal> attributes allow you to specify custom "
+"SQL that Hibernate will use to access the column's value. For more on this, "
+"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
+"read and write expressions</link>."
msgstr ""
-"<literal>meta-type</literal>(オプション - デフォルトは <literal>string</"
-"literal> ): ディスクリミネータマッピングで許された型。"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3982
+#, fuzzy, no-c-format
msgid ""
-"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
-"the cascade style."
+"The <literal>column</literal> and <literal>formula</literal> elements can "
+"even be combined within the same property or association mapping to express, "
+"for example, exotic join conditions."
msgstr ""
-"<literal>cascade</literal>(オプション - デフォルトは <literal>none</"
-"literal> ): カスケードのスタイル。"
+"同じプロパティや関連のマッピングの中で、 <literal>column</literal> と "
+"<literal>formula</literal> 属性を組み合わせることができます。例えば、特殊な結"
+"合条件などです。"
-#. Tag: para
-#, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:3986
+#, fuzzy, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this property either do or do not "
-"require acquisition of the optimistic lock. It defines whether a version "
-"increment should occur if this property is dirty."
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
msgstr ""
-"<literal>optimistic-lock</literal> (オプション - デフォルトは <literal>true</"
-"literal> ): このプロパティの更新に楽観ロックの取得を要求するかどうかを指定し"
-"ます。言い換えれば、このプロパティがダーティであるときにバージョンを増やすべ"
-"きかを定義します。"
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
#. Tag: title
+#: basic_mapping.xml:3992
#, no-c-format
msgid "Hibernate types"
msgstr "Hibernate の型"
#. Tag: title
+#: basic_mapping.xml:3995
#, no-c-format
msgid "Entities and values"
msgstr "エンティティと値"
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
msgid ""
"In relation to the persistence service, Java language-level objects are "
@@ -3301,6 +8280,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4000
#, no-c-format
msgid ""
"An <emphasis>entity</emphasis> exists independently of any other objects "
@@ -3324,6 +8304,7 @@
"それらはバージョン付けすることもできます。"
#. Tag: para
+#: basic_mapping.xml:4010
#, no-c-format
msgid ""
"An entity's persistent state consists of references to other entities and "
@@ -3346,6 +8327,7 @@
"エンティティやコレクションがこれを共有することはできません。"
#. Tag: para
+#: basic_mapping.xml:4020
#, no-c-format
msgid ""
"Until now, we have been using the term \"persistent class\" to refer to "
@@ -3372,11 +8354,13 @@
"に対する良いヒントになります。一方合成集約や集約は、通常値型へ変換されます。"
#. Tag: para
+#: basic_mapping.xml:4033
#, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
msgstr "本ドキュメントを通して、何度もこの概念を取り上げます。"
#. Tag: para
+#: basic_mapping.xml:4036
#, no-c-format
msgid ""
"The challenge is to map the Java type system, and the developers' definition "
@@ -3401,6 +8385,7 @@
"身のマッピング型を記述し、同様にカスタムの変換戦略を実装することができます。"
#. Tag: para
+#: basic_mapping.xml:4049
#, no-c-format
msgid ""
"With the exception of collections, all built-in Hibernate types support null "
@@ -3410,11 +8395,13 @@
"ポートします。"
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
msgid "Basic value types"
msgstr "基本的な型"
#. Tag: para
+#: basic_mapping.xml:4056
#, no-c-format
msgid ""
"The built-in <emphasis>basic mapping types</emphasis> can be roughly "
@@ -3423,16 +8410,18 @@
"組み込みの <emphasis>基本的なマッピング型</emphasis> は大まかに以下のように分"
"けられます。"
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4059
+#, fuzzy, no-c-format
msgid ""
-"<literal>integer, long, short, float, double, character, byte, boolean, "
-"yes_no, true_false</literal>"
+"integer, long, short, float, double, character, byte, boolean, yes_no, "
+"true_false"
msgstr ""
"<literal>integer, long, short, float, double, character, byte, boolean, "
"yes_no, true_false</literal>"
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
msgid ""
"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
@@ -3445,12 +8434,14 @@
"<literal>true_false</literal> は、すべて Java の <literal>boolean</literal> "
"または <literal>java.lang.Boolean</literal> の代替エンコードです。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>string</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4073
+#, no-c-format
+msgid "string"
+msgstr "string"
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</"
@@ -3459,12 +8450,14 @@
"<literal>java.lang.String</literal> から <literal>VARCHAR</literal> (または "
"Oracle の <literal>VARCHAR2</literal> )への型マッピング。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4083
+#, fuzzy, no-c-format
+msgid "date, time, timestamp"
msgstr "<literal>date, time, timestamp</literal>"
#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Date</literal> and its subclasses to "
@@ -3475,12 +8468,14 @@
"<literal>DATE</literal> 、 <literal>TIME</literal> 、 <literal>TIMESTAMP</"
"literal> (またはそれらと等価なもの) への型マッピング。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4094
+#, fuzzy, no-c-format
+msgid "calendar, calendar_date"
msgstr "<literal>calendar, calendar_date</literal>"
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Calendar</literal> to SQL types "
@@ -3490,12 +8485,14 @@
"literal> 、 <literal>DATE</literal> (またはそれらと等価なもの)への型マッピン"
"グ。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4104
+#, fuzzy, no-c-format
+msgid "big_decimal, big_integer"
msgstr "<literal>big_decimal, big_integer</literal>"
#. Tag: para
+#: basic_mapping.xml:4107
#, no-c-format
msgid ""
"Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java."
@@ -3506,12 +8503,14 @@
"literal> から <literal>NUMERIC</literal>(または Oracle の <literal>NUMBER</"
"literal> )への型マッピング。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4115
+#, fuzzy, no-c-format
+msgid "locale, timezone, currency"
msgstr "<literal>locale, timezone, currency</literal>"
#. Tag: para
+#: basic_mapping.xml:4118
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Locale</literal>, <literal>java.util."
@@ -3528,12 +8527,14 @@
"れらの ISO コードにマッピングされます。 <literal>TimeZone</literal> のインス"
"タンスは、それらの <literal>ID</literal> にマッピングされます。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4131
#, fuzzy, no-c-format
-msgid "<literal>class</literal>"
-msgstr "<literal>sequence-identity</literal>"
+msgid "class"
+msgstr "subclass"
#. Tag: para
+#: basic_mapping.xml:4134
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</"
@@ -3544,22 +8545,26 @@
"Oracle の <literal>VARCHAR2</literal> )への型マッピング。 <literal>Class</"
"literal> はその完全修飾された名前にマッピングされます。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>binary</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4142
+#, no-c-format
+msgid "binary"
+msgstr "binary"
#. Tag: para
+#: basic_mapping.xml:4145
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr "バイト配列は、適切な SQL のバイナリ型にマッピングされます。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>text</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4150
+#, no-c-format
+msgid "text"
+msgstr "text"
#. Tag: para
+#: basic_mapping.xml:4153
#, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</"
@@ -3568,12 +8573,14 @@
"長い Java 文字列は、 SQL の <literal>CLOB</literal> または <literal>TEXT</"
"literal> 型にマッピングされます。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>serializable</literal>"
-msgstr "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4159
+#, no-c-format
+msgid "serializable"
+msgstr "serializable"
#. Tag: para
+#: basic_mapping.xml:4162
#, no-c-format
msgid ""
"Maps serializable Java types to an appropriate SQL binary type. You can also "
@@ -3585,12 +8592,14 @@
"前を指定することで、 Hibernate の型を <literal>serializable</literal> とする"
"こともできます。"
-#. Tag: term
-#, fuzzy, no-c-format
-msgid "<literal>clob, blob</literal>"
-msgstr "<literal>calendar, calendar_date</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4171
+#, no-c-format
+msgid "clob, blob"
+msgstr "clob, blob"
#. Tag: para
+#: basic_mapping.xml:4174
#, no-c-format
msgid ""
"Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and "
@@ -3603,16 +8612,18 @@
"外では再利用できないため、アプリケーションによっては不便かもしれません。(さ"
"らにはドライバサポートが一貫していません。)"
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4184
+#, fuzzy, no-c-format
msgid ""
-"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
-"imm_serializable, imm_binary</literal>"
+"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary"
msgstr ""
"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary</literal>"
#. Tag: para
+#: basic_mapping.xml:4188
#, no-c-format
msgid ""
"Type mappings for what are considered mutable Java types. This is where "
@@ -3632,6 +8643,7 @@
"ん。"
#. Tag: para
+#: basic_mapping.xml:4200
#, no-c-format
msgid ""
"Unique identifiers of entities and collections can be of any basic type "
@@ -3644,6 +8656,7 @@
"基本型でも構いません。(複合識別子でも構いません。以下を見てください。)"
#. Tag: para
+#: basic_mapping.xml:4205
#, no-c-format
msgid ""
"The basic value types have corresponding <literal>Type</literal> constants "
@@ -3656,11 +8669,13 @@
"STRING</literal> は <literal>string</literal> 型を表現しています。"
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
msgid "Custom value types"
msgstr "カスタム型"
#. Tag: para
+#: basic_mapping.xml:4214
#, no-c-format
msgid ""
"It is relatively easy for developers to create their own value types. For "
@@ -3684,6 +8699,7 @@
"す。"
#. Tag: para
+#: basic_mapping.xml:4225
#, no-c-format
msgid ""
"To implement a custom type, implement either <literal>org.hibernate."
@@ -3698,7 +8714,24 @@
"は、 <literal>org.hibernate.test.DoubleStringType</literal> を確認してくださ"
"い。"
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+msgstr ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+
#. Tag: para
+#: basic_mapping.xml:4234
#, no-c-format
msgid ""
"Notice the use of <literal><column></literal> tags to map a property "
@@ -3708,6 +8741,7 @@
"グできることに注目してください。"
#. Tag: para
+#: basic_mapping.xml:4237
#, no-c-format
msgid ""
"The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</"
@@ -3721,6 +8755,7 @@
"てのサポートを提供します。"
#. Tag: para
+#: basic_mapping.xml:4243
#, no-c-format
msgid ""
"You can even supply parameters to a <literal>UserType</literal> in the "
@@ -3735,7 +8770,24 @@
"ラメータを提供するために、マッピングファイル内で <literal><type></"
"literal> 要素を使用できます。"
+#. Tag: programlisting
+#: basic_mapping.xml:4250
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+msgstr ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+
#. Tag: para
+#: basic_mapping.xml:4252
#, no-c-format
msgid ""
"The <literal>UserType</literal> can now retrieve the value for the parameter "
@@ -3747,6 +8799,7 @@
"対する値を検索することができます。"
#. Tag: para
+#: basic_mapping.xml:4256
#, no-c-format
msgid ""
"If you regularly use a certain <literal>UserType</literal>, it is useful to "
@@ -3760,7 +8813,28 @@
"うなことが行えます。 Typedefs はカスタム型に名前を割り当てます。その型がパラ"
"メータを持つならば、パラメータのデフォルト値のリストを含むこともできます。"
+#. Tag: programlisting
+#: basic_mapping.xml:4262
+#, fuzzy, no-c-format
+msgid ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+msgstr ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:4264
+#, fuzzy, no-c-format
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
+msgstr "<property name=\"priority\" type=\"default_zero\"/>"
+
#. Tag: para
+#: basic_mapping.xml:4266
#, no-c-format
msgid ""
"It is also possible to override the parameters supplied in a typedef on a "
@@ -3770,6 +8844,7 @@
"メータをその都度オーバーライドすることが可能です。"
#. Tag: para
+#: basic_mapping.xml:4270
#, fuzzy, no-c-format
msgid ""
"Even though Hibernate's rich range of built-in types and support for "
@@ -3791,11 +8866,13 @@
"ピングドキュメントは起こりうる変化に対応できます。"
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
msgid "Mapping a class more than once"
msgstr "1つのクラスに1つ以上のマッピング"
#. Tag: para
+#: basic_mapping.xml:4285
#, no-c-format
msgid ""
"It is possible to provide more than one mapping for a particular persistent "
@@ -3812,7 +8889,48 @@
"クエリを書き込むとき、指定されたエンティティへの関連をマッピングするときに、"
"エンティティ名を指定しなければなりません。"
+#. Tag: programlisting
+#: basic_mapping.xml:4293
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Contract\" table=\"Contracts\"\n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\"\n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\"\n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\"\n"
+" column=\"currentContractId\"\n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Contract\" table=\"Contracts\" \n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\" \n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\" \n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\" \n"
+" column=\"currentContractId\" \n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:4295
#, no-c-format
msgid ""
"Associations are now specified using <literal>entity-name</literal> instead "
@@ -3821,12 +8939,20 @@
"関連が <literal>class</literal> の代わりに <literal>entity-name</literal> を"
"使って、どのように指定されるのかに注目してください。"
+#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
+#, no-c-format
+msgid "This feature is not supported in Annotations"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
msgid "SQL quoted identifiers"
msgstr "バッククォートで囲んだ SQL 識別子"
#. Tag: para
+#: basic_mapping.xml:4306
#, no-c-format
msgid ""
"You can force Hibernate to quote an identifier in the generated SQL by "
@@ -3841,99 +8967,38 @@
"(普通はダブルクォートですが、 SQL Server ではかぎ括弧、 MySQL ではバック"
"クォートです)。"
-#. Tag: title
-#, no-c-format
-msgid "Metadata alternatives"
-msgstr "メタデータの代替手段"
-
-#. Tag: para
-#, no-c-format
+#. Tag: programlisting
+#: basic_mapping.xml:4312
+#, fuzzy, no-c-format
msgid ""
-"XML does not suit all users so there are some alternative ways to define O/R "
-"mapping metadata in Hibernate."
+"@Entity @Table(name=\"`Line Item`\")\n"
+"class LineItem {\n"
+" @id @Column(name=\"`Item Id`\") Integer id;\n"
+" @Column(name=\"`Item #`\") int itemNumber\n"
+"}\n"
+"\n"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"XML の記述以外に、 Hibernate では O/R マッピングのメタデータを定義する代替方"
-"法があります。"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
#. Tag: title
+#: basic_mapping.xml:4316
#, no-c-format
-msgid "Using XDoclet markup"
-msgstr "XDoclet マークアップの使用"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Many Hibernate users prefer to embed mapping information directly in "
-"sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover "
-"this approach in this reference guide since it is considered part of "
-"XDoclet. However, we include the following example of the <literal>Cat</"
-"literal> class with XDoclet mappings:"
-msgstr ""
-"多くの Hibernate ユーザーは XDoclet の <literal>@hibernate.tags</literal> を"
-"使って、ソースコード内に直接マッピング情報を埋め込むことを好みます。これは厳"
-"密に言えば XDoclet の分野なので、本ドキュメントではこの方法を対象とはしませ"
-"ん。しかし XDoclet を使った以下の <literal>Cat</literal> マッピングの例を示し"
-"ます。"
-
-#. Tag: para
-#, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr ""
-"Hibernate のウェブサイトには、 XDoclet と Hibernate に関するサンプルが多数あ"
-"ります。"
-
-#. Tag: title
-#, no-c-format
-msgid "Using JDK 5.0 Annotations"
-msgstr "JDK 5.0 アノテーションの使用"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"JDK 5.0 introduced XDoclet-style annotations at the language level that are "
-"type-safe and checked at compile time. This mechanism is more powerful than "
-"XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, "
-"for example, supports auto-completion and syntax highlighting of JDK 5.0 "
-"annotations. The new revision of the EJB specification (JSR-220) uses JDK "
-"5.0 annotations as the primary metadata mechanism for entity beans. "
-"Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the "
-"persistence API). Support for mapping metadata is available via the "
-"<emphasis>Hibernate Annotations</emphasis> package as a separate download. "
-"Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
-msgstr ""
-"JDK5.0 ではタイプセーフかつコンパイル時にチェックできる、言語レベルの "
-"XDoclet スタイルのアノテーションを導入しました。このメカニズムは XDoclet のア"
-"ノテーションよりも強力で、ツールや IDE も多くがサポートしています。例えば "
-"IntelliJ IDEA は、 JDK5.0 にアノテーションの自動補完と構文の強調表示をサポー"
-"トしています。 EJB 仕様 (JSR-220) の新しいバージョンでは、エンティティ Bean "
-"に対する主要なメタデータメカニズムとして JDK5.0 のアノテーションを使用してい"
-"ます。 Hibernate3 では JSR-220 (永続化 API) の <literal>EntityManager</"
-"literal> を実装し、メタデータマッピングに対するサポートは、別ダウンロードの "
-"<emphasis>Hibernate Annotations</emphasis> パッケージにより利用可能です。これ"
-"は EJB3 (JSR-220) と Hibernate3 のメタデータをどちらもサポートしています。"
-
-#. Tag: para
-#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
-msgstr "以下は EJB のエンティティ Bean として注釈された POJO クラスの例です:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Support for JDK 5.0 Annotations (and JSR-220) is currently under "
-"development. Please refer to the Hibernate Annotations module for more "
-"details."
-msgstr ""
-"JDK5.0 のアノテーション (と JSR-220) のサポートは進行中の作業であり、完全では"
-"ないことに注意してください。さらに詳しい情報は Hibernate のアノテーションモ"
-"ジュールを参照してください。"
-
-#. Tag: title
-#, no-c-format
msgid "Generated properties"
msgstr "生成プロパティ"
#. Tag: para
+#: basic_mapping.xml:4318
#, no-c-format
msgid ""
"Generated properties are properties that have their values generated by the "
@@ -3953,6 +9018,7 @@
"ぐに、生成された値を読み込むための SELECT SQL が発行されます。"
#. Tag: para
+#: basic_mapping.xml:4327
#, fuzzy, no-c-format
msgid ""
"Properties marked as generated must additionally be non-insertable and non-"
@@ -3967,6 +9033,7 @@
"declaration-property\"/> 簡単なプロパティだけが生成されたとマークできます。"
#. Tag: para
+#: basic_mapping.xml:4334
#, no-c-format
msgid ""
"<literal>never</literal> (the default): the given property value is not "
@@ -3976,6 +9043,7 @@
"ベースから生成されないことを意味します。"
#. Tag: para
+#: basic_mapping.xml:4337
#, fuzzy, no-c-format
msgid ""
"<literal>insert</literal>: the given property value is generated on insert, "
@@ -3993,6 +9061,7 @@
"意してください。"
#. Tag: para
+#: basic_mapping.xml:4344
#, no-c-format
msgid ""
"<literal>always</literal>: the property value is generated both on insert "
@@ -4001,24 +9070,43 @@
"<literal>always</literal> - 挿入時も更新時もプロパティの値が生成されることを"
"示します。"
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4354
#, no-c-format
msgid ""
"Hibernate allows you to customize the SQL it uses to read and write the "
"values of columns mapped to <link linkend=\"mapping-declaration-property"
"\">simple properties</link>. For example, if your database provides a set of "
"data encryption functions, you can invoke them for individual columns like "
-"this: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"this:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4359
+#, no-c-format
+msgid ""
+"<property name=\"creditCardNumber\">\n"
+" <column \n"
+" name=\"credit_card_num\"\n"
+" read=\"decrypt(credit_card_num)\"\n"
+" write=\"encrypt(?)\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
msgid ""
"Hibernate applies the custom expressions automatically whenever the property "
@@ -4027,6 +9115,7 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
msgid ""
"The property is backed by one or more columns that are exported as part of "
@@ -4034,11 +9123,13 @@
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
msgid ""
"The <literal>write</literal> expression, if specified, must contain exactly "
@@ -4046,11 +9137,13 @@
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4384
#, no-c-format
msgid "Auxiliary database objects"
msgstr "補助的なデータベースオブジェクト"
#. Tag: para
+#: basic_mapping.xml:4386
#, no-c-format
msgid ""
"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
@@ -4072,6 +9165,7 @@
"の、2つの基本的な方法があります。"
#. Tag: para
+#: basic_mapping.xml:4396
#, no-c-format
msgid ""
"The first mode is to explicitly list the CREATE and DROP commands in the "
@@ -4080,7 +9174,28 @@
"1つ目の方法は、 CREATE と DROP コマンドをマッピングファイルの外に、明示的に記"
"載することです:"
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:4401
#, no-c-format
msgid ""
"The second mode is to supply a custom class that constructs the CREATE and "
@@ -4091,7 +9206,26 @@
"を提供することです。このカスタムクラスは <literal>org.hibernate.mapping."
"AuxiliaryDatabaseObject</literal> インタフェースを実装しなければなりません。"
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:4408
#, no-c-format
msgid ""
"Additionally, these database objects can be optionally scoped so that they "
@@ -4100,1407 +9234,484 @@
"さらに、あるデータベース方言が使用される時にだけ適用するといったように、デー"
"タベースオブジェクトが使われるケースを限定できます。"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\"\n"
-#~ " table=\"cats\"\n"
-#~ " discriminator-value=\"C\">\n"
-#~ "\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <discriminator column=\"subclass\"\n"
-#~ " type=\"character\"/>\n"
-#~ "\n"
-#~ " <property name=\"weight\"/>\n"
-#~ "\n"
-#~ " <property name=\"birthdate\"\n"
-#~ " type=\"date\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"color\"\n"
-#~ " type=\"eg.types.ColorUserType\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"sex\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"litterId\"\n"
-#~ " column=\"litterId\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"mother\"\n"
-#~ " column=\"mother_id\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <set name=\"kittens\"\n"
-#~ " inverse=\"true\"\n"
-#~ " order-by=\"litter_id\">\n"
-#~ " <key column=\"mother_id\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ " <subclass name=\"DomesticCat\"\n"
-#~ " discriminator-value=\"D\">\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " </subclass>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" \n"
-#~ " table=\"cats\"\n"
-#~ " discriminator-value=\"C\">\n"
-#~ " \n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <discriminator column=\"subclass\" \n"
-#~ " type=\"character\"/>\n"
-#~ "\n"
-#~ " <property name=\"weight\"/>\n"
-#~ "\n"
-#~ " <property name=\"birthdate\"\n"
-#~ " type=\"date\" \n"
-#~ " not-null=\"true\" \n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"color\"\n"
-#~ " type=\"eg.types.ColorUserType\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"sex\"\n"
-#~ " not-null=\"true\" \n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"litterId\"\n"
-#~ " column=\"litterId\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"mother\"\n"
-#~ " column=\"mother_id\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <set name=\"kittens\"\n"
-#~ " inverse=\"true\"\n"
-#~ " order-by=\"litter_id\">\n"
-#~ " <key column=\"mother_id\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ " <subclass name=\"DomesticCat\"\n"
-#~ " discriminator-value=\"D\">\n"
-#~ "\n"
-#~ " <property name=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " </subclass>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
+">\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
-#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
-#~ "]>\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"your.domain\">\n"
-#~ " <class name=\"MyEntity\">\n"
-#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
-#~ " ...\n"
-#~ " </id>\n"
-#~ " <class>\n"
-#~ " &types;\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
-#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
-#~ "]>\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"your.domain\">\n"
-#~ " <class name=\"MyEntity\">\n"
-#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
-#~ " ...\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ " & types;\n"
-#~ "</hibernate-mapping>"
+#~ msgid "Class"
+#~ msgstr "Class"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping\n"
-#~ " schema=\"schemaName\"\n"
-#~ " catalog=\"catalogName\"\n"
-#~ " default-cascade=\"cascade_style\"\n"
-#~ " default-access=\"field|property|ClassName\"\n"
-#~ " default-lazy=\"true|false\"\n"
-#~ " auto-import=\"true|false\"\n"
-#~ " package=\"package.name\"\n"
-#~ " />]]>"
+#~ "Use of <literal>select-before-update</literal> will usually decrease "
+#~ "performance. It is useful to prevent a database update trigger being "
+#~ "called unnecessarily if you reattach a graph of detached instances to a "
+#~ "<literal>Session</literal>."
#~ msgstr ""
-#~ "<hibernate-mapping\n"
-#~ " schema=\"schemaName\"\n"
-#~ " catalog=\"catalogName\"\n"
-#~ " default-cascade=\"cascade_style\"\n"
-#~ " default-access=\"field|property|ClassName\"\n"
-#~ " default-lazy=\"true|false\"\n"
-#~ " auto-import=\"true|false\"\n"
-#~ " package=\"package.name\"\n"
-#~ " />"
+#~ "<literal>select-before-update</literal> の使用は通常パフォーマンスを落とし"
+#~ "ます。もし <literal>Session</literal> へ分離インスタンスのグラフを再追加す"
+#~ "るなら、データベース更新のトリガを不必要に呼び出すのを避けるという点で、非"
+#~ "常に有用です。"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tableName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " select-before-update=\"true|false\"\n"
-#~ " polymorphism=\"implicit|explicit\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " persister=\"PersisterClass\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " optimistic-lock=\"none|version|dirty|all\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " check=\"arbitrary sql check condition\"\n"
-#~ " rowid=\"rowid\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " node=\"element-name\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<class\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tableName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " select-before-update=\"true|false\"\n"
-#~ " polymorphism=\"implicit|explicit\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " persister=\"PersisterClass\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " optimistic-lock=\"none|version|dirty|all\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " check=\"arbitrary sql check condition\"\n"
-#~ " rowid=\"rowid\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " node=\"element-name\"\n"
-#~ "/>"
+#~ msgid "id"
+#~ msgstr "uuid"
+#~ msgid "Generator"
+#~ msgstr "ジェネレータ"
+
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Summary\">\n"
-#~ " <subselect>\n"
-#~ " select item.name, max(bid.amount), count(*)\n"
-#~ " from item\n"
-#~ " join bid on bid.item_id = item.id\n"
-#~ " group by item.name\n"
-#~ " </subselect>\n"
-#~ " <synchronize table=\"item\"/>\n"
-#~ " <synchronize table=\"bid\"/>\n"
-#~ " <id name=\"name\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Summary\">\n"
-#~ " <subselect>\n"
-#~ " select item.name, max(bid.amount), count(*)\n"
-#~ " from item\n"
-#~ " join bid on bid.item_id = item.id\n"
-#~ " group by item.name\n"
-#~ " </subselect>\n"
-#~ " <synchronize table=\"item\"/>\n"
-#~ " <synchronize table=\"bid\"/>\n"
-#~ " <id name=\"name\"/>\n"
-#~ " ...\n"
-#~ "</class>"
+#~ msgid "<literal>increment</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " column=\"column_name\"\n"
-#~ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "\n"
-#~ " <generator class=\"generatorClass\"/>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " column=\"column_name\"\n"
-#~ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "\n"
-#~ " <generator class=\"generatorClass\"/>\n"
-#~ "</id>"
+#~ msgid "<literal>identity</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
-#~ " <param name=\"table\">uid_table</param>\n"
-#~ " <param name=\"column\">next_hi_value_column</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
-#~ " <param name=\"table\">uid_table</param>\n"
-#~ " <param name=\"column\">next_hi_value_column</"
-#~ "param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>sequence</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
-#~ msgid "increment"
-#~ msgstr "increment"
-
-#~ msgid "identity"
-#~ msgstr "identity"
-
-#~ msgid "sequence"
-#~ msgstr "sequence"
-
-#~ msgid "hilo"
-#~ msgstr "hilo"
-
-#~ msgid "seqhilo"
-#~ msgstr "seqhilo"
-
-#~ msgid "guid"
-#~ msgstr "guid"
-
-#~ msgid "native"
-#~ msgstr "native"
-
-#~ msgid "assigned"
-#~ msgstr "assigned"
-
-#~ msgid "select"
-#~ msgstr "select"
-
-#~ msgid "foreign"
-#~ msgstr "foreign"
-
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"hilo\">\n"
-#~ " <param name=\"table\">hi_value</param>\n"
-#~ " <param name=\"column\">next_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"hilo\">\n"
-#~ " <param name=\"table\">hi_value</param>\n"
-#~ " <param name=\"column\">next_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>seqhilo</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"seqhilo\">\n"
-#~ " <param name=\"sequence\">hi_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"seqhilo\">\n"
-#~ " <param name=\"sequence\">hi_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>uuid</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"sequence\">\n"
-#~ " <param name=\"sequence\">person_id_sequence</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
+#~ "are unique within a network (the IP address is used). The UUID is encoded "
+#~ "as a string of 32 hexadecimal digits in length."
#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"sequence\">\n"
-#~ " <param name=\"sequence\">person_id_sequence</"
-#~ "param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ "( IP アドレスが使用される)ネットワーク内でユニークな文字列型の識別子を生成"
+#~ "するために、 128 ビットの UUID アルゴリズムを使用します。 UUID は長さ 32 "
+#~ "の 16 進数字の文字列としてエンコードされます。"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value="
-#~ "\"0\">\n"
-#~ " <generator class=\"identity\"/>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
-#~ "\">\n"
-#~ " <generator class=\"identity\"/>\n"
-#~ "</id>"
+#~ msgid "<literal>guid</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"select\">\n"
-#~ " <param name=\"key\">socialSecurityNumber</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"select\">\n"
-#~ " <param name=\"key\">socialSecurityNumber</"
-#~ "param>\n"
-#~ " </generator>\n"
-#~ "</id>"
+#~ msgid "<literal>native</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<composite-id\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " mapped=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|.\"\n"
-#~ "\n"
-#~ " <key-property name=\"propertyName\" type=\"typename\" column="
-#~ "\"column_name\"/>\n"
-#~ " <key-many-to-one name=\"propertyName class=\"ClassName\" column="
-#~ "\"column_name\"/>\n"
-#~ " ......\n"
-#~ "</composite-id>]]>"
-#~ msgstr ""
-#~ "<composite-id\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " mapped=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|.\"\n"
-#~ "\n"
-#~ " <key-property name=\"propertyName\" type=\"typename\" column="
-#~ "\"column_name\"/>\n"
-#~ " <key-many-to-one name=\"propertyName class=\"ClassName\" "
-#~ "column=\"column_name\"/>\n"
-#~ " ......\n"
-#~ "</composite-id>"
+#~ msgid "<literal>select</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<composite-id>\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
-#~ msgstr ""
-#~ "<composite-id>\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>"
+#~ msgid "<literal>foreign</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
+#~ "<literal>optimizer</literal> (optional - defaults to <literal>none</"
+#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
#~ msgstr ""
-#~ "<composite-id class=\"MedicareId\" mapped=\"true\">\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>"
+#~ "<literal>type</literal> (オプション - デフォルトは <literal>integer</"
+#~ "literal> ):バージョン番号の型。"
-#, fuzzy
+#~ msgid "composite-id"
+#~ msgstr "composite-id"
+
#~ msgid ""
-#~ "<![CDATA[<discriminator\n"
-#~ " column=\"discriminator_column\"\n"
-#~ " type=\"discriminator_type\"\n"
-#~ " force=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary sql expression\"\n"
-#~ "/>]]>"
+#~ "A table with a composite key can be mapped with multiple properties of "
+#~ "the class as identifier properties. The <literal><composite-id></"
+#~ "literal> element accepts <literal><key-property></literal> property "
+#~ "mappings and <literal><key-many-to-one></literal> mappings as child "
+#~ "elements."
#~ msgstr ""
-#~ "<discriminator\n"
-#~ " column=\"discriminator_column\"\n"
-#~ " type=\"discriminator_type\"\n"
-#~ " force=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary sql expression\"\n"
-#~ "/>"
+#~ "複合キーのあるテーブルに対し、識別子プロパティとしてクラスの複数のプロパ"
+#~ "ティをマッピングすることができます。 <literal><composite-id></"
+#~ "literal> 要素は、子要素として <literal><key-property></literal> プロ"
+#~ "パティマッピングと <literal><key-many-to-one></literal> マッピングを"
+#~ "受け入れます。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<discriminator\n"
-#~ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end"
-#~ "\"\n"
-#~ " type=\"integer\"/>]]>"
+#~ "The persistent class <emphasis>must</emphasis> override <literal>equals()"
+#~ "</literal> and <literal>hashCode()</literal> to implement composite "
+#~ "identifier equality. It must also implement <literal>Serializable</"
+#~ "literal>."
#~ msgstr ""
-#~ "<discriminator\n"
-#~ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end"
-#~ "\"\n"
-#~ " type=\"integer\"/>"
+#~ "複合識別子の等価性を実装するためには、永続クラスが <literal>equals()</"
+#~ "literal> と <literal>hashCode()</literal> をオーバーライド <emphasis>しな"
+#~ "ければなりません</emphasis> 。 また <literal>Serializable</literal> も実装"
+#~ "しなければいけません。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<version\n"
-#~ " column=\"version_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|negative|undefined\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "Unfortunately, this approach means that a persistent object is its own "
+#~ "identifier. There is no convenient \"handle\" other than the object "
+#~ "itself. You must instantiate an instance of the persistent class itself "
+#~ "and populate its identifier properties before you can <literal>load()</"
+#~ "literal> the persistent state associated with a composite key. We call "
+#~ "this approach an <emphasis>embedded</emphasis> composite identifier, and "
+#~ "discourage it for serious applications."
#~ msgstr ""
-#~ "<version\n"
-#~ " column=\"version_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|negative|undefined\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>"
+#~ "残念ながら複合識別子のためのこの方法は、永続オブジェクトが自身の識別子であ"
+#~ "ることを意味しています。オブジェクト自身を識別子とする以外に便利な「扱い"
+#~ "方」はありません。複合キーに関連した永続状態を <literal>load()</literal> "
+#~ "出来るようになる前に、永続クラス自身をインスタンス化し、識別子プロパティを"
+#~ "設定しなければなりません。 <emphasis> 組み込みの</emphasis> 複合識別子と呼"
+#~ "ばれるこのアプローチは、本格的なアプリケーションには向いていません。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<timestamp\n"
-#~ " column=\"timestamp_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|undefined\"\n"
-#~ " source=\"vm|db\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "A second approach is what we call a <emphasis>mapped</emphasis> composite "
+#~ "identifier, where the identifier properties named inside the <literal><"
+#~ "composite-id></literal> element are duplicated on both the persistent "
+#~ "class and a separate identifier class."
#~ msgstr ""
-#~ "<timestamp\n"
-#~ " column=\"timestamp_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|undefined\"\n"
-#~ " source=\"vm|db\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>"
+#~ "2つ目の方法は <emphasis>マップされた</emphasis> 複合識別子と呼ばれるもの"
+#~ "で、 <literal><composite-id></literal>エレメント内で指定した識別プロ"
+#~ "パティが永続クラスと分離した識別子クラスの両方に重複して存在します。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " type=\"typename\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " generated=\"never|insert|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " length=\"L\"\n"
-#~ " precision=\"P\"\n"
-#~ " scale=\"S\"\n"
-#~ "/>]]>"
+#~ "In this example, both the composite identifier class, "
+#~ "<literal>MedicareId</literal>, and the entity class itself have "
+#~ "properties named <literal>medicareNumber</literal> and "
+#~ "<literal>dependent</literal>. The identifier class must override "
+#~ "<literal>equals()</literal> and <literal>hashCode()</literal> and "
+#~ "implement <literal>Serializable</literal>. The main disadvantage of this "
+#~ "approach is code duplication."
#~ msgstr ""
-#~ "<property\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " type=\"typename\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " generated=\"never|insert|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " length=\"L\"\n"
-#~ " precision=\"P\"\n"
-#~ " scale=\"S\"\n"
-#~ "/>"
+#~ "この例では、複合識別子クラス( <literal>MedicareId</literal> )とエンティ"
+#~ "ティクラス自身の両方が、 <literal>medicareNumber</literal> と "
+#~ "<literal>dependent</literal> という名前のプロパティを持ちます。識別子クラ"
+#~ "スは、 <literal>equals()</literal> と <literal>hashCode()</literal> をオー"
+#~ "バライドし、 <literal>Serializable</literal> を実装しなくてはなりません。"
+#~ "この方法には、明らかにコードが重複するという不都合があります。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "<property name=\"totalPrice\"\n"
-#~ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, "
-#~ "Product p\n"
-#~ " WHERE li.productId = p.productId\n"
-#~ " AND li.customerId = customerId\n"
-#~ " AND li.orderNumber = orderNumber )\"/>]]>"
-#~ msgstr ""
-#~ "<property name=\"totalPrice\"\n"
-#~ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, "
-#~ "Product p\n"
-#~ " WHERE li.productId = p.productId\n"
-#~ " AND li.customerId = customerId\n"
-#~ " AND li.orderNumber = orderNumber )\"/>"
+#~ "The following attributes are used to specify a mapped composite "
+#~ "identifier:"
+#~ msgstr "次の属性はマッピングした複合識別子を指定するために使用します:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>]]>"
+#~ "<literal>mapped</literal> (optional - defaults to <literal>false</"
+#~ "literal>): indicates that a mapped composite identifier is used, and that "
+#~ "the contained property mappings refer to both the entity class and the "
+#~ "composite identifier class."
#~ msgstr ""
-#~ "<many-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>"
+#~ "<literal>mapped</literal> (オプション、デフォルトは <literal>false</"
+#~ "literal> ): マッピングした複合識別子が使用されることと、包含されたプロパ"
+#~ "ティのマッピングが、エンティティクラスと複合識別子クラスの両方を参照するこ"
+#~ "とを示します。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"product\" class=\"Product\" column="
-#~ "\"PRODUCT_ID\"/>]]>"
+#~ "<literal>class</literal> (optional - but required for a mapped composite "
+#~ "identifier): the class used as a composite identifier."
#~ msgstr ""
-#~ "<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/"
-#~ ">"
+#~ "<literal>class</literal> (オプション、ただしマッピングした複合識別子には必"
+#~ "須): 複合識別子として使用するクラス。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"serialNumber\" unique=\"true\" type=\"string\" "
-#~ "column=\"SERIAL_NUMBER\"/>]]>"
+#~ "We will describe a third, even more convenient approach, where the "
+#~ "composite identifier is implemented as a component class in <xref linkend="
+#~ "\"components-compositeid\" />. The attributes described below apply only "
+#~ "to this alternative approach:"
#~ msgstr ""
-#~ "<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
-#~ "\"SERIAL_NUMBER\"/>"
+#~ "3つ目のさらに便利な方法は、複合識別子を <xref linkend=\"components-"
+#~ "compositeid\"/> のコンポーネントクラスとして実装することです。下で記述して"
+#~ "いる属性は、この代替方法にのみ適用されます:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"product\" property-ref=\"serialNumber\" "
-#~ "column=\"PRODUCT_SERIAL_NUMBER\"/>]]>"
+#~ "<literal>name</literal> (optional - required for this approach): a "
+#~ "property of component type that holds the composite identifier. Please "
+#~ "see chapter 9 for more information."
#~ msgstr ""
-#~ "<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
-#~ "\"PRODUCT_SERIAL_NUMBER\"/>"
+#~ "<literal>name</literal> (オプション、このアプローチでは必須): 複合識別子を"
+#~ "保持するコンポーネントタイプのプロパティ(9章を参照してください)。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
-#~ "\"OWNER_SSN\"/>]]>"
+#~ "<literal>class</literal> (optional - defaults to the property type "
+#~ "determined by reflection): the component class used as a composite "
+#~ "identifier. Please see the next section for more information."
#~ msgstr ""
-#~ "<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
-#~ "\"OWNER_SSN\"/>"
+#~ "<literal>class</literal> (オプション - デフォルトはリフレクションにより決"
+#~ "定されるプロパティの型): 複合識別子として使われるコンポーネントのクラス"
+#~ "(次の節を見てください)。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " constrained=\"true|false\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " formula=\"any SQL expression\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>]]>"
+#~ "The third approach, an <emphasis>identifier component</emphasis>, is "
+#~ "recommended for almost all applications."
#~ msgstr ""
-#~ "<one-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " constrained=\"true|false\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " formula=\"any SQL expression\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>"
+#~ "この3つ目の方法は <emphasis> 識別子コンポーネント</emphasis> と呼び、ほと"
+#~ "んどすべてのアプリケーションに対して推奨する方法です。"
-#, fuzzy
-#~ msgid "<![CDATA[<one-to-one name=\"person\" class=\"Person\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
+#~ msgid "Version (optional)"
+#~ msgstr "version(オプション)"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" constrained="
-#~ "\"true\"/>]]>"
+#~ "The <literal><version></literal> element is optional and indicates "
+#~ "that the table contains versioned data. This is particularly useful if "
+#~ "you plan to use <emphasis>long transactions</emphasis>. See below for "
+#~ "more information:"
#~ msgstr ""
-#~ "<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/"
-#~ ">"
+#~ "<literal><version></literal> 要素はオプションであり、テーブルがバー"
+#~ "ジョンデータを含むことを示します。これは <emphasis>ロングトランザクション"
+#~ "</emphasis> を使うつもりなら、特に役立ちます(以下を参照してください)。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"foreign\">\n"
-#~ " <param name=\"property\">employee</param>\n"
-#~ " </generator>\n"
-#~ " </id>\n"
-#~ " ...\n"
-#~ " <one-to-one name=\"employee\"\n"
-#~ " class=\"Employee\"\n"
-#~ " constrained=\"true\"/>\n"
-#~ "</class>]]>"
+#~ "Version numbers can be of Hibernate type <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> or <literal>calendar</literal>."
#~ msgstr ""
-#~ "<class name=\"person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"foreign\">\n"
-#~ " <param name=\"property\">employee</param>\n"
-#~ " </generator>\n"
-#~ " </id>\n"
-#~ " ...\n"
-#~ " <one-to-one name=\"employee\"\n"
-#~ " class=\"Employee\"\n"
-#~ " constrained=\"true\"/>\n"
-#~ "</class>"
+#~ "バージョン番号は Hibernate の <literal>long</literal> 、 "
+#~ "<literal>integer</literal> 、 <literal>short</literal> 、 "
+#~ "<literal>timestamp</literal> 、 <literal>calendar</literal> 型のいずれかで"
+#~ "す。"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID"
-#~ "\" unique=\"true\"/>]]>"
-#~ msgstr ""
-#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
-#~ "unique=\"true\"/>"
+#~ msgid "Many-to-one"
+#~ msgstr "many-to-one"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" property-ref="
-#~ "\"person\"/>]]>"
+#~ "An ordinary association to another persistent class is declared using a "
+#~ "<literal>many-to-one</literal> element. The relational model is a many-to-"
+#~ "one association; a foreign key in one table is referencing the primary "
+#~ "key column(s) of the target table."
#~ msgstr ""
-#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
-#~ "\"/>"
+#~ "他の永続クラスへの通常の関連は <literal>many-to-one</literal> 要素を使って"
+#~ "定義します。リレーショナルモデルは多対一関連です。つまりあるテーブルの外部"
+#~ "キーは、ターゲットとなるテーブルの主キーカラムを参照しています。"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<natural-id mutable=\"true|false\"/>\n"
-#~ " <property ... />\n"
-#~ " <many-to-one ... />\n"
-#~ " ......\n"
-#~ "</natural-id>]]>"
-#~ msgstr ""
-#~ "<natural-id mutable=\"true|false\"/>\n"
-#~ " <property ... />\n"
-#~ " <many-to-one ... />\n"
-#~ " ......\n"
-#~ "</natural-id>"
+#~ msgid "One-to-one"
+#~ msgstr "one-to-one"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<component\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"className\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</component>]]>"
-#~ msgstr ""
-#~ "<component \n"
-#~ " name=\"propertyName\" \n"
-#~ " class=\"className\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ ">\n"
-#~ " \n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</component>"
+#~ msgid "There are two varieties of one-to-one associations:"
+#~ msgstr "一対一関連には2種類あります:"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<properties\n"
-#~ " name=\"logicalName\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</properties>]]>"
-#~ msgstr ""
-#~ "<properties \n"
-#~ " name=\"logicalName\" \n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ ">\n"
-#~ " \n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</properties>"
+#~ msgid "primary key associations"
+#~ msgstr "主キー関連"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"personNumber\"/>\n"
-#~ "\n"
-#~ " ...\n"
-#~ " <properties name=\"name\"\n"
-#~ " unique=\"true\" update=\"false\">\n"
-#~ " <property name=\"firstName\"/>\n"
-#~ " <property name=\"initial\"/>\n"
-#~ " <property name=\"lastName\"/>\n"
-#~ " </properties>\n"
-#~ "</class>]]>"
+#~ "Alternatively, a foreign key with a unique constraint, from "
+#~ "<literal>Employee</literal> to <literal>Person</literal>, can be "
+#~ "expressed as:"
#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"personNumber\"/>\n"
-#~ " ...\n"
-#~ " <properties name=\"name\" \n"
-#~ " unique=\"true\" update=\"false\">\n"
-#~ " <property name=\"firstName\"/>\n"
-#~ " <property name=\"initial\"/>\n"
-#~ " <property name=\"lastName\"/>\n"
-#~ " </properties>\n"
-#~ "</class>"
+#~ "もう1つの方法として、 <literal>Employee</literal> から <literal>Person</"
+#~ "literal> へのユニーク制約を使った外部キー関連は以下のように表現されます:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"person\"\n"
-#~ " class=\"Person\" property-ref=\"name\">\n"
-#~ " <column name=\"firstName\"/>\n"
-#~ " <column name=\"initial\"/>\n"
-#~ " <column name=\"lastName\"/>\n"
-#~ "</many-to-one>]]>"
+#~ "This association can be made bidirectional by adding the following to the "
+#~ "<literal>Person</literal> mapping:"
#~ msgstr ""
-#~ "<many-to-one name=\"person\" \n"
-#~ " class=\"Person\" property-ref=\"name\">\n"
-#~ " <column name=\"firstName\"/>\n"
-#~ " <column name=\"initial\"/>\n"
-#~ " <column name=\"lastName\"/>\n"
-#~ "</many-to-one>"
+#~ "そしてこの関連は、以下の記述を <literal>Person</literal> のマッピングに追"
+#~ "加することで双方向にすることができます:"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " extends=\"SuperclassName\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</subclass>]]>"
-#~ msgstr ""
-#~ "<subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " extends=\"SuperclassName\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</subclass>"
+#~ msgid "Component and dynamic-component"
+#~ msgstr "component, dynamic-component"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<joined-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <key .... >\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</joined-subclass>]]>"
-#~ msgstr ""
-#~ "<joined-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <key .... >\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</joined-subclass>"
+#~ msgid "Subclass"
+#~ msgstr "subclass"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" table=\"CATS\">\n"
-#~ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
-#~ " <generator class=\"hilo\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"birthdate\" type=\"date\"/>\n"
-#~ " <property name=\"color\" not-null=\"true\"/>\n"
-#~ " <property name=\"sex\" not-null=\"true\"/>\n"
-#~ " <property name=\"weight\"/>\n"
-#~ " <many-to-one name=\"mate\"/>\n"
-#~ " <set name=\"kittens\">\n"
-#~ " <key column=\"MOTHER\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ " <joined-subclass name=\"DomesticCat\" table="
-#~ "\"DOMESTIC_CATS\">\n"
-#~ " <key column=\"CAT\"/>\n"
-#~ " <property name=\"name\" type=\"string\"/>\n"
-#~ " </joined-subclass>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"eg.Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
+#~ "A discriminator column is not required for this mapping strategy. Each "
+#~ "subclass must, however, declare a table column holding the object "
+#~ "identifier using the <literal><key></literal> element. The mapping "
+#~ "at the start of the chapter would then be re-written as:"
#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" table=\"CATS\">\n"
-#~ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
-#~ " <generator class=\"hilo\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"birthdate\" type=\"date\"/>\n"
-#~ " <property name=\"color\" not-null=\"true\"/>\n"
-#~ " <property name=\"sex\" not-null=\"true\"/>\n"
-#~ " <property name=\"weight\"/>\n"
-#~ " <many-to-one name=\"mate\"/>\n"
-#~ " <set name=\"kittens\">\n"
-#~ " <key column=\"MOTHER\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ " <joined-subclass name=\"DomesticCat\" table="
-#~ "\"DOMESTIC_CATS\">\n"
-#~ " <key column=\"CAT\"/>\n"
-#~ " <property name=\"name\" type=\"string\"/>\n"
-#~ " </joined-subclass>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"eg.Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
+#~ "このマッピング戦略には、識別カラムは必要ありません。しかし各サブクラスは "
+#~ "<literal><key></literal> 要素を使い、オブジェクト識別子を保持する"
+#~ "テーブルカラムを定義しなければなりません。この章の初めのマッピングは以下の"
+#~ "ように書き直せます:"
-#, fuzzy
+#~ msgid "Union-subclass"
+#~ msgstr "union-subclass"
+
+#~ msgid "Join"
+#~ msgstr "join"
+
#~ msgid ""
-#~ "<![CDATA[<union-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</union-subclass>]]>"
+#~ "Using the <literal><join></literal> element, it is possible to map "
+#~ "properties of one class to several tables that have a one-to-one "
+#~ "relationship. For example:"
#~ msgstr ""
-#~ "<union-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</union-subclass>"
+#~ "テーブル間に一対一の関係があるとき、 <literal><join></literal> 要素"
+#~ "を使うことで、1つのクラスのプロパティをいくつものテーブルにマッピングする"
+#~ "ことができます。"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<join\n"
-#~ " table=\"tablename\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " optional=\"true|false\">\n"
-#~ "\n"
-#~ " <key ... />\n"
-#~ "\n"
-#~ " <property ... />\n"
-#~ " ...\n"
-#~ "</join>]]>"
-#~ msgstr ""
-#~ "<join\n"
-#~ " table=\"tablename\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " optional=\"true|false\">\n"
-#~ " \n"
-#~ " <key ... />\n"
-#~ " \n"
-#~ " <property ... />\n"
-#~ " ...\n"
-#~ "</join>"
+#~ msgid "<literal>class</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\"\n"
-#~ " table=\"PERSON\">\n"
-#~ "\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
-#~ "\n"
-#~ " <join table=\"ADDRESS\">\n"
-#~ " <key column=\"ADDRESS_ID\"/>\n"
-#~ " <property name=\"address\"/>\n"
-#~ " <property name=\"zip\"/>\n"
-#~ " <property name=\"country\"/>\n"
-#~ " </join>\n"
-#~ " ...]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\"\n"
-#~ " table=\"PERSON\">\n"
-#~ "\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
-#~ "\n"
-#~ " <join table=\"ADDRESS\">\n"
-#~ " <key column=\"ADDRESS_ID\"/>\n"
-#~ " <property name=\"address\"/>\n"
-#~ " <property name=\"zip\"/>\n"
-#~ " <property name=\"country\"/>\n"
-#~ " </join>\n"
-#~ " ..."
+#~ msgid "<literal>binary</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid "<title>Key</title>"
-#~ msgstr "<title>key</title>"
+#~ msgid "<literal>text</literal>"
+#~ msgstr "<literal>sequence-identity</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<key\n"
-#~ " column=\"columnname\"\n"
-#~ " on-delete=\"noaction|cascade\"\n"
-#~ " property-ref=\"propertyName\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<key\n"
-#~ " column=\"columnname\"\n"
-#~ " on-delete=\"noaction|cascade\"\n"
-#~ " property-ref=\"propertyName\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ "/>"
+#~ msgid "<literal>clob, blob</literal>"
+#~ msgstr "<literal>calendar, calendar_date</literal>"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<column\n"
-#~ " name=\"column_name\"\n"
-#~ " length=\"N\"\n"
-#~ " precision=\"N\"\n"
-#~ " scale=\"N\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " unique-key=\"multicolumn_unique_key_name\"\n"
-#~ " index=\"index_name\"\n"
-#~ " sql-type=\"sql_type_name\"\n"
-#~ " check=\"SQL expression\"\n"
-#~ " default=\"SQL expression\"/>]]>"
+#~ "XML does not suit all users so there are some alternative ways to define "
+#~ "O/R mapping metadata in Hibernate."
#~ msgstr ""
-#~ "<column\n"
-#~ " name=\"column_name\"\n"
-#~ " length=\"N\"\n"
-#~ " precision=\"N\"\n"
-#~ " scale=\"N\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " unique-key=\"multicolumn_unique_key_name\"\n"
-#~ " index=\"index_name\"\n"
-#~ " sql-type=\"sql_type_name\"\n"
-#~ " check=\"SQL expression\"\n"
-#~ " default=\"SQL expression\"/>"
+#~ "XML の記述以外に、 Hibernate では O/R マッピングのメタデータを定義する代替"
+#~ "方法があります。"
-#, fuzzy
-#~ msgid "<![CDATA[<formula>SQL expression</formula>]]>"
-#~ msgstr "<formula>SQL expression</formula>"
+#~ msgid "Using XDoclet markup"
+#~ msgstr "XDoclet マークアップの使用"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"homeAddress\" class=\"Address\"\n"
-#~ " insert=\"false\" update=\"false\">\n"
-#~ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
-#~ " <formula>'MAILING'</formula>\n"
-#~ "</many-to-one>]]>"
+#~ "Many Hibernate users prefer to embed mapping information directly in "
+#~ "sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not "
+#~ "cover this approach in this reference guide since it is considered part "
+#~ "of XDoclet. However, we include the following example of the "
+#~ "<literal>Cat</literal> class with XDoclet mappings:"
#~ msgstr ""
-#~ "<many-to-one name=\"homeAddress\" class=\"Address\"\n"
-#~ " insert=\"false\" update=\"false\">\n"
-#~ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
-#~ " <formula>'MAILING'</formula>\n"
-#~ "</many-to-one>"
+#~ "多くの Hibernate ユーザーは XDoclet の <literal>@hibernate.tags</literal> "
+#~ "を使って、ソースコード内に直接マッピング情報を埋め込むことを好みます。これ"
+#~ "は厳密に言えば XDoclet の分野なので、本ドキュメントではこの方法を対象とは"
+#~ "しません。しかし XDoclet を使った以下の <literal>Cat</literal> マッピング"
+#~ "の例を示します。"
-#, fuzzy
-#~ msgid "<![CDATA[<import class=\"java.lang.Object\" rename=\"Universe\"/>]]>"
-#~ msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<import\n"
-#~ " class=\"ClassName\"\n"
-#~ " rename=\"ShortName\"\n"
-#~ "/>]]>"
+#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
#~ msgstr ""
-#~ "<import\n"
-#~ " class=\"ClassName\"\n"
-#~ " rename=\"ShortName\"\n"
-#~ "/>"
+#~ "Hibernate のウェブサイトには、 XDoclet と Hibernate に関するサンプルが多数"
+#~ "あります。"
-#, fuzzy
-#~ msgid "<title>Any</title>"
-#~ msgstr "<title>any</title>"
+#~ msgid "Using JDK 5.0 Annotations"
+#~ msgstr "JDK 5.0 アノテーションの使用"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
-#~ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
-#~ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
-#~ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
-#~ " <column name=\"table_name\"/>\n"
-#~ " <column name=\"id\"/>\n"
-#~ "</any>]]>"
+#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
+#~ "are type-safe and checked at compile time. This mechanism is more "
+#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
+#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
+#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
+#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
+#~ "mechanism for entity beans. Hibernate3 implements the "
+#~ "<literal>EntityManager</literal> of JSR-220 (the persistence API). "
+#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
+#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
+#~ "220) and Hibernate3 metadata is supported."
#~ msgstr ""
-#~ "<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
-#~ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
-#~ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
-#~ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
-#~ " <column name=\"table_name\"/>\n"
-#~ " <column name=\"id\"/>\n"
-#~ "</any>"
+#~ "JDK5.0 ではタイプセーフかつコンパイル時にチェックできる、言語レベルの "
+#~ "XDoclet スタイルのアノテーションを導入しました。このメカニズムは XDoclet "
+#~ "のアノテーションよりも強力で、ツールや IDE も多くがサポートしています。例"
+#~ "えば IntelliJ IDEA は、 JDK5.0 にアノテーションの自動補完と構文の強調表示"
+#~ "をサポートしています。 EJB 仕様 (JSR-220) の新しいバージョンでは、エンティ"
+#~ "ティ Bean に対する主要なメタデータメカニズムとして JDK5.0 のアノテーション"
+#~ "を使用しています。 Hibernate3 では JSR-220 (永続化 API) の "
+#~ "<literal>EntityManager</literal> を実装し、メタデータマッピングに対するサ"
+#~ "ポートは、別ダウンロードの <emphasis>Hibernate Annotations</emphasis> パッ"
+#~ "ケージにより利用可能です。これは EJB3 (JSR-220) と Hibernate3 のメタデータ"
+#~ "をどちらもサポートしています。"
-#, fuzzy
+#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+#~ msgstr ""
+#~ "以下は EJB のエンティティ Bean として注釈された POJO クラスの例です:"
+
#~ msgid ""
-#~ "<![CDATA[<any\n"
-#~ " name=\"propertyName\"\n"
-#~ " id-type=\"idtypename\"\n"
-#~ " meta-type=\"metatypename\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ ">\n"
-#~ " <meta-value ... />\n"
-#~ " <meta-value ... />\n"
-#~ " .....\n"
-#~ " <column .... />\n"
-#~ " <column .... />\n"
-#~ " .....\n"
-#~ "</any>]]>"
+#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
+#~ "development. Please refer to the Hibernate Annotations module for more "
+#~ "details."
#~ msgstr ""
-#~ "<any\n"
-#~ " name=\"propertyName\"\n"
-#~ " id-type=\"idtypename\"\n"
-#~ " meta-type=\"metatypename\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ ">\n"
-#~ " <meta-value ... />\n"
-#~ " <meta-value ... />\n"
-#~ " .....\n"
-#~ " <column .... />\n"
-#~ " <column .... />\n"
-#~ " .....\n"
-#~ "</any>"
+#~ "JDK5.0 のアノテーション (と JSR-220) のサポートは進行中の作業であり、完全"
+#~ "ではないことに注意してください。さらに詳しい情報は Hibernate のアノテー"
+#~ "ションモジュールを参照してください。"
-#~ msgid "string"
-#~ msgstr "string"
-
#, fuzzy
-#~ msgid "class"
-#~ msgstr "subclass"
-
-#~ msgid "binary"
-#~ msgstr "binary"
-
-#~ msgid "text"
-#~ msgstr "text"
-
-#~ msgid "serializable"
-#~ msgstr "serializable"
-
-#~ msgid "clob, blob"
-#~ msgstr "clob, blob"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"twoStrings\" type=\"org.hibernate.test."
-#~ "DoubleStringType\">\n"
-#~ " <column name=\"first_string\"/>\n"
-#~ " <column name=\"second_string\"/>\n"
-#~ "</property>]]>"
+#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
+#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
+#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
+#~ "]>\n"
+#~ "\n"
+#~ "<hibernate-mapping package=\"your.domain\">\n"
+#~ " <class name=\"MyEntity\">\n"
+#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
+#~ " ...\n"
+#~ " </id>\n"
+#~ " <class>\n"
+#~ " &types;\n"
+#~ "</hibernate-mapping>]]>"
#~ msgstr ""
-#~ "<property name=\"twoStrings\" type=\"org.hibernate.test."
-#~ "DoubleStringType\">\n"
-#~ " <column name=\"first_string\"/>\n"
-#~ " <column name=\"second_string\"/>\n"
-#~ "</property>"
+#~ "<?xml version=\"1.0\"?>\n"
+#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
+#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
+#~ "]>\n"
+#~ "\n"
+#~ "<hibernate-mapping package=\"your.domain\">\n"
+#~ " <class name=\"MyEntity\">\n"
+#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
+#~ " ...\n"
+#~ " </id>\n"
+#~ " </class>\n"
+#~ " & types;\n"
+#~ "</hibernate-mapping>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"priority\">\n"
-#~ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ " </type>\n"
-#~ "</property>]]>"
+#~ "<![CDATA[<composite-id>\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
#~ msgstr ""
-#~ "<property name=\"priority\">\n"
-#~ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType"
-#~ "\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ " </type>\n"
-#~ "</property>"
+#~ "<composite-id>\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType"
-#~ "\" name=\"default_zero\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ "</typedef>]]>"
+#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
#~ msgstr ""
-#~ "<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" "
-#~ "name=\"default_zero\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ "</typedef>"
+#~ "<composite-id class=\"MedicareId\" mapped=\"true\">\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>"
#, fuzzy
-#~ msgid "<![CDATA[<property name=\"priority\" type=\"default_zero\"/>]]>"
-#~ msgstr "<property name=\"priority\" type=\"default_zero\"/>"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Contract\" table=\"Contracts\"\n"
-#~ " entity-name=\"CurrentContract\">\n"
-#~ " ...\n"
-#~ " <set name=\"history\" inverse=\"true\"\n"
-#~ " order-by=\"effectiveEndDate desc\">\n"
-#~ " <key column=\"currentContractId\"/>\n"
-#~ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Contract\" table=\"ContractHistory\"\n"
-#~ " entity-name=\"HistoricalContract\">\n"
-#~ " ...\n"
-#~ " <many-to-one name=\"currentContract\"\n"
-#~ " column=\"currentContractId\"\n"
-#~ " entity-name=\"CurrentContract\"/>\n"
-#~ "</class>]]>"
+#~ "<![CDATA[<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID"
+#~ "\" unique=\"true\"/>]]>"
#~ msgstr ""
-#~ "<class name=\"Contract\" table=\"Contracts\" \n"
-#~ " entity-name=\"CurrentContract\">\n"
-#~ " ...\n"
-#~ " <set name=\"history\" inverse=\"true\" \n"
-#~ " order-by=\"effectiveEndDate desc\">\n"
-#~ " <key column=\"currentContractId\"/>\n"
-#~ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Contract\" table=\"ContractHistory\" \n"
-#~ " entity-name=\"HistoricalContract\">\n"
-#~ " ...\n"
-#~ " <many-to-one name=\"currentContract\" \n"
-#~ " column=\"currentContractId\" \n"
-#~ " entity-name=\"CurrentContract\"/>\n"
-#~ "</class>"
+#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
+#~ "unique=\"true\"/>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"LineItem\" table=\"`Line Item`\">\n"
-#~ " <id name=\"id\" column=\"`Item Id`\"/><generator class=\"assigned\"/"
-#~ "></id>\n"
-#~ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
+#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" property-ref="
+#~ "\"person\"/>]]>"
#~ msgstr ""
-#~ "<class name=\"LineItem\" table=\"`Line Item`\">\n"
-#~ " <id name=\"id\" column=\"`Item Id`\"/><generator class="
-#~ "\"assigned\"/></id>\n"
-#~ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
-#~ " ...\n"
-#~ "</class>"
+#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
+#~ "\"/>"
#, fuzzy
#~ msgid ""
@@ -5761,59 +9972,3 @@
#~ "\n"
#~ " // Getter/setter and business methods\n"
#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <create>CREATE TRIGGER my_trigger ...</create>\n"
-#~ " <drop>DROP TRIGGER my_trigger</drop>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <create>CREATE TRIGGER my_trigger ...</create>\n"
-#~ " <drop>DROP TRIGGER my_trigger</drop>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
-#~ ">\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/"
-#~ ">\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/collection_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/collection_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/collection_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-06 16:08+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,33 +14,51 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: collection_mapping.xml:31
#, no-c-format
msgid "Collection mapping"
msgstr "コレクションのマッピング"
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr "コレクションの永続化"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:36
+#, fuzzy, no-c-format
msgid ""
-"Hibernate requires that persistent collection-valued fields be declared as "
-"an interface type. For example:"
+"Naturally Hibernate also allows to persist collections. These persistent "
+"collections can contain almost any other Hibernate type, including: basic "
+"types, custom types, components and references to other entities. The "
+"distinction between value and reference semantics is in this context very "
+"important. An object in a collection might be handled with \"value\" "
+"semantics (its life cycle fully depends on the collection owner), or it "
+"might be a reference to another entity with its own life cycle. In the "
+"latter case, only the \"link\" between the two objects is considered to be a "
+"state held by the collection."
msgstr ""
-"コレクション型のフィールドを永続化するには、そのコレクション型がインター"
-"フェース型である必要があります。例えば、"
+"コレクションは他の Hibernate の型のほとんど(すべての基本型、カスタム型、コン"
+"ポーネント、他のエンティティへの参照)を格納することができます。次の点は重要"
+"な違いになります。コレクションに格納されたオブジェクトが「値」セマンティクス"
+"として扱われるのか (ライフサイクルはコレクションのオーナーに完全に依存しま"
+"す)、もしくはそれ自身のライフサイクルを持った別のエンティティへの参照である"
+"かのかという違いです。後者は、2つのオブジェクト間の「リンク」をコレクションに"
+"保持していると見なしているだけです。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:46
+#, fuzzy, no-c-format
msgid ""
-"The actual interface might be <literal>java.util.Set</literal>, "
+"As a requirement persistent collection-valued fields must be declared as an "
+"interface type (see <xref linkend=\"example.collection.mapping.annotations\"/"
+">). The actual interface might be <literal>java.util.Set</literal>, "
"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
"<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, "
"<literal>java.util.SortedMap</literal> or anything you like (\"anything you "
"like\" means you will have to write an implementation of <literal>org."
-"hibernate.usertype.UserCollectionType</literal>.)"
+"hibernate.usertype.UserCollectionType</literal>)."
msgstr ""
"実在するインターフェースには <literal>java.util.Set</literal>、 "
"<literal>java.util.Collection</literal>、 <literal>java.util.List</"
@@ -51,15 +69,17 @@
"装クラスを作成する必要があります。)"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:57
+#, fuzzy, no-c-format
msgid ""
-"Notice how the instance variable was initialized with an instance of "
-"<literal>HashSet</literal>. This is the best way to initialize collection "
+"Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the "
+"instance variable <literal>parts</literal> was initialized with an instance "
+"of <literal>HashSet</literal>. This is the best way to initialize collection "
"valued properties of newly instantiated (non-persistent) instances. When you "
-"make the instance persistent, by calling <literal>persist()</literal> for "
-"example, Hibernate will actually replace the <literal>HashSet</literal> with "
-"an instance of Hibernate's own implementation of <literal>Set</literal>. Be "
-"aware of the following errors:"
+"make the instance persistent, by calling <literal>persist()</literal>, "
+"Hibernate will actually replace the <literal>HashSet</literal> with an "
+"instance of Hibernate's own implementation of <literal>Set</literal>. Be "
+"aware of the following error:"
msgstr ""
"<literal>HashSet</literal> のインスタンスを持つインスタンス変数がどのように初"
"期化されるかに注目してみましょう。これは新たに生成された(永続化されていな"
@@ -69,7 +89,39 @@
"literal> の実装クラスに置き換えます。このため、次のようなエラーには注意が必要"
"です。"
+#. Tag: title
+#: collection_mapping.xml:68
+#, no-c-format
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+
#. Tag: para
+#: collection_mapping.xml:73
#, no-c-format
msgid ""
"The persistent collections injected by Hibernate behave like "
@@ -83,6 +135,7 @@
"振舞います。"
#. Tag: para
+#: collection_mapping.xml:78
#, no-c-format
msgid ""
"Collections instances have the usual behavior of value types. They are "
@@ -104,66 +157,393 @@
"を区別しません。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:89
+#, fuzzy, no-c-format
msgid ""
"Use persistent collections the same way you use ordinary Java collections. "
-"However, please ensure you understand the semantics of bidirectional "
-"associations (these are discussed later)."
+"However, ensure you understand the semantics of bidirectional associations "
+"(see <xref linkend=\"collections-bidirectional\"/>)."
msgstr ""
"しかしそれほど心配しなくても構いません。普段使っている Java のコレクションと"
"同じように、永続化コレクションを使ってください。双方向関連の意味を理解すれば"
"よいのです(これは後ほど説明します)。"
#. Tag: title
+#: collection_mapping.xml:97
+#, fuzzy, no-c-format
+msgid "How to map collections"
+msgstr "ソートされたコレクション"
+
+#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "Collection mappings"
-msgstr "コレクションのマッピング"
+msgid ""
+"Using annotations you can map <classname>Collection</classname>s, "
+"<classname>List</classname>s, <classname>Map</classname>s and "
+"<classname>Set</classname>s of associated entities using @OneToMany and "
+"@ManyToMany. For collections of a basic or embeddable type use "
+"@ElementCollection. In the simplest case a collection mapping looks like "
+"this:"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
+#, fuzzy, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinColumn(name=\"PART_ID\")\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+"public class Product {\n"
+" private String serialNumber;\n"
+" private Set parts = new HashSet();\n"
+" \n"
+" public Set getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+"}"
+
#. Tag: para
+#: collection_mapping.xml:112
#, no-c-format
msgid ""
-"There are quite a range of mappings that can be generated for collections "
-"that cover many common relational models. We suggest you experiment with the "
-"schema generation tool so that you understand how various mapping "
-"declarations translate to database tables."
+"Product describes a unidirectional relationship with Part using the join "
+"column PART_ID. In this unidirectional one to many scenario you can also use "
+"a join table as seen in <xref linkend=\"example-one-to-many-with-join-table"
+"\"/>."
msgstr ""
-"多くの一般的なリレーショナルモデルをカバーしたために、コレクションのために利"
-"用できるマッピングにはかなりの幅があります。様々なマッピング宣言がどのように"
-"データベーステーブルに変換されるかを知るために、スキーマ生成ツールを使ってみ"
-"ると良いでしょう。"
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"PRODUCT_PARTS\",\n"
+" joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+" )\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:124
#, no-c-format
msgid ""
-"The Hibernate mapping element used for mapping a collection depends upon the "
-"type of interface. For example, a <literal><set></literal> element is "
-"used for mapping properties of type <literal>Set</literal>."
+"Without describing any physical mapping (no <classname>@JoinColumn</"
+"classname> or <classname>@JoinTable</classname>), a unidirectional one to "
+"many with join table is used. The table name is the concatenation of the "
+"owner table name, _, and the other side table name. The foreign key name(s) "
+"referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:135
+#, fuzzy, no-c-format
+msgid ""
+"Lets have a look now how collections are mapped using Hibernate mapping "
+"files. In this case the first step is to chose the right mapping element. It "
+"depends on the type of interface. For example, a <literal><set></"
+"literal> element is used for mapping properties of type <literal>Set</"
+"literal>."
+msgstr ""
"コレクションをマッピングするためのマッピング要素は、インターフェースの型に依"
"存します。例えば、 <literal><set></literal> 要素は <literal>Set</"
"literal> 型のプロパティをマッピングするために使います。"
+#. Tag: title
+#: collection_mapping.xml:142
+#, no-c-format
+msgid "Mapping a Set using <set>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:147
+#, fuzzy, no-c-format
+msgid ""
+"In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many "
+"association</emphasis> links the <literal>Product</literal> and "
+"<literal>Part</literal> entities. This association requires the existence of "
+"a foreign key column and possibly an index column to the <literal>Part</"
+"literal> table. This mapping loses certain semantics of normal Java "
+"collections:"
+msgstr ""
+"<literal>Product</literal> から <literal>Part</literal> への関連は、 "
+"<literal>Part</literal> テーブルへの外部キーカラムと、場合によってはインデッ"
+"クスカラムが必要です。 <literal><one-to-many></literal> タグは、これが"
+"一対多関連であることを表しています。"
+
+#. Tag: para
+#: collection_mapping.xml:156
#, no-c-format
msgid ""
-"Apart from <literal><set></literal>, there is also <literal><"
-"list></literal>, <literal><map></literal>, <literal><bag></"
-"literal>, <literal><array></literal> and <literal><primitive-"
-"array></literal> mapping elements. The <literal><map></literal> "
-"element is representative:"
+"An instance of the contained entity class cannot belong to more than one "
+"instance of the collection."
msgstr ""
+"エンティティクラスのインスタンスは、2つ以上のコレクションのインスタンスに属し"
+"てはいけません。"
+
+#. Tag: para
+#: collection_mapping.xml:161
+#, no-c-format
+msgid ""
+"An instance of the contained entity class cannot appear at more than one "
+"value of the collection index."
+msgstr ""
+"コレクションに含まれるエンティティクラスのインスタンスは、コレクションイン"
+"デックスの値として2度以上現れてはいけません。"
+
+#. Tag: para
+#: collection_mapping.xml:166
+#, no-c-format
+msgid ""
+"Looking closer at the used <literal><one-to-many></literal> tag we see "
+"that it has the following options."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-many\n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+msgstr ""
+"<one-to-many \n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+
+#. Tag: para
+#: collection_mapping.xml:185
+#, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, no-c-format
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how cached identifiers that reference missing rows will "
+"be handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal> (オプション - デフォルトは <literal>exception</"
+"literal>): 参照先の行がないキャッシュされた識別子をどのように扱うかを指定し"
+"ます: <literal>ignore</literal> を指定すると、行がないことを関連がないものと"
+"して扱います。"
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class, as an alternative to <literal>class</literal>."
+msgstr ""
+"<literal>entity-name</literal> (オプション): <literal>class</literal> の代"
+"替である関連クラスのエンティティ名。 <literal>class</literal> の代わりに指定"
+"する、関連クラスのエンティティ名。"
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, no-c-format
+msgid ""
+"The <literal><one-to-many></literal> element does not need to declare "
+"any columns. Nor is it necessary to specify the <literal>table</literal> "
+"name anywhere."
+msgstr ""
+"<literal><one-to-many></literal> 要素はカラムを宣言する必要がないことに"
+"注意してください。同様に <literal>テーブル</literal> 名を指定する必要もありま"
+"せん。"
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, fuzzy, no-c-format
+msgid ""
+"If the foreign key column of a <literal><one-to-many></literal> "
+"association is declared <literal>NOT NULL</literal>, you must declare the "
+"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
+"or <emphasis>use a bidirectional association</emphasis> with the collection "
+"mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend="
+"\"collections-bidirectional\"/>."
+msgstr ""
+"<emphasis>とても重要な注意:</emphasis> もし <literal><one-to-many></"
+"literal> 関連の外部キーカラムが <literal>NOT NULL</literal>と宣言された場"
+"合、 <literal><key></literal> マッピングに <literal>not-null=\"true\"</"
+"literal> を宣言するか、コレクションマッピングに <literal>inverse=\"true\"</"
+"literal> を付けた上で、 <emphasis>双方向関連を使う</emphasis> 必要がありま"
+"す。双方向関連についてはこの章の後のほうで説明します。"
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, fuzzy, no-c-format
+msgid ""
+"Apart from the <literal><set> </literal>tag as shown in <xref linkend="
+"\"example.collections.set\"/>, there is also <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> and <literal><primitive-array></"
+"literal> mapping elements. The <literal><map></literal> element is "
+"representative:"
+msgstr ""
"マッピング要素には <literal><set></literal> の他に <literal><"
"list></literal>、 <literal><map></literal>、 <literal><bag></"
"literal>、 <literal><array></literal>、 <literal><primitive-"
"array></literal> があります。代表として、 <literal><map></literal> "
"要素を下記に示します。"
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, fuzzy, no-c-format
+msgid ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+msgstr ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+
#. Tag: para
+#: collection_mapping.xml:266
#, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr "<literal>name</literal> :コレクション型であるプロパティの名前"
#. Tag: para
+#: collection_mapping.xml:270
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to property name): the name of "
@@ -173,6 +553,7 @@
"ションテーブルの名前(一対多関連では使用しません)。"
#. Tag: para
+#: collection_mapping.xml:276
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): the name of a table schema to override "
@@ -182,6 +563,7 @@
"で宣言されているスキーマより優先されます。"
#. Tag: para
+#: collection_mapping.xml:281
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
@@ -197,6 +579,7 @@
"なコレクションに適しています)。"
#. Tag: para
+#: collection_mapping.xml:290
#, no-c-format
msgid ""
"<literal>inverse</literal> (optional - defaults to <literal>false</"
@@ -207,6 +590,7 @@
"literal>):このコレクションが双方向関連の「逆」側であるとマークします。"
#. Tag: para
+#: collection_mapping.xml:296
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional - defaults to <literal>none</literal>): "
@@ -216,6 +600,7 @@
"literal>):子エンティティへのカスケード操作を有効にします。"
#. Tag: para
+#: collection_mapping.xml:302
#, no-c-format
msgid ""
"<literal>sort</literal> (optional): specifies a sorted collection with "
@@ -226,12 +611,13 @@
"指定します。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:308
+#, fuzzy, no-c-format
msgid ""
-"<literal>order-by</literal> (optional, JDK1.4 only): specifies a table "
-"column or columns that define the iteration order of the <literal>Map</"
-"literal>, <literal>Set</literal> or bag, together with an optional "
-"<literal>asc</literal> or <literal>desc</literal>."
+"<literal>order-by</literal> (optional): specifies a table column or columns "
+"that define the iteration order of the <literal>Map</literal>, <literal>Set</"
+"literal> or bag, together with an optional <literal>asc</literal> or "
+"<literal>desc</literal>."
msgstr ""
"<literal>order-by</literal> (オプション、 JDK1.4 のみ) <literal>Map</"
"literal>、 <literal>Set</literal>、 bag のイテレーション順序を定義するテーブ"
@@ -239,6 +625,7 @@
"<literal>desc</literal> を指定します。"
#. Tag: para
+#: collection_mapping.xml:316
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -251,6 +638,7 @@
"分だけをコレクションが含むべきときに、これは有用です)。"
#. Tag: para
+#: collection_mapping.xml:324
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional, defaults to <literal>select</literal>): "
@@ -263,6 +651,7 @@
"選択してください。"
#. Tag: para
+#: collection_mapping.xml:331
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): "
@@ -273,6 +662,7 @@
"を指定します。"
#. Tag: para
+#: collection_mapping.xml:337
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -284,6 +674,7 @@
"す。"
#. Tag: para
+#: collection_mapping.xml:343
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -297,6 +688,7 @@
"対多関連では、ほとんどの場合において無効に設定するのが妥当です。)"
#. Tag: para
+#: collection_mapping.xml:351
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -308,19 +700,31 @@
"literal>) <literal>false</literal> 値は、コレクションの要素が変更されないこ"
"とを表します (ある場合には、少しパフォーマンスを高めます)。"
+#. Tag: para
+#: collection_mapping.xml:360
+#, no-c-format
+msgid ""
+"After exploring the basic mapping of collections in the preceding paragraphs "
+"we will now focus details like physical mapping considerations, indexed "
+"collections and collections of value types."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr "コレクションの外部キー"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:367
+#, fuzzy, no-c-format
msgid ""
-"Collection instances are distinguished in the database by the foreign key of "
-"the entity that owns the collection. This foreign key is referred to as the "
-"<emphasis>collection key column</emphasis>, or columns, of the collection "
-"table. The collection key column is mapped by the <literal><key></"
-"literal> element."
+"On the database level collection instances are distinguished by the foreign "
+"key of the entity that owns the collection. This foreign key is referred to "
+"as the <emphasis>collection key column</emphasis>, or columns, of the "
+"collection table. The collection key column is mapped by the "
+"<literal>@JoinColumn</literal> annotation respectively the <literal><"
+"key></literal> XML element."
msgstr ""
"コレクションのインスタンスは、データベース内では、そのコレクションを所有する"
"エンティティの外部キーによって識別されます。この外部キーはコレクションテーブ"
@@ -329,170 +733,300 @@
"ングします。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:374
+#, fuzzy, no-c-format
msgid ""
"There can be a nullability constraint on the foreign key column. For most "
"collections, this is implied. For unidirectional one-to-many associations, "
-"the foreign key column is nullable by default, so you may need to specify "
-"<literal>not-null=\"true\"</literal>."
+"the foreign key column is nullable by default, so you may need to specify"
msgstr ""
"外部キーカラムには null 設定制約があるかもしれません。ほとんどのコレクション"
"に当てはまるでしょう。単方向の一対多関連において、外部キーカラムはデフォルト"
"で null を許す設定になっています。よって、 <literal>not-null=\"true\"</"
"literal> を指定する必要があるかもしれません。"
+#. Tag: programlisting
+#: collection_mapping.xml:379
+#, no-c-format
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:381
#, no-c-format
+msgid "<para>or</para>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:383
+#, fuzzy, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+
+#. Tag: para
+#: collection_mapping.xml:385
+#, fuzzy, no-c-format
msgid ""
-"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
+"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In "
+"XML this can be expressed via:"
msgstr ""
"外部キーの制約が <literal>ON DELETE CASCADE</literal> を使うかもしれません。"
+#. Tag: programlisting
+#: collection_mapping.xml:388
+#, fuzzy, no-c-format
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+msgstr "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+
#. Tag: para
+#: collection_mapping.xml:390
#, no-c-format
msgid ""
-"See the previous chapter for a full definition of the <literal><key></"
-"literal> element."
+"In annotations the Hibernate specific annotation @OnDelete has to be used."
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:393
+#, no-c-format
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:395
+#, fuzzy, no-c-format
+msgid ""
+"See <xref lang=\"\" linkend=\"section.key\"/> for more information about the "
+"<literal><key></literal> element."
+msgstr ""
"<literal><key></literal> 要素のすべての定義については前の章を参照してく"
"ださい。"
#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
-msgid "Collection elements"
-msgstr "コレクションの要素"
+msgid "Indexed collections"
+msgstr "インデックス付きのコレクション"
#. Tag: para
+#: collection_mapping.xml:402
#, no-c-format
msgid ""
-"Collections can contain almost any other Hibernate type, including: basic "
-"types, custom types, components and references to other entities. This is an "
-"important distinction. An object in a collection might be handled with "
-"\"value\" semantics (its life cycle fully depends on the collection owner), "
-"or it might be a reference to another entity with its own life cycle. In the "
-"latter case, only the \"link\" between the two objects is considered to be a "
-"state held by the collection."
+"In the following paragraphs we have a closer at the indexed collections "
+"<classname>List</classname> and <classname>Map</classname> how the their "
+"index can be mapped in Hibernate."
msgstr ""
-"コレクションは他の Hibernate の型のほとんど(すべての基本型、カスタム型、コン"
-"ポーネント、他のエンティティへの参照)を格納することができます。次の点は重要"
-"な違いになります。コレクションに格納されたオブジェクトが「値」セマンティクス"
-"として扱われるのか (ライフサイクルはコレクションのオーナーに完全に依存しま"
-"す)、もしくはそれ自身のライフサイクルを持った別のエンティティへの参照である"
-"かのかという違いです。後者は、2つのオブジェクト間の「リンク」をコレクションに"
-"保持していると見なしているだけです。"
+#. Tag: title
+#: collection_mapping.xml:407
+#, no-c-format
+msgid "Lists"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
-msgid ""
-"The contained type is referred to as the <emphasis>collection element type</"
-"emphasis>. Collection elements are mapped by <literal><element></"
-"literal> or <literal><composite-element></literal>, or in the case of "
-"entity references, with <literal><one-to-many></literal> or "
-"<literal><many-to-many></literal>. The first two map elements with "
-"value semantics, the next two are used to map entity associations."
+msgid "Lists can be mapped in two different ways:"
msgstr ""
-"格納される型は <emphasis>コレクション要素型</emphasis> と呼ばれます。コレク"
-"ション要素は、 <literal><element></literal> または <literal><"
-"composite-element></literal> によりマッピングされ、エンティティへの参照の"
-"場合には <literal><one-to-many></literal> または <literal><many-to-"
-"many></literal> によりマッピングされます。最初の二つは値として要素をマッピ"
-"ングし、次の二つはエンティティの関連をマッピングするのに使われます。"
-#. Tag: title
+#. Tag: para
+#: collection_mapping.xml:413
#, no-c-format
-msgid "Indexed collections"
-msgstr "インデックス付きのコレクション"
+msgid "as ordered lists, where the order is not materialized in the database"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:418
#, no-c-format
-msgid ""
-"All collection mappings, except those with set and bag semantics, need an "
-"<emphasis>index column</emphasis> in the collection table. An index column "
-"is a column that maps to an array index, or <literal>List</literal> index, "
-"or <literal>Map</literal> key. The index of a <literal>Map</literal> may be "
-"of any basic type, mapped with <literal><map-key></literal>. It can be "
-"an entity reference mapped with <literal><map-key-many-to-many></"
-"literal>, or it can be a composite type mapped with <literal><composite-"
-"map-key></literal>. The index of an array or list is always of type "
-"<literal>integer</literal> and is mapped using the <literal><list-"
-"index></literal> element. The mapped column contains sequential integers "
-"that are numbered from zero by default."
+msgid "as indexed lists, where the order is materialized in the database"
msgstr ""
-"set と bag を除く全てのコレクションマッピングには、コレクションテーブルの中"
-"に <emphasis>インデックス用のカラム</emphasis> が必要です。そのカラムに、配列"
-"や <literal>List</literal> のインデックス、もしくは <literal>Map</literal> の"
-"キーをマッピングします。 <literal>Map</literal> のインデックスは、 "
-"<literal><map-key></literal> によりマッピングされた基本型か、 "
-"<literal><map-key-many-to-many></literal> によりマッピングされたエン"
-"ティティの関連か、あるいは <literal><composite-map-key></literal> によ"
-"りマッピングされたコンポジット型になります。配列かリストのインデックスは、常"
-"に <literal>integer</literal> 型で、 <literal><list-index></literal> 要"
-"素によりマッピングします。マッピングされたカラムにはシーケンシャルな整数を格"
-"納します (デフォルトでは0から番号が付けられます)。"
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:423
+#, no-c-format
msgid ""
-"<literal>column_name</literal> (required): the name of the column holding "
-"the collection index values."
-msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+"To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> "
+"to your property. This annotation takes as parameter a list of comma "
+"separated properties (of the target entity) and orders the collection "
+"accordingly (eg <code>firstname asc, age desc</code>), if the string is "
+"empty, the collection will be ordered by the primary key of the target "
+"entity."
+msgstr ""
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: title
+#: collection_mapping.xml:432
+#, no-c-format
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:434
+#, no-c-format
msgid ""
-"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
-"value of the index column that corresponds to the first element of the list "
-"or array."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderBy(\"number\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"<literal>cascade</literal> (オプション - デフォルトは <literal>none</"
-"literal>):子エンティティへのカスケード操作を有効にします。"
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:437
+#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection index values."
+"To store the index value in a dedicated column, use the <classname>@javax."
+"persistence.OrderColumn</classname> annotation on your property. This "
+"annotations describes the column name and attributes of the column keeping "
+"the index value. This column is hosted on the table containing the "
+"association foreign key. If the column name is not specified, the default is "
+"the name of the referencing property, followed by underscore, followed by "
+"<literal>ORDER</literal> (in the following example, it would be "
+"<literal>orders_ORDER</literal>)."
msgstr ""
-"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
-"で宣言されているスキーマより優先されます。"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:448
#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
-"key of the map."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderColumn(name=\"orders_index\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|--------------| |----------|\n"
+"| Order | | Customer |\n"
+"|--------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"| orders_order |\n"
+"|--------------|"
msgstr ""
#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
-msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+#: collection_mapping.xml:455
+#, no-c-format
+msgid ""
+"We recommend you to convert <classname>the legacy @org.hibernate.annotations."
+"IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless "
+"you are making use of the base property. The <literal>base</literal> "
+"property lets you define the index value of the first element (aka as base "
+"index). The usual value is <literal>0</literal> or <literal>1</literal>. The "
+"default is 0 like in Java."
+msgstr ""
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:464
+#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the foreign key column for "
-"the collection index values."
+"Looking again at the Hibernate mapping file equivalent, the index of an "
+"array or list is always of type <literal>integer</literal> and is mapped "
+"using the <literal><list-index></literal> element. The mapped column "
+"contains sequential integers that are numbered from zero by default."
msgstr ""
-"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
-"で宣言されているスキーマより優先されます。"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:471
#, no-c-format
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:481
+#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
-"foreign key of the map key."
+"<list-index\n"
+" column=\"column_name\"\n"
+" base=\"0|1|...\"/>"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:485
#, fuzzy, no-c-format
msgid ""
-"<literal>class</literal> (required): the entity class used as the map key."
+"<literal>column_name</literal> (required): the name of the column holding "
+"the collection index values."
msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
#. Tag: para
+#: collection_mapping.xml:490
#, fuzzy, no-c-format
msgid ""
+"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
+"value of the index column that corresponds to the first element of the list "
+"or array."
+msgstr ""
+"<literal>cascade</literal> (オプション - デフォルトは <literal>none</"
+"literal>):子エンティティへのカスケード操作を有効にします。"
+
+#. Tag: para
+#: collection_mapping.xml:498
+#, fuzzy, no-c-format
+msgid ""
"If your table does not have an index column, and you still wish to use "
"<literal>List</literal> as the property type, you can map the property as a "
"Hibernate <emphasis><bag></emphasis>. A bag does not retain its order "
@@ -506,289 +1040,595 @@
"けしたり(order by)することもできます。"
#. Tag: title
+#: collection_mapping.xml:506
#, no-c-format
-msgid "Collections of values and many-to-many associations"
-msgstr "値のコレクションと多対多関連"
+msgid "Maps"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:508
#, no-c-format
msgid ""
-"Any collection of values or many-to-many associations requires a dedicated "
-"<emphasis>collection table</emphasis> with a foreign key column or columns, "
-"<emphasis>collection element column</emphasis> or columns, and possibly an "
-"index column or columns."
+"The question with <classname>Map</classname>s is where the key value is "
+"stored. There are everal options. Maps can borrow their keys from one of the "
+"associated entity properties or have dedicated columns to store an explicit "
+"key."
msgstr ""
-"値のコレクションや多対多関連は、専用の <emphasis>コレクションテーブル</"
-"emphasis> が必要です。このテーブルは、外部キーカラムと、 <emphasis>コレクショ"
-"ン要素のカラム</emphasis> と、場合によってはインデックスカラムを持ちます。"
#. Tag: para
+#: collection_mapping.xml:513
#, no-c-format
msgid ""
-"For a collection of values use the <literal><element></literal> tag. "
-"For example:"
+"To use one of the target entity property as a key of the map, use "
+"<literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</"
+"literal> is a property name in the target entity. When using "
+"<literal>@MapKey</literal> without the name attribuate, 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, "
+"because the map key 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."
msgstr ""
-"値のコレクションのために、 <literal><element></literal> タグを使用しま"
-"す。"
-#. Tag: para
-#, fuzzy, no-c-format
+#. Tag: title
+#: collection_mapping.xml:525
+#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection element values."
+"Use of target entity property as map key via <classname>@MapKey</classname>"
msgstr ""
-"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
-"で宣言されているスキーマより優先されます。"
+#. Tag: programlisting
+#: collection_mapping.xml:528
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @MapKey(name=\"number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> order) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
+msgstr ""
+
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:531
+#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element."
+"Alternatively the map key is mapped to a dedicated column or columns. In "
+"order to customize the mapping use one of the following annotations:"
msgstr ""
-"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
-"で宣言されているスキーマより優先されます。"
#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
-msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+#: collection_mapping.xml:537
+#, no-c-format
+msgid ""
+"@<classname>MapKeyColumn</classname> if the map key is a basic type. If you "
+"don't specify the column name, the name of the property followed by "
+"underscore followed by <literal>KEY</literal> is used (for example "
+"<literal>orders_KEY</literal>)."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:544
#, no-c-format
msgid ""
-"A <emphasis>many-to-many association</emphasis> is specified using the "
-"<literal><many-to-many></literal> element."
+"<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</"
+"classname> if the map key type is respectively an enum or a <classname>Date</"
+"classname>."
msgstr ""
#. Tag: para
-#, fuzzy, no-c-format
+#: collection_mapping.xml:550
+#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the element foreign key "
-"column."
-msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+"<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</"
+"classname> if the map key type is another entity."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:555
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element foreign key value."
+"<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</"
+"classname> when the map key is a embeddable object. Use <literal>key.</"
+"literal> as a prefix for your embeddable object property names."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:562
#, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
-msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+msgid ""
+"You can also use <classname>@MapKeyClass</classname> to define the type of "
+"the key if you don't use generics."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:566
+#, no-c-format
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+" @MapKeyColumn(name=\"orders_number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> orders) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------| |---------------|\n"
+"| Order | | Customer | | Cust_Order |\n"
+"|-------------| |----------| |---------------|\n"
+"| id | | id | | customer_id |\n"
+"| number | |----------| | order_id |\n"
+"| customer_id | | orders_number |\n"
+"|-------------| |---------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:573
#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"enables outer-join or sequential select fetching for this association. This "
-"is a special case; for full eager fetching in a single <literal>SELECT</"
-"literal> of an entity and its many-to-many relationships to other entities, "
-"you would enable <literal>join</literal> fetching,not only of the collection "
-"itself, but also with this attribute on the <literal><many-to-many></"
-"literal> nested element."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</"
+"classname> to the new standard approach described above"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files there exists equivalent concepts to the "
+"descibed annotations. You have to use <literal><map-key></literal>, "
+"<literal><map-key-many-to-many></literal> and <literal><composite-"
+"map-key></literal>. <literal><map-key></literal> is used for any "
+"basic type, <literal><map-key-many-to-many></literal> for an entity "
+"reference and <literal><composite-map-key></literal> for a composite "
+"type."
+msgstr ""
+"マッピング要素には <literal><set></literal> の他に <literal><"
+"list></literal>、 <literal><map></literal>、 <literal><bag></"
+"literal>、 <literal><array></literal>、 <literal><primitive-"
+"array></literal> があります。代表として、 <literal><map></literal> "
+"要素を下記に示します。"
+
+#. Tag: title
+#: collection_mapping.xml:590
#, no-c-format
+msgid "map-key xml mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional): enables the DDL generation of a unique "
-"constraint for the foreign-key column. This makes the association "
-"multiplicity effectively one-to-many."
+"<map-key\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"type_name\"\n"
+" node=\"@attribute-name\"\n"
+" length=\"N\"/>"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:605
#, fuzzy, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how foreign keys that reference missing rows will be "
-"handled: <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection index values."
msgstr ""
-"<literal>not-found</literal> (オプション - デフォルトは <literal>exception</"
-"literal>): 参照先の行がないキャッシュされた識別子をどのように扱うかを指定し"
-"ます: <literal>ignore</literal> を指定すると、行がないことを関連がないものと"
-"して扱います。"
+"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
+"で宣言されているスキーマより優先されます。"
#. Tag: para
+#: collection_mapping.xml:610
#, no-c-format
msgid ""
-"<literal>entity-name</literal> (optional): the entity name of the associated "
-"class, as an alternative to <literal>class</literal>."
+"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
+"key of the map."
msgstr ""
-"<literal>entity-name</literal> (オプション): <literal>class</literal> の代"
-"替である関連クラスのエンティティ名。 <literal>class</literal> の代わりに指定"
-"する、関連クラスのエンティティ名。"
#. Tag: para
+#: collection_mapping.xml:615
+#, fuzzy, no-c-format
+msgid "<literal>type</literal> (required): the type of the map keys."
+msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+
+#. Tag: title
+#: collection_mapping.xml:623
+#, fuzzy, no-c-format
+msgid "map-key-many-to-many"
+msgstr "many-to-many"
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
#, no-c-format
msgid ""
-"<literal>property-ref</literal> (optional): the name of a property of the "
-"associated class that is joined to this foreign key. If not specified, the "
-"primary key of the associated class is used."
+"<map-key-many-to-many\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" class=\"ClassName\"\n"
+"/>"
msgstr ""
#. Tag: para
-#, no-c-format
-msgid "Here are some examples."
+#: collection_mapping.xml:638
+#, fuzzy, no-c-format
+msgid ""
+"<literal>column</literal> (optional): the name of the foreign key column for "
+"the collection index values."
msgstr ""
+"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
+"で宣言されているスキーマより優先されます。"
#. Tag: para
+#: collection_mapping.xml:643
#, no-c-format
-msgid "A set of strings:"
+msgid ""
+"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
+"foreign key of the map key."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:648
+#, fuzzy, no-c-format
+msgid ""
+"<literal>class</literal> (required): the entity class used as the map key."
+msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+
+#. Tag: title
+#: collection_mapping.xml:658
+#, fuzzy, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr "値のコレクションと多対多関連"
+
+#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
msgid ""
-"A bag containing integers with an iteration order determined by the "
-"<literal>order-by</literal> attribute:"
+"In some situations you don't need to associate two entities but simply "
+"create a collection of basic types or embeddable objects. Use the "
+"<classname>@ElementCollection</classname> for this case."
msgstr ""
-"整数値を含む bag (bagは <literal>order-by</literal> 属性によって反復順序が定"
-"義されています):"
+#. Tag: title
+#: collection_mapping.xml:665
+#, no-c-format
+msgid ""
+"Collection of basic types mapped via <classname>@ElementCollection</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @Column(name=\"nickname\")\n"
+" public Set<String> getNicknames() { ... } \n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:671
#, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
-msgstr "エンティティの配列 - この場合、多対多の関連です。"
+msgid ""
+"The collection table holding the collection data is set using the "
+"<classname>@CollectionTable</classname> annotation. If omitted the "
+"collection table name defaults to the concatenation of the name of the "
+"containing entity and the name of the collection attribute, separated by an "
+"underscore. In our example, it would be <literal>User_nicknames</literal>."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
-msgid "A map from string indices to dates:"
-msgstr "文字列と日付の map"
+msgid ""
+"The column holding the basic type is set using the <classname>@Column</"
+"classname> annotation. If omitted, the column name defaults to the property "
+"name: in our example, it would be <literal>nicknames</literal>."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
-msgstr "コンポーネントの list (次の章で詳しく説明します)"
+msgid ""
+"But you are not limited to basic types, the collection type can be any "
+"embeddable object. To override the columns of the embeddable object in the "
+"collection table, use the <classname>@AttributeOverride</classname> "
+"annotation."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:689
#, no-c-format
-msgid "One-to-many associations"
-msgstr "一対多関連"
+msgid "@ElementCollection for embeddable objects"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:691
#, no-c-format
msgid ""
-"A <emphasis>one-to-many association</emphasis> links the tables of two "
-"classes via a foreign key with no intervening collection table. This mapping "
-"loses certain semantics of normal Java collections:"
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street"
+"\"))\n"
+" })\n"
+" public Set<Address> getAddresses() { ... } \n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" public String getStreet1() {...}\n"
+" [...]\n"
+"}"
msgstr ""
-"<emphasis>一対多関連</emphasis> は、コレクションテーブルを介さず、外部キーに"
-"より2つのクラスのテーブルを関連付けます。このマッピングは標準的な Java のコレ"
-"クションのセマンティクスをいくつか失います:"
#. Tag: para
+#: collection_mapping.xml:694
#, no-c-format
-msgid ""
-"An instance of the contained entity class cannot belong to more than one "
-"instance of the collection."
+msgid "Such an embeddable object cannot contains a collection itself."
msgstr ""
-"エンティティクラスのインスタンスは、2つ以上のコレクションのインスタンスに属し"
-"てはいけません。"
#. Tag: para
+#: collection_mapping.xml:698
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot appear at more than one "
-"value of the collection index."
+"in <classname>@AttributeOverride</classname>, you must use the "
+"<literal>value.</literal> prefix to override properties of the embeddable "
+"object used in the map value and the <literal>key.</literal> prefix to "
+"override properties of the embeddable object used in the map key."
msgstr ""
-"コレクションに含まれるエンティティクラスのインスタンスは、コレクションイン"
-"デックスの値として2度以上現れてはいけません。"
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:704
#, no-c-format
msgid ""
-"An association from <literal>Product</literal> to <literal>Part</literal> "
-"requires the existence of a foreign key column and possibly an index column "
-"to the <literal>Part</literal> table. A <literal><one-to-many></"
-"literal> tag indicates that this is a one-to-many association."
+"@Entity\n"
+"public class User {\n"
+" @ElementCollection\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"key.street1\", column=@Column(name="
+"\"fld_street\")),\n"
+" @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note"
+"\"))\n"
+" })\n"
+" public Map<Address,Rating> getFavHomes() { ... }"
msgstr ""
-"<literal>Product</literal> から <literal>Part</literal> への関連は、 "
-"<literal>Part</literal> テーブルへの外部キーカラムと、場合によってはインデッ"
-"クスカラムが必要です。 <literal><one-to-many></literal> タグは、これが"
-"一対多関連であることを表しています。"
#. Tag: para
+#: collection_mapping.xml:708
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how cached identifiers that reference missing rows will "
-"be handled. <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"CollectionOfElements</classname> to the new <classname>@ElementCollection</"
+"classname> annotation."
msgstr ""
-"<literal>not-found</literal> (オプション - デフォルトは <literal>exception</"
-"literal>): 参照先の行がないキャッシュされた識別子をどのように扱うかを指定し"
-"ます: <literal>ignore</literal> を指定すると、行がないことを関連がないものと"
-"して扱います。"
#. Tag: para
+#: collection_mapping.xml:714
+#, fuzzy, no-c-format
+msgid ""
+"Using the mapping file approach a collection of values is mapped using the "
+"<literal><element></literal> tag. For example:"
+msgstr ""
+"値のコレクションのために、 <literal><element></literal> タグを使用しま"
+"す。"
+
+#. Tag: title
+#: collection_mapping.xml:718
#, no-c-format
+msgid "<element> tag for collection values using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
msgid ""
-"The <literal><one-to-many></literal> element does not need to declare "
-"any columns. Nor is it necessary to specify the <literal>table</literal> "
-"name anywhere."
+"<element\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"typename\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
msgstr ""
-"<literal><one-to-many></literal> 要素はカラムを宣言する必要がないことに"
-"注意してください。同様に <literal>テーブル</literal> 名を指定する必要もありま"
-"せん。"
#. Tag: para
+#: collection_mapping.xml:734
#, fuzzy, no-c-format
msgid ""
-"If the foreign key column of a <literal><one-to-many></literal> "
-"association is declared <literal>NOT NULL</literal>, you must declare the "
-"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
-"or <emphasis>use a bidirectional association</emphasis> with the collection "
-"mapping marked <literal>inverse=\"true\"</literal>. See the discussion of "
-"bidirectional associations later in this chapter for more information."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection element values."
msgstr ""
-"<emphasis>とても重要な注意:</emphasis> もし <literal><one-to-many></"
-"literal> 関連の外部キーカラムが <literal>NOT NULL</literal>と宣言された場"
-"合、 <literal><key></literal> マッピングに <literal>not-null=\"true\"</"
-"literal> を宣言するか、コレクションマッピングに <literal>inverse=\"true\"</"
-"literal> を付けた上で、 <emphasis>双方向関連を使う</emphasis> 必要がありま"
-"す。双方向関連についてはこの章の後のほうで説明します。"
+"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
+"で宣言されているスキーマより優先されます。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:739
+#, fuzzy, no-c-format
msgid ""
-"The following example shows a map of <literal>Part</literal> entities by "
-"name, where <literal>partName</literal> is a persistent property of "
-"<literal>Part</literal>. Notice the use of a formula-based index:"
+"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
+"element."
msgstr ""
-"次の例は、名称(<literal>Part</literal> の永続的なプロパティである "
-"<literal>partName</literal>) による <literal>Part</literal> エンティティの "
-"map を表しています。 formula によるインデックスを使っていることに注意してくだ"
-"さい。"
+"<literal>schema</literal> (オプション):テーブルスキーマの名前。ルート要素"
+"で宣言されているスキーマより優先されます。"
+#. Tag: para
+#: collection_mapping.xml:744
+#, fuzzy, no-c-format
+msgid "<literal>type</literal> (required): the type of the collection element."
+msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
+
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr "高度なコレクションマッピング"
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr "ソートされたコレクション"
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
msgid ""
"Hibernate supports collections implementing <literal>java.util.SortedMap</"
-"literal> and <literal>java.util.SortedSet</literal>. You must specify a "
-"comparator in the mapping file:"
+"literal> and <literal>java.util.SortedSet</literal>. With annotations you "
+"declare a sort comparator using <literal>@Sort</literal>. You chose between "
+"the comparator types unsorted, natural or custom. If you want to use your "
+"own comparator implementation, you'll also have to specify 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 ""
-"Hibernate は <literal>java.util.SortedMap</literal> と <literal>java.util."
-"SortedSet</literal> を実装したコレクションをサポートしています。開発者はマッ"
-"ピング定義ファイルにコンパレータを指定しなければなりません: "
+#. Tag: title
+#: collection_mapping.xml:770
+#, fuzzy, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr "ソートされたコレクション"
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+"@JoinColumn(name=\"CUST_ID\")\n"
+"@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+"public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
msgid ""
+"Using Hibernate mapping files you specify a comparator in the mapping file "
+"with <literal><sort></literal>:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:779
+#, fuzzy, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr "ソートされたコレクション"
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"aliases\"\n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+msgstr ""
+"<set name=\"aliases\" \n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+
+#. Tag: para
+#: collection_mapping.xml:784
+#, no-c-format
+msgid ""
"Allowed values of the <literal>sort</literal> attribute are "
"<literal>unsorted</literal>, <literal>natural</literal> and the name of a "
"class implementing <literal>java.util.Comparator</literal>."
@@ -798,6 +1638,7 @@
"を実装したクラスの名前です。"
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
msgid ""
"Sorted collections actually behave like <literal>java.util.TreeSet</literal> "
@@ -807,14 +1648,15 @@
"<literal>java.util.TreeMap</literal> のように振舞います。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:794
+#, fuzzy, no-c-format
msgid ""
"If you want the database itself to order the collection elements, use the "
"<literal>order-by</literal> attribute of <literal>set</literal>, "
"<literal>bag</literal> or <literal>map</literal> mappings. This solution is "
-"only available under JDK 1.4 or higher and is implemented using "
-"<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This "
-"performs the ordering in the SQL query and not in the memory."
+"implemented using <literal>LinkedHashSet</literal> or "
+"<literal>LinkedHashMap</literal> and performs the ordering in the SQL query "
+"and not in the memory."
msgstr ""
"もしデータベース自身にコレクションの要素を並べさせたいなら、 <literal>set</"
"literal> や <literal>bag</literal>、<literal>map</literal> の <literal>order-"
@@ -824,11 +1666,47 @@
"はなく、 SQL クエリ内で実行されます。"
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+msgstr ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr "注記"
#. Tag: para
+#: collection_mapping.xml:810
#, fuzzy, no-c-format
msgid ""
"The value of the <literal>order-by</literal> attribute is an SQL ordering, "
@@ -838,6 +1716,7 @@
"とに注意してください。"
#. Tag: para
+#: collection_mapping.xml:814
#, no-c-format
msgid ""
"Associations can even be sorted by arbitrary criteria at runtime using a "
@@ -847,11 +1726,29 @@
"の criteria によってソートすることも可能です。"
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, fuzzy, no-c-format
+msgid ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+msgstr ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr "双方向関連"
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
msgid ""
"A <emphasis>bidirectional association</emphasis> allows navigation from both "
@@ -862,48 +1759,437 @@
"きます。2種類の双方向関連がサポートされています:"
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr "one-to-many"
#. Tag: para
+#: collection_mapping.xml:834
#, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr "片側が set か bag 、もう片方が単一値です。"
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr "many-to-many"
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr "両側が set か bag です。"
#. Tag: para
+#: collection_mapping.xml:848
#, no-c-format
msgid ""
-"You can specify a bidirectional many-to-many association by mapping two many-"
-"to-many associations to the same database table and declaring one end as "
-"<emphasis>inverse</emphasis>. You cannot select an indexed collection."
+"Often there exists a many to one association which is the owner side of a "
+"bidirectional relationship. The corresponding one to many association is in "
+"this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:854
+#, no-c-format
+msgid "Bidirectional one to many with many to one side as association owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:860
+#, no-c-format
+msgid ""
+"<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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:865
+#, no-c-format
+msgid ""
+"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 not optimized and will produce additional UPDATE "
+"statements."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:872
+#, fuzzy, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr "インデックス付きコレクションと双方向関連"
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:878
+#, fuzzy, no-c-format
+msgid ""
+"How does the mappping of a bidirectional mapping look like in Hibernate "
+"mapping xml? There you define a bidirectional one-to-many association by "
+"mapping a one-to-many association to the same table column(s) as a many-to-"
+"one association and declaring the many-valued end <literal>inverse=\"true\"</"
+"literal>."
+msgstr ""
+"双方向の一対多関連を定義するには、一対多関連を多対一関連と同じテーブルのカラ"
+"ムにマッピングし、多側に <literal>inverse=\"true\"</literal> と宣言します。"
+
+#. Tag: title
+#: collection_mapping.xml:885
+#, no-c-format
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+
+#. Tag: para
+#: collection_mapping.xml:890
+#, no-c-format
+msgid ""
+"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
+"does not affect the operation of cascades as these are orthogonal concepts."
+msgstr ""
+"関連の片側に <literal>inverse=\"true\"</literal> を設定しても、カスケード操作"
+"に影響を与えません。これらは直交した概念です。"
+
+#. Tag: para
+#: collection_mapping.xml:894
+#, no-c-format
+msgid ""
+"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):"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:903
+#, no-c-format
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:910
+#, no-c-format
+msgid ""
+"In this example <classname>@JoinTable</classname> defines a <literal>name</"
+"literal>, an array of join columns, 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\"). 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:919
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:938
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:955
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:961
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:966
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files you can map a bidirectional many-to-many "
+"association by mapping two many-to-many associations to the same database "
+"table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
"2つの多対多関連で同じデータベーステーブルをマッピングし、片方を "
"<emphasis>inverse</emphasis> として宣言することで、双方向の多対多関連を指定す"
"ることが出来ます (どちらを inverse に選んだとしても、そちら側にはインデック"
"ス付きのコレクションは使えません)。"
#. Tag: para
+#: collection_mapping.xml:970
#, no-c-format
+msgid "You cannot select an indexed collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:973
+#, fuzzy, no-c-format
msgid ""
-"Here is an example of a bidirectional many-to-many association that "
-"illustrates how each category can have many items and each item can be in "
-"many categories:"
+"shows a bidirectional many-to-many association that illustrates how each "
+"category can have many items and each item can be in many categories:"
msgstr ""
"次に双方向の多対多関連の例を示します。各カテゴリは多数のアイテムを持つことが"
"でき、各アイテムは多くのカテゴリに属することが出来ます。"
+#. Tag: title
+#: collection_mapping.xml:979
+#, no-c-format
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+msgstr ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:984
#, no-c-format
msgid ""
"Changes made only to the inverse end of the association are <emphasis>not</"
@@ -919,7 +2205,36 @@
"向関係をどうやって作るかを考えれば、これは理解しやすいです。下記に、 Java で"
"の双方向関連を示します。"
+#. Tag: title
+#: collection_mapping.xml:992
+#, fuzzy, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr "値のコレクションと多対多関連"
+
+#. Tag: programlisting
+#: collection_mapping.xml:995
+#, fuzzy, no-c-format
+msgid ""
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
+msgstr ""
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
+
#. Tag: para
+#: collection_mapping.xml:998
#, no-c-format
msgid ""
"The non-inverse side is used to save the in-memory representation to the "
@@ -928,45 +2243,84 @@
"関連の inverse ではない側は、メモリ上の表現をデータベースに保存するのに使われ"
"ます。"
-#. Tag: para
-#, no-c-format
-msgid ""
-"You can define a bidirectional one-to-many association by mapping a one-to-"
-"many association to the same table column(s) as a many-to-one association "
-"and declaring the many-valued end <literal>inverse=\"true\"</literal>."
-msgstr ""
-"双方向の一対多関連を定義するには、一対多関連を多対一関連と同じテーブルのカラ"
-"ムにマッピングし、多側に <literal>inverse=\"true\"</literal> と宣言します。"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
-"does not affect the operation of cascades as these are orthogonal concepts."
-msgstr ""
-"関連の片側に <literal>inverse=\"true\"</literal> を設定しても、カスケード操作"
-"に影響を与えません。これらは直交した概念です。"
-
#. Tag: title
+#: collection_mapping.xml:1003
#, no-c-format
msgid "Bidirectional associations with indexed collections"
msgstr "インデックス付きコレクションと双方向関連"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1005
+#, fuzzy, no-c-format
msgid ""
-"A bidirectional association where one end is represented as a <literal><"
-"list></literal> or <literal><map></literal>, requires special "
-"consideration. If there is a property of the child class that maps to the "
-"index column you can use <literal>inverse=\"true\"</literal> on the "
-"collection mapping:"
+"There are some additional considerations for bidirectional mappings with "
+"indexed collections (where one end is represented as a <literal><list>"
+"</literal> or <literal><map></literal>) when using Hibernate mapping "
+"files. If there is a property of the child class that maps to the index "
+"column you can use <literal>inverse=\"true\"</literal> on the collection "
+"mapping:"
msgstr ""
"片側が <literal><list></literal> や <literal><map></literal> であ"
"る双方向関連は、特によく考える必要があります。インデックスカラムにマップされ"
"る子クラスのプロパティがある場合は、問題ないです。コレクションのマッピングで "
"<literal>inverse=\"true\"</literal> を使い続けられます。"
+#. Tag: title
+#: collection_mapping.xml:1013
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr "インデックス付きコレクションと双方向関連"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:1018
#, no-c-format
msgid ""
"If there is no such property on the child class, the association cannot be "
@@ -980,7 +2334,64 @@
"ありません)。この場合は、コレクションに <literal>inverse=\"true\"</literal> "
"をマッピングできません。代わりに、次のようなマッピングが使えます:"
+#. Tag: title
+#: collection_mapping.xml:1026
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr "インデックス付きコレクションと双方向関連"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+
#. Tag: para
+#: collection_mapping.xml:1032
#, fuzzy, no-c-format
msgid ""
"Note that in this mapping, the collection-valued end of the association is "
@@ -991,11 +2402,13 @@
"テートメントをもたらすのでしょうか? -->"
#. Tag: title
+#: collection_mapping.xml:1037
#, no-c-format
msgid "Ternary associations"
msgstr "3項関連"
#. Tag: para
+#: collection_mapping.xml:1039
#, no-c-format
msgid ""
"There are three possible approaches to mapping a ternary association. One "
@@ -1004,39 +2417,64 @@
"3項関連のマッピングには3つのアプローチがあります。1つ目は関連をインデックスと"
"して <literal>Map</literal> を使用するアプローチです:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1044
+#, fuzzy, no-c-format
+msgid "Ternary association mapping"
+msgstr "3項関連"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1046
#, no-c-format
msgid ""
-"A second approach is to remodel the association as an entity class. This is "
-"the most common approach."
+"@Entity\n"
+"public class Company {\n"
+" @Id \n"
+" int id;\n"
+" ...\n"
+" @OneToMany // unidirectional\n"
+" @MapKeyJoinColumn(name=\"employee_id\")\n"
+" Map<Employee, Contract> contracts;\n"
+"}\n"
+"\n"
+"// or\n"
+"\n"
+"<map name=\"contracts\">\n"
+" <key column=\"employer_id\" not-null=\"true\"/>\n"
+" <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+" <one-to-many class=\"Contract\"/>\n"
+"</map>"
msgstr ""
-"2つ目は単純に関連をエンティティクラスとしてモデルを作り直すアプローチで、頻繁"
-"に使われます。"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1049
+#, fuzzy, no-c-format
msgid ""
-"A final alternative is to use composite elements, which will be discussed "
-"later."
+"A second approach is to remodel the association as an entity class. This is "
+"the most common approach. A final alternative is to use composite elements, "
+"which will be discussed later."
msgstr ""
-"最後は composite 要素を使うアプローチです。これに関する議論は後ほど行います。"
+"2つ目は単純に関連をエンティティクラスとしてモデルを作り直すアプローチで、頻繁"
+"に使われます。"
-#. Tag: title
+#. Tag: literal
+#: collection_mapping.xml:1055
#, fuzzy, no-c-format
-msgid "<literal>Using an <idbag></literal>"
+msgid "Using an <idbag>"
msgstr "<idbag>の使用"
#. Tag: para
+#: collection_mapping.xml:1057
#, fuzzy, no-c-format
msgid ""
"The majority of the many-to-many associations and collections of values "
"shown previously all map to tables with composite keys, even though it has "
-"been have suggested that entities should have synthetic identifiers "
-"(surrogate keys). A pure association table does not seem to benefit much "
-"from a surrogate key, although a collection of composite values "
-"<emphasis>might</emphasis>. It is for this reason that Hibernate provides a "
-"feature that allows you to map many-to-many associations and collections of "
-"values to a table with a surrogate key."
+"been suggested that entities should have synthetic identifiers (surrogate "
+"keys). A pure association table does not seem to benefit much from a "
+"surrogate key, although a collection of composite values <emphasis>might</"
+"emphasis>. For this reason Hibernate provides a feature that allows you to "
+"map many-to-many associations and collections of values to a table with a "
+"surrogate key."
msgstr ""
"複合キーは悪いもので、エンティティは人工の識別子(代理キー)を持つべきであると"
"いう考え方からは、多対多関連と値のコレクションを複合キーを用いたテーブルへ"
@@ -1047,6 +2485,7 @@
"のコレクションをマッピングする機能も備えています。"
#. Tag: para
+#: collection_mapping.xml:1066
#, no-c-format
msgid ""
"The <literal><idbag></literal> element lets you map a <literal>List</"
@@ -1056,7 +2495,30 @@
"<literal>Collection</literal>)を <literal><idbag></literal> 要素にマッ"
"ピングできます。"
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, fuzzy, no-c-format
+msgid ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+msgstr ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+
#. Tag: para
+#: collection_mapping.xml:1072
#, no-c-format
msgid ""
"An <literal><idbag></literal> has a synthetic id generator, just like "
@@ -1070,6 +2532,7 @@
"構を持っていません。"
#. Tag: para
+#: collection_mapping.xml:1077
#, no-c-format
msgid ""
"The update performance of an <literal><idbag></literal> supersedes a "
@@ -1083,6 +2546,7 @@
"の行を更新、削除できます。"
#. Tag: para
+#: collection_mapping.xml:1082
#, no-c-format
msgid ""
"In the current implementation, the <literal>native</literal> identifier "
@@ -1093,16 +2557,19 @@
"idbag></literal> コレクションの識別子に対して使えません。"
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr "コレクションの例"
#. Tag: para
+#: collection_mapping.xml:1105
#, fuzzy, no-c-format
msgid "This section covers collection examples."
msgstr "コレクションの例"
#. Tag: para
+#: collection_mapping.xml:1107
#, fuzzy, no-c-format
msgid ""
"The following class has a collection of <literal>Child</literal> instances:"
@@ -1110,7 +2577,39 @@
"以下のコードを使えば、新しい <literal>Child</literal> を追加することができま"
"す。"
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid ""
+"Example classes <classname>Parent</classname> and <classname>Child</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" private long id;\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" private long id;\n"
+" private String name\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, fuzzy, no-c-format
msgid ""
"If each child has, at most, one parent, the most natural mapping is a one-to-"
@@ -1120,12 +2619,127 @@
"す。もし各々の child が最大でも一つの parent を持っているならば、最も自然な"
"マッピングは一対多関連です。"
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr "これは以下のテーブル定義にマッピングします。"
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid ""
+"Table definitions for unidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
msgid ""
"If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-"
@@ -1134,174 +2748,541 @@
"もし parent が <emphasis>要求</emphasis> されるなら、双方向の一対多関連を使用"
"してください:"
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+" \n"
+" @ManyToOne\n"
+" private Parent parent;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr "<literal>NOT NULL</literal> 制約に注意してください。"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1164
#, no-c-format
msgid ""
-"Alternatively, if this association must be unidirectional you can declare "
-"the <literal>NOT NULL</literal> constraint on the <literal><key></"
-"literal> mapping:"
+"Table definitions for bidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+
+#. Tag: para
+#: collection_mapping.xml:1171
+#, fuzzy, no-c-format
+msgid ""
+"Alternatively, if this association must be unidirectional you can enforce "
+"the <literal>NOT NULL</literal> constraint."
+msgstr ""
"あるいは、もしこの関連は単方向であるべきと強く主張するのであれば、 "
"<literal><key></literal> マッピングに <literal>NOT NULL</literal> 制約"
"を宣言できます:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1175
#, no-c-format
msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(optional=false)\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
+#. Tag: para
+#: collection_mapping.xml:1188
+#, fuzzy, no-c-format
+msgid ""
"On the other hand, if a child has multiple parents, a many-to-many "
-"association is appropriate:"
+"association is appropriate."
msgstr ""
"一方で、もし child が複数の parent を持てるならば、多対多関連が妥当です:"
+#. Tag: title
+#: collection_mapping.xml:1192
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using "
+"annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @ManyToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using mapping "
+"files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr "テーブル定義は以下のようになります:"
+#. Tag: title
+#: collection_mapping.xml:1208
+#, no-c-format
+msgid "Table definitions for many to many releationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+
#. Tag: para
+#: collection_mapping.xml:1213
#, fuzzy, no-c-format
msgid ""
"For more examples and a complete explanation of a parent/child relationship "
-"mapping, see <xref linkend=\"example-parentchild\" /> for more information."
+"mapping, see <xref linkend=\"example-parentchild\"/> for more information. "
+"Even more complex association mappings are covered in the next chapter."
msgstr ""
"parent/child 関係のマッピングについてのより多くの例や完全な手順が必要であれ"
"ば、 <xref linkend=\"example-parentchild\"/> をご覧ください。"
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
-msgstr "また、さらに特殊な関連マッピングも可能です。次の章で詳しく述べます。"
+#~ msgid ""
+#~ "Hibernate requires that persistent collection-valued fields be declared "
+#~ "as an interface type. For example:"
+#~ msgstr ""
+#~ "コレクション型のフィールドを永続化するには、そのコレクション型がインター"
+#~ "フェース型である必要があります。例えば、"
-#, fuzzy
+#~ msgid "Collection mappings"
+#~ msgstr "コレクションのマッピング"
+
#~ msgid ""
-#~ "<![CDATA[public class Product {\n"
-#~ " private String serialNumber;\n"
-#~ " private Set parts = new HashSet();\n"
-#~ " \n"
-#~ " public Set getParts() { return parts; }\n"
-#~ " void setParts(Set parts) { this.parts = parts; }\n"
-#~ " public String getSerialNumber() { return serialNumber; }\n"
-#~ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
-#~ "}]]>"
+#~ "There are quite a range of mappings that can be generated for collections "
+#~ "that cover many common relational models. We suggest you experiment with "
+#~ "the schema generation tool so that you understand how various mapping "
+#~ "declarations translate to database tables."
#~ msgstr ""
-#~ "public class Product {\n"
-#~ " private String serialNumber;\n"
-#~ " private Set parts = new HashSet();\n"
-#~ " \n"
-#~ " public Set getParts() { return parts; }\n"
-#~ " void setParts(Set parts) { this.parts = parts; }\n"
-#~ " public String getSerialNumber() { return serialNumber; }\n"
-#~ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
-#~ "}"
+#~ "多くの一般的なリレーショナルモデルをカバーしたために、コレクションのために"
+#~ "利用できるマッピングにはかなりの幅があります。様々なマッピング宣言がどのよ"
+#~ "うにデータベーステーブルに変換されるかを知るために、スキーマ生成ツールを"
+#~ "使ってみると良いでしょう。"
-#, fuzzy
+#~ msgid "Collection elements"
+#~ msgstr "コレクションの要素"
+
#~ msgid ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "Cat kitten = new DomesticCat();\n"
-#~ "....\n"
-#~ "Set kittens = new HashSet();\n"
-#~ "kittens.add(kitten);\n"
-#~ "cat.setKittens(kittens);\n"
-#~ "session.persist(cat);\n"
-#~ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
-#~ "(HashSet) cat.getKittens(); // Error!]]>"
+#~ "The contained type is referred to as the <emphasis>collection element "
+#~ "type</emphasis>. Collection elements are mapped by <literal><"
+#~ "element></literal> or <literal><composite-element></literal>, or "
+#~ "in the case of entity references, with <literal><one-to-many></"
+#~ "literal> or <literal><many-to-many></literal>. The first two map "
+#~ "elements with value semantics, the next two are used to map entity "
+#~ "associations."
#~ msgstr ""
-#~ "Cat cat = new DomesticCat();\n"
-#~ "Cat kitten = new DomesticCat();\n"
-#~ "....\n"
-#~ "Set kittens = new HashSet();\n"
-#~ "kittens.add(kitten);\n"
-#~ "cat.setKittens(kittens);\n"
-#~ "session.persist(cat);\n"
-#~ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
-#~ "(HashSet) cat.getKittens(); // Error!"
+#~ "格納される型は <emphasis>コレクション要素型</emphasis> と呼ばれます。コレ"
+#~ "クション要素は、 <literal><element></literal> または <literal><"
+#~ "composite-element></literal> によりマッピングされ、エンティティへの参照"
+#~ "の場合には <literal><one-to-many></literal> または <literal><"
+#~ "many-to-many></literal> によりマッピングされます。最初の二つは値として"
+#~ "要素をマッピングし、次の二つはエンティティの関連をマッピングするのに使われ"
+#~ "ます。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Product\">\n"
-#~ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
-#~ " <set name=\"parts\">\n"
-#~ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Part\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
+#~ "All collection mappings, except those with set and bag semantics, need an "
+#~ "<emphasis>index column</emphasis> in the collection table. An index "
+#~ "column is a column that maps to an array index, or <literal>List</"
+#~ "literal> index, or <literal>Map</literal> key. The index of a "
+#~ "<literal>Map</literal> may be of any basic type, mapped with <literal><"
+#~ "map-key></literal>. It can be an entity reference mapped with "
+#~ "<literal><map-key-many-to-many></literal>, or it can be a composite "
+#~ "type mapped with <literal><composite-map-key></literal>. The index "
+#~ "of an array or list is always of type <literal>integer</literal> and is "
+#~ "mapped using the <literal><list-index></literal> element. The "
+#~ "mapped column contains sequential integers that are numbered from zero by "
+#~ "default."
#~ msgstr ""
-#~ "<class name=\"Product\">\n"
-#~ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
-#~ " <set name=\"parts\">\n"
-#~ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Part\"/>\n"
-#~ " </set>\n"
-#~ "</class>"
+#~ "set と bag を除く全てのコレクションマッピングには、コレクションテーブルの"
+#~ "中に <emphasis>インデックス用のカラム</emphasis> が必要です。そのカラム"
+#~ "に、配列や <literal>List</literal> のインデックス、もしくは <literal>Map</"
+#~ "literal> のキーをマッピングします。 <literal>Map</literal> のインデックス"
+#~ "は、 <literal><map-key></literal> によりマッピングされた基本型か、 "
+#~ "<literal><map-key-many-to-many></literal> によりマッピングされたエン"
+#~ "ティティの関連か、あるいは <literal><composite-map-key></literal> に"
+#~ "よりマッピングされたコンポジット型になります。配列かリストのインデックス"
+#~ "は、常に <literal>integer</literal> 型で、 <literal><list-index></"
+#~ "literal> 要素によりマッピングします。マッピングされたカラムにはシーケン"
+#~ "シャルな整数を格納します (デフォルトでは0から番号が付けられます)。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<map\n"
-#~ " name=\"propertyName\"\n"
-#~ " table=\"table_name\"\n"
-#~ " schema=\"schema_name\"\n"
-#~ " lazy=\"true|extra|false\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan"
-#~ "\"\n"
-#~ " sort=\"unsorted|natural|comparatorClass\"\n"
-#~ " order-by=\"column_name asc|desc\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " fetch=\"join|select|subselect\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <key .... />\n"
-#~ " <map-key .... />\n"
-#~ " <element .... />\n"
-#~ "</map>]]>"
+#~ "Any collection of values or many-to-many associations requires a "
+#~ "dedicated <emphasis>collection table</emphasis> with a foreign key column "
+#~ "or columns, <emphasis>collection element column</emphasis> or columns, "
+#~ "and possibly an index column or columns."
#~ msgstr ""
-#~ "<map\n"
-#~ " name=\"propertyName\"\n"
-#~ " table=\"table_name\"\n"
-#~ " schema=\"schema_name\"\n"
-#~ " lazy=\"true|extra|false\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan"
-#~ "\"\n"
-#~ " sort=\"unsorted|natural|comparatorClass\"\n"
-#~ " order-by=\"column_name asc|desc\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " fetch=\"join|select|subselect\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <key .... />\n"
-#~ " <map-key .... />\n"
-#~ " <element .... />\n"
-#~ "</map>"
+#~ "値のコレクションや多対多関連は、専用の <emphasis>コレクションテーブル</"
+#~ "emphasis> が必要です。このテーブルは、外部キーカラムと、 <emphasis>コレク"
+#~ "ション要素のカラム</emphasis> と、場合によってはインデックスカラムを持ちま"
+#~ "す。"
#, fuzzy
-#~ msgid "<![CDATA[<key column=\"productSerialNumber\" not-null=\"true\"/>]]>"
-#~ msgstr "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+#~ msgid ""
+#~ "<literal>column</literal> (optional): the name of the element foreign key "
+#~ "column."
+#~ msgstr "<literal>class</literal> (必須): 関連クラスの名前。"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<key column=\"productSerialNumber\" on-delete=\"cascade\"/>]]>"
-#~ msgstr "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+#~ "<literal>not-found</literal> (optional - defaults to <literal>exception</"
+#~ "literal>): specifies how foreign keys that reference missing rows will be "
+#~ "handled: <literal>ignore</literal> will treat a missing row as a null "
+#~ "association."
+#~ msgstr ""
+#~ "<literal>not-found</literal> (オプション - デフォルトは "
+#~ "<literal>exception</literal>): 参照先の行がないキャッシュされた識別子をど"
+#~ "のように扱うかを指定します: <literal>ignore</literal> を指定すると、行がな"
+#~ "いことを関連がないものとして扱います。"
+#~ msgid ""
+#~ "A bag containing integers with an iteration order determined by the "
+#~ "<literal>order-by</literal> attribute:"
+#~ msgstr ""
+#~ "整数値を含む bag (bagは <literal>order-by</literal> 属性によって反復順序"
+#~ "が定義されています):"
+
+#~ msgid "An array of entities, in this case, a many-to-many association:"
+#~ msgstr "エンティティの配列 - この場合、多対多の関連です。"
+
+#~ msgid "A map from string indices to dates:"
+#~ msgstr "文字列と日付の map"
+
+#~ msgid "A list of components (this is discussed in the next chapter):"
+#~ msgstr "コンポーネントの list (次の章で詳しく説明します)"
+
+#~ msgid "One-to-many associations"
+#~ msgstr "一対多関連"
+
+#~ msgid ""
+#~ "A <emphasis>one-to-many association</emphasis> links the tables of two "
+#~ "classes via a foreign key with no intervening collection table. This "
+#~ "mapping loses certain semantics of normal Java collections:"
+#~ msgstr ""
+#~ "<emphasis>一対多関連</emphasis> は、コレクションテーブルを介さず、外部キー"
+#~ "により2つのクラスのテーブルを関連付けます。このマッピングは標準的な Java "
+#~ "のコレクションのセマンティクスをいくつか失います:"
+
+#~ msgid ""
+#~ "The following example shows a map of <literal>Part</literal> entities by "
+#~ "name, where <literal>partName</literal> is a persistent property of "
+#~ "<literal>Part</literal>. Notice the use of a formula-based index:"
+#~ msgstr ""
+#~ "次の例は、名称(<literal>Part</literal> の永続的なプロパティである "
+#~ "<literal>partName</literal>) による <literal>Part</literal> エンティティ"
+#~ "の map を表しています。 formula によるインデックスを使っていることに注意し"
+#~ "てください。"
+
+#~ msgid ""
+#~ "Hibernate supports collections implementing <literal>java.util.SortedMap</"
+#~ "literal> and <literal>java.util.SortedSet</literal>. You must specify a "
+#~ "comparator in the mapping file:"
+#~ msgstr ""
+#~ "Hibernate は <literal>java.util.SortedMap</literal> と <literal>java.util."
+#~ "SortedSet</literal> を実装したコレクションをサポートしています。開発者は"
+#~ "マッピング定義ファイルにコンパレータを指定しなければなりません: "
+
+#~ msgid ""
+#~ "A final alternative is to use composite elements, which will be discussed "
+#~ "later."
+#~ msgstr ""
+#~ "最後は composite 要素を使うアプローチです。これに関する議論は後ほど行いま"
+#~ "す。"
+
#, fuzzy
#~ msgid ""
+#~ "Even more complex association mappings are covered in the next chapter."
+#~ msgstr ""
+#~ "また、さらに特殊な関連マッピングも可能です。次の章で詳しく述べます。"
+
+#, fuzzy
+#~ msgid ""
#~ "<![CDATA[<set name=\"names\" table=\"person_names\">\n"
#~ " <key column=\"person_id\"/>\n"
#~ " <element column=\"person_name\" type=\"string\"/>\n"
@@ -1392,24 +3373,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<one-to-many \n"
-#~ " class=\"ClassName\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " />]]>"
-#~ msgstr ""
-#~ "<one-to-many \n"
-#~ " class=\"ClassName\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " />"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<map name=\"parts\"\n"
#~ " cascade=\"all\">\n"
#~ " <key column=\"productId\" not-null=\"true\"/>\n"
@@ -1426,265 +3389,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<set name=\"aliases\" \n"
-#~ " table=\"person_aliases\" \n"
-#~ " sort=\"natural\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date\" type=\"date\"/>\n"
-#~ "</map>]]>"
-#~ msgstr ""
-#~ "<set name=\"aliases\" \n"
-#~ " table=\"person_aliases\" \n"
-#~ " sort=\"natural\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date\" type=\"date\"/>\n"
-#~ "</map>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower"
-#~ "(name) asc\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date type=\"date\"/>\n"
-#~ "</map>]]>"
-#~ msgstr ""
-#~ "<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) "
-#~ "asc\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date type=\"date\"/>\n"
-#~ "</map>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sortedUsers = s.createFilter( group.getUsers(), \"order by this."
-#~ "name\" ).list();]]>"
-#~ msgstr ""
-#~ "sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" )."
-#~ "list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Category\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
-#~ " <key column=\"CATEGORY_ID\"/>\n"
-#~ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Item\">\n"
-#~ " <id name=\"id\" column=\"ITEM_ID\"/>\n"
-#~ " ...\n"
-#~ "\n"
-#~ " <!-- inverse end -->\n"
-#~ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"
-#~ " <key column=\"ITEM_ID\"/>\n"
-#~ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Category\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
-#~ " <key column=\"CATEGORY_ID\"/>\n"
-#~ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Item\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ "\n"
-#~ " <!-- inverse end -->\n"
-#~ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
-#~ "\">\n"
-#~ " <key column=\"ITEM_ID\"/>\n"
-#~ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "category.getItems().add(item); // The category now \"knows\" "
-#~ "about the relationship\n"
-#~ "item.getCategories().add(category); // The item now \"knows\" about "
-#~ "the relationship\n"
-#~ "\n"
-#~ "session.persist(item); // The relationship won't be "
-#~ "saved!\n"
-#~ "session.persist(category); // The relationship will be "
-#~ "saved]]>"
-#~ msgstr ""
-#~ "category.getItems().add(item); // The category now \"knows\" "
-#~ "about the relationship\n"
-#~ "item.getCategories().add(category); // The item now \"knows\" about "
-#~ "the relationship\n"
-#~ "\n"
-#~ "session.persist(item); // The relationship won't be "
-#~ "saved!\n"
-#~ "session.persist(category); // The relationship will be saved"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <property name=\"name\" \n"
-#~ " not-null=\"true\"/>\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <property name=\"name\" \n"
-#~ " not-null=\"true\"/>\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\">\n"
-#~ " <key column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " insert=\"false\"\n"
-#~ " update=\"false\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\">\n"
-#~ " <key column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " insert=\"false\"\n"
-#~ " update=\"false\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<map name=\"contracts\">\n"
#~ " <key column=\"employer_id\" not-null=\"true\"/>\n"
#~ " <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
@@ -1715,25 +3419,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<idbag name=\"lovers\" table=\"LOVERS\">\n"
-#~ " <collection-id column=\"ID\" type=\"long\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </collection-id>\n"
-#~ " <key column=\"PERSON1\"/>\n"
-#~ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/>\n"
-#~ "</idbag>]]>"
-#~ msgstr ""
-#~ "<idbag name=\"lovers\" table=\"LOVERS\">\n"
-#~ " <collection-id column=\"ID\" type=\"long\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </collection-id>\n"
-#~ " <key column=\"PERSON1\"/>\n"
-#~ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
-#~ ">\n"
-#~ "</idbag>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[package eg;\n"
#~ "import java.util.Set;\n"
#~ "\n"
@@ -1767,233 +3452,3 @@
#~ " ....\n"
#~ " ....\n"
#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255), "
-#~ "parent_id bigint )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-#~ msgstr ""
-#~ "create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255), "
-#~ "parent_id bigint )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
-#~ "\" not-null=\"true\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " <many-to-one name=\"parent\" class=\"Parent\" column="
-#~ "\"parent_id\" not-null=\"true\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null\n"
-#~ " primary key,\n"
-#~ " name varchar(255),\n"
-#~ " parent_id bigint not null )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-#~ msgstr ""
-#~ "create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null\n"
-#~ " primary key,\n"
-#~ " name varchar(255),\n"
-#~ " parent_id bigint not null )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" table=\"childset\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" table=\"childset\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255) )\n"
-#~ "create table childset ( parent_id bigint not null,\n"
-#~ " child_id bigint not null,\n"
-#~ " primary key ( parent_id, child_id ) )\n"
-#~ "alter table childset add constraint childsetfk0 (parent_id) references "
-#~ "parent\n"
-#~ "alter table childset add constraint childsetfk1 (child_id) references "
-#~ "child]]>"
-#~ msgstr ""
-#~ "create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255) )\n"
-#~ "create table childset ( parent_id bigint not null,\n"
-#~ " child_id bigint not null,\n"
-#~ " primary key ( parent_id, child_id ) )\n"
-#~ "alter table childset add constraint childsetfk0 (parent_id) references "
-#~ "parent\n"
-#~ "alter table childset add constraint childsetfk1 (child_id) references "
-#~ "child"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/configuration.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/configuration.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/configuration.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-12-21 17:12+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,11 +14,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr "設定"
#. Tag: para
+#: configuration.xml:33
#, no-c-format
msgid ""
"Hibernate is designed to operate in many different environments and, as "
@@ -36,11 +38,13 @@
"タマイズするだけです。"
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr "プログラム上の設定"
#. Tag: para
+#: configuration.xml:43
#, no-c-format
msgid ""
"An instance of <classname>org.hibernate.cfg.Configuration</classname> "
@@ -56,6 +60,7 @@
"数の XML マッピングファイルを変換し、マッピング情報にします。"
#. Tag: para
+#: configuration.xml:51
#, no-c-format
msgid ""
"You can obtain a <classname>org.hibernate.cfg.Configuration</classname> "
@@ -68,7 +73,20 @@
"ファイルがクラスパスに設定されている場合、次のメソッドを使ってください。 "
"<literal>addResource()</literal> :"
+#. Tag: programlisting
+#: configuration.xml:57
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+
#. Tag: para
+#: configuration.xml:59
#, no-c-format
msgid ""
"An alternative way is to specify the mapped class and allow Hibernate to "
@@ -77,7 +95,20 @@
"代替案 (こちらのほうが良いときもあります) としてマッピングクラスを指定する方"
"法もあります。 Hibernate に、マッピングファイルを 見つけさせてください:"
+#. Tag: programlisting
+#: configuration.xml:62
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+
#. Tag: para
+#: configuration.xml:64
#, no-c-format
msgid ""
"Hibernate will then search for mapping files named <filename>/org/hibernate/"
@@ -91,6 +122,7 @@
"グされたファイル名を排除できます。"
#. Tag: para
+#: configuration.xml:69
#, no-c-format
msgid ""
"A <classname>org.hibernate.cfg.Configuration</classname> also allows you to "
@@ -99,7 +131,30 @@
"<classname>org.hibernate.cfg.Configuration</classname> は、設定プロパティを指"
"定することもできます:"
+#. Tag: programlisting
+#: configuration.xml:72
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+
#. Tag: para
+#: configuration.xml:74
#, no-c-format
msgid ""
"This is not the only way to pass configuration properties to Hibernate. Some "
@@ -109,6 +164,7 @@
"を用意しています:"
#. Tag: para
+#: configuration.xml:79
#, no-c-format
msgid ""
"Pass an instance of <classname>java.util.Properties</classname> to "
@@ -118,6 +174,7 @@
"<literal>Configuration.setProperties()</literal> に渡します。"
#. Tag: para
+#: configuration.xml:84
#, no-c-format
msgid ""
"Place a file named <filename>hibernate.properties</filename> in a root "
@@ -127,6 +184,7 @@
"きます。"
#. Tag: para
+#: configuration.xml:89
#, no-c-format
msgid ""
"Set <literal>System</literal> properties using <literal>java -"
@@ -136,6 +194,7 @@
"literal> を使うように設定します。"
#. Tag: para
+#: configuration.xml:94
#, no-c-format
msgid ""
"Include <literal><property></literal> elements in <literal>hibernate."
@@ -145,6 +204,7 @@
"filename> (後述)に設定します。"
#. Tag: para
+#: configuration.xml:99
#, fuzzy, no-c-format
msgid ""
"If you want to get started quickly<filename>hibernate.properties</filename> "
@@ -154,6 +214,7 @@
"きます。"
#. Tag: para
+#: configuration.xml:103
#, no-c-format
msgid ""
"The <classname>org.hibernate.cfg.Configuration</classname> is intended as a "
@@ -165,11 +226,13 @@
"されることを意図しています。"
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr "SessionFactory を取得する"
#. Tag: para
+#: configuration.xml:111
#, fuzzy, no-c-format
msgid ""
"When all mappings have been parsed by the <classname>org.hibernate.cfg."
@@ -182,7 +245,14 @@
"classname> インスタンスのためにファクトリを取得しなければなりません。この "
"SessionFactory は、 Hibernate を使用するすべてのスレッドで共有されるべきです:"
+#. Tag: programlisting
+#: configuration.xml:117
+#, fuzzy, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr "SessionFactory sessions = cfg.buildSessionFactory();"
+
#. Tag: para
+#: configuration.xml:119
#, fuzzy, no-c-format
msgid ""
"Hibernate does allow your application to instantiate more than one "
@@ -194,11 +264,13 @@
"する場合に便利です。"
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr "JDBC コネクション"
#. Tag: para
+#: configuration.xml:127
#, no-c-format
msgid ""
"It is advisable to have the <interfacename>org.hibernate.SessionFactory</"
@@ -211,7 +283,14 @@
"のアプローチを採用する場合、単純に <interfacename>org.hibernate.Session</"
"interfacename> をオープンしてください:"
+#. Tag: programlisting
+#: configuration.xml:133
+#, fuzzy, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr "Session session = sessions.openSession(); // open a new Session"
+
#. Tag: para
+#: configuration.xml:135
#, no-c-format
msgid ""
"Once you start a task that requires access to the database, a JDBC "
@@ -221,6 +300,7 @@
"セスすることができます。"
#. Tag: para
+#: configuration.xml:138
#, no-c-format
msgid ""
"Before you can do this, you first need to pass some JDBC connection "
@@ -235,6 +315,7 @@
"JDBC コネクション設定の中で一番重要なものです。"
#. Tag: para
+#: configuration.xml:144
#, no-c-format
msgid ""
"Hibernate will obtain and pool connections using <classname>java.sql."
@@ -244,71 +325,89 @@
"(プールも) <classname>java.sql.DriverManager</classname> を使います:"
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr "Hibernate JDBC プロパティ"
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327
+#: configuration.xml:495 configuration.xml:657 configuration.xml:753
+#: configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr "プロパティ名"
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329
+#: configuration.xml:497 configuration.xml:659 configuration.xml:755
+#: configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr "意味"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+#. Tag: property
+#: configuration.xml:166
+#, fuzzy, no-c-format
+msgid "hibernate.connection.driver_class"
msgstr "<property>hibernate.connection.driver_class</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:168
+#, fuzzy, no-c-format
+msgid "JDBC driver class"
msgstr "JDBC のドライバークラス"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+#. Tag: property
+#: configuration.xml:172
+#, fuzzy, no-c-format
+msgid "hibernate.connection.url"
msgstr "<property>hibernate.connection.url</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:174
+#, no-c-format
+msgid "JDBC URL"
+msgstr ""
+
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
#, fuzzy, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
-msgstr "JDBC のドライバークラス"
+msgid "hibernate.connection.username"
+msgstr "<property>hibernate.connection.username</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:180
#, no-c-format
-msgid "<property>hibernate.connection.username</property>"
-msgstr "<property>hibernate.connection.username</property>"
+msgid "database user"
+msgstr "データベースのユーザー"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
#, fuzzy, no-c-format
-msgid "<emphasis>database user</emphasis>"
-msgstr "<emphasis>データベースユーザ</emphasis> (オプション)"
+msgid "hibernate.connection.password"
+msgstr "<property>hibernate.connection.password</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:186
#, no-c-format
-msgid "<property>hibernate.connection.password</property>"
-msgstr "<property>hibernate.connection.password</property>"
+msgid "database user password"
+msgstr "データベースユーザーパスワード"
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:190
#, fuzzy, no-c-format
-msgid "<emphasis>database user password</emphasis>"
-msgstr "<emphasis>データベースユーザのパスワード</emphasis> (オプション)"
-
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+msgid "hibernate.connection.pool_size"
msgstr "<property>hibernate.connection.pool_size</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:192
+#, fuzzy, no-c-format
+msgid "maximum number of pooled connections"
msgstr "<emphasis>プールするコネクションの最大数</emphasis>"
#. Tag: para
+#: configuration.xml:199
#, no-c-format
msgid ""
"Hibernate's own connection pooling algorithm is, however, quite rudimentary. "
@@ -329,6 +428,7 @@
"使います。"
#. Tag: para
+#: configuration.xml:208
#, no-c-format
msgid ""
"C3P0 is an open source JDBC connection pool distributed along with Hibernate "
@@ -347,6 +447,7 @@
"くの情報を取得してください。"
#. Tag: para
+#: configuration.xml:216
#, no-c-format
msgid ""
"The following is an example <filename>hibernate.properties</filename> file "
@@ -355,7 +456,32 @@
"C3P0 用の <literal>hibernate.properties</literal> ファイルを例として示しま"
"す:"
+#. Tag: programlisting
+#: configuration.xml:219
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+
#. Tag: para
+#: configuration.xml:221
#, no-c-format
msgid ""
"For use inside an application server, you should almost always configure "
@@ -369,36 +495,43 @@
"ように設定してください:"
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr "Hibernate データソースプロパティ"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+#. Tag: property
+#: configuration.xml:244
+#, fuzzy, no-c-format
+msgid "hibernate.connection.datasource"
msgstr "<property>hibernate.connection.datasource</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:246
+#, no-c-format
+msgid "datasource JNDI name"
+msgstr "データソースの JNDI 名"
+
+#. Tag: property
+#: configuration.xml:250
#, fuzzy, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
-msgstr "<emphasis>データベースユーザ</emphasis> (オプション)"
-
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+msgid "hibernate.jndi.url"
msgstr "<property>hibernate.jndi.url</property>"
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr "<emphasis>JNDI プロバイダの URL</emphasis> (オプション)"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+#. Tag: property
+#: configuration.xml:257
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.class"
msgstr "<property>hibernate.jndi.class</property>"
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
msgid ""
"<emphasis>class of the JNDI <literal>InitialContextFactory</literal></"
@@ -408,16 +541,19 @@
"(オプション)"
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr "<emphasis>データベースユーザ</emphasis> (オプション)"
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
msgstr "<emphasis>データベースユーザのパスワード</emphasis> (オプション)"
#. Tag: para
+#: configuration.xml:280
#, no-c-format
msgid ""
"Here is an example <filename>hibernate.properties</filename> file for an "
@@ -426,7 +562,26 @@
"アプリケーションサーバーから提供された JNDI データソースを使う "
"<filename>hibernate.properties</filename> ファイルの例を示します:"
+#. Tag: programlisting
+#: configuration.xml:283
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
msgid ""
"JDBC connections obtained from a JNDI datasource will automatically "
@@ -436,6 +591,7 @@
"コンテナ管理トランザクションに自動的に参加します。"
#. Tag: para
+#: configuration.xml:289
#, no-c-format
msgid ""
"Arbitrary connection properties can be given by prepending "
@@ -449,6 +605,7 @@
"property> を使います。"
#. Tag: para
+#: configuration.xml:294
#, no-c-format
msgid ""
"You can define your own plugin strategy for obtaining JDBC connections by "
@@ -463,11 +620,13 @@
"connection.provider_class</property> に設定してください。"
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr "オプション設定プロパティ"
#. Tag: para
+#: configuration.xml:304
#, no-c-format
msgid ""
"There are a number of other properties that control the behavior of "
@@ -477,6 +636,7 @@
"プロパティはすべて妥当なデフォルト値があり、任意で設定します。"
#. Tag: para
+#: configuration.xml:309
#, fuzzy, no-c-format
msgid ""
"<emphasis>Some of these properties are \"system-level\" only.</emphasis> "
@@ -490,16 +650,19 @@
"方法は <emphasis>ありません</emphasis> 。"
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr "Hibernate 設定プロパティ"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.dialect</property>"
+#. Tag: property
+#: configuration.xml:335
+#, fuzzy, no-c-format
+msgid "hibernate.dialect"
msgstr "<property>hibernate.dialect</property>"
#. Tag: entry
+#: configuration.xml:337
#, no-c-format
msgid ""
"The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</"
@@ -511,6 +674,7 @@
"す。"
#. Tag: para
+#: configuration.xml:340
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of."
@@ -520,6 +684,7 @@
"literal>"
#. Tag: para
+#: configuration.xml:341
#, no-c-format
msgid ""
"In most cases Hibernate will actually be able to choose the correct "
@@ -527,12 +692,14 @@
"the <literal>JDBC metadata</literal> returned by the JDBC driver."
msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+#. Tag: property
+#: configuration.xml:349
+#, fuzzy, no-c-format
+msgid "hibernate.show_sql"
msgstr "<property>hibernate.show_sql</property>"
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
msgid ""
"Write all SQL statements to console. This is an alternative to setting the "
@@ -544,6 +711,11 @@
"法の代替手段です。"
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426
+#: configuration.xml:435 configuration.xml:443 configuration.xml:453
+#: configuration.xml:468 configuration.xml:525 configuration.xml:545
+#: configuration.xml:555 configuration.xml:598 configuration.xml:797
+#: configuration.xml:808 configuration.xml:904
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
@@ -552,22 +724,26 @@
"<emphasis role=\"strong\">例</emphasis><literal>true</literal> | "
"<literal>false</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+#. Tag: property
+#: configuration.xml:359
+#, fuzzy, no-c-format
+msgid "hibernate.format_sql"
msgstr "<property>hibernate.format_sql</property>"
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr "ログとコンソールの SQL を整形して表示します。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+#. Tag: property
+#: configuration.xml:367
+#, fuzzy, no-c-format
+msgid "hibernate.default_schema"
msgstr "<property>hibernate.default_schema</property>"
#. Tag: entry
+#: configuration.xml:369
#, no-c-format
msgid ""
"Qualify unqualified table names with the given schema/tablespace in "
@@ -575,34 +751,40 @@
msgstr "生成される SQL 文のテーブルに設定するスキーマ/テーブルスペースです。"
#. Tag: para
+#: configuration.xml:370
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
msgstr "<emphasis role=\"strong\">例.</emphasis><literal>SCHEMA_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+#. Tag: property
+#: configuration.xml:376
+#, fuzzy, no-c-format
+msgid "hibernate.default_catalog"
msgstr "<property>hibernate.default_catalog</property>"
#. Tag: entry
+#: configuration.xml:378
#, no-c-format
msgid ""
"Qualifies unqualified table names with the given catalog in generated SQL."
msgstr "生成される SQL 文のテーブルに設定するカタログです。"
#. Tag: para
+#: configuration.xml:379
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
msgstr "<emphasis role=\"strong\">例</emphasis><literal>CATALOG_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+#. Tag: property
+#: configuration.xml:384
+#, fuzzy, no-c-format
+msgid "hibernate.session_factory_name"
msgstr "<property>hibernate.session_factory_name</property>"
#. Tag: entry
+#: configuration.xml:386
#, no-c-format
msgid ""
"The <interfacename>org.hibernate.SessionFactory</interfacename> will be "
@@ -612,6 +794,7 @@
"前で JNDI に自動的に登録されます。"
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
@@ -619,12 +802,14 @@
msgstr ""
"<emphasis role=\"strong\">例</emphasis><literal>jndi/composite/name</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+#. Tag: property
+#: configuration.xml:394
+#, fuzzy, no-c-format
+msgid "hibernate.max_fetch_depth"
msgstr "<property>hibernate.max_fetch_depth</property>"
#. Tag: entry
+#: configuration.xml:396
#, no-c-format
msgid ""
"Sets a maximum \"depth\" for the outer join fetch tree for single-ended "
@@ -636,6 +821,7 @@
"ます。"
#. Tag: para
+#: configuration.xml:398
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -644,17 +830,20 @@
"<emphasis role=\"strong\">例:</emphasis> 推奨する値は <literal>0</literal> "
"から <literal>3</literal> の間です。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+#. Tag: property
+#: configuration.xml:404
+#, fuzzy, no-c-format
+msgid "hibernate.default_batch_fetch_size"
msgstr "<property>hibernate.default_batch_fetch_size</property>"
#. Tag: entry
+#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr "関連フェッチのデフォルト Hibernate バッチサイズを指定します。"
#. Tag: para
+#: configuration.xml:407
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</"
@@ -663,12 +852,14 @@
"<emphasis role=\"strong\">例:</emphasis> 推奨する値は <literal>4</"
"literal> , <literal>8</literal> , <literal>16</literal> です。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+#. Tag: property
+#: configuration.xml:413
+#, fuzzy, no-c-format
+msgid "hibernate.default_entity_mode"
msgstr "<property>hibernate.default_entity_mode</property>"
#. Tag: entry
+#: configuration.xml:415
#, fuzzy, no-c-format
msgid ""
"Sets a default mode for entity representation for all sessions opened from "
@@ -678,6 +869,7 @@
"エンティティのデフォルトモードを設定します。"
#. Tag: para
+#: configuration.xml:416
#, no-c-format
msgid ""
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
@@ -686,12 +878,14 @@
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+#. Tag: property
+#: configuration.xml:422
+#, fuzzy, no-c-format
+msgid "hibernate.order_updates"
msgstr "<property>hibernate.order_updates</property>"
#. Tag: entry
+#: configuration.xml:424
#, no-c-format
msgid ""
"Forces Hibernate to order SQL updates by the primary key value of the items "
@@ -702,12 +896,14 @@
"合、同時実行可能なシステムでは、まれにデッドロックが発生する可能性がありま"
"す。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
-msgstr "<property>hibernate.generate_statistics</property>"
+#. Tag: property
+#: configuration.xml:432
+#, fuzzy, no-c-format
+msgid "hibernate.generate_statistics"
+msgstr "Hibernate 統計"
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
msgid ""
"If enabled, Hibernate will collect statistics useful for performance tuning."
@@ -715,12 +911,14 @@
"有効の場合、 Hibernate はパフォーマンスチューニングに有効な統計情報を収集しま"
"す。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+#. Tag: property
+#: configuration.xml:440
+#, fuzzy, no-c-format
+msgid "hibernate.use_identifier_rollback"
msgstr "<property>hibernate.use_identifier_rollback</property>"
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
msgid ""
"If enabled, generated identifier properties will be reset to default values "
@@ -729,12 +927,14 @@
"有効の場合、オブジェクトが削除されたときに識別子プロパティをリセットし、デ"
"フォルト値にしたものを生成します。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
+#. Tag: property
+#: configuration.xml:449
+#, fuzzy, no-c-format
+msgid "hibernate.use_sql_comments"
msgstr "<property>hibernate.use_sql_comments</property>"
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
msgid ""
"If turned on, Hibernate will generate comments inside the SQL, for easier "
@@ -743,17 +943,51 @@
"有効の場合、 SQL 内にコメントを生成します。これはデバックを容易にします。デ"
"フォルトの値は <literal>false</literal> です。"
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:460
+#, no-c-format
+msgid ""
+"Setting is relevant when using <classname>@GeneratedValue</classname>. It "
+"indicates whether or not the new <classname>IdentifierGenerator</classname> "
+"implementations are used for <classname>javax.persistence.GenerationType."
+"AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</"
+"classname> and <classname>javax.persistence.GenerationType.SEQUENCE</"
+"classname>. Default to <literal>false</literal> to keep backward "
+"compatibility."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid ""
+"We recommend all new projects which make use of to use "
+"<classname>@GeneratedValue</classname> to also set <code>hibernate.id."
+"new_generator_mappings=true</code> as the new generators are more efficient "
+"and closer to the JPA 2 specification semantic. However they are not "
+"backward compatible with existing databases (if a sequence or a table is "
+"used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr "Hibernate JDBC とコネクションプロパティ"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+#. Tag: property
+#: configuration.xml:503
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.fetch_size"
msgstr "<property>hibernate.jdbc.fetch_size</property>"
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
msgid ""
"A non-zero value determines the JDBC fetch size (calls <literal>Statement."
@@ -762,17 +996,20 @@
"値が0でない場合、 JDBC フェッチサイズを決定します ( <literal>Statement."
"setFetchSize()</literal> を呼びます)。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+#. Tag: property
+#: configuration.xml:510
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_size"
msgstr "<property>hibernate.jdbc.batch_size</property>"
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr "値が0でない場合、 Hibernate が JDBC2 バッチ更新を使用します。"
#. Tag: para
+#: configuration.xml:513
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -781,16 +1018,18 @@
"<emphasis role=\"strong\">例:</emphasis> 推奨する値は <literal>5</literal> "
"から <literal>30</literal> の間です。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+#. Tag: property
+#: configuration.xml:519
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr "<property>hibernate.jdbc.batch_versioned_data</property>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:521
+#, fuzzy, no-c-format
msgid ""
"Set this property to <literal>true</literal> if your JDBC driver returns "
-"correct row counts from <literal>executeBatch()</literal>. Iit is usually "
+"correct row counts from <literal>executeBatch()</literal>. It is usually "
"safe to turn this option on. Hibernate will then use batched DML for "
"automatically versioned data. Defaults to <literal>false</literal>."
msgstr ""
@@ -799,12 +1038,14 @@
"オプションを ON するのが安全です)。 Hibernate は、自動バージョンデータのため"
"バッチ DML を使います。デフォルトの値は <literal>false</literal> です。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+#. Tag: property
+#: configuration.xml:531
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.factory_class"
msgstr "<property>hibernate.jdbc.factory_class</property>"
#. Tag: entry
+#: configuration.xml:533
#, no-c-format
msgid ""
"Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. "
@@ -814,6 +1055,7 @@
"す。ほとんどのアプリケーションに、この設定プロパティは必要ありません。"
#. Tag: para
+#: configuration.xml:535
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -822,12 +1064,14 @@
"<emphasis role=\"strong\">例</emphasis><literal>classname.of.BatcherFactory</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+#. Tag: property
+#: configuration.xml:541
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr "<property>hibernate.jdbc.use_scrollable_resultset</property>"
#. Tag: entry
+#: configuration.xml:543
#, no-c-format
msgid ""
"Enables use of JDBC2 scrollable resultsets by Hibernate. This property is "
@@ -839,12 +1083,14 @@
"場合のみ必要で、そうでなければ Hibernate はコネクションメタデータを使用しま"
"す。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+#. Tag: property
+#: configuration.xml:551
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr "<property>hibernate.jdbc.use_streams_for_binary</property>"
#. Tag: entry
+#: configuration.xml:553
#, no-c-format
msgid ""
"Use streams when writing/reading <literal>binary</literal> or "
@@ -854,12 +1100,14 @@
"JDBC へ/から <literal>binary</literal> や <literal>serializable</literal> の"
"書き込み/読み込みストリームを使います (システムレベルのプロパティ)。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+#. Tag: property
+#: configuration.xml:561
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr "<property>hibernate.jdbc.use_get_generated_keys</property>"
#. Tag: entry
+#: configuration.xml:563
#, no-c-format
msgid ""
"Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> "
@@ -875,16 +1123,20 @@
"クションメタデータを使いドライバの能力を決定します。"
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687
+#: configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
msgstr "<emphasis role=\"strong\">例</emphasis><literal>true|false</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+#. Tag: property
+#: configuration.xml:574
+#, fuzzy, no-c-format
+msgid "hibernate.connection.provider_class"
msgstr "<property>hibernate.connection.provider_class</property>"
#. Tag: entry
+#: configuration.xml:576
#, no-c-format
msgid ""
"The classname of a custom <interfacename>org.hibernate.connection."
@@ -895,6 +1147,7 @@
"literal> のクラス名。"
#. Tag: para
+#: configuration.xml:578
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -903,12 +1156,14 @@
"<emphasis role=\"strong\">例</emphasis><literal>classname.of."
"ConnectionProvider</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+#. Tag: property
+#: configuration.xml:584
+#, fuzzy, no-c-format
+msgid "hibernate.connection.isolation"
msgstr "<property>hibernate.connection.isolation</property>"
#. Tag: entry
+#: configuration.xml:586
#, no-c-format
msgid ""
"Sets the JDBC transaction isolation level. Check <interfacename>java.sql."
@@ -922,27 +1177,32 @@
"ん。"
#. Tag: para
+#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
msgstr "<emphasis role=\"strong\">例</emphasis><literal>1, 2, 4, 8</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+#. Tag: property
+#: configuration.xml:595
+#, fuzzy, no-c-format
+msgid "hibernate.connection.autocommit"
msgstr "<property>hibernate.connection.autocommit</property>"
#. Tag: entry
+#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr ""
"プールされている JDBC コネクションの自動コミットを有効にする(非推奨)。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+#. Tag: property
+#: configuration.xml:603
+#, fuzzy, no-c-format
+msgid "hibernate.connection.release_mode"
msgstr "<property>hibernate.connection.release_mode</property>"
#. Tag: entry
+#: configuration.xml:605
#, no-c-format
msgid ""
"Specifies when Hibernate should release JDBC connections. By default, a JDBC "
@@ -966,6 +1226,7 @@
"の場合、 <literal>after_transaction</literal> でクローズします。"
#. Tag: para
+#: configuration.xml:615
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) "
@@ -977,15 +1238,15 @@
"<literal>after_statement</literal>"
#. Tag: para
-#, no-c-format
+#: configuration.xml:618
+#, fuzzy, no-c-format
msgid ""
"This setting only affects <literal>Session</literal>s returned from "
"<literal>SessionFactory.openSession</literal>. For <literal>Session</"
"literal>s obtained through <literal>SessionFactory.getCurrentSession</"
"literal>, the <literal>CurrentSessionContext</literal> implementation "
"configured for use controls the connection release mode for those "
-"<literal>Session</literal>s. See <xref linkend=\"architecture-current-session"
-"\" />"
+"<literal>Session</literal>s. See"
msgstr ""
"この設定は <literal>SessionFactory.openSession</literal> から取得した "
"<literal>Session</literal> だけに効果があります。 <literal>SessionFactory."
@@ -995,6 +1256,7 @@
"> を参照してください。"
#. Tag: entry
+#: configuration.xml:630
#, no-c-format
msgid ""
"<property>hibernate.connection.</property><emphasis><propertyName></"
@@ -1004,6 +1266,7 @@
"emphasis>"
#. Tag: entry
+#: configuration.xml:632
#, no-c-format
msgid ""
"Pass the JDBC property <emphasis><propertyName></emphasis> to "
@@ -1013,6 +1276,7 @@
"<literal>DriverManager.getConnection()</literal> に渡します。"
#. Tag: entry
+#: configuration.xml:638
#, fuzzy, no-c-format
msgid ""
"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
@@ -1021,6 +1285,7 @@
"使って、システムプロパティとして"
#. Tag: entry
+#: configuration.xml:640
#, no-c-format
msgid ""
"Pass the property <emphasis><propertyName></emphasis> to the JNDI "
@@ -1030,21 +1295,25 @@
"<literal>InitialContextFactory</literal> に渡します。"
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr "Hibernate キャッシュプロパティ"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+#. Tag: literal
+#: configuration.xml:665
+#, fuzzy, no-c-format
+msgid "hibernate.cache.provider_class"
msgstr "<literal>hibernate.cache.provider_class</literal>"
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
msgstr "カスタム <literal>CacheProvider</literal> のクラス名です。"
#. Tag: para
+#: configuration.xml:668
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1053,12 +1322,14 @@
"<emphasis role=\"strong\">例</emphasis><literal>classname.of.CacheProvider</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+#. Tag: literal
+#: configuration.xml:673
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_minimal_puts"
msgstr "<literal>hibernate.cache.use_minimal_puts</literal>"
#. Tag: entry
+#: configuration.xml:675
#, no-c-format
msgid ""
"Optimizes second-level cache operation to minimize writes, at the cost of "
@@ -1070,24 +1341,28 @@
"キャッシュで役に立ちます。 Hibernate3 ではクラスタキャッシュ実装用にデフォル"
"トでは有効になっています。 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+#. Tag: literal
+#: configuration.xml:684
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache"
msgstr "<literal>hibernate.cache.use_query_cache</literal>"
#. Tag: entry
+#: configuration.xml:686
#, no-c-format
msgid ""
"Enables the query cache. Individual queries still have to be set cachable."
msgstr ""
"特定のクエリがキャッシュ可能な場合に、クエリキャッシュを有効にします。 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+#. Tag: literal
+#: configuration.xml:692
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_second_level_cache"
msgstr "<literal>hibernate.cache.use_second_level_cache</literal>"
#. Tag: entry
+#: configuration.xml:694
#, no-c-format
msgid ""
"Can be used to completely disable the second level cache, which is enabled "
@@ -1097,12 +1372,14 @@
"二次キャッシュを完全に無効にする場合に使います。デフォルトでは有効で、クラス"
"の <literal><cache></literal> マッピングで制御します。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+#. Tag: literal
+#: configuration.xml:702
+#, fuzzy, no-c-format
+msgid "hibernate.cache.query_cache_factory"
msgstr "<literal>hibernate.cache.query_cache_factory</literal>"
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
msgid ""
"The classname of a custom <literal>QueryCache</literal> interface, defaults "
@@ -1112,6 +1389,7 @@
"す。デフォルトでは <literal>StandardQueryCache</literal> になります。"
#. Tag: para
+#: configuration.xml:706
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
@@ -1120,27 +1398,32 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+#. Tag: literal
+#: configuration.xml:712
+#, fuzzy, no-c-format
+msgid "hibernate.cache.region_prefix"
msgstr "<literal>hibernate.cache.region_prefix</literal>"
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr "二次キャッシュの領域名の接頭辞です。"
#. Tag: para
+#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
msgstr "<emphasis role=\"strong\">例</emphasis><literal>prefix</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+#. Tag: literal
+#: configuration.xml:720
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_structured_entries"
msgstr "<literal>hibernate.cache.use_structured_entries</literal>"
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
msgid ""
"Forces Hibernate to store data in the second-level cache in a more human-"
@@ -1148,17 +1431,36 @@
msgstr ""
"二次キャッシュに格納するデータを、人が理解しやすいフォーマットにします。 "
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid ""
+"Setting used to give the name of the default <classname>org.hibernate."
+"annotations.CacheConcurrencyStrategy</classname> to use when either "
+"<classname>@Cacheable</classname> or <classname>@Cache</classname> is used. "
+"<code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr "Hibernate トランザクションプロパティ"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:761
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.factory_class"
msgstr "<literal>hibernate.transaction.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
msgid ""
"The classname of a <literal>TransactionFactory</literal> to use with "
@@ -1170,6 +1472,7 @@
"<literal>JDBCTransactionFactory</literal> です)。"
#. Tag: para
+#: configuration.xml:765
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1178,12 +1481,14 @@
"<emphasis role=\"strong\">例</emphasis><literal>classname.of."
"TransactionFactory</literal>>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+#. Tag: literal
+#: configuration.xml:771
+#, fuzzy, no-c-format
+msgid "jta.UserTransaction"
msgstr "<literal>jta.UserTransaction</literal>"
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
msgid ""
"A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the "
@@ -1192,12 +1497,14 @@
"アプリケーションサーバーから JTA <literal>UserTransaction</literal> を取得す"
"るために <literal>JTATransactionFactory</literal> に使われる JNDI 名です。"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:781
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+msgid "hibernate.transaction.manager_lookup_class"
msgstr "<literal>hibernate.transaction. manager_lookup_class</literal>"
#. Tag: entry
+#: configuration.xml:783
#, no-c-format
msgid ""
"The classname of a <literal>TransactionManagerLookup</literal>. It is "
@@ -1209,6 +1516,7 @@
"ときに必要です。"
#. Tag: para
+#: configuration.xml:786
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1217,34 +1525,38 @@
"<emphasis role=\"strong\">例</emphasis><literal>classname.of."
"TransactionManagerLookup</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:792
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+msgid "hibernate.transaction.flush_before_completion"
msgstr "<literal>hibernate.transaction. flush_before_completion</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:794
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically flushed during the before "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"有効の場合、トランザクションの completion フェーズの前に自動的にセッションを"
"フラッシュします。内蔵の自動セッションコンテキスト管理に適しています。 <xref "
"linkend=\"architecture-current-session\"/> を参照してください。"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:803
#, fuzzy, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+msgid "hibernate.transaction.auto_close_session"
msgstr "<literal>hibernate.transaction. auto_close_session</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:805
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically closed during the after "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"有効の場合、トランザクションの completion フェーズの後にセッションを自動的に"
@@ -1252,27 +1564,31 @@
"linkend=\"architecture-current-session\"/> を参照してください。"
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr "その他のプロパティ"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:834
#, fuzzy, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+msgid "hibernate.current_session_context_class"
msgstr "<literal>hibernate. current_session_context_class</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:836
+#, fuzzy, no-c-format
msgid ""
"Supply a custom strategy for the scoping of the \"current\" "
"<literal>Session</literal>. See <xref linkend=\"architecture-current-session"
-"\" /> for more information about the built-in strategies."
+"\"/> for more information about the built-in strategies."
msgstr ""
"「現在の」 <literal>Session</literal> のための(カスタム)戦略を提供します。"
"ビルトインストラテジーに関するその他の情報については <xref linkend="
"\"architecture-current-session\"/> を参照してください。"
#. Tag: para
+#: configuration.xml:839
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | "
@@ -1283,17 +1599,20 @@
"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
"Class</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:846
+#, fuzzy, no-c-format
+msgid "hibernate.query.factory_class"
msgstr "<literal>hibernate.query.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr "HQL パーサーの実装を選択します。"
#. Tag: para
+#: configuration.xml:848
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast."
@@ -1304,12 +1623,14 @@
"ASTQueryTranslatorFactory</literal> or <literal>org.hibernate.hql.classic."
"ClassicQueryTranslatorFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
-msgstr "<literal>hibernate.query.substitutions</literal>"
+#. Tag: literal
+#: configuration.xml:857
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions"
+msgstr "hibernate.query.substitutions true=1, false=0"
#. Tag: entry
+#: configuration.xml:859
#, no-c-format
msgid ""
"Is used to map from tokens in Hibernate queries to SQL tokens (tokens might "
@@ -1319,6 +1640,7 @@
"名です)。"
#. Tag: para
+#: configuration.xml:861
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
@@ -1327,12 +1649,14 @@
"<emphasis role=\"strong\">例</emphasis><literal>hqlLiteral=SQL_LITERAL, "
"hqlFunction=SQLFUNC</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+#. Tag: literal
+#: configuration.xml:867
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.auto"
msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
#. Tag: entry
+#: configuration.xml:869
#, no-c-format
msgid ""
"Automatically validates or exports schema DDL to the database when the "
@@ -1346,6 +1670,7 @@
"をドロップします。"
#. Tag: para
+#: configuration.xml:873
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | "
@@ -1356,12 +1681,48 @@
"<literal>update</literal> | <literal>create</literal> | <literal>create-"
"drop</literal>"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:880
#, fuzzy, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+msgid "hibernate.hbm2ddl.import_file"
+msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
+
+#. Tag: para
+#: configuration.xml:882
+#, no-c-format
+msgid ""
+"Comma-separated names of the optional files containing SQL DML statements "
+"executed during the <classname>SessionFactory</classname> creation. This is "
+"useful for testing or demoing: by adding INSERT statements for example you "
+"can populate your database with a minimal set of data when it is deployed."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:887
+#, no-c-format
+msgid ""
+"File order matters, the statements of a give file are executed before the "
+"statements of the following files. These statements are only executed if the "
+"schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to "
+"<literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:892
+#, fuzzy, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</"
+"literal>"
+msgstr "<emphasis role=\"strong\">例</emphasis><literal>true|false</literal>"
+
+#. Tag: literal
+#: configuration.xml:898
+#, fuzzy, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
msgstr "<literal>hibernate.cglib. use_reflection_optimizer</literal>"
#. Tag: entry
+#: configuration.xml:900
#, no-c-format
msgid ""
"Enables the use of CGLIB instead of runtime reflection (System-level "
@@ -1376,11 +1737,13 @@
"literal> で設定できません。"
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr "SQL 方言(Dialect)"
#. Tag: para
+#: configuration.xml:915
#, no-c-format
msgid ""
"Always set the <literal>hibernate.dialect</literal> property to the correct "
@@ -1396,256 +1759,307 @@
"定する手間が省けます。"
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr "RDBMS"
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr "Dialect"
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
-msgstr "DB2"
+msgid "<entry>DB2</entry>"
+msgstr "<entry>DB2</entry>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:943
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr "<literal>org.hibernate.dialect.DB2Dialect</literal>"
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr "DB2 AS/400"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:949
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr "DB2 OS390"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:955
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr "PostgreSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:961
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr "MySQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:967
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr "<literal>org.hibernate.dialect.MySQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr "MySQL with InnoDB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:973
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr "MySQL with MyISAM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+#. Tag: literal
+#: configuration.xml:979
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr "Oracle (いずれのバージョンでも)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+#. Tag: literal
+#: configuration.xml:985
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.OracleDialect"
msgstr "<literal>org.hibernate.dialect.OracleDialect</literal>"
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr "Oracle 9i"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+#. Tag: literal
+#: configuration.xml:991
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr "Oracle 10g"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+#. Tag: literal
+#: configuration.xml:997
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr "Sybase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1003
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr "<literal>org.hibernate.dialect.SybaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr "Sybase Anywhere"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1009
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr "Microsoft SQL Server"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1015
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr "SAP DB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1021
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr "Informix"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1027
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InformixDialect"
msgstr "<literal>org.hibernate.dialect.InformixDialect</literal>"
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr "HypersonicSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1033
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr "<literal>org.hibernate.dialect.HSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr "Ingres"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1039
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.IngresDialect"
msgstr "<literal>org.hibernate.dialect.IngresDialect</literal>"
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr "Progress"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1045
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr "<literal>org.hibernate.dialect.ProgressDialect</literal>"
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr "Mckoi SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1051
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr "<literal>org.hibernate.dialect.MckoiDialect</literal>"
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr "Interbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1057
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr "Pointbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1063
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr "FrontBase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1069
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr "Firebird"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1075
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr "外部結合フェッチ"
#. Tag: para
+#: configuration.xml:1085
#, no-c-format
msgid ""
"If your database supports ANSI, Oracle or Sybase style outer joins, "
@@ -1664,6 +2078,7 @@
"ます。"
#. Tag: para
+#: configuration.xml:1094
#, no-c-format
msgid ""
"Outer join fetching can be disabled <emphasis>globally</emphasis> by setting "
@@ -1679,18 +2094,21 @@
"としてマッピングされます。"
#. Tag: para
-#, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+#: configuration.xml:1100
+#, fuzzy, no-c-format
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr ""
"さらに情報が見たければ <xref linkend=\"performance-fetching\"/> を参照してく"
"ださい。"
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr "バイナリストリーム"
#. Tag: para
+#: configuration.xml:1107
#, no-c-format
msgid ""
"Oracle limits the size of <literal>byte</literal> arrays that can be passed "
@@ -1706,27 +2124,31 @@
"はシステムレベルの設定だけです</emphasis> 。"
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr "ニ次キャッシュとクエリキャッシュ"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1118
+#, fuzzy, no-c-format
msgid ""
"The properties prefixed by <literal>hibernate.cache</literal> allow you to "
"use a process or cluster scoped second-level cache system with Hibernate. "
-"See the <xref linkend=\"performance-cache\" /> for more information."
+"See the <xref linkend=\"performance-cache\"/> for more information."
msgstr ""
"<literal>hibernate.cache</literal> プロパティ接頭辞は Hibernate でプロセスや"
"クラスタ二次キャッシュを使うとことを許可します。<xref linkend=\"performance-"
"cache\"/> により多くの詳細があります。"
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr "クエリ言語の置き換え"
#. Tag: para
+#: configuration.xml:1127
#, no-c-format
msgid ""
"You can define new Hibernate query tokens using <literal>hibernate.query."
@@ -1735,7 +2157,14 @@
"<literal>hibernate.query.substitutions</literal> を使うことで、新しい "
"Hibernate クエリトークンを定義できます。例:"
+#. Tag: programlisting
+#: configuration.xml:1130
+#, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr "hibernate.query.substitutions true=1, false=0"
+
#. Tag: para
+#: configuration.xml:1132
#, no-c-format
msgid ""
"This would cause the tokens <literal>true</literal> and <literal>false</"
@@ -1744,7 +2173,14 @@
"これはトークン <literal>true</literal> と <literal>false</literal> を、生成さ"
"れる SQL において整数リテラルに翻訳します。"
+#. Tag: programlisting
+#: configuration.xml:1136
+#, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr "hibernate.query.substitutions toLowercase=LOWER"
+
#. Tag: para
+#: configuration.xml:1138
#, no-c-format
msgid ""
"This would allow you to rename the SQL <literal>LOWER</literal> function."
@@ -1752,11 +2188,13 @@
"これは SQL の <literal>LOWER</literal> 関数の名前の付け替えを可能にします。"
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr "Hibernate 統計"
#. Tag: para
+#: configuration.xml:1145
#, no-c-format
msgid ""
"If you enable <literal>hibernate.generate_statistics</literal>, Hibernate "
@@ -1772,11 +2210,13 @@
"stats</literal> パッケージ内のインターフェースにはより多くの情報があります。"
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr "ロギング"
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
msgid ""
"Hibernate utilizes <ulink url=\"http://www.slf4j.org/\">Simple Logging "
@@ -1794,6 +2234,7 @@
msgstr ""
#. Tag: para
+#: configuration.xml:1171
#, no-c-format
msgid ""
"It is recommended that you familiarize yourself with Hibernate's log "
@@ -1807,56 +2248,67 @@
"ルシューティングデバイスです。以下に重要なログのカテゴリを示します:"
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr "Hibernate ログカテゴリ"
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr "カテゴリ"
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr "機能"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
-msgstr "<literal>org.hibernate.SQL</literal>"
+#. Tag: literal
+#: configuration.xml:1195
+#, fuzzy, no-c-format
+msgid "org.hibernate.SQL"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr "実行したすべての SQL(DDL)ステートメントをロギングします。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
-msgstr "<literal>org.hibernate.type</literal>"
+#. Tag: literal
+#: configuration.xml:1201
+#, fuzzy, no-c-format
+msgid "org.hibernate.type"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr "すべての JDBC パラメータをロギングします。"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1207
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+msgid "org.hibernate.tool.hbm2ddl"
msgstr "<literal>org.hibernate.tool. hbm2ddl</literal>"
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr "実行したすべての SQL(DDL)ステートメントをロギングします。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
-msgstr "<literal>org.hibernate.pretty</literal>"
+#. Tag: literal
+#: configuration.xml:1213
+#, fuzzy, no-c-format
+msgid "org.hibernate.pretty"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
msgid ""
"Log the state of all entities (max 20 entities) associated with the session "
@@ -1865,62 +2317,74 @@
"session に関連するすべてのエンティティ(最大20)のフラッシュ時間をロギング"
"します。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
-msgstr "<literal>org.hibernate.cache</literal>"
+#. Tag: literal
+#: configuration.xml:1220
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr "すべてのニ次キャッシュの動作をロギングします。"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1226
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+msgid "org.hibernate.transaction"
msgstr "<literal>org.hibernate. transaction</literal>"
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr "トランザクションに関連する動作をロギングします。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
-msgstr "<literal>org.hibernate.jdbc</literal>"
+#. Tag: literal
+#: configuration.xml:1232
+#, fuzzy, no-c-format
+msgid "org.hibernate.jdbc"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr "JDBC リソース取得をロギングします。"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1238
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+msgid "org.hibernate.hql.ast.AST"
msgstr "<literal>org.hibernate.hql. ast.AST</literal>"
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr "HQL と SQL の AST のクエリパースをロギングします。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
-msgstr "<literal>org.hibernate.secure</literal>"
+#. Tag: literal
+#: configuration.xml:1244
+#, fuzzy, no-c-format
+msgid "org.hibernate.secure"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr "すべての JAAS 分析をロギングします。"
-#. Tag: entry
-#, fuzzy, no-c-format
-msgid "<literal>org.hibernate</literal>"
-msgstr "SessionFactory の JNDI への登録"
+#. Tag: literal
+#: configuration.xml:1250
+#, no-c-format
+msgid "org.hibernate"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1252
#, no-c-format
msgid ""
"Log everything. This is a lot of information but it is useful for "
@@ -1930,6 +2394,7 @@
"便利です)"
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
msgid ""
"When developing applications with Hibernate, you should almost always work "
@@ -1943,11 +2408,13 @@
"有効にする方法があります。"
#. Tag: title
+#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr "<literal>NamingStrategy</literal> を選択"
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
msgid ""
"The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you "
@@ -1958,6 +2425,7 @@
"す。"
#. Tag: para
+#: configuration.xml:1272
#, no-c-format
msgid ""
"You can provide rules for automatically generating database identifiers from "
@@ -1975,6 +2443,7 @@
"なり最小限に近いものです。"
#. Tag: para
+#: configuration.xml:1279
#, no-c-format
msgid ""
"You can specify a different strategy by calling <literal>Configuration."
@@ -1983,7 +2452,24 @@
"マッピングを追加する前に <literal>Configuration.setNamingStrategy()</"
"literal> を呼ぶことで以下のように異なる戦略を指定することができます:"
+#. Tag: programlisting
+#: configuration.xml:1283
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
msgid ""
"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in "
@@ -1994,11 +2480,13 @@
"ん。"
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr "XML 設定ファイル"
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
msgid ""
"An alternative approach to configuration is to specify a full configuration "
@@ -2012,6 +2500,7 @@
"置き換えられます。"
#. Tag: para
+#: configuration.xml:1299
#, no-c-format
msgid ""
"The XML configuration file is by default expected to be in the root of your "
@@ -2020,7 +2509,92 @@
"XML 設定ファイルは初期設定で <literal>CLASSPATH</literal> の root に配置して"
"ください。これが例です:"
+#. Tag: programlisting
+#: configuration.xml:1302
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+msgstr ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+
#. Tag: para
+#: configuration.xml:1304
#, no-c-format
msgid ""
"The advantage of this approach is the externalization of the mapping file "
@@ -2038,26 +2612,51 @@
"ところといえば XML 構文を使うことの利点だけです。"
#. Tag: para
+#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr "XML 設定を使うことで、 Hibernate は以下のようにシンプルになります。"
+#. Tag: programlisting
+#: configuration.xml:1314
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+
#. Tag: para
+#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
msgstr "違う XML 設定ファイルを使うこともできます。"
+#. Tag: programlisting
+#: configuration.xml:1318
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr "J2EE アプリケーションサーバーとの統合"
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr "Hibernate は J2EE 構造と統合するポイントをサポートしています:"
#. Tag: para
+#: configuration.xml:1329
#, no-c-format
msgid ""
"<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC "
@@ -2078,6 +2677,7 @@
"の <literal>Transaction</literal> API を使いたくなるかもしれません。"
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
msgid ""
"<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its "
@@ -2087,6 +2687,7 @@
"がった後に <literal>SessionFactory</literal> を生成します。"
#. Tag: para
+#: configuration.xml:1350
#, no-c-format
msgid ""
"<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</"
@@ -2106,6 +2707,7 @@
"UserTransaction) することも可能です。"
#. Tag: para
+#: configuration.xml:1362
#, no-c-format
msgid ""
"<emphasis>JMX deployment:</emphasis> if you have a JMX capable application "
@@ -2125,6 +2727,7 @@
"しなければなりません)。"
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
msgid ""
"Depending on your environment, you might have to set the configuration "
@@ -2136,11 +2739,13 @@
"aggressive_release</literal> を true にしてください。"
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr "トランザクション戦略設定"
#. Tag: para
+#: configuration.xml:1381
#, no-c-format
msgid ""
"The Hibernate <literal>Session</literal> API is independent of any "
@@ -2158,6 +2763,7 @@
"ことになるでしょう。"
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
msgid ""
"To keep your code portable between these two (and other) environments we "
@@ -2174,26 +2780,31 @@
"literal> クラスのインスタンスを持つことができます。"
#. Tag: para
+#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr "3つの基本的な(既にある)選択を挙げます:"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1401
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr "データベース (JDBC) トランザクションに委譲します(デフォルト)"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1409
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1412
#, no-c-format
msgid ""
"delegates to container-managed transactions if an existing transaction is "
@@ -2205,17 +2816,20 @@
"ない場合は、新しいトランザクションが開始されており、 Bean 管理トランザクショ"
"ンが使われます。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1420
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr "コンテナ管理 JTA トランザクションに委譲します"
#. Tag: para
+#: configuration.xml:1428
#, no-c-format
msgid ""
"You can also define your own transaction strategies (for a CORBA transaction "
@@ -2225,6 +2839,7 @@
"義することもできます。"
#. Tag: para
+#: configuration.xml:1431
#, no-c-format
msgid ""
"Some features in Hibernate (i.e., the second level cache, Contextual "
@@ -2242,151 +2857,164 @@
"る必要があります。"
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr "JTA トランザクションマネージャ"
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr "Transaction Factory"
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr "Application Server"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1456
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JBossTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr "JBoss"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1462
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. WeblogicTransactionManagerLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr "Weblogic"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1468
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
-"literal>"
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. WebSphereTransactionManagerLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr "WebSphere"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1474
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
-"literal>"
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr ""
"<literal>org.hibernate.transaction. WebSphereExtendedJTATransactionLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr "WebSphere 6"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1480
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. OrionTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr "Orion"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1486
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. ResinTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr "Resin"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1492
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JOTMTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr "JOTM"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1498
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JOnASTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr "JOnAS"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1504
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. JRun4TransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr "JRun4"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1510
#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction. BESTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr "Borland ES"
#. Tag: title
+#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr "<literal>SessionFactory</literal> の JNDI への登録"
#. Tag: para
+#: configuration.xml:1522
#, no-c-format
msgid ""
"A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the "
@@ -2400,6 +3028,7 @@
"じ登録を使うことに注意してください。"
#. Tag: para
+#: configuration.xml:1528
#, no-c-format
msgid ""
"If you wish to have the <literal>SessionFactory</literal> bound to a JNDI "
@@ -2417,6 +3046,7 @@
"り専用の環境の場合は特に便利です。)"
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
msgid ""
"When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will "
@@ -2430,6 +3060,7 @@
"い場合は、デフォルトの <literal>InitialContext</literal> を使用します。"
#. Tag: para
+#: configuration.xml:1542
#, no-c-format
msgid ""
"Hibernate will automatically place the <literal>SessionFactory</literal> in "
@@ -2447,6 +3078,7 @@
"論します)。"
#. Tag: para
+#: configuration.xml:1550
#, no-c-format
msgid ""
"If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other "
@@ -2457,7 +3089,8 @@
"JNDI ルックアップを使って <literal>SessionFactory</literal> を取得します。"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1554
+#, fuzzy, no-c-format
msgid ""
"It is recommended that you bind the <literal>SessionFactory</literal> to "
"JNDI in a managed environment and use a <literal>static</literal> singleton "
@@ -2465,7 +3098,7 @@
"recommend to hide the actual lookup code for a <literal>SessionFactory</"
"literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory"
"()</literal>. Note that such a class is also a convenient way to startup "
-"Hibernate—see chapter 1."
+"Hibernate—see chapter 1."
msgstr ""
"管理された環境では <literal>SessionFactory</literal> を JNDI にバインドし、そ"
"うでなければ <literal>static</literal> シングルトンを使うことを推奨します。こ"
@@ -2476,22 +3109,24 @@
"ます。 - 1章を参照してください。"
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr "JTA による現在のセッションコンテキストマネージメント"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1567
+#, fuzzy, no-c-format
msgid ""
"The easiest way to handle <literal>Sessions</literal> and transactions is "
"Hibernate's automatic \"current\" <literal>Session</literal> management. For "
"a discussion of contextual sessions see <xref linkend=\"architecture-current-"
-"session\" />. Using the <literal>\"jta\"</literal> session context, if there "
+"session\"/>. Using the <literal>\"jta\"</literal> session context, if there "
"is no Hibernate <literal>Session</literal> associated with the current JTA "
"transaction, one will be started and associated with that JTA transaction "
"the first time you call <literal>sessionFactory.getCurrentSession()</"
"literal>. The <literal>Session</literal>s retrieved via "
-"<literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> "
+"<literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> "
"context are set to automatically flush before the transaction completes, "
"close after the transaction completes, and aggressively release JDBC "
"connections after each statement. This allows the <literal>Session</"
@@ -2523,11 +3158,13 @@
"クション境界が好ましいです。"
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr "JMX デプロイメント"
#. Tag: para
+#: configuration.xml:1592
#, no-c-format
msgid ""
"The line <literal>cfg.buildSessionFactory()</literal> still has to be "
@@ -2543,6 +3180,7 @@
"emphasis> として Hibernate をデプロイするか、どちらかで実行できます。"
#. Tag: para
+#: configuration.xml:1598
#, no-c-format
msgid ""
"Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</"
@@ -2555,7 +3193,114 @@
"実際のデプロイメントと設定はベンダー特有です。ここで例として JBoss 4.0.x 用"
"の <literal>jboss-service.xml</literal> を示します。"
+#. Tag: programlisting
+#: configuration.xml:1604
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+
#. Tag: para
+#: configuration.xml:1606
#, no-c-format
msgid ""
"This file is deployed in a directory called <literal>META-INF</literal> and "
@@ -2579,327 +3324,48 @@
"メントのより多くの情報があります。"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addResource(\"Item.hbm.xml\")\n"
-#~ " .addResource(\"Bid.hbm.xml\");]]>"
-#~ msgstr ""
-#~ "Configuration cfg = new Configuration()\n"
-#~ " .addResource(\"Item.hbm.xml\")\n"
-#~ " .addResource(\"Bid.hbm.xml\");"
+#~ msgid "<emphasis>JDBC URL</emphasis>"
+#~ msgstr "JDBC のドライバークラス"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class);]]>"
-#~ msgstr ""
-#~ "Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class);"
+#~ msgid "<emphasis>database user</emphasis>"
+#~ msgstr "<emphasis>データベースユーザ</emphasis> (オプション)"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class)\n"
-#~ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
-#~ "MySQLInnoDBDialect\")\n"
-#~ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/"
-#~ "jdbc/test\")\n"
-#~ " .setProperty(\"hibernate.order_updates\", \"true\");]]>"
-#~ msgstr ""
-#~ "Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class)\n"
-#~ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
-#~ "MySQLInnoDBDialect\")\n"
-#~ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/"
-#~ "jdbc/test\")\n"
-#~ " .setProperty(\"hibernate.order_updates\", \"true\");"
+#~ msgid "<emphasis>database user password</emphasis>"
+#~ msgstr "<emphasis>データベースユーザのパスワード</emphasis> (オプション)"
#, fuzzy
-#~ msgid "<![CDATA[SessionFactory sessions = cfg.buildSessionFactory();]]>"
-#~ msgstr "SessionFactory sessions = cfg.buildSessionFactory();"
+#~ msgid "<emphasis>datasource JNDI name</emphasis>"
+#~ msgstr "<emphasis>データベースユーザ</emphasis> (オプション)"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Session session = sessions.openSession(); // open a new Session]]"
-#~ ">"
-#~ msgstr "Session session = sessions.openSession(); // open a new Session"
+#~ msgid "<property>hibernate.generate_statistics</property>"
+#~ msgstr "<property>hibernate.generate_statistics</property>"
-#~ msgid "database user"
-#~ msgstr "データベースのユーザー"
+#~ msgid "<literal>hibernate.query.substitutions</literal>"
+#~ msgstr "<literal>hibernate.query.substitutions</literal>"
-#~ msgid "database user password"
-#~ msgstr "データベースユーザーパスワード"
+#~ msgid "DB2"
+#~ msgstr "DB2"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[hibernate.connection.driver_class = org.postgresql.Driver\n"
-#~ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
-#~ "hibernate.connection.username = myuser\n"
-#~ "hibernate.connection.password = secret\n"
-#~ "hibernate.c3p0.min_size=5\n"
-#~ "hibernate.c3p0.max_size=20\n"
-#~ "hibernate.c3p0.timeout=1800\n"
-#~ "hibernate.c3p0.max_statements=50\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
-#~ msgstr ""
-#~ "hibernate.connection.driver_class = org.postgresql.Driver\n"
-#~ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
-#~ "hibernate.connection.username = myuser\n"
-#~ "hibernate.connection.password = secret\n"
-#~ "hibernate.c3p0.min_size=5\n"
-#~ "hibernate.c3p0.max_size=20\n"
-#~ "hibernate.c3p0.timeout=1800\n"
-#~ "hibernate.c3p0.max_statements=50\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+#~ msgid "<literal>org.hibernate.SQL</literal>"
+#~ msgstr "<literal>org.hibernate.SQL</literal>"
-#~ msgid "datasource JNDI name"
-#~ msgstr "データソースの JNDI 名"
+#~ msgid "<literal>org.hibernate.type</literal>"
+#~ msgstr "<literal>org.hibernate.type</literal>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
-#~ "hibernate.transaction.factory_class = \\\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ "hibernate.transaction.manager_lookup_class = \\\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
-#~ msgstr ""
-#~ "hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
-#~ "hibernate.transaction.factory_class = \\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ "hibernate.transaction.manager_lookup_class = \\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+#~ msgid "<literal>org.hibernate.pretty</literal>"
+#~ msgstr "<literal>org.hibernate.pretty</literal>"
-#~ msgid "<entry>DB2</entry>"
-#~ msgstr "<entry>DB2</entry>"
+#~ msgid "<literal>org.hibernate.cache</literal>"
+#~ msgstr "<literal>org.hibernate.cache</literal>"
-#~ msgid "hibernate.query.substitutions true=1, false=0"
-#~ msgstr "hibernate.query.substitutions true=1, false=0"
+#~ msgid "<literal>org.hibernate.jdbc</literal>"
+#~ msgstr "<literal>org.hibernate.jdbc</literal>"
-#~ msgid "hibernate.query.substitutions toLowercase=LOWER"
-#~ msgstr "hibernate.query.substitutions toLowercase=LOWER"
+#~ msgid "<literal>org.hibernate.secure</literal>"
+#~ msgstr "<literal>org.hibernate.secure</literal>"
-#~ msgid "org.hibernate"
-#~ msgstr "org.hibernate"
-
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
-#~ " .addFile(\"Item.hbm.xml\")\n"
-#~ " .addFile(\"Bid.hbm.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "SessionFactory sf = new Configuration()\n"
-#~ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
-#~ " .addFile(\"Item.hbm.xml\")\n"
-#~ " .addFile(\"Bid.hbm.xml\")\n"
-#~ " .buildSessionFactory();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!DOCTYPE hibernate-configuration PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-configuration>\n"
-#~ "\n"
-#~ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
-#~ " <session-factory\n"
-#~ " name=\"java:hibernate/SessionFactory\">\n"
-#~ "\n"
-#~ " <!-- properties -->\n"
-#~ " <property name=\"connection.datasource\">java:/comp/env/jdbc/"
-#~ "MyDB</property>\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</"
-#~ "property>\n"
-#~ " <property name=\"show_sql\">false</property>\n"
-#~ " <property name=\"transaction.factory_class\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ " </property>\n"
-#~ " <property name=\"jta.UserTransaction\">java:comp/UserTransaction</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- mapping files -->\n"
-#~ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
-#~ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
-#~ "\n"
-#~ " <!-- cache settings -->\n"
-#~ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
-#~ "write\"/>\n"
-#~ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
-#~ "\"/>\n"
-#~ " <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
-#~ "usage=\"read-write\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-#~ msgstr ""
-#~ "<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!DOCTYPE hibernate-configuration PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-configuration>\n"
-#~ "\n"
-#~ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
-#~ " <session-factory\n"
-#~ " name=\"java:hibernate/SessionFactory\">\n"
-#~ "\n"
-#~ " <!-- properties -->\n"
-#~ " <property name=\"connection.datasource\">java:/comp/env/"
-#~ "jdbc/MyDB</property>\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect."
-#~ "MySQLDialect</property>\n"
-#~ " <property name=\"show_sql\">false</property>\n"
-#~ " <property name=\"transaction.factory_class\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ " </property>\n"
-#~ " <property name=\"jta.UserTransaction\">java:comp/"
-#~ "UserTransaction</property>\n"
-#~ "\n"
-#~ " <!-- mapping files -->\n"
-#~ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
-#~ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
-#~ "\n"
-#~ " <!-- cache settings -->\n"
-#~ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
-#~ "write\"/>\n"
-#~ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-"
-#~ "only\"/>\n"
-#~ " <collection-cache collection=\"org.hibernate.auction.Item.bids"
-#~ "\" usage=\"read-write\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration().configure()."
-#~ "buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "SessionFactory sf = new Configuration().configure().buildSessionFactory();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .configure(\"catdb.cfg.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "SessionFactory sf = new Configuration()\n"
-#~ " .configure(\"catdb.cfg.xml\")\n"
-#~ " .buildSessionFactory();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<server>\n"
-#~ "\n"
-#~ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
-#~ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
-#~ "\n"
-#~ " <!-- Required services -->\n"
-#~ " <depends>jboss.jca:service=RARDeployer</depends>\n"
-#~ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
-#~ "\n"
-#~ " <!-- Bind the Hibernate service to JNDI -->\n"
-#~ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Datasource settings -->\n"
-#~ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
-#~ " <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Transaction integration -->\n"
-#~ " <attribute name=\"TransactionStrategy\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory</attribute>\n"
-#~ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup</"
-#~ "attribute>\n"
-#~ " <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
-#~ " <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Fetching options -->\n"
-#~ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
-#~ "\n"
-#~ " <!-- Second-level caching -->\n"
-#~ " <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
-#~ " <attribute name=\"CacheProviderClass\">org.hibernate.cache."
-#~ "EhCacheProvider</attribute>\n"
-#~ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Logging -->\n"
-#~ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Mapping files -->\n"
-#~ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
-#~ "Category.hbm.xml</attribute>\n"
-#~ "\n"
-#~ "</mbean>\n"
-#~ "\n"
-#~ "</server>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<server>\n"
-#~ "\n"
-#~ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
-#~ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory"
-#~ "\">\n"
-#~ "\n"
-#~ " <!-- Required services -->\n"
-#~ " <depends>jboss.jca:service=RARDeployer</depends>\n"
-#~ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</"
-#~ "depends>\n"
-#~ "\n"
-#~ " <!-- Bind the Hibernate service to JNDI -->\n"
-#~ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Datasource settings -->\n"
-#~ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
-#~ " <attribute name=\"Dialect\">org.hibernate.dialect."
-#~ "HSQLDialect</attribute>\n"
-#~ "\n"
-#~ " <!-- Transaction integration -->\n"
-#~ " <attribute name=\"TransactionStrategy\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory</"
-#~ "attribute>\n"
-#~ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup</"
-#~ "attribute>\n"
-#~ " <attribute name=\"FlushBeforeCompletionEnabled\">true</"
-#~ "attribute>\n"
-#~ " <attribute name=\"AutoCloseSessionEnabled\">true</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Fetching options -->\n"
-#~ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
-#~ "\n"
-#~ " <!-- Second-level caching -->\n"
-#~ " <attribute name=\"SecondLevelCacheEnabled\">true</"
-#~ "attribute>\n"
-#~ " <attribute name=\"CacheProviderClass\">org.hibernate.cache."
-#~ "EhCacheProvider</attribute>\n"
-#~ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Logging -->\n"
-#~ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Mapping files -->\n"
-#~ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
-#~ "Category.hbm.xml</attribute>\n"
-#~ "\n"
-#~ "</mbean>\n"
-#~ "\n"
-#~ "</server>"
+#~ msgid "<literal>org.hibernate</literal>"
+#~ msgstr "SessionFactory の JNDI への登録"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/filters.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/filters.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/filters.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:35\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-18 15:28+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,11 +14,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr "データのフィルタリング"
#. Tag: para
+#: filters.xml:33
#, no-c-format
msgid ""
"Hibernate3 provides an innovative new approach to handling data with "
@@ -32,11 +34,13 @@
"を切り替えられます。"
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr "Hibernate のフィルタ"
#. Tag: para
+#: filters.xml:41
#, no-c-format
msgid ""
"Hibernate3 has the ability to pre-define filter criteria and attach those "
@@ -57,9 +61,95 @@
"スビューのように使用されますが、アプリケーション内ではパラメータ化されます。"
#. Tag: para
+#: filters.xml:50
#, no-c-format
msgid ""
-"In order to use filters, they must first be defined and then attached to the "
+"Using annotatons filters are defined via <literal>@org.hibernate.annotations."
+"FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</"
+"literal>. A filter definition has a <methodname>name()</methodname> 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 "
+"<methodname>defaultCondition()</methodname> parameter for a given "
+"<literal>@FilterDef</literal> to set the default condition to use when none "
+"are defined in each individual <literal>@Filter</literal>. "
+"<literal>@FilterDef</literal>(s) can be defined at the class or package "
+"level."
+msgstr ""
+
+#. Tag: para
+#: filters.xml:63
+#, 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. The connection between "
+"<classname>@FilterName</classname> and <classname>@Filter</classname> is a "
+"matching name."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
+#, 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 want "
+"to target the association table, use the <literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid ""
+"Using <classname>@FilterJoinTable</classname> for filterting on the "
+"association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files for defining filters the situtation is very "
+"similar. The filters must first be defined and then attached to the "
"appropriate mapping elements. To define a filter, use the <literal><"
"filter-def/></literal> element within a <literal><hibernate-mapping/"
"></literal> element:"
@@ -68,22 +158,58 @@
"せん。フィルタを定義するためには、 <literal><hibernate-mapping/></"
"literal> 要素内で <literal><filter-def/></literal> 要素を使用します:"
-#. Tag: para
+#. Tag: title
+#: filters.xml:97
#, no-c-format
-msgid "This filter can then be attached to a class:"
-msgstr "そうしてフィルタはクラスへと結び付けられます:"
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
+#. Tag: programlisting
+#: filters.xml:100
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+msgstr ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+
#. Tag: para
+#: filters.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"This filter can then be attached to a class or collection (or, to both or "
+"multiples of each at the same time):"
+msgstr "どちらに対しても (また、それぞれを複数) 同時に設定することもできます。"
+
+#. Tag: title
+#: filters.xml:107
#, no-c-format
-msgid "Or, to a collection:"
-msgstr "また、コレクションに対しては次のようになります:"
+msgid ""
+"Attaching a filter to a class or collection using <literal><filter></"
+"literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: filters.xml:110
#, no-c-format
-msgid "Or, to both or multiples of each at the same time."
-msgstr "どちらに対しても (また、それぞれを複数) 同時に設定することもできます。"
+msgid ""
+"<class name=\"myClass\" ...>\n"
+" ...\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+"\n"
+" <set ...>\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+" </set> \n"
+"</class>"
+msgstr ""
#. Tag: para
+#: filters.xml:113
#, no-c-format
msgid ""
"The methods on <literal>Session</literal> are: <literal>enableFilter(String "
@@ -104,7 +230,18 @@
"示的に使用可能となります。上で定義した単純なフィルタの使用は、このようになり"
"ます:"
+#. Tag: programlisting
+#: filters.xml:123
+#, fuzzy, no-c-format
+msgid ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+msgstr ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+
#. Tag: para
+#: filters.xml:125
#, no-c-format
msgid ""
"Methods on the org.hibernate.Filter interface do allow the method-chaining "
@@ -114,13 +251,87 @@
"ているメソッド連鎖を許していることに注意してください。"
#. Tag: para
+#: filters.xml:128
#, no-c-format
msgid ""
"The following is a full example, using temporal data with an effective "
"record date pattern:"
msgstr "有効なレコードデータパターンを持つ一時データを使った完全な例です:"
+#. Tag: programlisting
+#: filters.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+
#. Tag: para
+#: filters.xml:133
#, no-c-format
msgid ""
"In order to ensure that you are provided with currently effective records, "
@@ -129,7 +340,28 @@
"常に現在の有効レコードを返却することを保証するために、単純に、社員データの検"
"索より前にセッション上のフィルタを有効にします:"
+#. Tag: programlisting
+#: filters.xml:137
+#, fuzzy, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+msgstr ""
+"Session session = ...;\n"
+"session.enabledFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+
#. Tag: para
+#: filters.xml:139
#, no-c-format
msgid ""
"Even though a salary constraint was mentioned explicitly on the results in "
@@ -142,6 +374,7 @@
"します。"
#. Tag: para
+#: filters.xml:144
#, no-c-format
msgid ""
"If you want to use filters with outer joining, either through HQL or load "
@@ -154,6 +387,7 @@
"す。一般的に、演算子の後カラム名に続けて最初のパラメータを配置してください。"
#. Tag: para
+#: filters.xml:149
#, no-c-format
msgid ""
"After being defined, a filter might be attached to multiple entities and/or "
@@ -167,7 +401,20 @@
"面倒かもしれません。従って、 <literal><filter-def/></literal> は、属性"
"または CDATA としてデフォルトコンディションを定義することが可能になります:"
+#. Tag: programlisting
+#: filters.xml:155
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+
#. Tag: para
+#: filters.xml:157
#, no-c-format
msgid ""
"This default condition will be used whenever the filter is attached to "
@@ -180,16 +427,12 @@
"ションをオーバーライドするフィルターのアタッチメントの一部として、特定のコン"
"ディションを与えることができることを意味します。"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
-#~ msgstr ""
-#~ "<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>"
+#~ msgid "This filter can then be attached to a class:"
+#~ msgstr "そうしてフィルタはクラスへと結び付けられます:"
+#~ msgid "Or, to a collection:"
+#~ msgstr "また、コレクションに対しては次のようになります:"
+
#, fuzzy
#~ msgid ""
#~ "<![CDATA[<class name=\"myClass\" ...>\n"
@@ -215,110 +458,3 @@
#~ " <filter name=\"myFilter\" condition=\":myFilterParam = "
#~ "MY_FILTERED_COLUMN\"/>\n"
#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-#~ msgstr ""
-#~ "session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
-#~ "value\");"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class="
-#~ "\"Department\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column="
-#~ "\"eff_end_dt\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "Session session = ...;\n"
-#~ "session.enabledFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary "
-#~ "> :targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
-#~ msgstr ""
-#~ "<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/performance.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/performance.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/performance.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-20 14:25+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,16 +14,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "パフォーマンスの改善"
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "フェッチ戦略"
#. Tag: para
+#: performance.xml:36
#, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve "
@@ -37,11 +40,13 @@
"<literal>Criteria</literal> クエリでオーバーライドします。"
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 は次に示すフェッチ戦略を定義しています:"
#. Tag: para
+#: performance.xml:46
#, no-c-format
msgid ""
"<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated "
@@ -53,6 +58,7 @@
"<literal>SELECT</literal> で復元します。"
#. Tag: para
+#: performance.xml:53
#, no-c-format
msgid ""
"<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is "
@@ -66,6 +72,7 @@
"に関連にアクセスしたときのみ実行されるでしょう。"
#. Tag: para
+#: performance.xml:61
#, no-c-format
msgid ""
"<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> "
@@ -81,6 +88,7 @@
"るでしょう。"
#. Tag: para
+#: performance.xml:70
#, no-c-format
msgid ""
"<emphasis>Batch fetching</emphasis>: an optimization strategy for select "
@@ -94,11 +102,13 @@
"することにより行います。"
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "Hibernate は次に示す戦略とも区別をします: "
#. Tag: para
+#: performance.xml:81
#, no-c-format
msgid ""
"<emphasis>Immediate fetching</emphasis>: an association, collection or "
@@ -108,6 +118,7 @@
"に、関連、コレクションは即時にフェッチされます。"
#. Tag: para
+#: performance.xml:87
#, no-c-format
msgid ""
"<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when "
@@ -119,6 +130,7 @@
"に対するデフォルトの動作です)"
#. Tag: para
+#: performance.xml:93
#, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements "
@@ -132,6 +144,7 @@
"きなコレクションに適しています)。"
#. Tag: para
+#: performance.xml:101
#, no-c-format
msgid ""
"<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched "
@@ -142,6 +155,7 @@
"メソッドが関連オブジェクトで呼び出されるときにフェッチされます。"
#. Tag: para
+#: performance.xml:107
#, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is "
@@ -159,6 +173,7 @@
"す。"
#. Tag: para
+#: performance.xml:117
#, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued "
@@ -170,6 +185,7 @@
"みが必要になり、使う場面はまれです。"
#. Tag: para
+#: performance.xml:124
#, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when</emphasis> is the "
@@ -187,11 +203,13 @@
"す。"
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "遅延関連の働き"
#. Tag: para
+#: performance.xml:134
#, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
@@ -203,6 +221,7 @@
"ぼすべてのアプリケーションのほぼすべての関連で意味があります。"
#. Tag: para
+#: performance.xml:138
#, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate "
@@ -215,6 +234,7 @@
"す)。"
#. Tag: para
+#: performance.xml:142
#, no-c-format
msgid ""
"Please be aware that access to a lazy association outside of the context of "
@@ -224,7 +244,36 @@
"Hibernate の session をオープンしているコンテキストの外から遅延関連にアクセス"
"すると、例外が発生します。例:"
+#. Tag: programlisting
+#: performance.xml:146
+#, fuzzy, no-c-format
+msgid ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+
#. Tag: para
+#: performance.xml:148
#, no-c-format
msgid ""
"Since the permissions collection was not initialized when the "
@@ -240,6 +289,7 @@
"ンザクションをコミットする直前に移動させます。"
#. Tag: para
+#: performance.xml:155
#, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
@@ -257,6 +307,7 @@
"にフェッチすることになるでしょう。"
#. Tag: para
+#: performance.xml:162
#, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
@@ -271,11 +322,13 @@
"フェッチ戦略を選択する仕組みは単一値関連とコレクションで変わりはありません。"
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "フェッチ戦略のチューニング"
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
@@ -284,7 +337,30 @@
"セレクトフェッチ(デフォルト)は N+1 セレクト問題という大きな弱点があるため、"
"マッピング定義で結合フェッチを有効にすることができます:"
+#. Tag: programlisting
+#: performance.xml:176
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"permissions\"\n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+msgstr ""
+"<set name=\"permissions\" \n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+
+#. Tag: programlisting
+#: performance.xml:178
+#, fuzzy, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch</literal> strategy defined in the mapping document "
@@ -294,26 +370,31 @@
"す:"
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr "<literal>get()</literal> や <literal>load()</literal> による復元"
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr "関連にナビゲートしたときに発生する暗黙的な復元"
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr "<literal>Criteria</literal> クエリ"
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr "<literal>サブセレクト</literal> フェッチを使う HQL クエリ"
#. Tag: para
+#: performance.xml:204
#, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
@@ -325,6 +406,7 @@
"の SELECT 文が即時実行されることがあるので注意してください。"
#. Tag: para
+#: performance.xml:209
#, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
@@ -342,6 +424,7 @@
"<literal>setFetchMode(FetchMode.JOIN)</literal> を使うことが出来ます。"
#. Tag: para
+#: performance.xml:216
#, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get()</literal> "
@@ -352,7 +435,22 @@
"戦略を変えたいと感じたときには、単純に <literal>Criteria</literal> クエリを"
"使ってください。例:"
+#. Tag: programlisting
+#: performance.xml:220
+#, fuzzy, no-c-format
+msgid ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+msgstr ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+
#. Tag: para
+#: performance.xml:222
#, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
@@ -362,6 +460,7 @@
"です。)"
#. Tag: para
+#: performance.xml:225
#, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
@@ -371,11 +470,13 @@
"とです。"
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "単一端関連プロキシ"
#. Tag: para
+#: performance.xml:232
#, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
@@ -392,6 +493,7 @@
"ジェクトの遅延初期化プロキシを実現しています。"
#. Tag: para
+#: performance.xml:239
#, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
@@ -403,6 +505,7 @@
"literal> 関連の遅延フェッチを可能にしています。"
#. Tag: para
+#: performance.xml:244
#, no-c-format
msgid ""
"The mapping file may declare an interface to use as the proxy interface for "
@@ -419,6 +522,7 @@
"emphasis>"
#. Tag: para
+#: performance.xml:251
#, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
@@ -427,7 +531,26 @@
"ポリモーフィズムのクラスに対してこの方法を適用するときにいくつか考慮すること"
"があります。例:"
+#. Tag: programlisting
+#: performance.xml:254
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat</literal> will never be castable to "
@@ -438,12 +561,52 @@
"literal> にキャストできません。たとえ基となるインスタンスが "
"<literal>DomesticCat</literal> であったとしてもです:"
+#. Tag: programlisting
+#: performance.xml:260
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+msgstr ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+
#. Tag: para
+#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr "第二に、プロキシの <literal>==</literal> は成立しないことがあります。"
+#. Tag: programlisting
+#: performance.xml:265
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+msgstr ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
@@ -454,7 +617,18 @@
"キシオブジェクトへの二つの参照があったとしても、基となるインスタンスは同じオ"
"ブジェクトです:"
+#. Tag: programlisting
+#: performance.xml:271
+#, fuzzy, no-c-format
+msgid ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+
#. Tag: para
+#: performance.xml:273
#, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or "
@@ -464,6 +638,7 @@
"を持つクラスに CGLIB プロキシを使えません。"
#. Tag: para
+#: performance.xml:276
#, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
@@ -477,6 +652,7 @@
"クラスです。"
#. Tag: para
+#: performance.xml:281
#, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
@@ -492,7 +668,26 @@
"クラスで実装しなければなりません。マッピングファイルでこれらのインターフェー"
"スを指定する必要があります。例:"
+#. Tag: programlisting
+#: performance.xml:289
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:291
#, fuzzy, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat</literal> and "
@@ -503,17 +698,34 @@
"literal> にキャストできません。たとえ基となるインスタンスが "
"<literal>DomesticCat</literal> であったとしてもです:"
+#. Tag: programlisting
+#: performance.xml:295
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();"
+msgstr ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.iterate(\"from CatImpl as cat where cat."
+"name='fritz'\");\n"
+"Cat fritz = (Cat) iter.next();"
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr ""
#. Tag: para
+#: performance.xml:300
#, fuzzy, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr "<literal>full join</literal> (たいていの場合使いづらい)"
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
@@ -525,6 +737,7 @@
"ん。"
#. Tag: para
+#: performance.xml:308
#, no-c-format
msgid ""
"Certain operations do <emphasis>not</emphasis> require proxy initialization:"
@@ -532,6 +745,7 @@
"プロキシの初期化を <emphasis>必要としない</emphasis> 操作も存在します。"
#. Tag: para
+#: performance.xml:313
#, no-c-format
msgid ""
"<literal>equals()</literal>: if the persistent class does not override "
@@ -541,6 +755,7 @@
"バーライドしないとき)"
#. Tag: para
+#: performance.xml:318
#, no-c-format
msgid ""
"<literal>hashCode()</literal>: if the persistent class does not override "
@@ -550,11 +765,13 @@
"オーバーライドしないとき)"
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "識別子の getter メソッド"
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()</"
@@ -564,6 +781,7 @@
"オーバーライドした永続クラスを検出します。"
#. Tag: para
+#: performance.xml:330
#, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default "
@@ -577,11 +795,13 @@
"あっても、ただちにプロキシの初期化を行うことになるでしょう。"
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "コレクションとプロキシの初期化"
#. Tag: para
+#: performance.xml:340
#, no-c-format
msgid ""
"A <literal>LazyInitializationException</literal> will be thrown by Hibernate "
@@ -595,6 +815,7 @@
"への参照を持つエンティティが分離された状態の時です。"
#. Tag: para
+#: performance.xml:346
#, no-c-format
msgid ""
"Sometimes a proxy or collection needs to be initialized before closing the "
@@ -610,6 +831,7 @@
"いう点からも不便です。"
#. Tag: para
+#: performance.xml:353
#, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize()</literal> and "
@@ -629,6 +851,7 @@
"コレクションに対して同様の効果があります。"
#. Tag: para
+#: performance.xml:362
#, no-c-format
msgid ""
"Another option is to keep the <literal>Session</literal> open until all "
@@ -648,6 +871,7 @@
"つの基本的な方法があります:"
#. Tag: para
+#: performance.xml:372
#, no-c-format
msgid ""
"In a web-based application, a servlet filter can be used to close the "
@@ -670,6 +894,7 @@
"View\" パターンの例を参照してください。"
#. Tag: para
+#: performance.xml:385
#, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
@@ -697,6 +922,7 @@
"emphasis> パターンを採用するほうがより簡単です。"
#. Tag: para
+#: performance.xml:401
#, no-c-format
msgid ""
"You can also attach a previously loaded object to a new <literal>Session</"
@@ -713,6 +939,7 @@
"emphasis> 。"
#. Tag: para
+#: performance.xml:410
#, no-c-format
msgid ""
"Sometimes you do not want to initialize a large collection, but still need "
@@ -723,6 +950,7 @@
"報(サイズのような)やデータのサブセットを必要とすることがあります。"
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid ""
"You can use a collection filter to get the size of a collection without "
@@ -731,7 +959,18 @@
"コレクションフィルタを使うことで、初期化せずにコレクションのサイズを取得する"
"ことが出来ます:"
+#. Tag: programlisting
+#: performance.xml:417
+#, fuzzy, no-c-format
+msgid ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+msgstr ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid ""
"The <literal>createFilter()</literal> method is also used to efficiently "
@@ -741,12 +980,24 @@
"<literal>createFilter()</literal> メソッドは、コレクション全体を初期化する必"
"要なしに、コレクションのサブセットを復元するために効果的に使えます:"
+#. Tag: programlisting
+#: performance.xml:423
+#, fuzzy, no-c-format
+msgid ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+msgstr ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "バッチフェッチの使用"
#. Tag: para
+#: performance.xml:429
#, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
@@ -761,6 +1012,7 @@
"レクションレベルです。"
#. Tag: para
+#: performance.xml:434
#, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
@@ -785,7 +1037,14 @@
"舞いを <literal>Person</literal> のマッピングの <literal>batch-size</"
"literal> の指定で調整できます。"
+#. Tag: programlisting
+#: performance.xml:447
+#, fuzzy, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr "<class name=\"Person\" batch-size=\"10\">...</class>"
+
#. Tag: para
+#: performance.xml:449
#, no-c-format
msgid ""
"Hibernate will now execute only three queries: the pattern is 10, 10, 5."
@@ -794,6 +1053,7 @@
"す。"
#. Tag: para
+#: performance.xml:452
#, no-c-format
msgid ""
"You can also enable batch fetching of collections. For example, if each "
@@ -813,7 +1073,24 @@
"のバッチフェッチを有効にすれば、 Hibernate はコレクションの事前フェッチが出来"
"ます。"
+#. Tag: programlisting
+#: performance.xml:461
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:463
#, no-c-format
msgid ""
"With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 "
@@ -827,6 +1104,7 @@
"レクションの期待数に依存します。"
#. Tag: para
+#: performance.xml:468
#, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
@@ -840,11 +1118,13 @@
"よりよい選択になります。)"
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "サブセレクトフェッチの使用"
#. Tag: para
+#: performance.xml:477
#, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
@@ -857,11 +1137,13 @@
"ん。"
#. Tag: title
+#: performance.xml:486
#, fuzzy, no-c-format
msgid "Fetch profiles"
msgstr "フェッチ戦略"
#. Tag: para
+#: performance.xml:488
#, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
@@ -869,19 +1151,112 @@
"associated with the <interfacename>org.hibernate.SessionFactory</"
"interfacename> but enabled, by name, on the <interfacename>org.hibernate."
"Session</interfacename>. Once enabled on a <interfacename>org.hibernate."
-"Session</interfacename>, the fetch profile wull be in affect for that "
+"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session</interfacename> until it is explicitly "
"disabled."
msgstr ""
#. Tag: para
+#: performance.xml:498
#, no-c-format
msgid ""
-"So what does that mean? Well lets explain that by way of an example. Say we "
-"have the following mappings:"
+"So what does that mean? Well lets explain that by way of an example which "
+"show the different available approaches to configure a fetch profile:"
msgstr ""
+#. Tag: title
+#: performance.xml:503
+#, no-c-format
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+" @FetchProfile.FetchOverride(entity = Customer.class, association = "
+"\"orders\", mode = FetchMode.JOIN)\n"
+"})\n"
+"public class Customer {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" private long customerNumber;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Order> orders;\n"
+"\n"
+" // standard getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
+">\n"
+" </fetch-profile>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch association=\"orders\" style=\"join\"/>\n"
+" </fetch-profile>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:525
#, no-c-format
msgid ""
"Now normally when you get a reference to a particular customer, that "
@@ -890,23 +1265,39 @@
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
-"to use a fetch profile to achieve that. Just add the following to your "
-"mapping:"
+"to use a fetch profile to achieve that. The following code will load both "
+"the customer <emphasis>and</emphasis>their orders:"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: performance.xml:536
#, no-c-format
-msgid "or even:"
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFetchProfile( \"customer-with-orders\" ); // name matches "
+"from mapping\n"
+"Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
msgid ""
-"Now the following code will actually load both the customer <emphasis>and "
-"their orders</emphasis>:"
+"<classname>@FetchProfile </classname>definitions are global and it does not "
+"matter on which class you place them. You can place the "
+"<classname>@FetchProfile</classname> annotation either onto a class or "
+"package (package-info.java). In order to define multiple fetch profiles for "
+"the same class or package <classname>@FetchProfiles</classname> can be used."
msgstr ""
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
@@ -915,11 +1306,13 @@
msgstr ""
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "遅延プロパティフェッチの使用"
#. Tag: para
+#: performance.xml:560
#, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
@@ -938,6 +1331,7 @@
"善できないなどの極端な場合には有用です。"
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy</literal> attribute "
@@ -946,7 +1340,34 @@
"遅延プロパティ読み込みを有効にするには、対象のプロパティのマッピングで "
"<literal>lazy</literal> 属性をセットしてください:"
+#. Tag: programlisting
+#: performance.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+
#. Tag: para
+#: performance.xml:573
#, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
@@ -958,11 +1379,49 @@
"を無視して、即時フェッチに戻します。"
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr "バイトコード組み込みは以下の Ant タスクを使ってください: "
+#. Tag: programlisting
+#: performance.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+msgstr ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+
#. Tag: para
+#: performance.xml:581
#, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
@@ -976,6 +1435,7 @@
"す。"
#. Tag: para
+#: performance.xml:586
#, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
@@ -985,11 +1445,13 @@
"パティの即時フェッチングを強制することが出来ます。"
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "第2レベルキャッシュ"
#. Tag: para
+#: performance.xml:594
#, no-c-format
msgid ""
"A Hibernate <literal>Session</literal> is a transaction-level cache of "
@@ -1009,15 +1471,17 @@
"す)。"
#. Tag: para
-#, no-c-format
+#: performance.xml:602
+#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property <literal>hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
-"integrations with the open-source cache providers that are listed below. You "
-"can also implement your own and plug it in as outlined above. Note that "
-"versions prior to 3.2 use EhCache as the default cache provider."
+"integrations with the open-source cache providers that are listed in <xref "
+"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
+"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
+"the default cache provider."
msgstr ""
"Hibernate が使用するキャッシュ実装は、 <literal>hibernate.cache."
"provider_class</literal> プロパティに <literal>org.hibernate.cache."
@@ -1029,157 +1493,403 @@
"ジョン3.2ではこれは当てはまりません。"
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "キャッシュプロバイダ"
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "キャッシュ"
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "プロバイダクラス"
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "タイプ"
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "クラスタセーフ"
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "クエリキャッシュのサポート"
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Hashtable(製品用として意図していません)"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:644
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "メモリ"
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674
+#: performance.xml:992 performance.xml:994 performance.xml:996
+#: performance.xml:1004 performance.xml:1006 performance.xml:1008
+#: performance.xml:1016 performance.xml:1018 performance.xml:1020
+#: performance.xml:1028 performance.xml:1030 performance.xml:1040
+#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
-msgstr ""
+msgid "<entry>yes</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:656
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr "<literal>org.hibernate.cache.EhCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "メモリ、ディスク"
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:668
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr "<literal>org.hibernate.cache.OSCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:680
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "クラスタ(ip マルチキャスト)"
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "yes(クラスタ無効化)"
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:692
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "クラスタ(ip マルチキャスト)、トランザクショナル"
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "yes(複製)"
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "yes(時刻同期が必要)"
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:704
#, fuzzy, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "<literal>org.hibernate.cache.jbc2.JBossCacheRegionFactory</literal>"
#. Tag: entry
+#: performance.xml:708
#, fuzzy, no-c-format
msgid "yes (replication or invalidation)"
msgstr "yes(クラスタ無効化)"
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "キャッシュのマッピング"
#. Tag: para
+#: performance.xml:719
#, no-c-format
msgid ""
-"The <literal><cache></literal> element of a class or collection "
-"mapping has the following form:"
+"As we have done in previous chapters we are looking at the two different "
+"possibiltites to configure caching. First configuration via annotations and "
+"then via Hibernate mapping files."
msgstr ""
-"クラスやコレクションのマッピングの <literal><cache></literal> 要素は以"
-"下の形式です。"
#. Tag: para
+#: performance.xml:723
#, no-c-format
msgid ""
+"By default, entities are not part of the second level cache and we recommend "
+"you to stick to this setting. However, you can override this by setting the "
+"<literal>shared-cache-mode</literal> element in your <filename>persistence."
+"xml</filename> file or by using the <literal>javax.persistence.sharedCache."
+"mode </literal>property in your configuration. The following values are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid ""
+"<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): "
+"entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid ""
+"<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly "
+"marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid ""
+"<literal>ALL</literal>: all entities are always cached even if marked as non "
+"cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid ""
+"<literal>NONE</literal>: no entity are cached even if marked as cacheable. "
+"This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid ""
+"The cache concurrency strategy used by default can be set globaly via the "
+"<literal>hibernate.cache.default_cache_concurrency_strategy</literal> "
+"configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, fuzzy, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr "<literal>Criteria</literal> クエリ"
+
+#. Tag: literal
+#: performance.xml:765
+#, fuzzy, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr "<literal>Criteria</literal> クエリ"
+
+#. Tag: literal
+#: performance.xml:769
+#, fuzzy, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr "厳密ではない read-write"
+
+#. Tag: literal
+#: performance.xml:773
+#, fuzzy, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr "<literal>Criteria</literal> クエリ"
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid ""
+"It is recommended to define the cache concurrency strategy per entity rather "
+"than using a global one. Use the <classname>@org.hibernate.annotations."
+"Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid ""
+"Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+"@Entity \n"
+"@Cacheable\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid ""
+"Hibernate also let's you cache the content of a collection or the "
+"identifiers if the collection contains other entities. Use the "
+"<classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, fuzzy, no-c-format
+msgid "Caching collections using annotations"
+msgstr "コレクションとプロキシの初期化"
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+"@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: para
+#: performance.xml:802
+#, no-c-format
+msgid ""
+"shows the<literal> @org.hibernate.annotations.Cache</literal> annotations "
+"with its attributes. It allows you to define the caching strategy and region "
+"of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid ""
+"Let's now take a look at Hibernate mapping files. There the <literal><"
+"cache></literal> element of a class or collection mapping is used to "
+"configure the second level cache. Looking at <xref linkend=\"example-"
+"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, fuzzy, no-c-format
+msgid ""
+"<cache\n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+msgstr ""
+"<cache \n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
+msgid ""
"<literal>usage</literal> (required) specifies the caching strategy: "
"<literal>transactional</literal>, <literal>read-write</literal>, "
"<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
@@ -1189,6 +1899,7 @@
"<literal>nonstrict-read-write</literal> または <literal>read-only</literal>"
#. Tag: para
+#: performance.xml:874
#, no-c-format
msgid ""
"<literal>region</literal> (optional: defaults to the class or collection "
@@ -1198,6 +1909,7 @@
"のデフォルト) 2次レベルのキャッシュ領域の名前を指定します"
#. Tag: para
+#: performance.xml:880
#, no-c-format
msgid ""
"<literal>include</literal> (optional: defaults to <literal>all</literal>) "
@@ -1211,31 +1923,31 @@
"ティのプロパティはキャッシュされなくてもよいことを指定します。"
#. Tag: para
-#, no-c-format
+#: performance.xml:890
+#, fuzzy, no-c-format
msgid ""
-"Alternatively, you can specify <literal><class-cache></literal> and "
-"<literal><collection-cache></literal> elements in <literal>hibernate."
-"cfg.xml</literal>."
+"Alternatively to <literal><cache></literal>, you can use <literal><"
+"class-cache></literal> and <literal><collection-cache></literal> "
+"elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
"または(よりよい方法として?)、 <literal>hibernate.cfg.xml</literal> に "
"<literal><class-cache></literal> と <literal><collection-cache></"
"literal> 要素を指定することも出来ます。"
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid ""
-"The <literal>usage</literal> attribute specifies a <emphasis>cache "
-"concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
-"<literal>usage</literal> 属性は <emphasis>キャッシュの並列性戦略</emphasis> "
-"を指定します。"
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr "read only 戦略"
#. Tag: para
+#: performance.xml:902
#, no-c-format
msgid ""
"If your application needs to read, but not modify, instances of a persistent "
@@ -1249,11 +1961,13 @@
"安全です。"
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "read/write 戦略"
#. Tag: para
+#: performance.xml:911
#, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write</literal> "
@@ -1282,11 +1996,13 @@
"emphasis> 。"
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr "厳密ではない read/write 戦略"
#. Tag: para
+#: performance.xml:929
#, no-c-format
msgid ""
"If the application only occasionally needs to update data (i.e. if it is "
@@ -1308,11 +2024,13 @@
"ションが完了していなければなりません。"
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "transactional 戦略"
#. Tag: para
+#: performance.xml:943
#, no-c-format
msgid ""
"The <literal>transactional</literal> cache strategy provides support for "
@@ -1326,11 +2044,13 @@
"manager_lookup_class</literal> を指定しなければなりません。"
#. Tag: title
+#: performance.xml:950
#, fuzzy, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "同時並行性キャッシュ戦略のサポート"
#. Tag: para
+#: performance.xml:953
#, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
@@ -1339,6 +2059,7 @@
"ません。"
#. Tag: para
+#: performance.xml:957
#, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
@@ -1347,36 +2068,43 @@
"以下の表はどのプロバイダがどの同時並列性戦略に対応するかを表しています。"
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr "同時並行性キャッシュ戦略のサポート"
#. Tag: entry
-#, no-c-format
-msgid "read-only"
-msgstr "read-only"
+#: performance.xml:978
+#, fuzzy, no-c-format
+msgid "<entry>read-only</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: entry
-#, no-c-format
-msgid "nonstrict-read-write"
+#: performance.xml:980
+#, fuzzy, no-c-format
+msgid "<entry>nonstrict-read-write</entry>"
msgstr "厳密ではない read-write"
#. Tag: entry
-#, no-c-format
-msgid "read-write"
-msgstr "read-write"
+#: performance.xml:982
+#, fuzzy, no-c-format
+msgid "<entry>read-write</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: entry
-#, no-c-format
-msgid "transactional"
-msgstr "transactional"
+#: performance.xml:984
+#, fuzzy, no-c-format
+msgid "<entry>transactional</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "キャッシュの管理"
#. Tag: para
+#: performance.xml:1069
#, no-c-format
msgid ""
"Whenever you pass an object to <literal>save()</literal>, <literal>update()</"
@@ -1394,6 +2122,7 @@
"内部キャッシュに追加されます。"
#. Tag: para
+#: performance.xml:1076
#, no-c-format
msgid ""
"When <literal>flush()</literal> is subsequently called, the state of that "
@@ -1409,7 +2138,36 @@
"</literal> メソッドを使って一次キャッシュからオブジェクトやコレクションを削除"
"することが出来ます。"
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid ""
+"Explcitly evicting a cached instance from the first level cache using "
+"<methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, fuzzy, no-c-format
+msgid ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+msgstr ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session</literal> also provides a <literal>contains()</literal> "
@@ -1419,6 +2177,7 @@
"うかを判断するための <literal>contains()</literal> メソッドも提供します。"
#. Tag: para
+#: performance.xml:1094
#, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear()</"
@@ -1428,6 +2187,7 @@
"<literal>Session.clear()</literal> を呼び出してください。"
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
@@ -1438,7 +2198,34 @@
"クラス全体、コレクションのインスタンス、コレクション全体をキャッシュから削除"
"するためのメソッドがそれぞれ定義されています。"
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid ""
+"Second-level cache eviction via <methodname>SessionFactoty.evict() </"
+"methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, fuzzy, no-c-format
+msgid ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+msgstr ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+
#. Tag: para
+#: performance.xml:1110
#, no-c-format
msgid ""
"The <literal>CacheMode</literal> controls how a particular session interacts "
@@ -1448,6 +2235,7 @@
"互作用するかを指定します。"
#. Tag: para
+#: performance.xml:1115
#, no-c-format
msgid ""
"<literal>CacheMode.NORMAL</literal>: will read items from and write items to "
@@ -1457,6 +2245,7 @@
"キャッシュを使います"
#. Tag: para
+#: performance.xml:1120
#, no-c-format
msgid ""
"<literal>CacheMode.GET</literal>: will read items from the second-level "
@@ -1466,6 +2255,7 @@
"データを更新した場合を除いて二次キャッシュに書き込みをしません。"
#. Tag: para
+#: performance.xml:1126
#, no-c-format
msgid ""
"<literal>CacheMode.PUT</literal>: will write items to the second-level "
@@ -1475,6 +2265,7 @@
"読み込みには二次キャッシュを使いません。"
#. Tag: para
+#: performance.xml:1131
#, no-c-format
msgid ""
"<literal>CacheMode.REFRESH</literal>: will write items to the second-level "
@@ -1488,6 +2279,7 @@
"アイテムの二次キャッシュを強制的にリフレッシュします。"
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
@@ -1496,7 +2288,30 @@
"二次キャッシュの内容やクエリキャッシュ領域を見るために、 "
"<literal>Statistics</literal> API を使ってください:"
+#. Tag: title
+#: performance.xml:1143
+#, fuzzy, no-c-format
+msgid ""
+"Browsing the second-level cache entries via the <classname>Statistics</"
+"classname> API"
+msgstr ""
+"二次キャッシュの内容やクエリキャッシュ領域を見るために、 "
+"<literal>Statistics</literal> API を使ってください:"
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, fuzzy, no-c-format
+msgid ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+msgstr ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+
#. Tag: para
+#: performance.xml:1149
#, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
@@ -1506,11 +2321,29 @@
"解可能な形式で保持することを Hibernate に強制します:"
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+msgstr ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr "クエリキャッシュ"
#. Tag: para
+#: performance.xml:1162
#, fuzzy, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
@@ -1521,11 +2354,13 @@
"にしなくてはなりません:"
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr ""
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
@@ -1538,12 +2373,20 @@
"need to enable the query cache:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1177
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr "hibernate.cache.use_query_cache true"
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr ""
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the "
@@ -1551,6 +2394,7 @@
msgstr ""
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding "
@@ -1559,10 +2403,11 @@
msgstr ""
#. Tag: para
+#: performance.xml:1194
#, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
-"timeouts is is very important that the cache timeout of the underlying cache "
+"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
@@ -1570,6 +2415,7 @@
msgstr ""
#. Tag: para
+#: performance.xml:1203
#, fuzzy, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
@@ -1586,6 +2432,7 @@
"ます。"
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
@@ -1596,11 +2443,13 @@
msgstr ""
#. Tag: title
+#: performance.xml:1221
#, fuzzy, no-c-format
msgid "Query cache regions"
msgstr "クエリキャッシュのサポート"
#. Tag: para
+#: performance.xml:1223
#, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
@@ -1611,7 +2460,28 @@
"setCacheRegion()</literal> を呼び出して特定のクエリに対するキャッシュ領域を指"
"定することが出来ます。"
+#. Tag: programlisting
+#: performance.xml:1227
+#, fuzzy, no-c-format
+msgid ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+msgstr ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+
#. Tag: para
+#: performance.xml:1229
#, fuzzy, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
@@ -1633,11 +2503,13 @@
"シュ領域を消去することです。"
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "コレクションのパフォーマンスの理解"
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
@@ -1646,31 +2518,37 @@
msgstr ""
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "分類"
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "Hibernate は3つの基本的なコレクションの種類を定義しています:"
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "値のコレクション"
#. Tag: para
+#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr "一対多関連"
#. Tag: para
+#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr "多対多関連"
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
@@ -1687,21 +2565,25 @@
"す。"
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "インデックス付きコレクション"
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "set"
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "bag"
#. Tag: para
+#: performance.xml:1288
#, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
@@ -1717,6 +2599,7 @@
"に、その行を効率的に見つけることができます。"
#. Tag: para
+#: performance.xml:1295
#, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key></literal> and "
@@ -1739,6 +2622,7 @@
"\"</literal> を宣言しなければなりません。)"
#. Tag: para
+#: performance.xml:1306
#, no-c-format
msgid ""
"<literal><idbag></literal> mappings define a surrogate key, so they "
@@ -1748,6 +2632,7 @@
"新は常に非常に効率的です。事実上、これは最善のケースです。"
#. Tag: para
+#: performance.xml:1309
#, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
@@ -1763,6 +2648,7 @@
"ションの再作成を行います。これは非常に非効率的かもしれません。"
#. Tag: para
+#: performance.xml:1316
#, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
@@ -1776,12 +2662,14 @@
"ます。)"
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
msgstr "更新にもっとも効率的なコレクション list、map、idbag、set"
#. Tag: para
+#: performance.xml:1326
#, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
@@ -1792,6 +2680,7 @@
"除、更新でもっとも効率的な操作が出来ることは明らかです。"
#. Tag: para
+#: performance.xml:1330
#, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
@@ -1810,6 +2699,7 @@
"て行います。繰り返しますが、これは一対多関連には当てはまりません。"
#. Tag: para
+#: performance.xml:1338
#, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
@@ -1825,6 +2715,7 @@
"デルではもっとも自然だからです。"
#. Tag: para
+#: performance.xml:1344
#, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
@@ -1839,11 +2730,13 @@
"フォーマンスの問題は当てはまりません。"
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr "inverse コレクションにもっとも最適な bag と list"
#. Tag: para
+#: performance.xml:1354
#, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
@@ -1864,12 +2757,30 @@
"いからです ( <literal>Set</literal> とは異なります)。これは以下の共通処理を"
"より速くすることができます。"
+#. Tag: programlisting
+#: performance.xml:1365
+#, fuzzy, no-c-format
+msgid ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+msgstr ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "一括削除"
#. Tag: para
+#: performance.xml:1371
#, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
@@ -1884,6 +2795,7 @@
"一回発行して、それですべて終わります。"
#. Tag: para
+#: performance.xml:1377
#, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
@@ -1897,6 +2809,7 @@
"これは確かに望ましい動作です。"
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
@@ -1906,11 +2819,13 @@
"す。このとき二つの方法があります。"
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr "18行を一つ一つ削除して、3行を追加する"
#. Tag: para
+#: performance.xml:1394
#, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE</literal> and insert "
@@ -1920,6 +2835,7 @@
"つの要素すべてを(一つずつ)追加する"
#. Tag: para
+#: performance.xml:1400
#, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
@@ -1931,6 +2847,7 @@
"振る舞いはデータベースのトリガなどを混乱させるかもしれません。)"
#. Tag: para
+#: performance.xml:1404
#, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
@@ -1942,6 +2859,7 @@
"戦略)を強制することが出来ます。時にこれはとても便利で強力です。"
#. Tag: para
+#: performance.xml:1409
#, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
@@ -1951,11 +2869,13 @@
"ンには行いません。"
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "パフォーマンスのモニタリング"
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
@@ -1968,11 +2888,13 @@
"は <literal>SessionFactory</literal> 単位で取得可能です。"
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "SessionFactory のモニタリング"
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory</literal> metrics in two ways. Your "
@@ -1984,6 +2906,7 @@
"び出し、自分で <literal>Statistics</literal> の読み込みや表示を行います。"
#. Tag: para
+#: performance.xml:1430
#, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
@@ -1997,7 +2920,56 @@
"に一つの MBean を有効にすることが出来ます。最小限の設定例である以下のコードを"
"見てください:"
+#. Tag: programlisting
+#: performance.xml:1435
+#, fuzzy, no-c-format
+msgid ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, fuzzy, no-c-format
+msgid ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+
#. Tag: para
+#: performance.xml:1439
#, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
@@ -2007,6 +2979,7 @@
"とが出来ます。"
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics</literal> "
@@ -2016,6 +2989,7 @@
"<literal>false</literal> にします"
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> "
@@ -2026,6 +3000,7 @@
"び出します"
#. Tag: para
+#: performance.xml:1458
#, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear()</"
@@ -2037,11 +3012,13 @@
"ることが出来ます(info レベルです)。"
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "メトリクス"
#. Tag: para
+#: performance.xml:1466
#, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
@@ -2053,6 +3030,7 @@
"literal> インターフェースの API に書かれており、3つの分類があります:"
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid ""
"Metrics related to the general <literal>Session</literal> usage, such as "
@@ -2062,6 +3040,7 @@
"オープンしたセッションの数が JDBC コネクションと関連しているのと同じです。"
#. Tag: para
+#: performance.xml:1479
#, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
@@ -2071,6 +3050,7 @@
"(別名はグローバルメトリクスです)。"
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
@@ -2080,6 +3060,7 @@
"関係しています。"
#. Tag: para
+#: performance.xml:1489
#, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
@@ -2094,6 +3075,7 @@
"フォームによっては10秒単位でしか正確でないかもしれません。"
#. Tag: para
+#: performance.xml:1495
#, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
@@ -2115,7 +3097,46 @@
"<literal>SecondLevelCacheStatistics</literal> 、 <literal>QueryStatistics</"
"literal> API の javadoc を参照してください。以下のコードは簡単な例です:"
+#. Tag: programlisting
+#: performance.xml:1506
+#, fuzzy, no-c-format
+msgid ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+
#. Tag: para
+#: performance.xml:1508
#, no-c-format
msgid ""
"You can work on all entities, collections, queries and region caches, by "
@@ -2131,6 +3152,29 @@
"のリストを取得することが出来ます。"
#~ msgid ""
+#~ "The <literal><cache></literal> element of a class or collection "
+#~ "mapping has the following form:"
+#~ msgstr ""
+#~ "クラスやコレクションのマッピングの <literal><cache></literal> 要素は"
+#~ "以下の形式です。"
+
+#~ msgid ""
+#~ "The <literal>usage</literal> attribute specifies a <emphasis>cache "
+#~ "concurrency strategy</emphasis>."
+#~ msgstr ""
+#~ "<literal>usage</literal> 属性は <emphasis>キャッシュの並列性戦略</"
+#~ "emphasis> を指定します。"
+
+#~ msgid "read-only"
+#~ msgstr "read-only"
+
+#~ msgid "read-write"
+#~ msgstr "read-write"
+
+#~ msgid "transactional"
+#~ msgstr "transactional"
+
+#~ msgid ""
#~ "This setting creates two new cache regions: one holding cached query "
#~ "result sets (<literal>org.hibernate.cache.StandardQueryCache</literal>), "
#~ "the other holding timestamps of the most recent updates to queryable "
@@ -2151,258 +3195,6 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[s = sessions.openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ " \n"
-#~ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
-#~ " .setString(\"userName\", userName).uniqueResult();\n"
-#~ "Map permissions = u.getPermissions();\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();\n"
-#~ "\n"
-#~ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // "
-#~ "Error!]]>"
-#~ msgstr ""
-#~ "s = sessions.openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ " \n"
-#~ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
-#~ " .setString(\"userName\", userName).uniqueResult();\n"
-#~ "Map permissions = u.getPermissions();\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();\n"
-#~ "\n"
-#~ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"permissions\" \n"
-#~ " fetch=\"join\">\n"
-#~ " <key column=\"userId\"/>\n"
-#~ " <one-to-many class=\"Permission\"/>\n"
-#~ "</set]]>"
-#~ msgstr ""
-#~ "<set name=\"permissions\" \n"
-#~ " fetch=\"join\">\n"
-#~ " <key column=\"userId\"/>\n"
-#~ " <one-to-many class=\"Permission\"/>\n"
-#~ "</set"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>]]>"
-#~ msgstr "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[User user = (User) session.createCriteria(User.class)\n"
-#~ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
-#~ " .add( Restrictions.idEq(userId) )\n"
-#~ " .uniqueResult();]]>"
-#~ msgstr ""
-#~ "User user = (User) session.createCriteria(User.class)\n"
-#~ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
-#~ " .add( Restrictions.idEq(userId) )\n"
-#~ " .uniqueResult();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Cat\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Cat\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
-#~ "proxy (does not hit the db)\n"
-#~ "if ( cat.isDomesticCat() ) { // hit the db to initialize "
-#~ "the proxy\n"
-#~ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy "
-#~ "(does not hit the db)\n"
-#~ "if ( cat.isDomesticCat() ) { // hit the db to initialize "
-#~ "the proxy\n"
-#~ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
-#~ " ....\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // "
-#~ "instantiate a Cat proxy\n"
-#~ "DomesticCat dc = \n"
-#~ " (DomesticCat) session.load(DomesticCat.class, id); // acquire "
-#~ "new DomesticCat proxy!\n"
-#~ "System.out.println(cat==dc); // false]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
-#~ "Cat proxy\n"
-#~ "DomesticCat dc = \n"
-#~ " (DomesticCat) session.load(DomesticCat.class, id); // acquire "
-#~ "new DomesticCat proxy!\n"
-#~ "System.out.println(cat==dc); // false"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[cat.setWeight(11.0); // hit the db to initialize the proxy\n"
-#~ "System.out.println( dc.getWeight() ); // 11.0]]>"
-#~ msgstr ""
-#~ "cat.setWeight(11.0); // hit the db to initialize the proxy\n"
-#~ "System.out.println( dc.getWeight() ); // 11.0"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"CatImpl\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"CatImpl\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
-#~ "Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
-#~ "name='fritz'\").iterate();\n"
-#~ "Cat fritz = (Cat) iter.next();]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
-#~ "Iterator iter = session.iterate(\"from CatImpl as cat where cat."
-#~ "name='fritz'\");\n"
-#~ "Cat fritz = (Cat) iter.next();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" )."
-#~ "list().get(0) ).intValue()]]>"
-#~ msgstr ""
-#~ "( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
-#~ "(0) ).intValue()"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0)."
-#~ "setMaxResults(10).list();]]>"
-#~ msgstr ""
-#~ "s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
-#~ "list();"
-
-#, fuzzy
-#~ msgid "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"
-#~ msgstr "<class name=\"Person\" batch-size=\"10\">...</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <set name=\"cats\" batch-size=\"3\">\n"
-#~ " ...\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <set name=\"cats\" batch-size=\"3\">\n"
-#~ " ...\n"
-#~ " </set>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Document\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
-#~ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
-#~ "\"true\"/>\n"
-#~ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
-#~ "\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Document\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
-#~ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
-#~ "\"true\"/>\n"
-#~ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy="
-#~ "\"true\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<target name=\"instrument\" depends=\"compile\">\n"
-#~ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
-#~ "instrument.InstrumentTask\">\n"
-#~ " <classpath path=\"${jar.path}\"/>\n"
-#~ " <classpath path=\"${classes.dir}\"/>\n"
-#~ " <classpath refid=\"lib.class.path\"/>\n"
-#~ " </taskdef>\n"
-#~ "\n"
-#~ " <instrument verbose=\"true\">\n"
-#~ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"
-#~ " <include name=\"*.class\"/>\n"
-#~ " </fileset>\n"
-#~ " </instrument>\n"
-#~ "</target>]]>"
-#~ msgstr ""
-#~ "<target name=\"instrument\" depends=\"compile\">\n"
-#~ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
-#~ "instrument.InstrumentTask\">\n"
-#~ " <classpath path=\"${jar.path}\"/>\n"
-#~ " <classpath path=\"${classes.dir}\"/>\n"
-#~ " <classpath refid=\"lib.class.path\"/>\n"
-#~ " </taskdef>\n"
-#~ "\n"
-#~ " <instrument verbose=\"true\">\n"
-#~ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/"
-#~ "model\">\n"
-#~ " <include name=\"*.class\"/>\n"
-#~ " </fileset>\n"
-#~ " </instrument>\n"
-#~ "</target>"
-
-#~ msgid "<entry>yes</entry>"
-#~ msgstr "<entry>yes</entry>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<cache \n"
-#~ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
-#~ " region=\"RegionName\"\n"
-#~ " include=\"all|non-lazy\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<cache \n"
-#~ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
-#~ " region=\"RegionName\"\n"
-#~ " include=\"all|non-lazy\"\n"
-#~ "/>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<class name=\"eg.Immutable\" mutable=\"false\">\n"
#~ " <cache usage=\"read-only\"/>\n"
#~ " ....\n"
@@ -2432,177 +3224,3 @@
#~ " ....\n"
#~ " </set>\n"
#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ScrollableResult cats = sess.createQuery(\"from Cat as cat\")."
-#~ "scroll(); //a huge result set\n"
-#~ "while ( cats.next() ) {\n"
-#~ " Cat cat = (Cat) cats.get(0);\n"
-#~ " doSomethingWithACat(cat);\n"
-#~ " sess.evict(cat);\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //"
-#~ "a huge result set\n"
-#~ "while ( cats.next() ) {\n"
-#~ " Cat cat = (Cat) cats.get(0);\n"
-#~ " doSomethingWithACat(cat);\n"
-#~ " sess.evict(cat);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sessionFactory.evict(Cat.class, catId); //evict a particular "
-#~ "Cat\n"
-#~ "sessionFactory.evict(Cat.class); //evict all Cats\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a "
-#~ "particular collection of kittens\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
-#~ "collections]]>"
-#~ msgstr ""
-#~ "sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
-#~ "sessionFactory.evict(Cat.class); //evict all Cats\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a "
-#~ "particular collection of kittens\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
-#~ "collections"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Map cacheEntries = sessionFactory.getStatistics()\n"
-#~ " .getSecondLevelCacheStatistics(regionName)\n"
-#~ " .getEntries();]]>"
-#~ msgstr ""
-#~ "Map cacheEntries = sessionFactory.getStatistics()\n"
-#~ " .getSecondLevelCacheStatistics(regionName)\n"
-#~ " .getEntries();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[hibernate.generate_statistics true\n"
-#~ "hibernate.cache.use_structured_entries true]]>"
-#~ msgstr ""
-#~ "hibernate.generate_statistics true\n"
-#~ "hibernate.cache.use_structured_entries true"
-
-#, fuzzy
-#~ msgid "<![CDATA[hibernate.cache.use_query_cache true]]>"
-#~ msgstr "hibernate.cache.use_query_cache true"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List blogs = sess.createQuery(\"from Blog blog where blog."
-#~ "blogger = :blogger\")\n"
-#~ " .setEntity(\"blogger\", blogger)\n"
-#~ " .setMaxResults(15)\n"
-#~ " .setCacheable(true)\n"
-#~ " .setCacheRegion(\"frontpages\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :"
-#~ "blogger\")\n"
-#~ " .setEntity(\"blogger\", blogger)\n"
-#~ " .setMaxResults(15)\n"
-#~ " .setCacheable(true)\n"
-#~ " .setCacheRegion(\"frontpages\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Parent p = (Parent) sess.load(Parent.class, id);\n"
-#~ "Child c = new Child();\n"
-#~ "c.setParent(p);\n"
-#~ "p.getChildren().add(c); //no need to fetch the collection!\n"
-#~ "sess.flush();]]>"
-#~ msgstr ""
-#~ "Parent p = (Parent) sess.load(Parent.class, id);\n"
-#~ "Child c = new Child();\n"
-#~ "c.setParent(p);\n"
-#~ "p.getChildren().add(c); //no need to fetch the collection!\n"
-#~ "sess.flush();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// MBean service registration for a specific SessionFactory\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "stats.setSessionFactory(sessionFactory); // Bind the stats to a "
-#~ "SessionFactory\n"
-#~ "server.registerMBean(stats, on); // Register the Mbean on the server]]>"
-#~ msgstr ""
-#~ "// MBean service registration for a specific SessionFactory\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "stats.setSessionFactory(sessionFactory); // Bind the stats to a "
-#~ "SessionFactory\n"
-#~ "server.registerMBean(stats, on); // Register the Mbean on the server"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// MBean service registration for all SessionFactory's\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"all\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "server.registerMBean(stats, on); // Register the MBean on the server]]>"
-#~ msgstr ""
-#~ "// MBean service registration for all SessionFactory's\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"all\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "server.registerMBean(stats, on); // Register the MBean on the server"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Statistics stats = HibernateUtil.sessionFactory.getStatistics"
-#~ "();\n"
-#~ "\n"
-#~ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
-#~ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
-#~ "double queryCacheHitRatio =\n"
-#~ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
-#~ "\n"
-#~ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
-#~ "\n"
-#~ "EntityStatistics entityStats =\n"
-#~ " stats.getEntityStatistics( Cat.class.getName() );\n"
-#~ "long changes =\n"
-#~ " entityStats.getInsertCount()\n"
-#~ " + entityStats.getUpdateCount()\n"
-#~ " + entityStats.getDeleteCount();\n"
-#~ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );]]>"
-#~ msgstr ""
-#~ "Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
-#~ "\n"
-#~ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
-#~ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
-#~ "double queryCacheHitRatio =\n"
-#~ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
-#~ "\n"
-#~ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
-#~ "\n"
-#~ "EntityStatistics entityStats =\n"
-#~ " stats.getEntityStatistics( Cat.class.getName() );\n"
-#~ "long changes =\n"
-#~ " entityStats.getInsertCount()\n"
-#~ " + entityStats.getUpdateCount()\n"
-#~ " + entityStats.getDeleteCount();\n"
-#~ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/persistent_classes.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/persistent_classes.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/persistent_classes.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-04 13:58+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,18 +14,20 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "永続クラス"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:34
+#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
-"application). Not all instances of a persistent class are considered to be "
-"in the persistent state. For example, an instance can instead be transient "
-"or detached."
+"application). The term \"persistent\" here means that the classes are able "
+"to be persisted, not that they are in the persistent state (see <xref "
+"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"永続クラスはビジネス上の問題のエンティティ(例えば、 E コマースアプリケーショ"
"ンの顧客や注文) を実装するアプリケーションのクラスです。永続クラスのすべての"
@@ -34,13 +36,15 @@
"せん。"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:41
+#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
-"these rules are hard requirements. Indeed, Hibernate3 assumes very little "
+"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
-"in other ways (using trees of <literal>Map</literal> instances, for example)."
+"in other ways (using trees of <interfacename>java.util.Map</interfacename> "
+"instances, for example)."
msgstr ""
"Plain Old Java Object (POJO)プログラミングモデルとしても知られるいくつかの単"
"純なルールに従うなら、 Hibernate は最もよく働きます。しかしこれらのルールは難"
@@ -49,18 +53,181 @@
"えば <literal>Map</literal> インスタンスのツリーを使う方法があります。"
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "単純な POJO の例"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
+#, no-c-format
+msgid "Simple POJO representing a cat"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:53
#, fuzzy, no-c-format
msgid ""
-"Most Java applications require a persistent class representing felines. For "
-"example:"
-msgstr "以下はネコ科の動物を表現する永続クラスです。"
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+"private Long id; // identifier\n"
+"\n"
+"private Date birthdate;\n"
+"private Color color;\n"
+"private char sex;\n"
+"private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+"\n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() );\n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
+msgstr ""
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+" private Long id; // identifier\n"
+"\n"
+" private Date birthdate;\n"
+" private Color color;\n"
+" private char sex;\n"
+" private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+" \n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+"kitten.setLitterId( kittens.size() ); \n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
@@ -68,19 +235,21 @@
msgstr ""
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "引数のないコンストラクタを実装する"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:64
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> has a no-argument constructor. All persistent classes "
-"must have a default constructor (which can be non-public) so that Hibernate "
-"can instantiate them using <literal>Constructor.newInstance()</literal>. It "
-"is recommended that you have a default constructor with at least "
-"<emphasis>package</emphasis> visibility for runtime proxy generation in "
-"Hibernate."
+"<classname>Cat</classname> has a no-argument constructor. All persistent "
+"classes must have a default constructor (which can be non-public) so that "
+"Hibernate can instantiate them using <literal><classname>java.lang.reflect."
+"Constructor</classname>.newInstance()</literal>. It is recommended that this "
+"constructor be defined with at least <emphasis>package</emphasis> visibility "
+"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat</literal> には引数のないコンストラクタがあります。 Hibernate が "
"<literal>Constructor.newInstance()</literal> を使って永続クラスのインスタンス"
@@ -90,69 +259,42 @@
"ストラクタを強くお勧めします。"
#. Tag: title
-#, no-c-format
-msgid "Provide an identifier property (optional)"
+#: persistent_classes.xml:74
+#, fuzzy, no-c-format
+msgid "Provide an identifier property"
msgstr "識別子プロパティを用意する(オプション)"
#. Tag: para
-#, fuzzy, no-c-format
+#: persistent_classes.xml:77
+#, no-c-format
msgid ""
-"<literal>Cat</literal> has a property called <literal>id</literal>. This "
-"property maps to the primary key column of a database table. The property "
-"might have been called anything, and its type might have been any primitive "
-"type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or "
-"<literal>java.util.Date</literal>. If your legacy database table has "
-"composite keys, you can use a user-defined class with properties of these "
-"types (see the section on composite identifiers later in the chapter.)"
+"Historically this was considered option. While still not (yet) enforced, "
+"this should be considered a deprecated feature as it will be completely "
+"required to provide a identifier property in an upcoming release."
msgstr ""
-"<literal>Cat</literal> には <literal>id</literal> というプロパティがありま"
-"す。このプロパティはデータベーステーブルの主キーカラムへマッピングされます。"
-"このプロパティの名前は何でも構いませんし、型はどのようなプリミティブ型でも、"
-"プリミティブの「ラッパー」型でも、 <literal>java.lang.String</literal> や "
-"<literal>java.util.Date</literal> でも構いません。 (もしレガシーデータベース"
-"テーブルが複合キーを持つならば、今述べたような型のプロパティを持つユーザー定"
-"義のクラスを使うことさえ可能です。後で複合識別子のセクションを見てくださ"
-"い。)"
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
msgid ""
-"The identifier property is strictly optional. You can leave them off and let "
-"Hibernate keep track of object identifiers internally. We do not recommend "
-"this, however."
+"<classname>Cat</classname> has a property named <literal>id</literal>. This "
+"property maps to the primary key column(s) of the underlying database table. "
+"The type of the identifier property can be any \"basic\" type (see <xref "
+"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
+"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
-"識別子プロパティは厳密にはオプションです。これを省略して、 Hibernate に内部的"
-"にオブジェクトの識別子を追跡させることは可能です。しかしお勧めはしません。"
#. Tag: para
+#: persistent_classes.xml:92
#, no-c-format
msgid ""
-"In fact, some functionality is available only to classes that declare an "
-"identifier property:"
+"Identifiers do not necessarily need to identify column(s) in the database "
+"physically defined as a primary key. They should just identify columns that "
+"can be used to uniquely identify rows in the underlying table."
msgstr ""
-"実際に、識別子プロパティを宣言するクラスだけが利用可能な機能がいくつかありま"
-"す:"
#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Transitive reattachment for detached objects (cascade update or cascade "
-"merge) - see <xref linkend=\"objectstate-transitive\" />"
-msgstr ""
-"分離オブジェクトの連鎖的な再追加(カスケード更新やカスケードマージ) - <xref "
-"linkend=\"objectstate-transitive\" />次を参照してください。"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
-msgstr "<xref linkend=\"objectstate-transitive\" />"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<literal>Session.merge()</literal>"
-msgstr "<literal>Session.merge()</literal>"
-
-#. Tag: para
+#: persistent_classes.xml:99
#, no-c-format
msgid ""
"We recommend that you declare consistently-named identifier properties on "
@@ -163,56 +305,117 @@
"う。"
#. Tag: title
-#, no-c-format
-msgid "Prefer non-final classes (optional)"
+#: persistent_classes.xml:107
+#, fuzzy, no-c-format
+msgid "Prefer non-final classes (semi-optional)"
msgstr "final クラスにしない(オプション)"
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
msgid ""
-"A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon "
-"the persistent class being either non-final, or the implementation of an "
-"interface that declares all public methods."
+"A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), "
+"depends upon the persistent class being either non-final, or the "
+"implementation of an interface that declares all public methods. You can "
+"persist <literal>final</literal> classes that do not implement an interface "
+"with Hibernate; you will not, however, be able to use proxies for lazy "
+"association fetching which will ultimately limit your options for "
+"performance tuning. To persist a <literal>final</literal> class which does "
+"not implement a \"full\" interface you must disable proxy generation. See "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
+"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
+"ann\"/>."
msgstr ""
-"Hibernate の中心的な特徴である <emphasis>プロキシ</emphasis> は、永続クラス"
-"が final でないこと、またはメソッドを全部 public で宣言しているインターフェー"
-"スが実装されているかに依存しています。"
+#. Tag: title
+#: persistent_classes.xml:121
+#, no-c-format
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:122
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:126
+#, no-c-format
+msgid "Disabling proxies in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:127
+#, no-c-format
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:130
#, no-c-format
msgid ""
-"You can persist <literal>final</literal> classes that do not implement an "
-"interface with Hibernate. You will not, however, be able to use proxies for "
-"lazy association fetching which will ultimately limit your options for "
-"performance tuning."
+"If the <literal>final</literal> class does implement a proper interface, you "
+"could alternatively tell Hibernate to use the interface instead when "
+"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
+"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
+"final-example-proxy-interface-ann\"/>."
msgstr ""
-"Hibernate でインターフェースを実装していない <literal>final</literal> クラス"
-"を永続化することはできますが、遅延関連フェッチに対してプロキシを使うことはで"
-"きなくなります。これはパフォーマンスチューニングへの選択肢を狭めることになり"
-"ます。"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:139
#, no-c-format
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:144
+#, no-c-format
+msgid "Proxying an interface in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:145
+#, no-c-format
msgid ""
-"You should also avoid declaring <literal>public final</literal> methods on "
-"the non-final classes. If you want to use a class with a <literal>public "
-"final</literal> method, you must explicitly disable proxying by setting "
-"<literal>lazy=\"false\"</literal>."
+"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
+"ICat { ... }]]>"
msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:148
+#, fuzzy, no-c-format
+msgid ""
+"You should also avoid declaring <literal>public final</literal> methods as "
+"this will again limit the ability to generate <emphasis>proxies</emphasis> "
+"from this class. If you want to use a class with <literal>public final</"
+"literal> methods, you must explicitly disable proxying. Again, see <xref "
+"linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/"
+">."
+msgstr ""
"final ではないクラスで <literal>public final</literal> メソッドを定義すること"
"も避けるべきです。 <literal>public final</literal> メソッドを持つクラスを使い"
"たければ、 <literal>lazy=\"false\"</literal> と設定して明示的にプロキシを無効"
"にしなければなりません。"
#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr "永続フィールドに対するアクセサとミューテータを定義する(オプション)"
#. Tag: para
+#: persistent_classes.xml:160
#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> declares accessor methods for all its persistent "
+"<classname>Cat</classname> declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
@@ -229,11 +432,13 @@
"て、直接のフィールドアクセスに切り替えることは可能です。"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:169
+#, fuzzy, no-c-format
msgid ""
-"Properties need <emphasis>not</emphasis> be declared public - Hibernate can "
-"persist a property with a default, <literal>protected</literal> or "
-"<literal>private</literal> get / set pair."
+"Properties need <emphasis>not</emphasis> be declared public. Hibernate can "
+"persist a property declared with <literal>package</literal>, "
+"<literal>protected</literal> or <literal>private</literal> visibility as "
+"well."
msgstr ""
"プロパティは public で宣言する必要は <emphasis>ありません</emphasis> 。 "
"Hibernate はデフォルトで、 <literal>protected</literal> もしくは "
@@ -241,11 +446,13 @@
"とができます。"
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "継承の実装"
#. Tag: para
+#: persistent_classes.xml:180
#, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
@@ -254,13 +461,45 @@
"サブクラスも1番目と2番目のルールを守らなければなりません。サブクラスはスー"
"パークラス <literal>Cat</literal> から識別子プロパティを継承します。"
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, fuzzy, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+msgstr ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+
#. Tag: title
+#: persistent_classes.xml:188
#, no-c-format
msgid ""
"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
msgstr "<literal>equals()</literal> と <literal>hashCode()</literal>の実装"
#. Tag: para
+#: persistent_classes.xml:191
#, no-c-format
msgid ""
"You have to override the <literal>equals()</literal> and <literal>hashCode()"
@@ -270,6 +509,7 @@
"literal> メソッドをオーバーライドしなければなりません、"
#. Tag: para
+#: persistent_classes.xml:196
#, no-c-format
msgid ""
"intend to put instances of persistent classes in a <literal>Set</literal> "
@@ -280,11 +520,13 @@
"関連を表現するおすすめの方法です) <emphasis>そして同時に</emphasis>"
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "分離インスタンスをセッションへ再追加する場合。"
#. Tag: para
+#: persistent_classes.xml:206
#, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
@@ -300,6 +542,7 @@
"と <literal>hashCode()</literal> を実装しなければなりません。"
#. Tag: para
+#: persistent_classes.xml:212
#, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()</literal>/"
@@ -334,6 +577,7 @@
"注意してください。"
#. Tag: para
+#: persistent_classes.xml:228
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
@@ -349,11 +593,64 @@
"つまり現実の世界においてインスタンスを特定するキー(<emphasis>自然</"
"emphasis> 候補キー) を形成するプロパティだけを比較することを意味します。"
+#. Tag: programlisting
+#: persistent_classes.xml:235
+#, fuzzy, no-c-format
+msgid ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+msgstr ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: persistent_classes.xml:237
#, fuzzy, no-c-format
msgid ""
"A business key does not have to be as solid as a database primary key "
-"candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable "
+"candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable "
"or unique properties are usually good candidates for a business key."
msgstr ""
"ビジネスキーはデータベースの主キー候補ほど安定である必要はないことに注意して"
@@ -362,25 +659,29 @@
"補です。"
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr "動的モデル"
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr "注意"
-#. Tag: para
+#. Tag: emphasis
+#: persistent_classes.xml:249
#, fuzzy, no-c-format
msgid ""
-"<emphasis>The following features are currently considered experimental and "
-"may change in the near future.</emphasis>"
+"The following features are currently considered experimental and may change "
+"in the near future."
msgstr ""
"以下の機能は現在実験段階にあると見なされており、近い将来変更される可能性があ"
"ることに注意してください。"
#. Tag: para
+#: persistent_classes.xml:253
#, no-c-format
msgid ""
"Persistent entities do not necessarily have to be represented as POJO "
@@ -396,12 +697,13 @@
"ングファイルだけを書くことになります。"
#. Tag: para
+#: persistent_classes.xml:259
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactory</"
"literal> using the <literal>default_entity_mode</literal> configuration "
-"option (see <xref linkend=\"configuration-optional-properties\" />)."
+"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"デフォルトでは、 Hibernate は通常の POJO モードで動作します。 "
"<literal>default_entity_mode</literal> 設定オプションを使って、特定の "
@@ -410,6 +712,7 @@
"\"/> を見てください)。"
#. Tag: para
+#: persistent_classes.xml:265
#, no-c-format
msgid ""
"The following examples demonstrate the representation using <literal>Map</"
@@ -420,7 +723,80 @@
"ファイルで、クラス名の代わりに(またはそれに加えて) <literal>entity-name</"
"literal> を定義しなければなりません:"
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: persistent_classes.xml:272
#, no-c-format
msgid ""
"Even though associations are declared using target class names, the target "
@@ -430,6 +806,7 @@
"POJO ではなく動的なエンティティでも構わないことに注意してください。"
#. Tag: para
+#: persistent_classes.xml:276
#, no-c-format
msgid ""
"After setting the default entity mode to <literal>dynamic-map</literal> for "
@@ -440,7 +817,55 @@
"<literal>dynamic-map</literal> に設定した後、実行時に <literal>Map</literal> "
"の <literal>Map</literal> を使うことができます:"
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, fuzzy, no-c-format
+msgid ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+msgstr ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"Session s = openSession();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+
#. Tag: para
+#: persistent_classes.xml:283
#, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
@@ -458,6 +883,7 @@
"ます。"
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session</"
@@ -466,7 +892,36 @@
"エンティティ表現モードは <literal>Session</literal> ごとに設定することも可能"
"です。"
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, fuzzy, no-c-format
+msgid ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+msgstr ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+
#. Tag: para
+#: persistent_classes.xml:295
#, no-c-format
msgid ""
"Please note that the call to <literal>getSession()</literal> using an "
@@ -488,31 +943,35 @@
"of Work)に任せることができるということです。"
#. Tag: para
+#: persistent_classes.xml:304
#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
-"<xref linkend=\"xml\" />."
+"<xref linkend=\"xml\"/>."
msgstr ""
"XML 表現の能力についてのさらなる情報は <xref linkend=\"xml\"/> に記述されてい"
"ます。"
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizer"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:312
+#, fuzzy, no-c-format
msgid ""
-"<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO "
-"through its constructor. It also knows how to access the POJO properties "
-"using the defined property accessors."
+"<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-"
+"interfaces are responsible for managing a particular representation of a "
+"piece of data given that representation's <classname>org.hibernate."
+"EntityMode</classname>. If a given piece of data is thought of as a data "
+"structure, then a tuplizer is the thing that knows how to create such a data "
+"structure, how to extract values from such a data structure and how to "
+"inject values into such a data structure. For example, for the POJO entity "
+"mode, the corresponding tuplizer knows how create the POJO through its "
+"constructor. It also knows how to access the POJO properties using the "
+"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer</literal> とそのサブインターフェース"
"は、表現の <literal>org.hibernate.EntityMode</literal> を利用して、データ断片"
@@ -524,34 +983,45 @@
"ティにどのようにアクセスするかを知ります。"
#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
+msgid "There are two (high-level) types of Tuplizers:"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:326
+#, no-c-format
msgid ""
-"There are two high-level types of Tuplizers, represented by the <literal>org."
-"hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate."
-"tuple.component.ComponentTuplizer</literal> interfaces. "
-"<literal>EntityTuplizer</literal>s are responsible for managing the above "
-"mentioned contracts in regards to entities, while "
-"<literal>ComponentTuplizer</literal>s do the same for components."
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"which is responsible for managing the above mentioned contracts in regards "
+"to entities"
msgstr ""
-"Tuplizer には二つのハイレベルの型があります。それらは、<literal>org."
-"hibernate.tuple.entity.EntityTuplizer</literal> と <literal>org.hibernate."
-"tuple.component.ComponentTuplizer</literal> インターフェースで表現されます。 "
-"<literal>EntityTuplizer</literal> は上で述べたようなエンティティに関する契約"
-"の管理に責任を持ちます。一方、 <literal>ComponentTuplizer</literal> はコン"
-"ポーネントに関する契約の管理に責任を持ちます。"
#. Tag: para
+#: persistent_classes.xml:332
#, no-c-format
msgid ""
-"Users can also plug in their own tuplizers. Perhaps you require that a "
-"<literal>java.util.Map</literal> implementation other than <literal>java."
-"util.HashMap</literal> be used while in the dynamic-map entity-mode. Or "
-"perhaps you need to define a different proxy generation strategy than the "
-"one used by default. Both would be achieved by defining a custom tuplizer "
-"implementation. Tuplizer definitions are attached to the entity or component "
-"mapping they are meant to manage. Going back to the example of our customer "
-"entity:"
+"<interfacename>org.hibernate.tuple.component.ComponentTuplizer</"
+"interfacename> which does the same for components"
msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:340
+#, fuzzy, no-c-format
+msgid ""
+"Users can also plug in their own tuplizers. Perhaps you require that "
+"<interfacename>java.util.Map</interfacename> implementation other than "
+"<classname>java.util.HashMap</classname> be used while in the dynamic-map "
+"entity-mode. Or perhaps you need to define a different proxy generation "
+"strategy than the one used by default. Both would be achieved by defining a "
+"custom tuplizer implementation. Tuplizer definitions are attached to the "
+"entity or component mapping they are meant to manage. Going back to the "
+"example of our <classname>Customer</classname> entity, <xref linkend="
+"\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom "
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
+"\"/> shows how to do the same in <literal>hbm.xml</literal>"
+msgstr ""
"ユーザーは独自の Tuplizer に差し替えることも可能です。おそらく dynamic-map "
"entity-mode の際に <literal>java.util.HashMap</literal> を使うのではなく、 "
"<literal>java.util.Map</literal> の実装が必要でしょう。もしくは、おそらくデ"
@@ -561,29 +1031,217 @@
"客エンティティの例は以下になります:"
#. Tag: title
+#: persistent_classes.xml:353
+#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class entity-name=\"Customer\">\n"
+" <!--\n"
+" Override the dynamic-map entity-mode\n"
+" tuplizer for the customer entity\n"
+" -->\n"
+" <tuplizer entity-mode=\"dynamic-map\"\n"
+" class=\"CustomMapTuplizerImpl\"/>\n"
+"\n"
+" <id name=\"id\" type=\"long\" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <!-- other properties -->\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
#, fuzzy, no-c-format
msgid "EntityNameResolvers"
msgstr "エンティティリゾルバ"
#. Tag: para
+#: persistent_classes.xml:365
#, no-c-format
msgid ""
-"The <interfacename>org.hibernate.EntityNameResolver</interfacename> "
-"interface is a contract for resolving the entity name of a given entity "
-"instance. The interface defines a single method "
-"<methodname>resolveEntityName</methodname> which is passed the entity "
-"instance and is expected to return the appropriate entity name (null is "
-"allowed and would indicate that the resolver does not know how to resolve "
-"the entity name of the given entity instance). Generally speaking, an "
-"<interfacename>org.hibernate.EntityNameResolver</interfacename> is going to "
-"be most useful in the case of dynamic models. One example might be using "
-"proxied interfaces as your domain model. The hibernate test suite has an "
-"example of this exact style of usage under the <package>org.hibernate.test."
-"dynamicentity.tuplizer2</package>. Here is some of the code from that "
-"package for illustration."
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> is a "
+"contract for resolving the entity name of a given entity instance. The "
+"interface defines a single method <methodname>resolveEntityName</methodname> "
+"which is passed the entity instance and is expected to return the "
+"appropriate entity name (null is allowed and would indicate that the "
+"resolver does not know how to resolve the entity name of the given entity "
+"instance). Generally speaking, an <interfacename>org.hibernate."
+"EntityNameResolver</interfacename> is going to be most useful in the case of "
+"dynamic models. One example might be using proxied interfaces as your domain "
+"model. The hibernate test suite has an example of this exact style of usage "
+"under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. "
+"Here is some of the code from that package for illustration."
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, no-c-format
+msgid ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an\n"
+" * interface as the domain model and simply store persistent state in an "
+"internal\n"
+" * Map. This is an extremely trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" *\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names\n"
+" * should be resolved. Since this particular impl can handle resolution for "
+"all of our\n"
+" * entities we want to take advantage of the fact that SessionFactoryImpl "
+"keeps these\n"
+" * in a Set so that we only ever have one instance registered. Why? Well, "
+"when it\n"
+" * comes time to resolve an entity name, Hibernate must iterate over all the "
+"registered\n"
+" * resolvers. So keeping that number down helps that process be as speedy "
+"as possible.\n"
+" * Hence the equals and hashCode implementations as is\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ..."
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
msgid ""
"In order to register an <interfacename>org.hibernate.EntityNameResolver</"
@@ -591,14 +1249,16 @@
msgstr ""
#. Tag: para
+#: persistent_classes.xml:383
#, no-c-format
msgid ""
-"Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link>, implementing the <methodname>getEntityNameResolvers</methodname> "
-"method."
+"Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers"
+"\"/>), implementing the <methodname>getEntityNameResolvers</methodname> "
+"method"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</"
@@ -609,386 +1269,97 @@
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[package eg;\n"
-#~ "import java.util.Set;\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Cat {\n"
-#~ " private Long id; // identifier\n"
-#~ "\n"
-#~ " private Date birthdate;\n"
-#~ " private Color color;\n"
-#~ " private char sex;\n"
-#~ " private float weight;\n"
-#~ " private int litterId;\n"
-#~ "\n"
-#~ " private Cat mother;\n"
-#~ " private Set kittens = new HashSet();\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id=id;\n"
-#~ " }\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setBirthdate(Date date) {\n"
-#~ " birthdate = date;\n"
-#~ " }\n"
-#~ " public Date getBirthdate() {\n"
-#~ " return birthdate;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setWeight(float weight) {\n"
-#~ " this.weight = weight;\n"
-#~ " }\n"
-#~ " public float getWeight() {\n"
-#~ " return weight;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Color getColor() {\n"
-#~ " return color;\n"
-#~ " }\n"
-#~ " void setColor(Color color) {\n"
-#~ " this.color = color;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setSex(char sex) {\n"
-#~ " this.sex=sex;\n"
-#~ " }\n"
-#~ " public char getSex() {\n"
-#~ " return sex;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setLitterId(int id) {\n"
-#~ " this.litterId = id;\n"
-#~ " }\n"
-#~ " public int getLitterId() {\n"
-#~ " return litterId;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setMother(Cat mother) {\n"
-#~ " this.mother = mother;\n"
-#~ " }\n"
-#~ " public Cat getMother() {\n"
-#~ " return mother;\n"
-#~ " }\n"
-#~ " void setKittens(Set kittens) {\n"
-#~ " this.kittens = kittens;\n"
-#~ " }\n"
-#~ " public Set getKittens() {\n"
-#~ " return kittens;\n"
-#~ " }\n"
-#~ " \n"
-#~ " // addKitten not needed by Hibernate\n"
-#~ " public void addKitten(Cat kitten) {\n"
-#~ " kitten.setMother(this);\n"
-#~ " kitten.setLitterId( kittens.size() ); \n"
-#~ " kittens.add(kitten);\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package eg;\n"
-#~ "import java.util.Set;\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Cat {\n"
-#~ " private Long id; // identifier\n"
-#~ "\n"
-#~ " private Date birthdate;\n"
-#~ " private Color color;\n"
-#~ " private char sex;\n"
-#~ " private float weight;\n"
-#~ " private int litterId;\n"
-#~ "\n"
-#~ " private Cat mother;\n"
-#~ " private Set kittens = new HashSet();\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id=id;\n"
-#~ " }\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setBirthdate(Date date) {\n"
-#~ " birthdate = date;\n"
-#~ " }\n"
-#~ " public Date getBirthdate() {\n"
-#~ " return birthdate;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setWeight(float weight) {\n"
-#~ " this.weight = weight;\n"
-#~ " }\n"
-#~ " public float getWeight() {\n"
-#~ " return weight;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Color getColor() {\n"
-#~ " return color;\n"
-#~ " }\n"
-#~ " void setColor(Color color) {\n"
-#~ " this.color = color;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setSex(char sex) {\n"
-#~ " this.sex=sex;\n"
-#~ " }\n"
-#~ " public char getSex() {\n"
-#~ " return sex;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setLitterId(int id) {\n"
-#~ " this.litterId = id;\n"
-#~ " }\n"
-#~ " public int getLitterId() {\n"
-#~ " return litterId;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setMother(Cat mother) {\n"
-#~ " this.mother = mother;\n"
-#~ " }\n"
-#~ " public Cat getMother() {\n"
-#~ " return mother;\n"
-#~ " }\n"
-#~ " void setKittens(Set kittens) {\n"
-#~ " this.kittens = kittens;\n"
-#~ " }\n"
-#~ " public Set getKittens() {\n"
-#~ " return kittens;\n"
-#~ " }\n"
-#~ " \n"
-#~ " // addKitten not needed by Hibernate\n"
-#~ " public void addKitten(Cat kitten) {\n"
-#~ " kitten.setMother(this);\n"
-#~ "kitten.setLitterId( kittens.size() ); \n"
-#~ " kittens.add(kitten);\n"
-#~ " }\n"
-#~ "}"
+#~ "Most Java applications require a persistent class representing felines. "
+#~ "For example:"
+#~ msgstr "以下はネコ科の動物を表現する永続クラスです。"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[package eg;\n"
-#~ "\n"
-#~ "public class DomesticCat extends Cat {\n"
-#~ " private String name;\n"
-#~ "\n"
-#~ " public String getName() {\n"
-#~ " return name;\n"
-#~ " }\n"
-#~ " protected void setName(String name) {\n"
-#~ " this.name=name;\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "<literal>Cat</literal> has a property called <literal>id</literal>. This "
+#~ "property maps to the primary key column of a database table. The property "
+#~ "might have been called anything, and its type might have been any "
+#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
+#~ "String</literal> or <literal>java.util.Date</literal>. If your legacy "
+#~ "database table has composite keys, you can use a user-defined class with "
+#~ "properties of these types (see the section on composite identifiers later "
+#~ "in the chapter.)"
#~ msgstr ""
-#~ "package eg;\n"
-#~ "\n"
-#~ "public class DomesticCat extends Cat {\n"
-#~ " private String name;\n"
-#~ "\n"
-#~ " public String getName() {\n"
-#~ " return name;\n"
-#~ " }\n"
-#~ " protected void setName(String name) {\n"
-#~ " this.name=name;\n"
-#~ " }\n"
-#~ "}"
+#~ "<literal>Cat</literal> には <literal>id</literal> というプロパティがありま"
+#~ "す。このプロパティはデータベーステーブルの主キーカラムへマッピングされま"
+#~ "す。このプロパティの名前は何でも構いませんし、型はどのようなプリミティブ型"
+#~ "でも、プリミティブの「ラッパー」型でも、 <literal>java.lang.String</"
+#~ "literal> や <literal>java.util.Date</literal> でも構いません。 (もしレガ"
+#~ "シーデータベーステーブルが複合キーを持つならば、今述べたような型のプロパ"
+#~ "ティを持つユーザー定義のクラスを使うことさえ可能です。後で複合識別子のセク"
+#~ "ションを見てください。)"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[public class Cat {\n"
-#~ "\n"
-#~ " ...\n"
-#~ " public boolean equals(Object other) {\n"
-#~ " if (this == other) return true;\n"
-#~ " if ( !(other instanceof Cat) ) return false;\n"
-#~ "\n"
-#~ " final Cat cat = (Cat) other;\n"
-#~ "\n"
-#~ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
-#~ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
-#~ "\n"
-#~ " return true;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " int result;\n"
-#~ " result = getMother().hashCode();\n"
-#~ " result = 29 * result + getLitterId();\n"
-#~ " return result;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
+#~ "The identifier property is strictly optional. You can leave them off and "
+#~ "let Hibernate keep track of object identifiers internally. We do not "
+#~ "recommend this, however."
#~ msgstr ""
-#~ "public class Cat {\n"
-#~ "\n"
-#~ " ...\n"
-#~ " public boolean equals(Object other) {\n"
-#~ " if (this == other) return true;\n"
-#~ " if ( !(other instanceof Cat) ) return false;\n"
-#~ "\n"
-#~ " final Cat cat = (Cat) other;\n"
-#~ "\n"
-#~ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
-#~ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
-#~ "\n"
-#~ " return true;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " int result;\n"
-#~ " result = getMother().hashCode();\n"
-#~ " result = 29 * result + getLitterId();\n"
-#~ " return result;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
+#~ "識別子プロパティは厳密にはオプションです。これを省略して、 Hibernate に内"
+#~ "部的にオブジェクトの識別子を追跡させることは可能です。しかしお勧めはしませ"
+#~ "ん。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class entity-name=\"Customer\">\n"
-#~ "\n"
-#~ " <id name=\"id\"\n"
-#~ " type=\"long\"\n"
-#~ " column=\"ID\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " column=\"NAME\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <property name=\"address\"\n"
-#~ " column=\"ADDRESS\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"organization\"\n"
-#~ " column=\"ORGANIZATION_ID\"\n"
-#~ " class=\"Organization\"/>\n"
-#~ "\n"
-#~ " <bag name=\"orders\"\n"
-#~ " inverse=\"true\"\n"
-#~ " lazy=\"false\"\n"
-#~ " cascade=\"all\">\n"
-#~ " <key column=\"CUSTOMER_ID\"/>\n"
-#~ " <one-to-many class=\"Order\"/>\n"
-#~ " </bag>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ " \n"
-#~ "</hibernate-mapping>]]>"
+#~ "In fact, some functionality is available only to classes that declare an "
+#~ "identifier property:"
#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class entity-name=\"Customer\">\n"
-#~ "\n"
-#~ " <id name=\"id\"\n"
-#~ " type=\"long\"\n"
-#~ " column=\"ID\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " column=\"NAME\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <property name=\"address\"\n"
-#~ " column=\"ADDRESS\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"organization\"\n"
-#~ " column=\"ORGANIZATION_ID\"\n"
-#~ " class=\"Organization\"/>\n"
-#~ "\n"
-#~ " <bag name=\"orders\"\n"
-#~ " inverse=\"true\"\n"
-#~ " lazy=\"false\"\n"
-#~ " cascade=\"all\">\n"
-#~ " <key column=\"CUSTOMER_ID\"/>\n"
-#~ " <one-to-many class=\"Order\"/>\n"
-#~ " </bag>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ " \n"
-#~ "</hibernate-mapping>"
+#~ "実際に、識別子プロパティを宣言するクラスだけが利用可能な機能がいくつかあり"
+#~ "ます:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[Session s = openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ "Session s = openSession();\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "\n"
-#~ "// Create an organization\n"
-#~ "Map foobar = new HashMap();\n"
-#~ "foobar.put(\"name\", \"Foobar Inc.\");\n"
-#~ "\n"
-#~ "// Link both\n"
-#~ "david.put(\"organization\", foobar);\n"
-#~ "\n"
-#~ "// Save both\n"
-#~ "s.save(\"Customer\", david);\n"
-#~ "s.save(\"Organization\", foobar);\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();]]>"
+#~ "Transitive reattachment for detached objects (cascade update or cascade "
+#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
#~ msgstr ""
-#~ "Session s = openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ "Session s = openSession();\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "\n"
-#~ "// Create an organization\n"
-#~ "Map foobar = new HashMap();\n"
-#~ "foobar.put(\"name\", \"Foobar Inc.\");\n"
-#~ "\n"
-#~ "// Link both\n"
-#~ "david.put(\"organization\", foobar);\n"
-#~ "\n"
-#~ "// Save both\n"
-#~ "s.save(\"Customer\", david);\n"
-#~ "s.save(\"Organization\", foobar);\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();"
+#~ "分離オブジェクトの連鎖的な再追加(カスケード更新やカスケードマージ) - "
+#~ "<xref linkend=\"objectstate-transitive\" />次を参照してください。"
#, fuzzy
+#~ msgid "<literal>Session.saveOrUpdate()</literal>"
+#~ msgstr "<xref linkend=\"objectstate-transitive\" />"
+
+#, fuzzy
+#~ msgid "<literal>Session.merge()</literal>"
+#~ msgstr "<literal>Session.merge()</literal>"
+
#~ msgid ""
-#~ "<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode."
-#~ "MAP);\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "dynamicSession.save(\"Customer\", david);\n"
-#~ "...\n"
-#~ "dynamicSession.flush();\n"
-#~ "dynamicSession.close()\n"
-#~ "...\n"
-#~ "// Continue on pojoSession\n"
-#~ "]]>"
+#~ "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends "
+#~ "upon the persistent class being either non-final, or the implementation "
+#~ "of an interface that declares all public methods."
#~ msgstr ""
-#~ "Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "dynamicSession.save(\"Customer\", david);\n"
-#~ "...\n"
-#~ "dynamicSession.flush();\n"
-#~ "dynamicSession.close()\n"
-#~ "...\n"
-#~ "// Continue on pojoSession"
+#~ "Hibernate の中心的な特徴である <emphasis>プロキシ</emphasis> は、永続クラ"
+#~ "スが final でないこと、またはメソッドを全部 public で宣言しているインター"
+#~ "フェースが実装されているかに依存しています。"
+#~ msgid ""
+#~ "You can persist <literal>final</literal> classes that do not implement an "
+#~ "interface with Hibernate. You will not, however, be able to use proxies "
+#~ "for lazy association fetching which will ultimately limit your options "
+#~ "for performance tuning."
+#~ msgstr ""
+#~ "Hibernate でインターフェースを実装していない <literal>final</literal> クラ"
+#~ "スを永続化することはできますが、遅延関連フェッチに対してプロキシを使うこと"
+#~ "はできなくなります。これはパフォーマンスチューニングへの選択肢を狭めること"
+#~ "になります。"
+
+#~ msgid ""
+#~ "There are two high-level types of Tuplizers, represented by the "
+#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal> "
+#~ "interfaces. <literal>EntityTuplizer</literal>s are responsible for "
+#~ "managing the above mentioned contracts in regards to entities, while "
+#~ "<literal>ComponentTuplizer</literal>s do the same for components."
+#~ msgstr ""
+#~ "Tuplizer には二つのハイレベルの型があります。それらは、<literal>org."
+#~ "hibernate.tuple.entity.EntityTuplizer</literal> と <literal>org.hibernate."
+#~ "tuple.component.ComponentTuplizer</literal> インターフェースで表現されま"
+#~ "す。 <literal>EntityTuplizer</literal> は上で述べたようなエンティティに関"
+#~ "する契約の管理に責任を持ちます。一方、 <literal>ComponentTuplizer</"
+#~ "literal> はコンポーネントに関する契約の管理に責任を持ちます。"
+
#, fuzzy
#~ msgid ""
#~ "<![CDATA[<hibernate-mapping>\n"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/preface.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/preface.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-12-21 17:17+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,19 +14,24 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr "前書き"
#. Tag: para
+#: preface.xml:35
#, fuzzy, no-c-format
msgid ""
-"Working with object-oriented software and a relational database can be "
-"cumbersome and time consuming in today's enterprise environments. Hibernate "
-"is an Object/Relational Mapping tool for Java environments. The term Object/"
-"Relational Mapping (ORM) refers to the technique of mapping a data "
-"representation from an object model to a relational data model with a SQL-"
-"based schema."
+"Working with both Object-Oriented software and Relational Databases can be "
+"cumbersome and time consuming. Development costs are significantly higher "
+"due to a paradigm mismatch between how data is represented in objects versus "
+"relational databases. Hibernate is an Object/Relational Mapping solution for "
+"Java environments. The term Object/Relational Mapping refers to the "
+"technique of mapping a data representation from an object model to a "
+"relational data model with a SQL-based schema; see <ulink url=\"http://en."
+"wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/"
+"Object-relational_mapping</ulink> for a discussion."
msgstr ""
"オブジェクト指向のソフトウェアやリレーショナルデータベースの使用は、 今日のエ"
"ンタープライズ環境では非常に繁雑で時間のかかる作業となります。 Hibernate は "
@@ -36,8 +41,32 @@
"指します。 "
#. Tag: para
+#: preface.xml:46
#, no-c-format
msgid ""
+"While having a strong background in SQL is not required to use Hibernate, "
+"having a basic understanding of the concepts can greatly help you understand "
+"Hibernate more fully and quickly. Probably the single best background is an "
+"understanding of data modeling principles. You might want to consider these "
+"resources as a good starting point:"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:54
+#, no-c-format
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:59
+#, no-c-format
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
+
+#. Tag: para
+#: preface.xml:66
+#, no-c-format
+msgid ""
"Hibernate not only takes care of the mapping from Java classes to database "
"tables (and from Java data types to SQL data types), but also provides data "
"query and retrieval facilities. It can also significantly reduce development "
@@ -49,17 +78,29 @@
"する時間を大幅に削減することが可能になります。"
#. Tag: para
+#: preface.xml:72
#, no-c-format
msgid ""
-"Hibernate's goal is to relieve the developer from 95 percent of common data "
-"persistence related programming tasks. Hibernate may not be the best "
-"solution for data-centric applications that only use stored-procedures to "
-"implement the business logic in the database, it is most useful with object-"
-"oriented domain models and business logic in the Java-based middle-tier. "
-"However, Hibernate can certainly help you to remove or encapsulate vendor-"
-"specific SQL code and will help with the common task of result set "
-"translation from a tabular representation to a graph of objects."
+"Hibernate’s design goal is to relieve the developer from 95% of common data "
+"persistence-related programming tasks by eliminating the need for manual, "
+"hand-crafted data processing using SQL and JDBC. However, unlike many other "
+"persistence solutions, Hibernate does not hide the power of SQL from you and "
+"guarantees that your investment in relational technology and knowledge is as "
+"valid as always."
msgstr ""
+
+#. Tag: para
+#: preface.xml:79
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate may not be the best solution for data-centric applications that "
+"only use stored-procedures to implement the business logic in the database, "
+"it is most useful with object-oriented domain models and business logic in "
+"the Java-based middle-tier. However, Hibernate can certainly help you to "
+"remove or encapsulate vendor-specific SQL code and will help with the common "
+"task of result set translation from a tabular representation to a graph of "
+"objects."
+msgstr ""
"Hibernate の目標は、 開発者にとってのプログラミングにおける一般的なデータ永続"
"性の作業の 95 % を軽減することです。 Hibernate データベース内でビジネスロジッ"
"クを実現するストアドプロシージャのみを使用するデータ処理中心のアプリケーショ"
@@ -70,6 +111,7 @@
"る一般的な作業に役立ちます。"
#. Tag: para
+#: preface.xml:88
#, no-c-format
msgid ""
"If you are new to Hibernate and Object/Relational Mapping or even Java, "
@@ -79,9 +121,10 @@
"な方は、 次の手順を行ってください。"
#. Tag: para
+#: preface.xml:95
#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step "
+"Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step "
"instructions. The source code for the tutorial is included in the "
"distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
@@ -91,15 +134,17 @@
"にあります。"
#. Tag: para
+#: preface.xml:103
#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"architecture\" /> to understand the environments where "
+"Read <xref linkend=\"architecture\"/> to understand the environments where "
"Hibernate can be used."
msgstr ""
"Hibernate が使用できる環境について理解するため、 <xref linkend=\"architecture"
"\"/> をお読みください。"
#. Tag: para
+#: preface.xml:109
#, no-c-format
msgid ""
"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
@@ -118,13 +163,15 @@
"するか、 Windows 環境の場合は <literal>build eg</literal> と入力します。"
#. Tag: para
+#: preface.xml:120
#, fuzzy, no-c-format
msgid ""
"Use this reference documentation as your primary source of information. "
"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
"more help with application design, or if you prefer a step-by-step tutorial. "
-"Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download "
-"the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+"Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and "
+"download the example application from <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>."
msgstr ""
"おもな情報源として本リファレンスドキュメントをご利用ください。 アプリケーショ"
"ンのデザインに関する詳細、 ステップバイステップによる解説が必要な場合は、 "
@@ -134,11 +181,13 @@
"す。"
#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr "よくある質問とその答え (FAQ) は Hibernate ウェブサイトでご覧ください。"
#. Tag: para
+#: preface.xml:135
#, fuzzy, no-c-format
msgid ""
"Links to third party demos, examples, and tutorials are maintained on the "
@@ -148,6 +197,7 @@
"ト上にリンクされています。"
#. Tag: para
+#: preface.xml:141
#, no-c-format
msgid ""
"The Community Area on the Hibernate website is a good resource for design "
@@ -159,31 +209,91 @@
"いリソースになります。"
#. Tag: para
+#: preface.xml:149
#, no-c-format
msgid ""
-"If you have questions, use the user forum linked on the Hibernate website. "
-"We also provide a JIRA issue tracking system for bug reports and feature "
-"requests. If you are interested in the development of Hibernate, join the "
-"developer mailing list. If you are interested in translating this "
-"documentation into your language, contact us on the developer mailing list."
+"There are a number of ways to become involved in the Hibernate community, "
+"including"
msgstr ""
-"質問がある場合は、 Hibernate ウェブサイト上にリンクされたユーザーフォーラムを"
-"ご利用ください。 また、 バグ報告及び今後のリクエストに関しては JIRA (問題追跡"
-"システム) を提供しています。 Hibernate, の開発に興味がある方は、 開発者用メー"
-"リングリストにご参加ください。 本ドキュメントの翻訳に興味がある方は、 開発者"
-"用メーリングリストよりご連絡ください。"
#. Tag: para
+#: preface.xml:153
#, no-c-format
msgid ""
-"Commercial development support, production support, and training for "
-"Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
-"SupportTraining/). Hibernate is a Professional Open Source project and a "
-"critical component of the JBoss Enterprise Middleware System (JEMS) suite of "
-"products."
+"Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/"
+"issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
msgstr ""
-"Hibernate に関する商業用開発サポート、 実稼働サポート、 トレーニングについて"
-"は JBoss Inc よりご利用頂けます (http://www.hibernate.org/SupportTraining/ を"
-"参照)。 Hibernate はプロフェッショナルなオープンソースプロジェクトであり、 "
-"JBoss Enterprise Middleware System (JEMS) スィート製品の重要なコンポーネント"
-"になります。"
+
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid ""
+"Trying your hand at fixing some bugs or implementing enhancements. Again, "
+"see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate."
+"org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid ""
+"<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/"
+"community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid ""
+"There are forums for users to ask questions and receive help from the "
+"community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid ""
+"There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat"
+"\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid ""
+"Helping improve or translate this documentation. Contact us on the developer "
+"mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
+
+#~ msgid ""
+#~ "If you have questions, use the user forum linked on the Hibernate "
+#~ "website. We also provide a JIRA issue tracking system for bug reports and "
+#~ "feature requests. If you are interested in the development of Hibernate, "
+#~ "join the developer mailing list. If you are interested in translating "
+#~ "this documentation into your language, contact us on the developer "
+#~ "mailing list."
+#~ msgstr ""
+#~ "質問がある場合は、 Hibernate ウェブサイト上にリンクされたユーザーフォーラ"
+#~ "ムをご利用ください。 また、 バグ報告及び今後のリクエストに関しては JIRA "
+#~ "(問題追跡システム) を提供しています。 Hibernate, の開発に興味がある方は、 "
+#~ "開発者用メーリングリストにご参加ください。 本ドキュメントの翻訳に興味があ"
+#~ "る方は、 開発者用メーリングリストよりご連絡ください。"
+
+#~ msgid ""
+#~ "Commercial development support, production support, and training for "
+#~ "Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
+#~ "SupportTraining/). Hibernate is a Professional Open Source project and a "
+#~ "critical component of the JBoss Enterprise Middleware System (JEMS) suite "
+#~ "of products."
+#~ msgstr ""
+#~ "Hibernate に関する商業用開発サポート、 実稼働サポート、 トレーニングについ"
+#~ "ては JBoss Inc よりご利用頂けます (http://www.hibernate.org/"
+#~ "SupportTraining/ を参照)。 Hibernate はプロフェッショナルなオープンソース"
+#~ "プロジェクトであり、 JBoss Enterprise Middleware System (JEMS) スィート製"
+#~ "品の重要なコンポーネントになります。"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/query_sql.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/query_sql.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/query_sql.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-18 15:09+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,11 +14,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr "ネイティブ SQL"
#. Tag: para
+#: query_sql.xml:33
#, no-c-format
msgid ""
"You can also express queries in the native SQL dialect of your database. "
@@ -33,6 +35,7 @@
"リケーションから Hibernate への移行も容易にしています。"
#. Tag: para
+#: query_sql.xml:39
#, no-c-format
msgid ""
"Hibernate3 allows you to specify handwritten SQL, including stored "
@@ -42,11 +45,13 @@
"ドプロシージャを含む)を手書きできます。"
#. Tag: title
+#: query_sql.xml:43
#, fuzzy, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr "もしくは <literal>List</literal> として、"
#. Tag: para
+#: query_sql.xml:45
#, no-c-format
msgid ""
"Execution of native SQL queries is controlled via the <literal>SQLQuery</"
@@ -60,16 +65,29 @@
"を使って問い合わせする方法を以下で説明します。"
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr "スカラーのクエリ"
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr "最も基本的な SQL クエリはスカラー(値)のリストを得ることです。"
+#. Tag: programlisting
+#: query_sql.xml:56
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+
#. Tag: para
+#: query_sql.xml:58
#, no-c-format
msgid ""
"These will return a List of Object arrays (Object[]) with scalar values for "
@@ -81,6 +99,7 @@
"に、 Hibernate は ResultSetMetadata を使用します。"
#. Tag: para
+#: query_sql.xml:63
#, no-c-format
msgid ""
"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or "
@@ -91,22 +110,40 @@
"しくは単に何が返されるか明確にするため、 <literal>addScalar()</literal> を使"
"えます。"
+#. Tag: programlisting
+#: query_sql.xml:67
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr "このクエリで指定されているものを下記に示します:"
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr "SQL クエリ文字列"
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr "返されるカラムと型"
#. Tag: para
+#: query_sql.xml:81
#, no-c-format
msgid ""
"This will return Object arrays, but now it will not use "
@@ -123,13 +160,29 @@
"literal> を使用し、列挙した3つより多くのカラムを返せるとしてもです。"
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
msgid ""
"It is possible to leave out the type information for all or some of the "
"scalars."
msgstr "スカラーの型情報を省くこともできます。"
+#. Tag: programlisting
+#: query_sql.xml:92
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+
#. Tag: para
+#: query_sql.xml:94
#, no-c-format
msgid ""
"This is essentially the same query as before, but now "
@@ -141,6 +194,7 @@
"定されています。"
#. Tag: para
+#: query_sql.xml:99
#, no-c-format
msgid ""
"How the java.sql.Types returned from ResultSetMetaData is mapped to "
@@ -154,11 +208,13 @@
"<literal>registerHibernateType</literal> を呼び出し、カスタマイズできます。"
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr "エンティティのクエリ"
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
msgid ""
"The above queries were all about returning scalar values, basically "
@@ -171,12 +227,26 @@
"より、ネイティブ SQL クエリからエンティティオブジェクトを取得する方法を示しま"
"す。"
+#. Tag: programlisting
+#: query_sql.xml:114
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr "クエリが返すエンティティと SQL テーブルの別名"
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
msgid ""
"Assuming that Cat is mapped as a class with the columns ID, NAME and "
@@ -187,6 +257,7 @@
"上記のクエリはどちらも、要素が Cat エンティティであるリストを返します。"
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
msgid ""
"If the entity is mapped with a <literal>many-to-one</literal> to another "
@@ -203,17 +274,30 @@
"されますが、次の例のように、 <literal>Dog</literal> に <literal>多対一</"
"literal> であることを明示することを私たちは好みます。"
+#. Tag: programlisting
+#: query_sql.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+msgstr ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr "これにより cat.getDog() が正しく機能します。"
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr "関連とコレクションの操作"
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
msgid ""
"It is possible to eagerly join in the <literal>Dog</literal> to avoid the "
@@ -225,7 +309,23 @@
"中で即時結合できます。これは <literal>addJoin()</literal> メソッドにより行い"
"ます。関連もしくはコレクションに結合できます。"
+#. Tag: programlisting
+#: query_sql.xml:153
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+msgstr ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d \n"
+" WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+
#. Tag: para
+#: query_sql.xml:155
#, no-c-format
msgid ""
"In this example, the returned <literal>Cat</literal>'s will have their "
@@ -242,7 +342,23 @@
"<literal>Cat</literal> が一対多で <literal>Dog</literal> を持っていた場合、次"
"のようになります。"
+#. Tag: programlisting
+#: query_sql.xml:163
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+msgstr ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d\n"
+" WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+
#. Tag: para
+#: query_sql.xml:165
#, no-c-format
msgid ""
"At this stage you are reaching the limits of what is possible with native "
@@ -255,11 +371,13 @@
"す際や、デフォルトの別名や列名で十分ではない場合に、問題は起こり始めます。"
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr "複数エンティティの取得"
#. Tag: para
+#: query_sql.xml:175
#, no-c-format
msgid ""
"Until now, the result set column names are assumed to be the same as the "
@@ -272,6 +390,7 @@
"があるため、複数テーブルを結合する SQL クエリで問題となる場合があります。"
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
msgid ""
"Column alias injection is needed in the following query (which most likely "
@@ -280,7 +399,22 @@
"下記のような(失敗しそうな)クエリでは、カラム別名インジェクション(column "
"alias injection)が必要です:"
+#. Tag: programlisting
+#: query_sql.xml:183
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+
#. Tag: para
+#: query_sql.xml:185
#, no-c-format
msgid ""
"The query was intended to return two Cat instances per row: a cat and its "
@@ -297,11 +431,27 @@
"\"NAME\")と等しくないため、失敗します。"
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
msgstr "下記の形式は、カラム名が重複しても大丈夫です:"
+#. Tag: programlisting
+#: query_sql.xml:195
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
msgid ""
"the SQL query string, with placeholders for Hibernate to inject column "
@@ -311,11 +461,13 @@
"む)"
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr "クエリによって返されるエンティティ"
#. Tag: para
+#: query_sql.xml:210
#, no-c-format
msgid ""
"The {cat.*} and {mother.*} notation used above is a shorthand for \"all "
@@ -334,12 +486,36 @@
"データで定義された Cat とその母親を復元します。もし好むなら、 where 節の中で"
"も、プロパティの別名を使えます。"
+#. Tag: programlisting
+#: query_sql.xml:219
+#, fuzzy, no-c-format
+msgid ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr "別名とプロパティのリファレンス"
#. Tag: para
+#: query_sql.xml:224
#, no-c-format
msgid ""
"In most cases the above alias injection is needed. For queries relating to "
@@ -353,6 +529,7 @@
"を挿入できます。"
#. Tag: para
+#: query_sql.xml:229
#, no-c-format
msgid ""
"The following table shows the different ways you can use the alias "
@@ -365,180 +542,213 @@
"ます。"
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr "別名に挿入する名前"
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr "説明"
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr "構文"
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr "例"
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr "単純なプロパティ"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:258
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+msgid "{[aliasname].[propertyname]"
msgstr "<literal>{[aliasname].[propertyname]</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:260
#, fuzzy, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "A_NAME as {item.name}"
+msgstr "<literal>A_NAME as {item.name}</literal>"
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr "複合プロパティ"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:266
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:268
#, fuzzy, no-c-format
-msgid ""
-"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
-"literal>"
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
msgstr ""
"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
"literal>"
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr "エンティティのクラスを識別する値"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:275
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].class}"
+msgstr "<literal>{[aliasname].class}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:277
#, fuzzy, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "DISC as {item.class}"
+msgstr "<literal>DISC as {item.class}</literal>"
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr "エンティティの全プロパティ"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].*}"
+msgstr "<literal>{[aliasname].*}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:285
#, no-c-format
-msgid "<literal>{item.*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{item.*}"
+msgstr "{item.*}"
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr "コレクションのキー"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:291
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].key}"
+msgstr "<literal>{[aliasname].key}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:293
#, fuzzy, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "ORGID as {coll.key}"
+msgstr "<literal>ORGID as {coll.key}</literal>"
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr "コレクションの ID"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:299
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{[aliasname].id}"
+msgstr "<literal>{[aliasname].id}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:301
#, fuzzy, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "EMPID as {coll.id}"
+msgstr "<literal>EMPID as {coll.id}</literal>"
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr "コレクションの要素"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:307
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
-msgstr "<literal>{coll.element.*}</literal>"
+msgid "{[aliasname].element}"
+msgstr "<literal>{[aliasname].element}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:309
#, fuzzy, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
-msgstr "<literal>{coll.element.*}</literal>"
+msgid "XID as {coll.element}"
+msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry
+#: query_sql.xml:313
#, no-c-format
msgid "property of the element in the collection"
msgstr "コレクションの要素のプロパティ"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:315
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+msgid "{[aliasname].element.[propertyname]}"
msgstr "<literal>{[aliasname].element.[propertyname]}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:317
#, fuzzy, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
-msgstr "<literal>{coll.element.*}</literal>"
+msgid "NAME as {coll.element.name}"
+msgstr "<literal>NAME as {coll.element.name}</literal>"
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr "コレクションの要素の全プロパティ"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:323
#, fuzzy, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
-msgstr "<literal>{coll.element.*}</literal>"
+msgid "{[aliasname].element.*}"
+msgstr "<literal>{[aliasname].element.*}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
-msgstr "<literal>{coll.element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:325
+#, fuzzy, no-c-format
+msgid "{coll.element.*}"
+msgstr "{coll.*}"
#. Tag: entry
+#: query_sql.xml:329
#, fuzzy, no-c-format
msgid "All properties of the collection"
msgstr "コレクションの全プロパティ"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:333
#, no-c-format
-msgid "<literal>{coll.*}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "{coll.*}"
+msgstr "{coll.*}"
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr "管理されていないエンティティの取得"
#. Tag: para
+#: query_sql.xml:344
#, no-c-format
msgid ""
"It is possible to apply a ResultTransformer to native SQL queries, allowing "
@@ -547,12 +757,24 @@
"ネイティブ SQL クエリに ResultTransformer を適用できます。下記のように、例え"
"ば、管理されていないエンティティを返します。"
+#. Tag: programlisting
+#: query_sql.xml:347
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr "結果を変換したもの"
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
msgid ""
"The above query will return a list of <literal>CatDTO</literal> which has "
@@ -563,11 +785,13 @@
"もしくはフィールドに挿入した <literal>CatDTO</literal> のリストを返します。"
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr "継承の制御"
#. Tag: para
+#: query_sql.xml:369
#, no-c-format
msgid ""
"Native SQL queries which query for entities that are mapped as part of an "
@@ -579,34 +803,108 @@
"なりません。"
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr "パラメータ"
#. Tag: para
+#: query_sql.xml:377
#, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr ""
"ネイティブ SQL クエリは、以下のように、名前付きパラメータ(:name)と同様に位"
"置パラメータをサポートします:"
+#. Tag: programlisting
+#: query_sql.xml:380
+#, fuzzy, no-c-format
+msgid ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr "名前付き SQL クエリ"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:387
+#, fuzzy, no-c-format
msgid ""
-"Named SQL queries can be defined in the mapping document and called in "
-"exactly the same way as a named HQL query. In this case, you do "
-"<emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
+"Named SQL queries can also be defined in the mapping document and called in "
+"exactly the same way as a named HQL query (see <xref linkend=\"objectstate-"
+"querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> "
+"need to call <literal>addEntity()</literal>."
msgstr ""
"名前付き SQL クエリはマッピングドキュメントで定義することができ、名前付き "
"HQL クエリと全く同じ方法で呼ぶことができます。この場合、 <literal>addEntity()"
"</literal> を呼び出す必要は <emphasis>ありません</emphasis> 。"
+#. Tag: title
+#: query_sql.xml:394
+#, no-c-format
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:397
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, fuzzy, no-c-format
+msgid ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+msgstr ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+
#. Tag: para
+#: query_sql.xml:406
#, fuzzy, no-c-format
msgid ""
"The <literal><return-join></literal> element is use to join "
@@ -617,7 +915,52 @@
"<literal><return-join></literal> と <literal><load-collection></"
"literal> 要素を使います。"
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" adddress.STREET AS {address.street},\n"
+" adddress.CITY AS {address.city},\n"
+" adddress.STATE AS {address.state},\n"
+" adddress.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS adddress\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
msgid ""
"A named SQL query may return a scalar value. You must declare the column "
@@ -628,7 +971,34 @@
"scalar></literal> 要素を使って、列の別名と Hibernate の型を宣言しなければ"
"なりません:"
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name, \n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name,\n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:426
#, no-c-format
msgid ""
"You can externalize the resultset mapping information in a <literal><"
@@ -640,7 +1010,58 @@
"化することができます。複数の名前付きクエリで再利用したり、 "
"<literal>setResultSetMapping()</literal> API を通して再利用したりできます。"
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, fuzzy, no-c-format
+msgid ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" adddress.STREET AS {address.street},\n"
+" adddress.CITY AS {address.city},\n"
+" adddress.STATE AS {address.state},\n"
+" adddress.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS adddress\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:438
#, no-c-format
msgid ""
"You can, alternatively, use the resultset mapping information in your hbm "
@@ -650,11 +1071,344 @@
"中で使用できます。"
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, fuzzy, no-c-format
+msgid ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+msgstr ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid ""
+"So far we have only looked at externalizing SQL queries using Hibernate "
+"mapping files. The same concept is also available with anntations and is "
+"called named native queries. You can use <classname>@NamedNativeQuery</"
+"classname> (<classname>@NamedNativeQueries</classname>) in conjunction with "
+"<literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</"
+"literal>). Like <literal>@NamedQuery</literal>, "
+"<classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</"
+"literal> can be defined at class level, but their scope is global to the "
+"application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid ""
+"shows how 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. "
+"In the example 2 entities, <literal>Night</literal> and <literal>Area</"
+"literal>, are returned and each property is declared and associated to a "
+"column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid ""
+"In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set "
+"mapping is implicit. We only describe the entity class of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid ""
+"Finally, 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. This can be seen in "
+"<xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid ""
+"Named SQL query using <classname>@NamedNativeQuery</classname> together with "
+"<classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+" resultSetMapping=\"joinMapping\")\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"implicit\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", \n"
+" query=\"select * from SpaceShip\", \n"
+" resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column = \"name\"),\n"
+" @FieldResult(name=\"model\", column = \"model\"),\n"
+" @FieldResult(name=\"speed\", column = \"speed\"),\n"
+" @FieldResult(name=\"captain.firstname\", column = "
+"\"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column = \"lastn"
+"\"),\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"
+"@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
+#: query_sql.xml:510
+#, no-c-format
+msgid ""
+"If you retrieve a single entity using the default mapping, you can specify "
+"the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip"
+"\", resultClass=SpaceShip.class)\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+"@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension"
+"\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension "
+"from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr "列と列の別名を明示的に指定するために return-property を使う"
#. Tag: para
+#: query_sql.xml:538
#, no-c-format
msgid ""
"You can explicitly tell Hibernate what column aliases to use with "
@@ -664,7 +1418,36 @@
"別名を挿入するために <literal>{}</literal> 構文を使う代わりに、 <literal><"
"return-property></literal> を使い、どの列の別名を使うのかを明示できます。"
+#. Tag: programlisting
+#: query_sql.xml:543
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:545
#, no-c-format
msgid ""
"<literal><return-property></literal> also works with multiple columns. "
@@ -675,7 +1458,44 @@
"列のプロパティをきめ細かく制御できないという、 <literal>{}</literal> 構文の制"
"限を解決します。"
+#. Tag: programlisting
+#: query_sql.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:552
#, no-c-format
msgid ""
"In this example <literal><return-property></literal> was used in "
@@ -687,6 +1507,7 @@
"い。列とプロパティをどのように参照するかを選べます。"
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
msgid ""
"If your mapping has a discriminator you must use <literal><return-"
@@ -697,11 +1518,13 @@
"せん。"
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr "問い合わせするためにストアドプロシージャを使う"
#. Tag: para
+#: query_sql.xml:565
#, no-c-format
msgid ""
"Hibernate3 provides support for queries via stored procedures and functions. "
@@ -716,14 +1539,82 @@
"してリザルトセットを返さなければなりません。 Oracle 9(もしくはそれ以上のバー"
"ジョン)のストアドプロシージャの例を以下に示します:"
+#. Tag: programlisting
+#: query_sql.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+msgstr ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr ""
"Hibernate でこのクエリを使うためには、名前付きクエリでマッピングする必要があ"
"ります。"
+#. Tag: programlisting
+#: query_sql.xml:576
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:578
#, no-c-format
msgid ""
"Stored procedures currently only return scalars and entities. <literal><"
@@ -735,11 +1626,13 @@
"literal> はサポートされていません。"
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr "ストアドプロシージャを使う上でのルールと制限"
#. Tag: para
+#: query_sql.xml:585
#, no-c-format
msgid ""
"You cannot use stored procedures with Hibernate unless you follow some "
@@ -757,6 +1650,7 @@
"マンティックスとシンタックスは、データベースベンダごとに異なるためです。"
#. Tag: para
+#: query_sql.xml:593
#, no-c-format
msgid ""
"Stored procedure queries cannot be paged with <literal>setFirstResult()/"
@@ -766,6 +1660,7 @@
"シージャクエリをページ分けすることはできません。"
#. Tag: para
+#: query_sql.xml:596
#, no-c-format
msgid ""
"The recommended call form is standard SQL92: <literal>{ ? = call functionName"
@@ -778,11 +1673,13 @@
"サポートされていません。"
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr "Oracle には下記のルールが適用されます:"
#. Tag: para
+#: query_sql.xml:605
#, no-c-format
msgid ""
"A function must return a result set. The first parameter of a procedure must "
@@ -798,11 +1695,13 @@
"Oracle の文献を参照してください。"
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr "Sybase と MS SQL サーバーに適用されるルールを下記に示します:"
#. Tag: para
+#: query_sql.xml:618
#, no-c-format
msgid ""
"The procedure must return a result set. Note that since these servers can "
@@ -815,6 +1714,7 @@
"返すことに注意してください。その他はすべて捨てられます。"
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
msgid ""
"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it "
@@ -824,73 +1724,186 @@
"く効率がよくなるでしょう。しかし、これは必要条件ではありません。"
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr "作成、更新、削除のためのカスタム SQL"
#. Tag: para
+#: query_sql.xml:638
#, no-c-format
msgid ""
"Hibernate3 can use custom SQL for create, update, and delete operations. The "
"SQL can be overridden at the statement level or inidividual column level. "
"This section describes statement overrides. For columns, see <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-"
+"annotations\"/> shows how to define custom SQL operatons using annotations."
msgstr ""
+#. Tag: title
+#: query_sql.xml:646
+#, no-c-format
+msgid "Custom CRUD via annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:648
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"@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"
+"@Loader(namedQuery = \"chaos\")\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
+#: query_sql.xml:651
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can "
+"be achieved using Hibernate mapping files and the <literal><sql-insert>"
+"</literal>, <literal><sql-update></literal> and <literal><sql-"
+"delete></literal> nodes. This can be seen in <xref linkend=\"example-"
+"custom-crdu-via-xml\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
#, fuzzy, no-c-format
msgid ""
-"The class and collection persisters in Hibernate already contain a set of "
-"configuration time generated strings (insertsql, deletesql, updatesql etc.). "
-"The mapping tags <literal><sql-insert></literal>, <literal><sql-"
-"delete></literal>, and <literal><sql-update></literal> override "
-"these strings:"
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
msgstr ""
-"Hibernate3 は作成、更新、削除処理のためのカスタム SQL 文を使用できます。クラ"
-"スとコレクションの永続化機構は、コンフィグレーション時に生成された文字列 "
-"(insertsql、deletesql、updatesql など)のセットをすでに保持しています。これ"
-"らの文字列より、 <literal><sql-insert></literal>、 <literal><sql-"
-"delete></literal>、 <literal><sql-update></literal> というマッピング"
-"タグが優先されます:"
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
#. Tag: para
+#: query_sql.xml:666
#, no-c-format
msgid ""
-"The SQL is directly executed in your database, so you can use any dialect "
-"you like. This will reduce the portability of your mapping if you use "
-"database specific SQL."
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to <constant>true</constant>. In "
+"annotations as well as in xml."
msgstr ""
-"SQL を直接データベースで実行するため、好みの方言を自由に使用できます。データ"
-"ベース独自の SQL を使えば、当然マッピングのポータビリティが下がります。"
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
msgid ""
-"Stored procedures are supported if the <literal>callable</literal> attribute "
-"is set:"
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
msgstr ""
-"<literal>callable</literal> 属性をセットすれば、ストアドプロシージャを使用で"
-"きます:"
#. Tag: para
+#: query_sql.xml:675
#, no-c-format
msgid ""
-"The order of the positional parameters is vital, as they must be in the same "
-"sequence as Hibernate expects them."
+"none: no check is performed: the store procedure is expected to fail upon "
+"issues"
msgstr ""
-"今のところ、位置パラメータの順番はとても重要です。すなわち、 Hibernate が期待"
-"する順序でなければなりません。"
#. Tag: para
+#: query_sql.xml:680
#, no-c-format
+msgid "count: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:685
+#, no-c-format
msgid ""
-"You can view 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 view the expected sequence, do not include "
-"your custom SQL in the mapping files, as this will override the Hibernate "
-"generated static SQL."
+"param: like COUNT but using an output parameter rather that the standard "
+"mechanism"
msgstr ""
+
+#. Tag: para
+#: query_sql.xml:690
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal> parameter "
+"which is again available in annoations as well as in xml."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:693
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations respectively xml nodes to "
+"override the collection related statements -see <xref linkend=\"example-"
+"overriding-sql-collections-annotations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:698
+#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?"
+"\")\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:705
+#, fuzzy, no-c-format
+msgid ""
+"The parameter order is important and is defined by the order Hibernate "
+"handles 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 or mapping files "
+"as that will override the Hibernate generated static sql)"
+msgstr ""
"<literal>org.hiberante.persister.entity</literal> レベルのデバッグログを有効"
"にすることによって、期待される順番を確かめられます。このレベルを有効にするこ"
"とにより、エンティティの作成、更新、削除などで使用される静的な SQL が出力され"
@@ -899,34 +1912,149 @@
"ください。)"
#. Tag: para
+#: query_sql.xml:715
#, no-c-format
msgid ""
-"The stored procedures are in most cases required to return the number of "
-"rows inserted, updated and deleted, as Hibernate has some runtime checks for "
-"the success of the statement. Hibernate always registers the first statement "
-"parameter as a numeric output parameter for the CUD operations:"
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>@org.hibernate.annotations.Table</literal> and either (or all) "
+"attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
msgstr ""
+
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"@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"
+" sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values"
+"(upper(?), ?)\") )\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:726
+#, no-c-format
+msgid ""
+"The previous example also shows that you can give a comment to a given table "
+"(primary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:731
+#, fuzzy, no-c-format
+msgid ""
+"The SQL is directly executed in your database, so you can use any dialect "
+"you like. This will, however, reduce the portability of your mapping if you "
+"use database specific SQL."
+msgstr ""
+"SQL を直接データベースで実行するため、好みの方言を自由に使用できます。データ"
+"ベース独自の SQL を使えば、当然マッピングのポータビリティが下がります。"
+
+#. Tag: para
+#: query_sql.xml:736
+#, fuzzy, no-c-format
+msgid ""
+"Last but not least, stored procedures are in most cases required to return "
+"the number of rows inserted, updated and deleted. Hibernate always registers "
+"the first statement parameter as a numeric output parameter for the CUD "
+"operations:"
+msgstr ""
"ストアドプロシージャは挿入/更新/削除された行数を返す必要があります(読み込み"
"の場合は、返さないよりは返す方がよいです)。実行時に Hibernate が SQL 文の成"
"功をチェックするからです。 Hibernate は、 CUD 処理のための数値の出力パラメー"
"タとして、 SQL 文の最初のパラメータをいつも記録します:"
#. Tag: title
+#: query_sql.xml:742
#, no-c-format
+msgid "Stored procedures and their return value"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:744
+#, fuzzy, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+msgstr ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
msgid "Custom SQL for loading"
msgstr "ロードのためのカスタム SQL"
#. Tag: para
+#: query_sql.xml:751
#, no-c-format
msgid ""
"You can also declare your own SQL (or HQL) queries for entity loading. As "
"with inserts, updates, and deletes, this can be done at the individual "
-"column level as described in <xref linkend=\"mapping-column-read-and-write"
-"\" /> or at the statement level. Here is an example of a statement level "
+"column level as described in <xref linkend=\"mapping-column-read-and-write\"/"
+"> or at the statement level. Here is an example of a statement level "
"override:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:757
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:759
#, no-c-format
msgid ""
"This is just a named query declaration, as discussed earlier. You can "
@@ -935,17 +2063,76 @@
"これは、まさに(以前議論した)名前付きクエリの宣言です。この名前付きクエリを"
"クラスのマッピングから参照できます:"
+#. Tag: programlisting
+#: query_sql.xml:762
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+
#. Tag: para
+#: query_sql.xml:764
#, no-c-format
msgid "This even works with stored procedures."
msgstr "これはストアドプロシージャでさえも動作します。"
#. Tag: para
+#: query_sql.xml:766
#, no-c-format
msgid "You can even define a query for collection loading:"
msgstr "次のように、コレクションをロードするためのクエリさえ定義してよいです:"
+#. Tag: programlisting
+#: query_sql.xml:768
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+msgstr ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+
+#. Tag: programlisting
+#: query_sql.xml:770
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:772
#, no-c-format
msgid ""
"You can also define an entity loader that loads a collection by join "
@@ -954,525 +2141,138 @@
"次のように、結合フェッチによりコレクションをロードするエンティティローダーを"
"定義できます:"
-#~ msgid ""
-#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
-#~ msgstr ""
-#~ "エンティティを読み込むための独自の SQL (もしくは HQL)クエリも宣言できま"
-#~ "す:"
+#. Tag: programlisting
+#: query_sql.xml:775
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid ""
+"The annotation equivalent <literal><loader></literal> is the @Loader "
+"annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/"
+">."
+msgstr ""
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\", Hibernate.STRING)\n"
-#~ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\", Hibernate.STRING)\n"
-#~ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+#~ msgid "<literal>A_NAME as {item.name}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\")\n"
-#~ " .addScalar(\"BIRTHDATE\")\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\")\n"
-#~ " .addScalar(\"BIRTHDATE\")"
+#~ msgid "<literal>{[aliasname].class}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat."
-#~ "class);\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity"
-#~ "(Cat.class);\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity"
-#~ "(Cat.class);"
+#~ msgid "<literal>DISC as {item.class}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM "
-#~ "CATS\").addEntity(Cat.class);\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
-#~ "addEntity(Cat.class);"
+#~ msgid "<literal>{[aliasname].*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, "
-#~ "D_ID, D_NAME FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dog\");\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
-#~ "FROM CATS c, DOGS d \n"
-#~ " WHERE c.DOG_ID = d.D_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dog\");"
+#~ msgid "<literal>{item.*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, "
-#~ "CAT_ID FROM CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dogs\");\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID "
-#~ "FROM CATS c, DOGS d\n"
-#~ " WHERE c.ID = d.CAT_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dogs\");"
+#~ msgid "<literal>{[aliasname].key}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE "
-#~ "c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c."
-#~ "MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)"
+#~ msgid "<literal>ORGID as {coll.key}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, "
-#~ "CATS m WHERE c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m "
-#~ "WHERE c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)"
+#~ msgid "<literal>{[aliasname].id}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
-#~ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother."
-#~ "*} \" +\n"
-#~ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
-#~ "\n"
-#~ "List loggedCats = sess.createSQLQuery(sql)\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class).list()\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
-#~ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother."
-#~ "*} \" +\n"
-#~ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
-#~ "\n"
-#~ "List loggedCats = sess.createSQLQuery(sql)\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class).list()"
+#~ msgid "<literal>EMPID as {coll.id}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
#, fuzzy
-#~ msgid "A_NAME as {item.name}"
-#~ msgstr "<literal>A_NAME as {item.name}</literal>"
+#~ msgid "<literal>{[aliasname].element}</literal>"
+#~ msgstr "<literal>{coll.element.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].class}"
-#~ msgstr "<literal>{[aliasname].class}</literal>"
+#~ msgid "<literal>XID as {coll.element}</literal>"
+#~ msgstr "<literal>{coll.element.*}</literal>"
#, fuzzy
-#~ msgid "DISC as {item.class}"
-#~ msgstr "<literal>DISC as {item.class}</literal>"
+#~ msgid "<literal>NAME as {coll.element.name}</literal>"
+#~ msgstr "<literal>{coll.element.*}</literal>"
#, fuzzy
-#~ msgid "{[aliasname].*}"
-#~ msgstr "<literal>{[aliasname].*}</literal>"
+#~ msgid "<literal>{[aliasname].element.*}</literal>"
+#~ msgstr "<literal>{coll.element.*}</literal>"
-#~ msgid "{item.*}"
-#~ msgstr "{item.*}"
+#~ msgid "<literal>{coll.element.*}</literal>"
+#~ msgstr "<literal>{coll.element.*}</literal>"
-#, fuzzy
-#~ msgid "{[aliasname].key}"
-#~ msgstr "<literal>{[aliasname].key}</literal>"
+#~ msgid "<literal>{coll.*}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
#, fuzzy
-#~ msgid "ORGID as {coll.key}"
-#~ msgstr "<literal>ORGID as {coll.key}</literal>"
-
-#, fuzzy
-#~ msgid "{[aliasname].id}"
-#~ msgstr "<literal>{[aliasname].id}</literal>"
-
-#, fuzzy
-#~ msgid "EMPID as {coll.id}"
-#~ msgstr "<literal>EMPID as {coll.id}</literal>"
-
-#, fuzzy
-#~ msgid "{[aliasname].element}"
-#~ msgstr "<literal>{[aliasname].element}</literal>"
-
-#, fuzzy
-#~ msgid "XID as {coll.element}"
-#~ msgstr "<literal>XID as {coll.element}</literal>"
-
-#, fuzzy
-#~ msgid "NAME as {coll.element.name}"
-#~ msgstr "<literal>NAME as {coll.element.name}</literal>"
-
-#, fuzzy
-#~ msgid "{[aliasname].element.*}"
-#~ msgstr "<literal>{[aliasname].element.*}</literal>"
-
-#, fuzzy
-#~ msgid "{coll.element.*}"
-#~ msgstr "{coll.*}"
-
-#~ msgid "{coll.*}"
-#~ msgstr "{coll.*}"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
-#~ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))]]>"
+#~ "The class and collection persisters in Hibernate already contain a set of "
+#~ "configuration time generated strings (insertsql, deletesql, updatesql "
+#~ "etc.). The mapping tags <literal><sql-insert></literal>, "
+#~ "<literal><sql-delete></literal>, and <literal><sql-update></"
+#~ "literal> override these strings:"
#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
-#~ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+#~ "Hibernate3 は作成、更新、削除処理のためのカスタム SQL 文を使用できます。ク"
+#~ "ラスとコレクションの永続化機構は、コンフィグレーション時に生成された文字"
+#~ "列 (insertsql、deletesql、updatesql など)のセットをすでに保持していま"
+#~ "す。これらの文字列より、 <literal><sql-insert></literal>、 "
+#~ "<literal><sql-delete></literal>、 <literal><sql-update></"
+#~ "literal> というマッピングタグが優先されます:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE "
-#~ "NAME like ?\").addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(0, \"Pus%\").list();\n"
-#~ " \n"
-#~ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
-#~ "addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(\"name\", \"Pus%\").list(); ]]>"
+#~ "Stored procedures are supported if the <literal>callable</literal> "
+#~ "attribute is set:"
#~ msgstr ""
-#~ "Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?"
-#~ "\").addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(0, \"Pus%\").list();\n"
-#~ " \n"
-#~ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
-#~ "addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(\"name\", \"Pus%\").list();"
+#~ "<literal>callable</literal> 属性をセットすれば、ストアドプロシージャを使用"
+#~ "できます:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"persons\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex}\n"
-#~ " FROM PERSON person\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
+#~ "The order of the positional parameters is vital, as they must be in the "
+#~ "same sequence as Hibernate expects them."
#~ msgstr ""
-#~ "<sql-query name=\"persons\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex}\n"
-#~ " FROM PERSON person\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
+#~ "今のところ、位置パラメータの順番はとても重要です。すなわち、 Hibernate が"
+#~ "期待する順序でなければなりません。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[List people = sess.getNamedQuery(\"persons\")\n"
-#~ " .setString(\"namePattern\", namePattern)\n"
-#~ " .setMaxResults(50)\n"
-#~ " .list();]]>"
+#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
#~ msgstr ""
-#~ "List people = sess.getNamedQuery(\"persons\")\n"
-#~ " .setString(\"namePattern\", namePattern)\n"
-#~ " .setMaxResults(50)\n"
-#~ " .list();"
+#~ "エンティティを読み込むための独自の SQL (もしくは HQL)クエリも宣言できま"
+#~ "す:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"personsWith\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " address.STREET AS {address.street},\n"
-#~ " address.CITY AS {address.city},\n"
-#~ " address.STATE AS {address.state},\n"
-#~ " address.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS address\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"personsWith\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/"
-#~ ">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " adddress.STREET AS {address.street},\n"
-#~ " adddress.CITY AS {address.city},\n"
-#~ " adddress.STATE AS {address.state},\n"
-#~ " adddress.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS adddress\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"mySqlQuery\">\n"
-#~ " <return-scalar column=\"name\" type=\"string\"/>\n"
-#~ " <return-scalar column=\"age\" type=\"long\"/>\n"
-#~ " SELECT p.NAME AS name,\n"
-#~ " p.AGE AS age,\n"
-#~ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"mySqlQuery\">\n"
-#~ " <return-scalar column=\"name\" type=\"string\"/>\n"
-#~ " <return-scalar column=\"age\" type=\"long\"/>\n"
-#~ " SELECT p.NAME AS name,\n"
-#~ " p.AGE AS age,\n"
-#~ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<resultset name=\"personAddress\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
-#~ "</resultset>\n"
-#~ "\n"
-#~ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " address.STREET AS {address.street},\n"
-#~ " address.CITY AS {address.city},\n"
-#~ " address.STATE AS {address.state},\n"
-#~ " address.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS address\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<resultset name=\"personAddress\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/"
-#~ ">\n"
-#~ "</resultset>\n"
-#~ "\n"
-#~ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " adddress.STREET AS {address.street},\n"
-#~ " adddress.CITY AS {address.city},\n"
-#~ " adddress.STATE AS {address.state},\n"
-#~ " adddress.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS adddress\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = sess.createSQLQuery(\n"
-#~ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where "
-#~ "kitten.mother = cat.id\"\n"
-#~ " )\n"
-#~ " .setResultSetMapping(\"catAndKitten\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "List cats = sess.createSQLQuery(\n"
-#~ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where "
-#~ "kitten.mother = cat.id\"\n"
-#~ " )\n"
-#~ " .setResultSetMapping(\"catAndKitten\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"mySqlQuery\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\">\n"
-#~ " <return-property name=\"name\" column=\"myName\"/>\n"
-#~ " <return-property name=\"age\" column=\"myAge\"/>\n"
-#~ " <return-property name=\"sex\" column=\"mySex\"/>\n"
-#~ " </return>\n"
-#~ " SELECT person.NAME AS myName,\n"
-#~ " person.AGE AS myAge,\n"
-#~ " person.SEX AS mySex,\n"
-#~ " FROM PERSON person WHERE person.NAME LIKE :name\n"
-#~ "</sql-query>\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"mySqlQuery\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\">\n"
-#~ " <return-property name=\"name\" column=\"myName\"/>\n"
-#~ " <return-property name=\"age\" column=\"myAge\"/>\n"
-#~ " <return-property name=\"sex\" column=\"mySex\"/>\n"
-#~ " </return>\n"
-#~ " SELECT person.NAME AS myName,\n"
-#~ " person.AGE AS myAge,\n"
-#~ " person.SEX AS mySex,\n"
-#~ " FROM PERSON person WHERE person.NAME LIKE :name\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"organizationCurrentEmployments\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
-#~ " </return>\n"
-#~ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
-#~ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
-#~ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT\n"
-#~ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
-#~ " ORDER BY STARTDATE ASC\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"organizationCurrentEmployments\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
-#~ " </return>\n"
-#~ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
-#~ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
-#~ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT\n"
-#~ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
-#~ " ORDER BY STARTDATE ASC\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[CREATE OR REPLACE FUNCTION selectAllEmployments\n"
-#~ " RETURN SYS_REFCURSOR\n"
-#~ "AS\n"
-#~ " st_cursor SYS_REFCURSOR;\n"
-#~ "BEGIN\n"
-#~ " OPEN st_cursor FOR\n"
-#~ " SELECT EMPLOYEE, EMPLOYER,\n"
-#~ " STARTDATE, ENDDATE,\n"
-#~ " REGIONCODE, EID, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT;\n"
-#~ " RETURN st_cursor;\n"
-#~ " END;]]>"
-#~ msgstr ""
-#~ "CREATE OR REPLACE FUNCTION selectAllEmployments\n"
-#~ " RETURN SYS_REFCURSOR\n"
-#~ "AS\n"
-#~ " st_cursor SYS_REFCURSOR;\n"
-#~ "BEGIN\n"
-#~ " OPEN st_cursor FOR\n"
-#~ " SELECT EMPLOYEE, EMPLOYER,\n"
-#~ " STARTDATE, ENDDATE,\n"
-#~ " REGIONCODE, EID, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT;\n"
-#~ " RETURN st_cursor;\n"
-#~ " END;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
-#~ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
-#~ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
-#~ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
-#~ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
-#~ " <return-property name=\"id\" column=\"EID\"/>\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " </return>\n"
-#~ " { ? = call selectAllEmployments() }\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
-#~ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
-#~ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
-#~ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
-#~ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/"
-#~ ">\n"
-#~ " <return-property name=\"id\" column=\"EID\"/>\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " </return>\n"
-#~ " { ? = call selectAllEmployments() }\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<class name=\"Person\">\n"
#~ " <id name=\"id\">\n"
#~ " <generator class=\"increment\"/>\n"
#~ " </id>\n"
#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</sql-"
-#~ "insert>\n"
-#~ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-update>\n"
-#~ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
-#~ "</sql-insert>\n"
-#~ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
-#~ "update>\n"
-#~ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
#~ " <sql-insert callable=\"true\">{call createPerson (?, ?)}</sql-"
#~ "insert>\n"
#~ " <sql-delete callable=\"true\">{? = call deletePerson (?)}</sql-"
@@ -1493,126 +2293,3 @@
#~ " <sql-update callable=\"true\">{? = call updatePerson (?, ?)}"
#~ "</sql-update>\n"
#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN "
-#~ "VARCHAR2)\n"
-#~ " RETURN NUMBER IS\n"
-#~ "BEGIN\n"
-#~ "\n"
-#~ " update PERSON\n"
-#~ " set\n"
-#~ " NAME = uname,\n"
-#~ " where\n"
-#~ " ID = uid;\n"
-#~ "\n"
-#~ " return SQL%ROWCOUNT;\n"
-#~ "\n"
-#~ "END updatePerson;]]>"
-#~ msgstr ""
-#~ "CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN "
-#~ "VARCHAR2)\n"
-#~ " RETURN NUMBER IS\n"
-#~ "BEGIN\n"
-#~ "\n"
-#~ " update PERSON\n"
-#~ " set\n"
-#~ " NAME = uname,\n"
-#~ " where\n"
-#~ " ID = uid;\n"
-#~ "\n"
-#~ " return SQL%ROWCOUNT;\n"
-#~ "\n"
-#~ "END updatePerson;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
-#~ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
-#~ " FROM PERSON\n"
-#~ " WHERE ID=?\n"
-#~ " FOR UPDATE\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/"
-#~ ">\n"
-#~ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
-#~ " FROM PERSON\n"
-#~ " WHERE ID=?\n"
-#~ " FOR UPDATE\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <loader query-ref=\"person\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <loader query-ref=\"person\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"employments\" inverse=\"true\">\n"
-#~ " <key/>\n"
-#~ " <one-to-many class=\"Employment\"/>\n"
-#~ " <loader query-ref=\"employments\"/>\n"
-#~ "</set>]]>"
-#~ msgstr ""
-#~ "<set name=\"employments\" inverse=\"true\">\n"
-#~ " <key/>\n"
-#~ " <one-to-many class=\"Employment\"/>\n"
-#~ " <loader query-ref=\"employments\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"employments\">\n"
-#~ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
-#~ " SELECT {emp.*}\n"
-#~ " FROM EMPLOYMENT emp\n"
-#~ " WHERE EMPLOYER = :id\n"
-#~ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"employments\">\n"
-#~ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
-#~ " SELECT {emp.*}\n"
-#~ " FROM EMPLOYMENT emp\n"
-#~ " WHERE EMPLOYER = :id\n"
-#~ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\"/>\n"
-#~ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
-#~ " SELECT NAME AS {pers.*}, {emp.*}\n"
-#~ " FROM PERSON pers\n"
-#~ " LEFT OUTER JOIN EMPLOYMENT emp\n"
-#~ " ON pers.ID = emp.PERSON_ID\n"
-#~ " WHERE ID=?\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\"/>\n"
-#~ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
-#~ " SELECT NAME AS {pers.*}, {emp.*}\n"
-#~ " FROM PERSON pers\n"
-#~ " LEFT OUTER JOIN EMPLOYMENT emp\n"
-#~ " ON pers.ID = emp.PERSON_ID\n"
-#~ " WHERE ID=?\n"
-#~ "</sql-query>"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/session_api.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/session_api.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/session_api.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:48\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-07 14:56+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,11 +14,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "オブジェクトを扱う"
#. Tag: para
+#: session_api.xml:33
#, no-c-format
msgid ""
"Hibernate is a full object/relational mapping solution that not only shields "
@@ -35,6 +37,7 @@
"における永続化に対する、とても自然なオブジェクト指向の考え方を提供します。"
#. Tag: para
+#: session_api.xml:40
#, no-c-format
msgid ""
"In other words, Hibernate application developers should always think about "
@@ -49,16 +52,19 @@
"ムのパフォーマンスをチューニングするときにだけ、問題になってきます。"
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "Hibernate におけるオブジェクトの状態"
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr "Hibernate は次のようなオブジェクトの状態を定義し、サポートしています:"
#. Tag: para
+#: session_api.xml:53
#, no-c-format
msgid ""
"<emphasis>Transient</emphasis> - an object is transient if it has just been "
@@ -81,6 +87,7 @@
"なる SQL 文の発行は、 Hibernate に任せましょう)。"
#. Tag: para
+#: session_api.xml:65
#, no-c-format
msgid ""
"<emphasis>Persistent</emphasis> - a persistent instance has a representation "
@@ -102,6 +109,7 @@
"ません。"
#. Tag: para
+#: session_api.xml:77
#, no-c-format
msgid ""
"<emphasis>Detached</emphasis> - a detached instance is an object that has "
@@ -126,6 +134,7 @@
"ち、ユーザーから見た作業単位だということです。"
#. Tag: para
+#: session_api.xml:90
#, no-c-format
msgid ""
"We will now discuss the states and state transitions (and the Hibernate "
@@ -135,11 +144,13 @@
"について、詳細に述べます。"
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "オブジェクトを永続状態にする"
#. Tag: para
+#: session_api.xml:97
#, fuzzy, no-c-format
msgid ""
"Newly instantiated instances of a persistent class are considered "
@@ -151,7 +162,24 @@
"づけることで、 transient インスタンスを <emphasis>永続状態 (persistent)</"
"emphasis> にできます。"
+#. Tag: programlisting
+#: session_api.xml:102
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+
#. Tag: para
+#: session_api.xml:104
#, no-c-format
msgid ""
"If <literal>Cat</literal> has a generated identifier, the identifier is "
@@ -173,6 +201,7 @@
"も可能です。"
#. Tag: para
+#: session_api.xml:115
#, no-c-format
msgid ""
"<literal>persist()</literal> makes a transient instance persistent. However, "
@@ -185,6 +214,7 @@
msgstr ""
#. Tag: para
+#: session_api.xml:126
#, no-c-format
msgid ""
"<literal>save()</literal> does guarantee to return an identifier. If an "
@@ -195,6 +225,7 @@
msgstr ""
#. Tag: para
+#: session_api.xml:135
#, fuzzy, no-c-format
msgid ""
"Alternatively, you can assign the identifier using an overloaded version of "
@@ -203,7 +234,28 @@
"代わりに、識別子を引数にとる <literal>save()</literal> メソッドを使って、識別"
"子を割り当てることもできます。"
+#. Tag: programlisting
+#: session_api.xml:138
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+msgstr ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+
#. Tag: para
+#: session_api.xml:140
#, no-c-format
msgid ""
"If the object you make persistent has associated objects (e.g. the "
@@ -223,6 +275,7 @@
"ん。"
#. Tag: para
+#: session_api.xml:148
#, no-c-format
msgid ""
"Usually you do not bother with this detail, as you will normally use "
@@ -238,11 +291,13 @@
"章の後半に書かれています。"
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr "オブジェクトのロード"
#. Tag: para
+#: session_api.xml:159
#, no-c-format
msgid ""
"The <literal>load()</literal> methods of <literal>Session</literal> provide "
@@ -256,13 +311,47 @@
"そのクラスのインスタンスを新たに生成し、状態をロードします。そのインスタンス"
"の状態は、永続 (persistent) 状態です。"
+#. Tag: programlisting
+#: session_api.xml:165
+#, fuzzy, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, fuzzy, no-c-format
+msgid ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr ""
"あるいは、以下のように、既存のインスタンスに状態をロードすることもできます:"
+#. Tag: programlisting
+#: session_api.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+msgstr ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+
#. Tag: para
+#: session_api.xml:173
#, no-c-format
msgid ""
"Be aware that <literal>load()</literal> will throw an unrecoverable "
@@ -283,6 +372,7 @@
"定義されているならば、複数のインスタンスを一括でロードすることが可能です。"
#. Tag: para
+#: session_api.xml:182
#, no-c-format
msgid ""
"If you are not certain that a matching row exists, you should use the "
@@ -293,7 +383,26 @@
"ソッドを使うべきです。それは、データベースにすぐにアクセスし、該当する行が無"
"い場合は null を返します。"
+#. Tag: programlisting
+#: session_api.xml:186
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+msgstr ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+
#. Tag: para
+#: session_api.xml:188
#, no-c-format
msgid ""
"You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</"
@@ -304,7 +413,14 @@
"literal> という SQL を使ってオブジェクトをロードすることができます。詳細な情"
"報は、 API ドキュメントを参照してください。"
+#. Tag: programlisting
+#: session_api.xml:192
+#, fuzzy, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+
#. Tag: para
+#: session_api.xml:194
#, no-c-format
msgid ""
"Any associated instances or contained collections will <emphasis>not</"
@@ -318,6 +434,7 @@
"しましょう。"
#. Tag: para
+#: session_api.xml:199
#, no-c-format
msgid ""
"It is possible to re-load an object and all its collections at any time, "
@@ -329,13 +446,26 @@
"ブルを更新した際に、そのテーブルに対応するオブジェクトのプロパティを同期する"
"場合、このメソッドが役に立ちます。"
+#. Tag: programlisting
+#: session_api.xml:204
+#, fuzzy, no-c-format
+msgid ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+
#. Tag: para
+#: session_api.xml:206
#, fuzzy, no-c-format
msgid ""
"How much does Hibernate load from the database and how many SQL "
"<literal>SELECT</literal>s will it use? This depends on the "
"<emphasis>fetching strategy</emphasis>. This is explained in <xref linkend="
-"\"performance-fetching\" />."
+"\"performance-fetching\"/>."
msgstr ""
"大切な問題は、いつも次の点に関するものです。それは、 Hibernate がデータベース"
"から、どのくらいの量を復元するのかと、どのくらいの数の SQL の "
@@ -344,11 +474,13 @@
"fetching\"/> で説明しています。"
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "クエリ"
#. Tag: para
+#: session_api.xml:215
#, no-c-format
msgid ""
"If you do not know the identifiers of the objects you are looking for, you "
@@ -366,11 +498,13 @@
"データベースのネイティブな SQL でクエリを表現することもできます。"
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "クエリの実行"
#. Tag: para
+#: session_api.xml:226
#, no-c-format
msgid ""
"HQL and native SQL queries are represented with an instance of <literal>org."
@@ -385,7 +519,62 @@
"常、 <literal>Query</literal> は、以下に示すように、その時点の "
"<literal>Session</literal> を使って取得します。"
+#. Tag: programlisting
+#: session_api.xml:232
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+
#. Tag: para
+#: session_api.xml:234
#, no-c-format
msgid ""
"A query is usually executed by invoking <literal>list()</literal>. The "
@@ -407,11 +596,13 @@
"複は <literal>Set</literal> を使って取り除くことができます。"
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "結果をイテレートする"
#. Tag: para
+#: session_api.xml:246
#, no-c-format
msgid ""
"Occasionally, you might be able to achieve better performance by executing "
@@ -434,12 +625,46 @@
"と、実際のインスタンスを初期化するために後から行う <emphasis>n回</emphasis> "
"の select のことです。"
+#. Tag: programlisting
+#: session_api.xml:257
+#, fuzzy, no-c-format
+msgid ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+msgstr ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "オブジェクトの組(tuple)を返すクエリ"
#. Tag: para
+#: session_api.xml:263
#, no-c-format
msgid ""
"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
@@ -448,12 +673,44 @@
"Hibernate のクエリでは、時々、オブジェクトの組を返すことがあります。その場合"
"は、各タプルは配列として返されます:"
+#. Tag: programlisting
+#: session_api.xml:266
+#, fuzzy, no-c-format
+msgid ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}"
+msgstr ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = tuple[0];\n"
+" Cat mother = tuple[1];\n"
+" ....\n"
+"}"
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "スカラーの結果"
#. Tag: para
+#: session_api.xml:272
#, no-c-format
msgid ""
"Queries can specify a property of a class in the <literal>select</literal> "
@@ -464,12 +721,48 @@
"す。 SQL の集合関数を呼ぶこともできます。プロパティや集合関数は、(永続状態の"
"エンティティではなく)「スカラー値」であると見なされます。"
+#. Tag: programlisting
+#: session_api.xml:277
+#, fuzzy, no-c-format
+msgid ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+msgstr ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "パラメータのバインド"
#. Tag: para
+#: session_api.xml:283
#, no-c-format
msgid ""
"Methods on <literal>Query</literal> are provided for binding values to named "
@@ -486,27 +779,84 @@
"です。"
#. Tag: para
+#: session_api.xml:292
#, no-c-format
msgid ""
"named parameters are insensitive to the order they occur in the query string"
msgstr "名前付きパラメータは、クエリ文字列に登場する順番と無関係です"
#. Tag: para
+#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "同じクエリ内に複数回登場することができます"
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "自分自身を説明します"
+#. Tag: programlisting
+#: session_api.xml:305
+#, fuzzy, no-c-format
+msgid ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, fuzzy, no-c-format
+msgid ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, fuzzy, no-c-format
+msgid ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+msgstr ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "ページ分け"
#. Tag: para
+#: session_api.xml:315
#, no-c-format
msgid ""
"If you need to specify bounds upon your result set, that is, the maximum "
@@ -517,7 +867,22 @@
"ば、以下のように、 <literal>Query</literal> インターフェースのメソッドを使い"
"ます。"
+#. Tag: programlisting
+#: session_api.xml:320
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+msgstr ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
msgid ""
"Hibernate knows how to translate this limit query into the native SQL of "
@@ -527,11 +892,13 @@
"知っています。"
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr "スクロール可能なイテレーション"
#. Tag: para
+#: session_api.xml:329
#, no-c-format
msgid ""
"If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the "
@@ -544,7 +911,60 @@
"<literal>ScrollableResults</literal> オブジェクトを取得できます。それを使う"
"と、クエリの結果に対して柔軟にナビゲーションできます。"
+#. Tag: programlisting
+#: session_api.xml:334
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+msgstr ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+
#. Tag: para
+#: session_api.xml:336
#, no-c-format
msgid ""
"Note that an open database connection and cursor is required for this "
@@ -557,28 +977,116 @@
"いましょう。"
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "名前付きクエリの外出し"
#. Tag: para
+#: session_api.xml:345
#, no-c-format
msgid ""
-"You can also define named queries in the mapping document. Remember to use a "
-"<literal>CDATA</literal> section if your query contains characters that "
-"could be interpreted as markup."
+"Queries can also be configured as so called named queries using annotations "
+"or Hibernate mapping documents. <literal>@NamedQuery</literal> and "
+"<literal>@NamedQueries</literal> can be defined at the class level as seen "
+"in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: session_api.xml:361
+#, fuzzy, no-c-format
+msgid ""
+"Using a mapping document can be configured using the <literal><query></"
+"literal> node. Remember to use a <literal>CDATA</literal> section if your "
+"query contains characters that could be interpreted as markup."
+msgstr ""
"マッピングドキュメントに名前付きのクエリを定義することができます。(マーク"
"アップと解釈される文字がクエリに含まれるなら、 <literal>CDATA</literal> セク"
"ションを使うことを忘れないようにしましょう。)"
-#. Tag: para
+#. Tag: title
+#: session_api.xml:367
#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+msgid "Defining a named query using <literal><query></literal>"
msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, fuzzy, no-c-format
+msgid ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+msgstr ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+
+#. Tag: para
+#: session_api.xml:373
+#, fuzzy, no-c-format
+msgid ""
+"Parameter binding and executing is done programatically as seen in <xref "
+"linkend=\"example-parameter-binding-named-query\"/>."
+msgstr ""
"パラメータのバインディングと実行は、以下のようなプログラムで行われます:"
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+msgstr ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+
#. Tag: para
+#: session_api.xml:382
#, no-c-format
msgid ""
"The actual program code is independent of the query language that is used. "
@@ -591,6 +1099,7 @@
"ます。"
#. Tag: para
+#: session_api.xml:387
#, no-c-format
msgid ""
"Also note that a query declaration inside a <literal><hibernate-"
@@ -606,11 +1115,13 @@
"ByNameAndMaximumWeight</literal>"
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "フィルタリングコレクション"
#. Tag: para
+#: session_api.xml:399
#, no-c-format
msgid ""
"A collection <emphasis>filter</emphasis> is a special type of query that can "
@@ -621,7 +1132,26 @@
"配列に適用される特殊なタイプのクエリです。そのクエリ文字列では、コレクション"
"のその時点での要素を意味する <literal>this</literal> を使います。"
+#. Tag: programlisting
+#: session_api.xml:404
+#, fuzzy, no-c-format
+msgid ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+msgstr ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+
#. Tag: para
+#: session_api.xml:406
#, no-c-format
msgid ""
"The returned collection is considered a bag that is a copy of the given "
@@ -633,6 +1163,7 @@
"う名前の意味とは異なりますが、期待される動きとは一致しています)。"
#. Tag: para
+#: session_api.xml:411
#, no-c-format
msgid ""
"Observe that filters do not require a <literal>from</literal> clause, "
@@ -643,7 +1174,22 @@
"なら、持つことも可能ですが)。フィルタは、コレクションの要素自体を返して構い"
"ません。"
+#. Tag: programlisting
+#: session_api.xml:415
+#, fuzzy, no-c-format
+msgid ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+msgstr ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+
#. Tag: para
+#: session_api.xml:417
#, no-c-format
msgid ""
"Even an empty filter query is useful, e.g. to load a subset of elements in a "
@@ -652,12 +1198,28 @@
"クエリを含まないフィルタも役に立ちます。例えば、非常に大きなコレクションの部"
"分集合をロードするために使えます。"
+#. Tag: programlisting
+#: session_api.xml:420
+#, fuzzy, no-c-format
+msgid ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+msgstr ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr "クライテリアのクエリ"
#. Tag: para
+#: session_api.xml:426
#, no-c-format
msgid ""
"HQL is extremely powerful, but some developers prefer to build queries "
@@ -670,22 +1232,39 @@
"Hibernate は直感的な <literal>Criteria</literal> クエリ API を提供していま"
"す。"
+#. Tag: programlisting
+#: session_api.xml:431
+#, fuzzy, no-c-format
+msgid ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+msgstr ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Expression.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+
#. Tag: para
+#: session_api.xml:433
#, fuzzy, no-c-format
msgid ""
"The <literal>Criteria</literal> and the associated <literal>Example</"
-"literal> API are discussed in more detail in <xref linkend=\"querycriteria"
-"\" />."
+"literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"
+">."
msgstr ""
"<literal>Criteria</literal> と <literal>Example</literal> API の詳細は、 "
"<xref linkend=\"querycriteria\"/> に述べられています。"
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "ネイティブ SQL のクエリ"
#. Tag: para
+#: session_api.xml:441
#, no-c-format
msgid ""
"You can express a query in SQL, using <literal>createSQLQuery()</literal> "
@@ -701,23 +1280,62 @@
"う。もし、 Hibernate API を使うのであれば、下記のように SQL の別名を括弧でく"
"くらなければなりません。"
+#. Tag: programlisting
+#: session_api.xml:448
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE "
+"ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();"
+msgstr ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10\",\n"
+" \"cat\",\n"
+" Cat.class\n"
+").list();"
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()"
+msgstr ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\",\n"
+" \"cat\",\n"
+" Cat.class\n"
+").list()"
+
#. Tag: para
+#: session_api.xml:452
#, fuzzy, no-c-format
msgid ""
"SQL queries can contain named and positional parameters, just like Hibernate "
"queries. More information about native SQL queries in Hibernate can be found "
-"in <xref linkend=\"querysql\" />."
+"in <xref linkend=\"querysql\"/>."
msgstr ""
"SQL クエリは、 Hibernate クエリと同じように、名前付きのパラメータと位置パラ"
"メータを持つことができます。 Hibernate におけるネイティブな SQL クエリの詳細"
"については、 <xref linkend=\"querysql\"/> を参照してください。"
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr "永続オブジェクトの修正"
#. Tag: para
+#: session_api.xml:461
#, no-c-format
msgid ""
"<emphasis>Transactional persistent instances</emphasis> (i.e. objects "
@@ -740,7 +1358,20 @@
"クトを <literal>load()</literal> し、 <literal>Session</literal> をオープンに"
"している間に、直接操作することです。"
+#. Tag: programlisting
+#: session_api.xml:473
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+
#. Tag: para
+#: session_api.xml:475
#, no-c-format
msgid ""
"Sometimes this programming model is inefficient, as it requires in the same "
@@ -755,6 +1386,7 @@
"スタンスを使用する方法です。"
#. Tag: para
+#: session_api.xml:481
#, fuzzy, no-c-format
msgid ""
"Hibernate does not offer its own API for direct execution of "
@@ -766,7 +1398,7 @@
"the notion of mass operations conflicts with object/relational mapping for "
"online transaction processing-oriented applications. Future versions of "
"Hibernate can, however, provide special mass operation functions. See <xref "
-"linkend=\"batch\" /> for some possible batch operation tricks."
+"linkend=\"batch\"/> for some possible batch operation tricks."
msgstr ""
"Hibernate は、 <literal>UPDATE</literal> 文や <literal>DELETE</literal> 文を"
"直接実行する API を用意していません。 Hibernate は、 <emphasis>ステートマネー"
@@ -781,11 +1413,13 @@
"参照してください。"
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr "detached オブジェクトの修正"
#. Tag: para
+#: session_api.xml:499
#, no-c-format
msgid ""
"Many applications need to retrieve an object in one transaction, send it to "
@@ -801,6 +1435,7 @@
"離性を保証するために、バージョンデータが通常使われます。"
#. Tag: para
+#: session_api.xml:505
#, no-c-format
msgid ""
"Hibernate supports this model by providing for reattachment of detached "
@@ -811,7 +1446,36 @@
"()</literal> メソッドを使って、 detached インスタンスを再追加することで、この"
"モデルに対応します。"
+#. Tag: programlisting
+#: session_api.xml:509
+#, fuzzy, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+msgstr ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
msgid ""
"If the <literal>Cat</literal> with identifier <literal>catId</literal> had "
@@ -823,6 +1487,7 @@
"ときに、例外が投げられます。"
#. Tag: para
+#: session_api.xml:516
#, no-c-format
msgid ""
"Use <literal>update()</literal> if you are certain that the session does not "
@@ -841,13 +1506,14 @@
"のなかで最初に呼ばれるメソッドになります。"
#. Tag: para
+#: session_api.xml:524
#, fuzzy, no-c-format
msgid ""
"The application should individually <literal>update()</literal> detached "
"instances that are reachable from the given detached instance "
"<emphasis>only</emphasis> if it wants their state to be updated. This can be "
"automated using <emphasis>transitive persistence</emphasis>. See <xref "
-"linkend=\"objectstate-transitive\" /> for more information."
+"linkend=\"objectstate-transitive\"/> for more information."
msgstr ""
"detached インスタンスから到達可能な、 detached インスタンスをアプリケーション"
"は個別に <literal>update()</literal> すべきです。それは、その状態を更新したい"
@@ -856,6 +1522,7 @@
"を参照してください。"
#. Tag: para
+#: session_api.xml:530
#, no-c-format
msgid ""
"The <literal>lock()</literal> method also allows an application to "
@@ -866,7 +1533,26 @@
"再関連付けできます。しかし、 detached インスタンスは無修正でなければなりませ"
"ん。"
+#. Tag: programlisting
+#: session_api.xml:534
+#, fuzzy, no-c-format
+msgid ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+
#. Tag: para
+#: session_api.xml:536
#, no-c-format
msgid ""
"Note that <literal>lock()</literal> can be used with various "
@@ -880,20 +1566,23 @@
"はありません。"
#. Tag: para
+#: session_api.xml:541
#, fuzzy, no-c-format
msgid ""
"Other models for long units of work are discussed in <xref linkend="
-"\"transactions-optimistic\" />."
+"\"transactions-optimistic\"/>."
msgstr ""
"期間の長い作業単位の、その他のモデルは、 <xref linkend=\"transactions-"
"optimistic\"/> で述べています。"
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr "自動的な状態検出"
#. Tag: para
+#: session_api.xml:548
#, no-c-format
msgid ""
"Hibernate users have requested a general purpose method that either saves a "
@@ -907,7 +1596,38 @@
"することのできるメソッドです。 <literal>saveOrUpdate()</literal> はこのような"
"機能を実現したメソッドです。"
+#. Tag: programlisting
+#: session_api.xml:554
+#, fuzzy, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+msgstr ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
msgid ""
"The usage and semantics of <literal>saveOrUpdate()</literal> seems to be "
@@ -925,6 +1645,7 @@
"もあります。"
#. Tag: para
+#: session_api.xml:563
#, no-c-format
msgid ""
"Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are "
@@ -934,26 +1655,31 @@
"のシナリオで使われます:"
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr "アプリケーションが最初のセッションでオブジェクトをロードします。"
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr "オブジェクトが UI 層に送られます。"
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr "オブジェクトに対して変更が加えられます。"
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr "オブジェクトがビジネスロジック層に送られます。"
#. Tag: para
+#: session_api.xml:585
#, no-c-format
msgid ""
"the application persists these modifications by calling <literal>update()</"
@@ -963,17 +1689,20 @@
"とで、これらの変更を永続化します。"
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr "<literal>saveOrUpdate()</literal> は以下のことを行います:"
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr ""
"オブジェクトがこのセッションで、すでに永続化されていれば、何もしません。"
#. Tag: para
+#: session_api.xml:599
#, no-c-format
msgid ""
"if another object associated with the session has the same identifier, throw "
@@ -983,12 +1712,14 @@
"例外を投げます。"
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
msgstr ""
"オブジェクトの識別子が値を持たないならば、 <literal>save()</literal> します。"
#. Tag: para
+#: session_api.xml:609
#, no-c-format
msgid ""
"if the object's identifier has the value assigned to a newly instantiated "
@@ -998,6 +1729,7 @@
"トのための値である場合、そのオブジェクトを <literal>save()</literal> します。"
#. Tag: para
+#: session_api.xml:614
#, no-c-format
msgid ""
"if the object is versioned by a <literal><version></literal> or "
@@ -1011,17 +1743,20 @@
"ある場合、そのオブジェクトを <literal>save()</literal> します。"
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
msgstr ""
"そうでない場合は、そのオブジェクトを <literal>update()</literal> します。"
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr "そして、 <literal>merge()</literal> は以下のように非常に異なります:"
#. Tag: para
+#: session_api.xml:630
#, no-c-format
msgid ""
"if there is a persistent instance with the same identifier currently "
@@ -1032,6 +1767,7 @@
"ば、引数で受け取ったオブジェクトの状態を永続化インスタンスにコピーします。"
#. Tag: para
+#: session_api.xml:636
#, no-c-format
msgid ""
"if there is no persistent instance currently associated with the session, "
@@ -1041,11 +1777,13 @@
"からそれをロードするか、あるいは、新しい永続化インスタンスを作成します。"
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr "永続化インスタンスが返されます。"
#. Tag: para
+#: session_api.xml:646
#, no-c-format
msgid ""
"the given instance does not become associated with the session, it remains "
@@ -1055,11 +1793,13 @@
"のままです。"
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr "永続オブジェクトの削除"
#. Tag: para
+#: session_api.xml:655
#, no-c-format
msgid ""
"<literal>Session.delete()</literal> will remove an object's state from the "
@@ -1072,7 +1812,14 @@
"よいです。そのため、 <literal>delete()</literal> は永続インスタンスを "
"transient にするものと考えるのが一番です。"
+#. Tag: programlisting
+#: session_api.xml:660
+#, fuzzy, no-c-format
+msgid "sess.delete(cat);"
+msgstr "sess.delete(cat);"
+
#. Tag: para
+#: session_api.xml:662
#, no-c-format
msgid ""
"You can delete objects in any order, without risk of foreign key constraint "
@@ -1086,11 +1833,13 @@
"ジェクトを削除したときに、子供オブジェクトを削除し忘れた場合です。"
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "異なる二つのデータストア間でのオブジェクトのレプリケーション"
#. Tag: para
+#: session_api.xml:672
#, no-c-format
msgid ""
"It is sometimes useful to be able to take a graph of persistent instances "
@@ -1100,7 +1849,40 @@
"永続インスタンスのグラフを別のデータストアに永続化する場合に、識別子の値を再"
"生成せずにすむと便利な場合があります。"
+#. Tag: programlisting
+#: session_api.xml:676
+#, fuzzy, no-c-format
+msgid ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+msgstr ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+
#. Tag: para
+#: session_api.xml:678
#, no-c-format
msgid ""
"The <literal>ReplicationMode</literal> determines how <literal>replicate()</"
@@ -1111,6 +1893,7 @@
"します。"
#. Tag: para
+#: session_api.xml:684
#, no-c-format
msgid ""
"<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is "
@@ -1120,6 +1903,7 @@
"に存在するなら、そのオブジェクトを無視します。"
#. Tag: para
+#: session_api.xml:689
#, no-c-format
msgid ""
"<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing "
@@ -1129,6 +1913,7 @@
"て上書きします。"
#. Tag: para
+#: session_api.xml:694
#, no-c-format
msgid ""
"<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there "
@@ -1138,6 +1923,7 @@
"スに存在するなら、例外を投げます。"
#. Tag: para
+#: session_api.xml:700
#, no-c-format
msgid ""
"<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its "
@@ -1149,6 +1935,7 @@
"きします。"
#. Tag: para
+#: session_api.xml:706
#, no-c-format
msgid ""
"Usecases for this feature include reconciling data entered into different "
@@ -1161,11 +1948,13 @@
"ンザクションのなかで加えられた変更のロールバックなどです。"
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr "セッションのフラッシュ"
#. Tag: para
+#: session_api.xml:715
#, no-c-format
msgid ""
"Sometimes the <literal>Session</literal> will execute the SQL statements "
@@ -1178,26 +1967,31 @@
"処理 <emphasis>flush</emphasis> は、デフォルトでは次のときに起こります。"
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr "クエリを実行する前"
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr "<literal>org.hibernate.Transaction.commit()</literal> を実行したとき"
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr "<literal>Session.flush()</literal> を実行したとき"
#. Tag: para
+#: session_api.xml:736
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "SQL 文は以下の順番で発行されます。"
#. Tag: para
+#: session_api.xml:740
#, no-c-format
msgid ""
"all entity insertions in the same order the corresponding objects were saved "
@@ -1207,26 +2001,31 @@
"てセーブしたオブジェクトの順に実行していきます。"
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr "すべてのエンティティの更新"
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr "すべてのコレクションの削除"
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr "すべてのコレクションの要素に対する削除、更新、挿入"
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr "すべてのコレクションの挿入"
#. Tag: para
+#: session_api.xml:761
#, no-c-format
msgid ""
"all entity deletions in the same order the corresponding objects were "
@@ -1236,6 +2035,7 @@
"使って削除したオブジェクトの順に実行していきます。"
#. Tag: para
+#: session_api.xml:766
#, no-c-format
msgid ""
"An exception is that objects using <literal>native</literal> ID generation "
@@ -1245,6 +2045,7 @@
"は、それらがセーブされたときに挿入されます。)"
#. Tag: para
+#: session_api.xml:769
#, no-c-format
msgid ""
"Except when you explicitly <literal>flush()</literal>, there are absolutely "
@@ -1260,6 +2061,7 @@
"データや間違ったデータ返さないことを保証しています。"
#. Tag: para
+#: session_api.xml:776
#, fuzzy, no-c-format
msgid ""
"It is possible to change the default behavior so that flush occurs less "
@@ -1269,7 +2071,7 @@
"never flush unless <literal>flush()</literal> is called explicitly. The last "
"mode is useful for long running units of work, where a <literal>Session</"
"literal> is kept open and disconnected for a long time (see <xref linkend="
-"\"transactions-optimistic-longsession\" />)."
+"\"transactions-optimistic-longsession\"/>)."
msgstr ""
"フラッシュが頻繁に起こらないようにデフォルトの振る舞いを変えることができま"
"す。 <literal>FlushMode</literal> クラスは3つの異なるモードを定義します。それ"
@@ -1280,13 +2082,48 @@
"役に立ちます ( <xref linkend=\"transactions-optimistic-longsession\"/> を参照"
"してください)。"
+#. Tag: programlisting
+#: session_api.xml:786
+#, fuzzy, no-c-format
+msgid ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+msgstr ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+
#. Tag: para
+#: session_api.xml:788
#, fuzzy, no-c-format
msgid ""
"During flush, an exception might occur (e.g. if a DML operation violates a "
"constraint). Since handling exceptions involves some understanding of "
"Hibernate's transactional behavior, we discuss it in <xref linkend="
-"\"transactions\" />."
+"\"transactions\"/>."
msgstr ""
"フラッシュのとき、例外が発生するかもしれません(例えば、 DML 操作が制約を違反"
"するような場合です)。例外処理を理解するためには、 Hibernate のトランザクショ"
@@ -1294,11 +2131,13 @@
"明します。"
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr "連鎖的な永続化"
#. Tag: para
+#: session_api.xml:797
#, no-c-format
msgid ""
"It is quite cumbersome to save, delete, or reattach individual objects, "
@@ -1310,6 +2149,7 @@
"は、親子関係を扱うケースです。以下の例を考えてみましょう:"
#. Tag: para
+#: session_api.xml:802
#, no-c-format
msgid ""
"If the children in a parent/child relationship would be value typed (e.g. a "
@@ -1330,6 +2170,7 @@
"を共有できないので、データベースからその子供を削除します。"
#. Tag: para
+#: session_api.xml:812
#, no-c-format
msgid ""
"Now consider the same scenario with parent and child objects being entities, "
@@ -1349,6 +2190,7 @@
"よる永続化</emphasis> をデフォルトでは実行しません。"
#. Tag: para
+#: session_api.xml:820
#, no-c-format
msgid ""
"For each basic operation of the Hibernate session - including "
@@ -1367,12 +2209,26 @@
"沿ってカスケードさせたい操作があるなら、マッピングファイルにそう指定しなけれ"
"ばなりません。例えば、以下のようにします:"
+#. Tag: programlisting
+#: session_api.xml:828
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr "<one-to-one name=\"person\" cascade=\"persist\"/>"
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr "カスケードスタイルは、組み合わせることができます:"
+#. Tag: programlisting
+#: session_api.xml:832
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+
#. Tag: para
+#: session_api.xml:834
#, no-c-format
msgid ""
"You can even use <literal>cascade=\"all\"</literal> to specify that "
@@ -1386,29 +2242,133 @@
"します。"
#. Tag: para
+#: session_api.xml:839
#, no-c-format
msgid ""
+"In case you are using annotatons you probably have noticed the "
+"<literal>cascade</literal> attribute taking an array of "
+"<classname>CascadeType</classname> as a value. The cascade concept in JPA is "
+"very is similar to the transitive persistence and cascading of operations as "
+"described above, but with slightly different semantics and cascading types:"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:848
+#, no-c-format
+msgid ""
+"<literal>CascadeType.PERSIST</literal>: cascades the persist (create) "
+"operation to associated entities persist() is called or if the entity is "
+"managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:854
+#, no-c-format
+msgid ""
+"<literal>CascadeType.MERGE</literal>: cascades the merge operation to "
+"associated entities if merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:860
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REMOVE</literal>: cascades the remove operation to "
+"associated entities if delete() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:865
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to "
+"associated entities if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:870
+#, no-c-format
+msgid ""
+"<literal>CascadeType.DETACH:</literal> cascades the detach operation to "
+"associated entities if detach() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:875
+#, fuzzy, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr "<literal>saveOrUpdate()</literal> は以下のことを行います:"
+
+#. Tag: para
+#: session_api.xml:880
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc..."
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:884
+#, no-c-format
+msgid ""
"A special cascade style, <literal>delete-orphan</literal>, applies only to "
"one-to-many associations, and indicates that the <literal>delete()</literal> "
"operation should be applied to any child object that is removed from the "
-"association."
+"association. Using annotations there is no <literal>CascadeType.DELETE-"
+"ORPHAN</literal> equivalent. Instead you can use the attribute "
+"<literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-"
+"many-with-orphan-removal\"/>. If an entity is removed from a "
+"<classname>@OneToMany</classname> collection or an associated entity is "
+"dereferenced from a <classname>@OneToOne</classname> association, this "
+"associated entity can be marked for deletion if <literal>orphanRemoval</"
+"literal> is set to true."
msgstr ""
-"特殊なカスケードスタイル <literal>delete-orphan</literal> は、一対多関連にだ"
-"け適用できます。これは、関連から削除された子供のオブジェクトに対して、 "
-"<literal>delete()</literal> 操作が適用されることを意味します。"
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+"@Entity \n"
+"public class Customer {\n"
+" private Set<Order> orders;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+" public Set<Order> getOrders() { return orders; }\n"
+"\n"
+" public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+"\n"
+" [...]\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Order { ... }\n"
+"\n"
+"Customer customer = em.find(Customer.class, 1l);\n"
+"Order order = em.find(Order.class, 1l);\n"
+"customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:903
#, no-c-format
msgid "Recommendations:"
msgstr "おすすめ:"
#. Tag: para
-#, no-c-format
+#: session_api.xml:907
+#, fuzzy, no-c-format
msgid ""
-"It does not usually make sense to enable cascade on a <literal><many-to-"
-"one></literal> or <literal><many-to-many></literal> association. "
-"Cascade is often useful for <literal><one-to-one></literal> and "
-"<literal><one-to-many></literal> associations."
+"It does not usually make sense to enable cascade on a many-to-one or many-to-"
+"many association. In fact the <literal>@ManyToOne</literal> and "
+"<literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</"
+"literal> attribute. Cascading is often useful for one-to-one and one-to-many "
+"associations."
msgstr ""
"普通、 <literal><many-to-one></literal> や <literal><many-to-"
"many></literal> 関連に対しては、カスケードを設定する意味はありません。 "
@@ -1416,17 +2376,20 @@
"literal> 関連に対しては、カスケードが役に立つことがあります。"
#. Tag: para
-#, no-c-format
+#: session_api.xml:915
+#, fuzzy, no-c-format
msgid ""
"If the child object's lifespan is bounded by the lifespan of the parent "
"object, make it a <emphasis>life cycle object</emphasis> by specifying "
-"<literal>cascade=\"all,delete-orphan\"</literal>."
+"<literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany"
+"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
msgstr ""
"子供オブジェクトの寿命が親オブジェクトの寿命に制限を受けるならば、 "
"<literal>cascade=\"all,delete-orphan\"</literal> を指定し、子供オブジェクト"
"を <emphasis>ライフサイクルオブジェクト</emphasis> にします。"
#. Tag: para
+#: session_api.xml:923
#, no-c-format
msgid ""
"Otherwise, you might not need cascade at all. But if you think that you will "
@@ -1440,6 +2403,7 @@
"literal> を使うことを考えましょう。"
#. Tag: para
+#: session_api.xml:931
#, no-c-format
msgid ""
"Mapping an association (either a single valued association, or a collection) "
@@ -1452,15 +2416,16 @@
"のセーブ/更新/削除が、子のセーブ/更新/削除を引き起こす関係のことです。"
#. Tag: para
-#, no-c-format
+#: session_api.xml:937
+#, fuzzy, no-c-format
msgid ""
"Furthermore, a mere reference to a child from a persistent parent will "
"result in save/update of the child. This metaphor is incomplete, however. A "
"child which becomes unreferenced by its parent is <emphasis>not</emphasis> "
-"automatically deleted, except in the case of a <literal><one-to-many></"
-"literal> association mapped with <literal>cascade=\"delete-orphan\"</"
-"literal>. The precise semantics of cascading operations for a parent/child "
-"relationship are as follows:"
+"automatically deleted, except in the case of a one-to-many association "
+"mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise "
+"semantics of cascading operations for a parent/child relationship are as "
+"follows:"
msgstr ""
"さらに、永続化された親が子を単に参照しているだけで、子のセーブ/更新を引き起こ"
"します。しかし、このメタファーは不完全です。親から参照されなくなった子は、自"
@@ -1470,6 +2435,7 @@
"なります:"
#. Tag: para
+#: session_api.xml:948
#, no-c-format
msgid ""
"If a parent is passed to <literal>persist()</literal>, all children are "
@@ -1479,6 +2445,7 @@
"<literal>persist()</literal> に渡されます。"
#. Tag: para
+#: session_api.xml:953
#, no-c-format
msgid ""
"If a parent is passed to <literal>merge()</literal>, all children are passed "
@@ -1488,6 +2455,7 @@
"literal> に渡されます。"
#. Tag: para
+#: session_api.xml:958
#, no-c-format
msgid ""
"If a parent is passed to <literal>save()</literal>, <literal>update()</"
@@ -1499,6 +2467,7 @@
"<literal>saveOrUpdate()</literal> に渡されます。"
#. Tag: para
+#: session_api.xml:964
#, no-c-format
msgid ""
"If a transient or detached child becomes referenced by a persistent parent, "
@@ -1508,6 +2477,7 @@
"<literal>saveOrUpdate()</literal> に渡されます。"
#. Tag: para
+#: session_api.xml:970
#, no-c-format
msgid ""
"If a parent is deleted, all children are passed to <literal>delete()</"
@@ -1517,6 +2487,7 @@
"す。"
#. Tag: para
+#: session_api.xml:975
#, no-c-format
msgid ""
"If a child is dereferenced by a persistent parent, <emphasis>nothing special "
@@ -1530,6 +2501,7 @@
"きます。この場合、「親のない」子は削除されます。"
#. Tag: para
+#: session_api.xml:983
#, no-c-format
msgid ""
"Finally, note that cascading of operations can be applied to an object graph "
@@ -1548,11 +2520,13 @@
"エンティティに伝播します。"
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr "メタデータの使用"
#. Tag: para
+#: session_api.xml:995
#, no-c-format
msgid ""
"Hibernate requires a rich meta-level model of all entity and value types. "
@@ -1571,6 +2545,7 @@
"るものです。"
#. Tag: para
+#: session_api.xml:1002
#, no-c-format
msgid ""
"Hibernate exposes metadata via the <literal>ClassMetadata</literal> and "
@@ -1583,650 +2558,48 @@
"literal> 階層を通してメタデータを公開します。メタデータインターフェースのイン"
"スタンスは、 <literal>SessionFactory</literal> から得られます。"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[DomesticCat fritz = new DomesticCat();\n"
-#~ "fritz.setColor(Color.GINGER);\n"
-#~ "fritz.setSex('M');\n"
-#~ "fritz.setName(\"Fritz\");\n"
-#~ "Long generatedId = (Long) sess.save(fritz);]]>"
-#~ msgstr ""
-#~ "DomesticCat fritz = new DomesticCat();\n"
-#~ "fritz.setColor(Color.GINGER);\n"
-#~ "fritz.setSex('M');\n"
-#~ "fritz.setName(\"Fritz\");\n"
-#~ "Long generatedId = (Long) sess.save(fritz);"
+#. Tag: programlisting
+#: session_api.xml:1007
+#, fuzzy, no-c-format
+msgid ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
+msgstr ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[DomesticCat pk = new DomesticCat();\n"
-#~ "pk.setColor(Color.TABBY);\n"
-#~ "pk.setSex('F');\n"
-#~ "pk.setName(\"PK\");\n"
-#~ "pk.setKittens( new HashSet() );\n"
-#~ "pk.addKitten(fritz);\n"
-#~ "sess.save( pk, new Long(1234) );]]>"
+#~ "A special cascade style, <literal>delete-orphan</literal>, applies only "
+#~ "to one-to-many associations, and indicates that the <literal>delete()</"
+#~ "literal> operation should be applied to any child object that is removed "
+#~ "from the association."
#~ msgstr ""
-#~ "DomesticCat pk = new DomesticCat();\n"
-#~ "pk.setColor(Color.TABBY);\n"
-#~ "pk.setSex('F');\n"
-#~ "pk.setName(\"PK\");\n"
-#~ "pk.setKittens( new HashSet() );\n"
-#~ "pk.addKitten(fritz);\n"
-#~ "sess.save( pk, new Long(1234) );"
-
-#, fuzzy
-#~ msgid "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"
-#~ msgstr "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// you need to wrap primitive identifiers\n"
-#~ "long id = 1234;\n"
-#~ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
-#~ "(id) );]]>"
-#~ msgstr ""
-#~ "// you need to wrap primitive identifiers\n"
-#~ "long id = 1234;\n"
-#~ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
-#~ "(id) );"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "// load pk's state into cat\n"
-#~ "sess.load( cat, new Long(pkId) );\n"
-#~ "Set kittens = cat.getKittens();]]>"
-#~ msgstr ""
-#~ "Cat cat = new DomesticCat();\n"
-#~ "// load pk's state into cat\n"
-#~ "sess.load( cat, new Long(pkId) );\n"
-#~ "Set kittens = cat.getKittens();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id);\n"
-#~ "if (cat==null) {\n"
-#~ " cat = new Cat();\n"
-#~ " sess.save(cat, id);\n"
-#~ "}\n"
-#~ "return cat;]]>"
-#~ msgstr ""
-#~ "Cat cat = (Cat) sess.get(Cat.class, id);\n"
-#~ "if (cat==null) {\n"
-#~ " cat = new Cat();\n"
-#~ " sess.save(cat, id);\n"
-#~ "}\n"
-#~ "return cat;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);]]>"
-#~ msgstr "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.save(cat);\n"
-#~ "sess.flush(); //force the SQL INSERT\n"
-#~ "sess.refresh(cat); //re-read the state (after the trigger executes)]]>"
-#~ msgstr ""
-#~ "sess.save(cat);\n"
-#~ "sess.flush(); //force the SQL INSERT\n"
-#~ "sess.refresh(cat); //re-read the state (after the trigger executes)"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.birthdate < ?\")\n"
-#~ " .setDate(0, date)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List mothers = session.createQuery(\n"
-#~ " \"select mother from Cat as cat join cat.mother as mother where cat."
-#~ "name = ?\")\n"
-#~ " .setString(0, name)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List kittens = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.mother = ?\")\n"
-#~ " .setEntity(0, pk)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "Cat mother = (Cat) session.createQuery(\n"
-#~ " \"select cat.mother from Cat as cat where cat = ?\")\n"
-#~ " .setEntity(0, izi)\n"
-#~ " .uniqueResult();]]\n"
-#~ "\n"
-#~ "Query mothersWithKittens = (Cat) session.createQuery(\n"
-#~ " \"select mother from Cat as mother left join fetch mother.kittens"
-#~ "\");\n"
-#~ "Set uniqueMothers = new HashSet(mothersWithKittens.list());]]>"
-#~ msgstr ""
-#~ "List cats = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.birthdate < ?\")\n"
-#~ " .setDate(0, date)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List mothers = session.createQuery(\n"
-#~ " \"select mother from Cat as cat join cat.mother as mother where cat."
-#~ "name = ?\")\n"
-#~ " .setString(0, name)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List kittens = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.mother = ?\")\n"
-#~ " .setEntity(0, pk)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "Cat mother = (Cat) session.createQuery(\n"
-#~ " \"select cat.mother from Cat as cat where cat = ?\")\n"
-#~ " .setEntity(0, izi)\n"
-#~ " .uniqueResult();]]\n"
-#~ "\n"
-#~ "Query mothersWithKittens = (Cat) session.createQuery(\n"
-#~ " \"select mother from Cat as mother left join fetch mother.kittens"
-#~ "\");\n"
-#~ "Set uniqueMothers = new HashSet(mothersWithKittens.list());"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// fetch ids\n"
-#~ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
-#~ "iterate();\n"
-#~ "while ( iter.hasNext() ) {\n"
-#~ " Qux qux = (Qux) iter.next(); // fetch the object\n"
-#~ " // something we couldnt express in the query\n"
-#~ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
-#~ " // delete the current instance\n"
-#~ " iter.remove();\n"
-#~ " // dont need to process the rest\n"
-#~ " break;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "// fetch ids\n"
-#~ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
-#~ "iterate();\n"
-#~ "while ( iter.hasNext() ) {\n"
-#~ " Qux qux = (Qux) iter.next(); // fetch the object\n"
-#~ " // something we couldnt express in the query\n"
-#~ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
-#~ " // delete the current instance\n"
-#~ " iter.remove();\n"
-#~ " // dont need to process the rest\n"
-#~ " break;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Iterator kittensAndMothers = sess.createQuery(\n"
-#~ " \"select kitten, mother from Cat kitten join kitten.mother "
-#~ "mother\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( kittensAndMothers.hasNext() ) {\n"
-#~ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
-#~ " Cat kitten = (Cat) tuple[0];\n"
-#~ " Cat mother = (Cat) tuple[1];\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Iterator kittensAndMothers = sess.createQuery(\n"
-#~ " \"select kitten, mother from Cat kitten join kitten.mother "
-#~ "mother\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( kittensAndMothers.hasNext() ) {\n"
-#~ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
-#~ " Cat kitten = tuple[0];\n"
-#~ " Cat mother = tuple[1];\n"
-#~ " ....\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Iterator results = sess.createQuery(\n"
-#~ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat "
-#~ "\" +\n"
-#~ " \"group by cat.color\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( results.hasNext() ) {\n"
-#~ " Object[] row = (Object[]) results.next();\n"
-#~ " Color type = (Color) row[0];\n"
-#~ " Date oldest = (Date) row[1];\n"
-#~ " Integer count = (Integer) row[2];\n"
-#~ " .....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Iterator results = sess.createQuery(\n"
-#~ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat "
-#~ "\" +\n"
-#~ " \"group by cat.color\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( results.hasNext() ) {\n"
-#~ " Object[] row = (Object[]) results.next();\n"
-#~ " Color type = (Color) row[0];\n"
-#~ " Date oldest = (Date) row[1];\n"
-#~ " Integer count = (Integer) row[2];\n"
-#~ " .....\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//named parameter (preferred)\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
-#~ "\");\n"
-#~ "q.setString(\"name\", \"Fritz\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgstr ""
-#~ "//named parameter (preferred)\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
-#~ "\");\n"
-#~ "q.setString(\"name\", \"Fritz\");\n"
-#~ "Iterator cats = q.iterate();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//positional parameter\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
-#~ "q.setString(0, \"Izi\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgstr ""
-#~ "//positional parameter\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
-#~ "q.setString(0, \"Izi\");\n"
-#~ "Iterator cats = q.iterate();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//named parameter list\n"
-#~ "List names = new ArrayList();\n"
-#~ "names.add(\"Izi\");\n"
-#~ "names.add(\"Fritz\");\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
-#~ "namesList)\");\n"
-#~ "q.setParameterList(\"namesList\", names);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "//named parameter list\n"
-#~ "List names = new ArrayList();\n"
-#~ "names.add(\"Izi\");\n"
-#~ "names.add(\"Fritz\");\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
-#~ "namesList)\");\n"
-#~ "q.setParameterList(\"namesList\", names);\n"
-#~ "List cats = q.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.createQuery(\"from DomesticCat cat\");\n"
-#~ "q.setFirstResult(20);\n"
-#~ "q.setMaxResults(10);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "Query q = sess.createQuery(\"from DomesticCat cat\");\n"
-#~ "q.setFirstResult(20);\n"
-#~ "q.setMaxResults(10);\n"
-#~ "List cats = q.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.createQuery(\"select cat.name, cat from "
-#~ "DomesticCat cat \" +\n"
-#~ " \"order by cat.name\");\n"
-#~ "ScrollableResults cats = q.scroll();\n"
-#~ "if ( cats.first() ) {\n"
-#~ "\n"
-#~ " // find the first name on each page of an alphabetical list of cats "
-#~ "by name\n"
-#~ " firstNamesOfPages = new ArrayList();\n"
-#~ " do {\n"
-#~ " String name = cats.getString(0);\n"
-#~ " firstNamesOfPages.add(name);\n"
-#~ " }\n"
-#~ " while ( cats.scroll(PAGE_SIZE) );\n"
-#~ "\n"
-#~ " // Now get the first page of cats\n"
-#~ " pageOfCats = new ArrayList();\n"
-#~ " cats.beforeFirst();\n"
-#~ " int i=0;\n"
-#~ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add( cats.get"
-#~ "(1) );\n"
-#~ "\n"
-#~ "}\n"
-#~ "cats.close()]]>"
-#~ msgstr ""
-#~ "Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" "
-#~ "+\n"
-#~ " \"order by cat.name\");\n"
-#~ "ScrollableResults cats = q.scroll();\n"
-#~ "if ( cats.first() ) {\n"
-#~ "\n"
-#~ " // find the first name on each page of an alphabetical list of cats "
-#~ "by name\n"
-#~ " firstNamesOfPages = new ArrayList();\n"
-#~ " do {\n"
-#~ " String name = cats.getString(0);\n"
-#~ " firstNamesOfPages.add(name);\n"
-#~ " }\n"
-#~ " while ( cats.scroll(PAGE_SIZE) );\n"
-#~ "\n"
-#~ " // Now get the first page of cats\n"
-#~ " pageOfCats = new ArrayList();\n"
-#~ " cats.beforeFirst();\n"
-#~ " int i=0;\n"
-#~ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
-#~ "( cats.get(1) );\n"
-#~ "\n"
-#~ "}\n"
-#~ "cats.close()"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
-#~ " from eg.DomesticCat as cat\n"
-#~ " where cat.name = ?\n"
-#~ " and cat.weight > ?\n"
-#~ "] ]></query>]]>"
-#~ msgstr ""
-#~ "<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
-#~ " from eg.DomesticCat as cat\n"
-#~ " where cat.name = ?\n"
-#~ " and cat.weight > ?\n"
-#~ "] ]></query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
-#~ "q.setString(0, name);\n"
-#~ "q.setInt(1, minWeight);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
-#~ "q.setString(0, name);\n"
-#~ "q.setInt(1, minWeight);\n"
-#~ "List cats = q.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Collection blackKittens = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"where this.color = ?\")\n"
-#~ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
-#~ " .list()\n"
-#~ ");]]>"
-#~ msgstr ""
-#~ "Collection blackKittens = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"where this.color = ?\")\n"
-#~ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
-#~ " .list()\n"
-#~ ");"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Collection blackKittenMates = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "Collection blackKittenMates = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Collection tenKittens = session.createFilter(\n"
-#~ " mother.getKittens(), \"\")\n"
-#~ " .setFirstResult(0).setMaxResults(10)\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "Collection tenKittens = session.createFilter(\n"
-#~ " mother.getKittens(), \"\")\n"
-#~ " .setFirstResult(0).setMaxResults(10)\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Criteria crit = session.createCriteria(Cat.class);\n"
-#~ "crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
-#~ "crit.setMaxResults(10);\n"
-#~ "List cats = crit.list();]]>"
-#~ msgstr ""
-#~ "Criteria crit = session.createCriteria(Cat.class);\n"
-#~ "crit.add( Expression.eq( \"color\", eg.Color.BLACK ) );\n"
-#~ "crit.setMaxResults(10);\n"
-#~ "List cats = crit.list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT "
-#~ "{cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list();]]>"
-#~ msgstr ""
-#~ "List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10\",\n"
-#~ " \"cat\",\n"
-#~ " Cat.class\n"
-#~ ").list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
-#~ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... "
-#~ "\" +\n"
-#~ " \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list()]]>"
-#~ msgstr ""
-#~ "List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
-#~ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... "
-#~ "\" +\n"
-#~ " \"FROM CAT {cat} WHERE ROWNUM<10\",\n"
-#~ " \"cat\",\n"
-#~ " Cat.class\n"
-#~ ").list()"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long"
-#~ "(69) );\n"
-#~ "cat.setName(\"PK\");\n"
-#~ "sess.flush(); // changes to cat are automatically detected and "
-#~ "persisted]]>"
-#~ msgstr ""
-#~ "DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
-#~ "cat.setName(\"PK\");\n"
-#~ "sess.flush(); // changes to cat are automatically detected and persisted"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
-#~ "Cat potentialMate = new Cat();\n"
-#~ "firstSession.save(potentialMate);\n"
-#~ "\n"
-#~ "// in a higher layer of the application\n"
-#~ "cat.setMate(potentialMate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.update(cat); // update cat\n"
-#~ "secondSession.update(mate); // update mate]]>"
-#~ msgstr ""
-#~ "// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
-#~ "Cat potentialMate = new Cat();\n"
-#~ "firstSession.save(potentialMate);\n"
-#~ "\n"
-#~ "// in a higher layer of the application\n"
-#~ "cat.setMate(potentialMate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.update(cat); // update cat\n"
-#~ "secondSession.update(mate); // update mate"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//just reassociate:\n"
-#~ "sess.lock(fritz, LockMode.NONE);\n"
-#~ "//do a version check, then reassociate:\n"
-#~ "sess.lock(izi, LockMode.READ);\n"
-#~ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
-#~ "sess.lock(pk, LockMode.UPGRADE);]]>"
-#~ msgstr ""
-#~ "//just reassociate:\n"
-#~ "sess.lock(fritz, LockMode.NONE);\n"
-#~ "//do a version check, then reassociate:\n"
-#~ "sess.lock(izi, LockMode.READ);\n"
-#~ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
-#~ "sess.lock(pk, LockMode.UPGRADE);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
-#~ "\n"
-#~ "// in a higher tier of the application\n"
-#~ "Cat mate = new Cat();\n"
-#~ "cat.setMate(mate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.saveOrUpdate(cat); // update existing state (cat has a "
-#~ "non-null id)\n"
-#~ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a "
-#~ "null id)]]>"
-#~ msgstr ""
-#~ "// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
-#~ "\n"
-#~ "// in a higher tier of the application\n"
-#~ "Cat mate = new Cat();\n"
-#~ "cat.setMate(mate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.saveOrUpdate(cat); // update existing state (cat has a "
-#~ "non-null id)\n"
-#~ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a "
-#~ "null id)"
-
-#, fuzzy
-#~ msgid "<![CDATA[sess.delete(cat);]]>"
-#~ msgstr "sess.delete(cat);"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[//retrieve a cat from one database\n"
-#~ "Session session1 = factory1.openSession();\n"
-#~ "Transaction tx1 = session1.beginTransaction();\n"
-#~ "Cat cat = session1.get(Cat.class, catId);\n"
-#~ "tx1.commit();\n"
-#~ "session1.close();\n"
-#~ "\n"
-#~ "//reconcile with a second database\n"
-#~ "Session session2 = factory2.openSession();\n"
-#~ "Transaction tx2 = session2.beginTransaction();\n"
-#~ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
-#~ "tx2.commit();\n"
-#~ "session2.close();]]>"
-#~ msgstr ""
-#~ "//retrieve a cat from one database\n"
-#~ "Session session1 = factory1.openSession();\n"
-#~ "Transaction tx1 = session1.beginTransaction();\n"
-#~ "Cat cat = session1.get(Cat.class, catId);\n"
-#~ "tx1.commit();\n"
-#~ "session1.close();\n"
-#~ "\n"
-#~ "//reconcile with a second database\n"
-#~ "Session session2 = factory2.openSession();\n"
-#~ "Transaction tx2 = session2.beginTransaction();\n"
-#~ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
-#~ "tx2.commit();\n"
-#~ "session2.close();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess = sf.openSession();\n"
-#~ "Transaction tx = sess.beginTransaction();\n"
-#~ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale "
-#~ "state\n"
-#~ "\n"
-#~ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
-#~ "izi.setName(iznizi);\n"
-#~ "\n"
-#~ "// might return stale data\n"
-#~ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
-#~ "\n"
-#~ "// change to izi is not flushed!\n"
-#~ "...\n"
-#~ "tx.commit(); // flush occurs\n"
-#~ "sess.close();]]>"
-#~ msgstr ""
-#~ "sess = sf.openSession();\n"
-#~ "Transaction tx = sess.beginTransaction();\n"
-#~ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale "
-#~ "state\n"
-#~ "\n"
-#~ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
-#~ "izi.setName(iznizi);\n"
-#~ "\n"
-#~ "// might return stale data\n"
-#~ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
-#~ "\n"
-#~ "// change to izi is not flushed!\n"
-#~ "...\n"
-#~ "tx.commit(); // flush occurs\n"
-#~ "sess.close();"
-
-#, fuzzy
-#~ msgid "<![CDATA[<one-to-one name=\"person\" cascade=\"persist\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" cascade=\"persist\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[Cat fritz = ......;\n"
-#~ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
-#~ "\n"
-#~ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
-#~ "String[] propertyNames = catMeta.getPropertyNames();\n"
-#~ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
-#~ "\n"
-#~ "// get a Map of all properties which are not collections or associations\n"
-#~ "Map namedValues = new HashMap();\n"
-#~ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
-#~ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
-#~ "isCollectionType() ) {\n"
-#~ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "Cat fritz = ......;\n"
-#~ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
-#~ "\n"
-#~ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
-#~ "String[] propertyNames = catMeta.getPropertyNames();\n"
-#~ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
-#~ "\n"
-#~ "// get a Map of all properties which are not collections or associations\n"
-#~ "Map namedValues = new HashMap();\n"
-#~ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
-#~ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
-#~ "isCollectionType() ) {\n"
-#~ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
-#~ " }\n"
-#~ "}"
+#~ "特殊なカスケードスタイル <literal>delete-orphan</literal> は、一対多関連に"
+#~ "だけ適用できます。これは、関連から削除された子供のオブジェクトに対して、 "
+#~ "<literal>delete()</literal> 操作が適用されることを意味します。"
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/tutorial.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/tutorial.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/tutorial.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-21 16:43+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -14,11 +14,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr ""
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
msgid ""
"Intended for new users, this chapter provides an step-by-step introduction "
@@ -29,6 +31,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
msgid ""
"This tutorial expects the user have knowledge of both Java and SQL. If you "
@@ -37,6 +40,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
msgid ""
"The distribution contains another example application under the "
@@ -44,11 +48,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr "パート1 - 初めての Hibernate アプリケーション"
#. Tag: para
+#: tutorial.xml:64
#, no-c-format
msgid ""
"For this example, we will set up a small database application that can store "
@@ -59,6 +65,7 @@
"ものとします。"
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
msgid ""
"Although you can use whatever database you feel comfortable using, we will "
@@ -68,11 +75,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr ""
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
msgid ""
"The first thing we need to do is to set up the development environment. We "
@@ -86,6 +95,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
msgid ""
"We will be using Maven in this tutorial, taking advantage of its transitive "
@@ -93,11 +103,65 @@
"automatically set up a project for us based on the maven descriptor."
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:97
+#, no-c-format
+msgid ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:100
#, no-c-format
msgid ""
"It is not a requirement to use Maven. If you wish to use something else to "
-"build this tutoial (such as Ant), the layout will remain the same. The only "
+"build this tutorial (such as Ant), the layout will remain the same. The only "
"change is that you will need to manually account for all the needed "
"dependencies. If you use something like <ulink url=\"http://ant.apache.org/"
"ivy/\">Ivy</ulink> providing transitive dependency management you would "
@@ -112,24 +176,106 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:117
#, no-c-format
msgid ""
"Save this file as <filename>pom.xml</filename> in the project root directory."
msgstr ""
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr "最初のクラス"
#. Tag: para
+#: tutorial.xml:126
#, no-c-format
msgid ""
"Next, we create a class that represents the event we want to store in the "
"database; it is a simple JavaBean class with some properties:"
msgstr "次にデータベースに格納するイベントを表すクラスを作成します。"
+#. Tag: programlisting
+#: tutorial.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:133
#, fuzzy, no-c-format
msgid ""
"This class uses standard JavaBean naming conventions for property getter and "
@@ -146,6 +292,7 @@
"のインスタンスを作成するために必要です。"
#. Tag: para
+#: tutorial.xml:141
#, no-c-format
msgid ""
"The <literal>id</literal> property holds a unique identifier value for a "
@@ -174,6 +321,7 @@
"リケーションの設計に合わせることができます。"
#. Tag: para
+#: tutorial.xml:156
#, no-c-format
msgid ""
"The no-argument constructor is a requirement for all persistent classes; "
@@ -188,6 +336,7 @@
"トコード操作なしの効率的なデータの抽出には、 package 可視性が必要です。"
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
msgid ""
"Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</"
@@ -195,11 +344,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr "マッピングファイル"
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
msgid ""
"Hibernate needs to know how to load and store objects of the persistent "
@@ -213,11 +364,35 @@
"のテーブルのどのカラムを使うべきかを、 Hibernate に教えます。"
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr "マッピングファイルの基本的な構造はこのようになります:"
+#. Tag: programlisting
+#: tutorial.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping>\n"
+"[...]\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:187
#, no-c-format
msgid ""
"Hibernate DTD is sophisticated. You can use it for auto-completion of XML "
@@ -239,6 +414,7 @@
"ディレクトリと同様、<literal>hibernate3.jar</literal> にも含まれています。"
#. Tag: para
+#: tutorial.xml:200
#, no-c-format
msgid ""
"We will omit the DTD declaration in future examples to shorten the code. It "
@@ -248,6 +424,7 @@
"ションではありません。"
#. Tag: para
+#: tutorial.xml:206
#, no-c-format
msgid ""
"Between the two <literal>hibernate-mapping</literal> tags, include a "
@@ -260,7 +437,28 @@
"が、ファーストクラスのエンティティではない依存クラスというものが後ほど登場し"
"ます)は SQL データベース内のテーブルへのこのようなマッピングを必要とします。"
+#. Tag: programlisting
+#: tutorial.xml:213
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:215
#, no-c-format
msgid ""
"So far we have told Hibernate how to persist and load object of class "
@@ -278,7 +476,32 @@
"なかったのと同様に、代理の主キーカラムに対する Hibernate の識別子生成戦略を設"
"定します。"
+#. Tag: programlisting
+#: tutorial.xml:225
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
msgid ""
"The <literal>id</literal> element is the declaration of the identifier "
@@ -290,6 +513,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
msgid ""
"The nested <literal>generator</literal> element specifies the identifier "
@@ -302,14 +526,15 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:249
#, no-c-format
msgid ""
"<literal>native</literal> is no longer consider the best strategy in terms "
-"of portability. for further discussion, see <xref linkend=\"portability-idgen"
-"\" />"
+"of portability. for further discussion, see"
msgstr ""
#. Tag: para
+#: tutorial.xml:255
#, no-c-format
msgid ""
"Lastly, we need to tell Hibernate about the remaining entity class "
@@ -318,7 +543,38 @@
"最後にクラスの永続プロパティの宣言をマッピングファイルに含めます。デフォルト"
"では、クラスのプロパティは永続と見なされません:"
+#. Tag: programlisting
+#: tutorial.xml:261
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/"
+">\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:263
#, no-c-format
msgid ""
"Similar to the <literal>id</literal> element, the <literal>name</literal> "
@@ -333,6 +589,7 @@
"()</literal> と <literal>getTitle()/setTitle()</literal> を探します。"
#. Tag: para
+#: tutorial.xml:274
#, no-c-format
msgid ""
"Why does the <literal>date</literal> property mapping include the "
@@ -350,6 +607,7 @@
"ので、違う名前でマッピングした方がよいのです。"
#. Tag: para
+#: tutorial.xml:284
#, no-c-format
msgid ""
"The <literal>title</literal> mapping also lacks a <literal>type</literal> "
@@ -384,6 +642,7 @@
"ます。"
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
msgid ""
"Hibernate makes this mapping type determination using reflection when the "
@@ -393,6 +652,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
msgid ""
"Save this mapping file as <filename>src/main/resources/org/hibernate/"
@@ -400,11 +660,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr "Hibernate の設定"
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
msgid ""
"At this point, you should have the persistent class and its mapping file in "
@@ -413,11 +675,13 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:324
#, no-c-format
msgid "We do this do that the data remains between runs."
msgstr ""
#. Tag: para
+#: tutorial.xml:329
#, fuzzy, no-c-format
msgid ""
"We will utilize the Maven exec plugin to launch the HSQLDB server by "
@@ -439,6 +703,7 @@
"HSQL DB を再起動します。"
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
msgid ""
"Hibernate will be connecting to the database on behalf of your application, "
@@ -452,6 +717,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:351
#, no-c-format
msgid ""
"The built-in Hibernate connection pool is in no way intended for production "
@@ -459,6 +725,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:357
#, no-c-format
msgid ""
"For Hibernate's configuration, we can use a simple <literal>hibernate."
@@ -471,12 +738,108 @@
"ル、または完全にプログラム上でセットアップする方法が利用できます。ほとんどの"
"ユーザーが好むのは XML 設定ファイルです:"
+#. Tag: programlisting
+#: tutorial.xml:363
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+msgstr ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb."
+"jdbcDriver</property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://"
+"localhost</property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"HSQLDialect</property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management --"
+">\n"
+" <property name=\"current_session_context_class\">thread</"
+"property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">create</property>\n"
+"\n"
+" <mapping resource=\"events/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr "この XML の設定が異なる DTD を使うことに注意してください。"
#. Tag: para
+#: tutorial.xml:369
#, no-c-format
msgid ""
"You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory "
@@ -491,6 +854,7 @@
"い。"
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
msgid ""
"The first four <literal>property</literal> elements contain the necessary "
@@ -502,13 +866,15 @@
"Hibernate が生成する特定の SQL 方言を指定します。"
#. Tag: para
+#: tutorial.xml:383
#, no-c-format
msgid ""
"In most cases, Hibernate is able to properly determine which dialect to use. "
-"See <xref linkend=\"portability-dialectresolver\" /> for more information."
+"See <xref linkend=\"portability-dialectresolver\"/> for more information."
msgstr ""
#. Tag: para
+#: tutorial.xml:389
#, no-c-format
msgid ""
"Hibernate's automatic session management for persistence contexts is "
@@ -528,6 +894,7 @@
"加します。"
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
msgid ""
"Save this file as <filename>hibernate.cfg.xml</filename> into the "
@@ -535,11 +902,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:406
#, no-c-format
msgid "Building with Maven"
msgstr "Maven によるビルド"
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
msgid ""
"We will now build the tutorial with Maven. You will need to have Maven "
@@ -550,12 +919,43 @@
"make sure we can compile everything so far:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+"<![CDATA[[hibernateTutorial]$ mvn compile\n"
+"[INFO] Scanning for projects...\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Building First Hibernate Tutorial\n"
+"[INFO] task-segment: [compile]\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] [resources:resources]\n"
+"[INFO] Using default encoding to copy filtered resources.\n"
+"[INFO] [compiler:compile]\n"
+"[INFO] Compiling 1 source file to /home/steve/projects/sandbox/"
+"hibernateTutorial/target/classes\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] BUILD SUCCESSFUL\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Total time: 2 seconds\n"
+"[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+"[INFO] Final Memory: 5M/547M\n"
+"[INFO] "
+"------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr "スタートアップとヘルパ"
#. Tag: para
+#: tutorial.xml:425
#, no-c-format
msgid ""
"It is time to load and store some <literal>Event</literal> objects, but "
@@ -582,6 +982,7 @@
"セーフのグローバルオブジェクトであり、一度だけインスタンス化されます。"
#. Tag: para
+#: tutorial.xml:439
#, no-c-format
msgid ""
"We will create a <literal>HibernateUtil</literal> helper class that takes "
@@ -592,7 +993,69 @@
"SessionFactory</interfacename> へアクセスする <literal>HibernateUtil</"
"literal> ヘルパクラスを作成します。実装を見てみましょう:"
+#. Tag: programlisting
+#: tutorial.xml:445
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.util;\n"
+"\n"
+"import org.hibernate.SessionFactory;\n"
+"import org.hibernate.cfg.Configuration;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory = buildSessionFactory"
+"();\n"
+"\n"
+" private static SessionFactory buildSessionFactory() {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" return new Configuration().configure().buildSessionFactory();\n"
+" }\n"
+" catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"package util;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" sessionFactory = new Configuration().configure()."
+"buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
msgid ""
"Save this code as <filename>src/main/java/org/hibernate/tutorial/util/"
@@ -600,6 +1063,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:452
#, fuzzy, no-c-format
msgid ""
"This class not only produces the global <interfacename>org.hibernate."
@@ -616,6 +1080,7 @@
"SessionFactory</interfacename> をルックアップするのと同様です。"
#. Tag: para
+#: tutorial.xml:461
#, fuzzy, no-c-format
msgid ""
"If you give the <interfacename>org.hibernate.SessionFactory</interfacename> "
@@ -634,6 +1099,7 @@
"ントで説明されています。"
#. Tag: para
+#: tutorial.xml:470
#, fuzzy, no-c-format
msgid ""
"You now need to configure a logging system. Hibernate uses commons logging "
@@ -655,6 +1121,7 @@
"ルトでは Hibernate のスタートアップメッセージだけが標準出力に表示されます。"
#. Tag: para
+#: tutorial.xml:480
#, no-c-format
msgid ""
"The tutorial infrastructure is complete and you are now ready to do some "
@@ -664,14 +1131,16 @@
"整いました。"
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr "オブジェクトのロードと格納"
#. Tag: para
-#, no-c-format
+#: tutorial.xml:490
+#, fuzzy, no-c-format
msgid ""
-"We are now ready to start doing some real worjk with Hibernate. Let's start "
+"We are now ready to start doing some real work with Hibernate. Let's start "
"by writing an <literal>EventManager</literal> class with a <literal>main()</"
"literal> method:"
msgstr ""
@@ -679,7 +1148,85 @@
"<literal>main()</literal> メソッドを持つ <literal>EventManager</literal> クラ"
"スを書きます:"
+#. Tag: programlisting
+#: tutorial.xml:496
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial;\n"
+"\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.*;\n"
+"\n"
+"import org.hibernate.tutorial.domain.Event;\n"
+"import org.hibernate.tutorial.util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"import util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+"\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:498
#, fuzzy, no-c-format
msgid ""
"In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</"
@@ -693,10 +1240,11 @@
"literal> を処理するコードを確認してください。"
#. Tag: para
+#: tutorial.xml:505
#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> is designed to represent a "
-"single unit of work (a single atmoic piece of work to be performed). For now "
+"single unit of work (a single atomic piece of work to be performed). For now "
"we will keep things simple and assume a one-to-one granularity between a "
"Hibernate <interface>org.hibernate.Session</interface> and a database "
"transaction. To shield our code from the actual underlying transaction "
@@ -713,6 +1261,7 @@
"用します。"
#. Tag: para
+#: tutorial.xml:518
#, fuzzy, no-c-format
msgid ""
"What does <literal>sessionFactory.getCurrentSession()</literal> do? First, "
@@ -736,6 +1285,7 @@
"はスコープも考慮する必要があります。"
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
msgid ""
"Hibernate offers three methods of current session tracking. The \"thread\" "
@@ -745,6 +1295,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:541
#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> begins when the first call to "
@@ -769,6 +1320,7 @@
"クセスコードとは区別されます)。"
#. Tag: para
+#: tutorial.xml:554
#, no-c-format
msgid ""
"Related to the unit of work scope, should the Hibernate <interface>org."
@@ -797,9 +1349,10 @@
"トリアルで後に見ることができます。"
#. Tag: para
+#: tutorial.xml:571
#, fuzzy, no-c-format
msgid ""
-"See <xref linkend=\"transactions\" /> for more information about transaction "
+"See <xref linkend=\"transactions\"/> for more information about transaction "
"handling and demarcation. The previous example also skipped any error "
"handling and rollback."
msgstr ""
@@ -808,6 +1361,7 @@
"ます。"
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
msgid ""
"To run this, we will make use of the Maven exec plugin to call our class "
@@ -816,11 +1370,13 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
msgstr ""
#. Tag: para
+#: tutorial.xml:589
#, no-c-format
msgid ""
"You should see Hibernate starting up and, depending on your configuration, "
@@ -829,31 +1385,102 @@
"コンパイルすると、 Hibernate がスタートし、設定によりますが、多くのログ出力が"
"あるはずです。その最後には以下の行があるでしょう:"
+#. Tag: programlisting
+#: tutorial.xml:594
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) "
+"values (?, ?, ?)]]>"
+msgstr ""
+"[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values "
+"(?, ?, ?)"
+
#. Tag: para
+#: tutorial.xml:596
#, fuzzy, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr "HQL の <literal>INSERT</literal> 文の実行例です:"
#. Tag: para
+#: tutorial.xml:600
#, fuzzy, no-c-format
msgid "To list stored events an option is added to the main method:"
msgstr ""
"それでは同じように格納されたイベントの一覧を見ようと思います。そのためメイン"
"メソッドにオプションを追加します:"
+#. Tag: programlisting
+#: tutorial.xml:604
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+" else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\n"
+" \"Event: \" + theEvent.getTitle() + \" Time: \" + "
+"theEvent.getDate()\n"
+" );\n"
+" }\n"
+" }]]>"
+msgstr ""
+"if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+"}\n"
+"else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\"Event: \" + theEvent.getTitle() +\n"
+" \" Time: \" + theEvent.getDate());\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:606
#, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr "新しい <literal>listEvents()メソッド</literal> も追加します。"
+#. Tag: programlisting
+#: tutorial.xml:610
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private List listEvents() {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+" session.getTransaction().commit();\n"
+" return result;\n"
+" }]]>"
+msgstr ""
+"private List listEvents() {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+"\n"
+" session.beginTransaction();\n"
+"\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" return result;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:612
#, fuzzy, no-c-format
msgid ""
"Here, we are using a Hibernate Query Language (HQL) query to load all "
"existing <literal>Event</literal> objects from the database. Hibernate will "
"generate the appropriate SQL, send it to the database and populate "
"<literal>Event</literal> objects with the data. You can create more complex "
-"queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
+"queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
msgstr ""
"ここですることは、データベースから存在するすべての <literal>Event</literal> "
"オブジェクトをロードする HQL (Hibernate Query Language) クエリを使うことで"
@@ -862,6 +1489,7 @@
"雑なクエリを作成できます。"
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
msgid ""
"Now we can call our new functionality, again using the Maven exec plugin: "
@@ -870,11 +1498,13 @@
msgstr ""
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr "パート2 - 関連のマッピング"
#. Tag: para
+#: tutorial.xml:632
#, no-c-format
msgid ""
"So far we have mapped a single persistent entity class to a table in "
@@ -887,16 +1517,53 @@
"らが参加するイベントのリストを格納します。"
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr "Person クラスのマッピング"
#. Tag: para
+#: tutorial.xml:642
#, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
msgstr "最初の <literal>Person</literal> クラスは単純です:"
+#. Tag: programlisting
+#: tutorial.xml:646
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
msgid ""
"Save this to a file named <filename>src/main/java/org/hibernate/tutorial/"
@@ -904,18 +1571,61 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
msgid ""
"Next, create the new mapping file as <filename>src/main/resources/org/"
"hibernate/tutorial/domain/Person.hbm.xml</filename>"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:658
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr "最後に Hibernate の設定に新しいマッピングを追加してください:"
+#. Tag: programlisting
+#: tutorial.xml:664
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+"<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>"
+
#. Tag: para
+#: tutorial.xml:666
#, no-c-format
msgid ""
"Create an association between these two entities. Persons can participate in "
@@ -927,11 +1637,13 @@
"方向、多重度、コレクションの振る舞いです。"
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr "単方向 Set ベース関連"
#. Tag: para
+#: tutorial.xml:678
#, fuzzy, no-c-format
msgid ""
"By adding a collection of events to the <literal>Person</literal> class, you "
@@ -949,7 +1661,38 @@
"interfacename> を使います。コレクションは重複要素を持たないし、順番は私たちに"
"は意味がないからです。"
+#. Tag: programlisting
+#: tutorial.xml:689
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}]]>"
+msgstr ""
+"public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:691
#, fuzzy, no-c-format
msgid ""
"Before mapping this association, let's consider the other side. We could "
@@ -972,7 +1715,42 @@
"にする、 <emphasis>多対多</emphasis> と呼ばれる関連です。そのため Hibernate "
"の多対多マッピングを使います:"
+#. Tag: programlisting
+#: tutorial.xml:704
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>]]>"
+msgstr ""
+"<class name=\"events.Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"events.Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>"
+
#. Tag: para
+#: tutorial.xml:706
#, no-c-format
msgid ""
"Hibernate supports a broad range of collection mappings, a <literal>set</"
@@ -998,16 +1776,49 @@
"(正確には、参照のコレクションの反対側のクラス)を教えなければなりません。"
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr "そのためこのマッピングのデータベーススキーマは以下のようになります:"
+#. Tag: programlisting
+#: tutorial.xml:726
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+"_____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|"
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr "関連を働かせる"
#. Tag: para
+#: tutorial.xml:733
#, no-c-format
msgid ""
"Now we will bring some people and events together in a new method in "
@@ -1016,7 +1827,38 @@
"<literal>EventManager</literal> の新しいメソッドで人々とイベントを一緒にしま"
"しょう:"
+#. Tag: programlisting
+#: tutorial.xml:737
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addPersonToEvent(Long personId, Long eventId) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:739
#, fuzzy, no-c-format
msgid ""
"After loading a <literal>Person</literal> and an <literal>Event</literal>, "
@@ -1050,6 +1892,7 @@
"スに対して <literal>thread</literal> を設定したためです。"
#. Tag: para
+#: tutorial.xml:758
#, no-c-format
msgid ""
"You can load person and event in different units of work. Or you can modify "
@@ -1064,7 +1907,75 @@
"hibernate.Session</interfacename> の外部でオブジェクトを修正します。分離され"
"るときにはコレクションを変更することも可能です:"
+#. Tag: programlisting
+#: tutorial.xml:767
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p."
+"events where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use "
+"it detached\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory()."
+"getCurrentSession();\n"
+" session2.beginTransaction();\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addPersonToEvent(Long personId, Long eventId) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p.events "
+"where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use it "
+"detached\n"
+"\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session2.beginTransaction();\n"
+"\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:769
#, no-c-format
msgid ""
"The call to <literal>update</literal> makes a detached object persistent "
@@ -1079,6 +1990,7 @@
"ティオブジェクトのコレクションへの修正(追加・削除)も同様にセーブできます。"
#. Tag: para
+#: tutorial.xml:778
#, no-c-format
msgid ""
"This is not much use in our example, but it is an important concept you can "
@@ -1095,7 +2007,29 @@
"<literal>save()</literal> メソッドが返してくれます (場合によっては識別子を返"
"すためにメソッドを修正する必要があるかもしれません)。"
+#. Tag: programlisting
+#: tutorial.xml:786
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
+"());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" "
+"+ eventId);\n"
+" }]]>"
+msgstr ""
+"else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" + "
+"eventId);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:788
#, no-c-format
msgid ""
"This is an example of an association between two equally important classes : "
@@ -1125,6 +2059,7 @@
"な独自の依存クラスを書くこともできます。"
#. Tag: para
+#: tutorial.xml:806
#, no-c-format
msgid ""
"You can also design a collection of value types. This is conceptually "
@@ -1136,11 +2071,13 @@
"ます。"
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr "値のコレクション"
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
msgid ""
"Let's add a collection of email addresses to the <literal>Person</literal> "
@@ -1148,12 +2085,52 @@
"interfacename> of <classname>java.lang.String</classname> instances:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:823
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private Set emailAddresses = new HashSet();\n"
+"\n"
+" public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+" }\n"
+"\n"
+" public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+" }]]>"
+msgstr ""
+"private Set emailAddresses = new HashSet();\n"
+"\n"
+"public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+"}\n"
+"\n"
+"public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:825
#, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr "この <literal>Set</literal> のマッピングです:"
+#. Tag: programlisting
+#: tutorial.xml:829
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+" </set>]]>"
+msgstr ""
+"<set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+"</set>"
+
#. Tag: para
+#: tutorial.xml:831
#, no-c-format
msgid ""
"The difference compared with the earlier mapping is the use of the "
@@ -1179,11 +2156,57 @@
"値が実際に格納されるカラムの名前を定義します。"
#. Tag: para
+#: tutorial.xml:847
#, no-c-format
msgid "Here is the updated schema:"
msgstr "更新したスキーマを見てください:"
+#. Tag: programlisting
+#: tutorial.xml:851
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
+"*PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+"_____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--"
+"> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|"
+
#. Tag: para
+#: tutorial.xml:853
#, no-c-format
msgid ""
"You can see that the primary key of the collection table is in fact a "
@@ -1196,6 +2219,7 @@
"Java の set に要求されるセマンティクスそのものです。"
#. Tag: para
+#: tutorial.xml:859
#, no-c-format
msgid ""
"You can now try to add elements to this collection, just like we did before "
@@ -1204,7 +2228,40 @@
"以前人とイベントを関連づけたときと全く同じように、今や試しにコレクションに要"
"素を追加することができるようになりました。 両方とも Java では同じコードです。"
+#. Tag: programlisting
+#: tutorial.xml:864
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addEmailToPerson(Long personId, String "
+"emailAddress) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" // adding to the emailAddress collection might trigger a lazy load "
+"of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addEmailToPerson(Long personId, String emailAddress) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+"\n"
+" // The getEmailAddresses() might trigger a lazy load of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:866
#, fuzzy, no-c-format
msgid ""
"This time we did not use a <emphasis>fetch</emphasis> query to initialize "
@@ -1217,11 +2274,13 @@
"を監視して、即時フェッチを使って最適化してください。"
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr "双方向関連"
#. Tag: para
+#: tutorial.xml:877
#, no-c-format
msgid ""
"Next you will map a bi-directional association. You will make the "
@@ -1234,6 +2293,7 @@
"です。"
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
msgid ""
"A relational database is more flexible than a network programming language, "
@@ -1245,6 +2305,7 @@
"り復元できるということです。"
#. Tag: para
+#: tutorial.xml:893
#, no-c-format
msgid ""
"First, add a collection of participants to the <literal>Event</literal> "
@@ -1253,7 +2314,32 @@
"まず <literal>Event</literal> イベントクラスに参加者のコレクションを追加しま"
"す:"
+#. Tag: programlisting
+#: tutorial.xml:898
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private Set participants = new HashSet();\n"
+"\n"
+" public Set getParticipants() {\n"
+" return participants;\n"
+" }\n"
+"\n"
+" public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+" }]]>"
+msgstr ""
+"private Set participants = new HashSet();\n"
+"\n"
+"public Set getParticipants() {\n"
+" return participants;\n"
+"}\n"
+"\n"
+"public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:900
#, no-c-format
msgid ""
"Now map this side of the association in <literal>Event.hbm.xml</literal>."
@@ -1261,7 +2347,23 @@
"それでは <literal>Event.hbm.xml</literal> で関連のこちら側をマッピングしてく"
"ださい。"
+#. Tag: programlisting
+#: tutorial.xml:904
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse="
+"\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+" </set>]]>"
+msgstr ""
+"<set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+"</set>"
+
#. Tag: para
+#: tutorial.xml:906
#, no-c-format
msgid ""
"These are normal <literal>set</literal> mappings in both mapping documents. "
@@ -1279,6 +2381,7 @@
"素にある <literal>inverse=\"true\"</literal> 属性です。"
#. Tag: para
+#: tutorial.xml:914
#, no-c-format
msgid ""
"What this means is that Hibernate should take the other side, the "
@@ -1292,11 +2395,13 @@
"に作成されるかがわかれば、これを理解することはとても簡単です。"
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr "双方向リンクの動作"
#. Tag: para
+#: tutorial.xml:925
#, no-c-format
msgid ""
"First, keep in mind that Hibernate does not affect normal Java semantics. "
@@ -1320,6 +2425,7 @@
"で、決して忘れないでください。"
#. Tag: para
+#: tutorial.xml:935
#, no-c-format
msgid ""
"Many developers program defensively and create link management methods to "
@@ -1329,7 +2435,48 @@
"するリンク管理メソッドを作成します。例えば <literal>Person</literal> では以下"
"のようになります。:"
+#. Tag: programlisting
+#: tutorial.xml:940
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ protected Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"\n"
+" public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+" }\n"
+"\n"
+" public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+" }]]>"
+msgstr ""
+"protected Set getEvents() {\n"
+" return events;\n"
+"}\n"
+"\n"
+"protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+"}\n"
+"\n"
+"public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+"}\n"
+"\n"
+"public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:942
#, no-c-format
msgid ""
"The get and set methods for the collection are now protected. This allows "
@@ -1344,6 +2491,7 @@
"をした方がいいでしょう。"
#. Tag: para
+#: tutorial.xml:949
#, no-c-format
msgid ""
"What about the <literal>inverse</literal> mapping attribute? For you, and "
@@ -1373,11 +2521,13 @@
"多対多関連ではどちら側でも構いません。どちらでも違いはありません。"
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr "パート3 - EventManager Web アプリケーション"
#. Tag: para
+#: tutorial.xml:967
#, no-c-format
msgid ""
"A Hibernate web application uses <literal>Session</literal> and "
@@ -1394,11 +2544,13 @@
"いイベントを入力できるものです。"
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr "基本的な Servlet の記述"
#. Tag: para
+#: tutorial.xml:977
#, no-c-format
msgid ""
"First we need create our basic processing servlet. Since our servlet only "
@@ -1408,7 +2560,76 @@
"Servlet は HTTP の <literal>GET</literal> リクエストのみを処理するので、 "
"<literal>doGet()</literal> を実装します。"
+#. Tag: programlisting
+#: tutorial.xml:983
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.web;\n"
+"\n"
+"// Imports\n"
+"\n"
+"public class EventManagerServlet extends HttpServlet {\n"
+"\n"
+" protected void doGet(\n"
+" HttpServletRequest request,\n"
+" HttpServletResponse response) throws ServletException, "
+"IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy"
+"\" );\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().commit();\n"
+" }\n"
+" catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().rollback();\n"
+" if ( ServletException.class.isInstance( ex ) ) {\n"
+" throw ( ServletException ) ex;\n"
+" }\n"
+" else {\n"
+" throw new ServletException( ex );\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"protected void doGet(HttpServletRequest request,\n"
+" HttpServletResponse response)\n"
+" throws ServletException, IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat(\"dd.MM.yyyy\");\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().getTransaction().commit();\n"
+"\n"
+" } catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().getTransaction().rollback();\n"
+" throw new ServletException(ex);\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
msgid ""
"Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/"
@@ -1416,6 +2637,7 @@
msgstr ""
#. Tag: para
+#: tutorial.xml:990
#, no-c-format
msgid ""
"The pattern applied here is called <emphasis>session-per-request</emphasis>. "
@@ -1434,6 +2656,7 @@
"しません)。"
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
msgid ""
"Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> "
@@ -1448,6 +2671,7 @@
"literal> を使用してください。"
#. Tag: para
+#: tutorial.xml:1006
#, no-c-format
msgid ""
"Next, the possible actions of the request are processed and the response "
@@ -1457,6 +2681,7 @@
"す。これについてはすぐに説明します。"
#. Tag: para
+#: tutorial.xml:1011
#, no-c-format
msgid ""
"Finally, the unit of work ends when processing and rendering are complete. "
@@ -1479,18 +2704,86 @@
"しょう。"
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr "処理と描画"
#. Tag: para
+#: tutorial.xml:1027
#, no-c-format
msgid ""
"Now you can implement the processing of the request and the rendering of the "
"page."
msgstr "では、リクエストの処理とページの描画を実装します。"
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ // Write HTML header\n"
+" PrintWriter out = response.getWriter();\n"
+" out.println(\"<html><head><title>Event Manager</title></head><body>"
+"\");\n"
+"\n"
+" // Handle actions\n"
+" if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date.</i></"
+"b>\");\n"
+" }\n"
+" else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse"
+"(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>\");\n"
+" }\n"
+" }\n"
+"\n"
+" // Print page\n"
+" printEventForm(out);\n"
+" listEvents(out, dateFormatter);\n"
+"\n"
+" // Write HTML footer\n"
+" out.println(\"</body></html>\");\n"
+" out.flush();\n"
+" out.close();]]>"
+msgstr ""
+"// Write HTML header\n"
+"PrintWriter out = response.getWriter();\n"
+"out.println(\"<html><head><title>Event Manager</"
+"title></head><body>\");\n"
+"\n"
+"// Handle actions\n"
+"if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date."
+"</i></b>\");\n"
+" } else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>"
+"\");\n"
+" }\n"
+"}\n"
+"\n"
+"// Print page\n"
+"printEventForm(out);\n"
+"listEvents(out, dateFormatter);\n"
+"\n"
+"// Write HTML footer\n"
+"out.println(\"</body></html>\");\n"
+"out.flush();\n"
+"out.close();"
+
#. Tag: para
+#: tutorial.xml:1033
#, no-c-format
msgid ""
"This coding style, with a mix of Java and HTML, would not scale in a more "
@@ -1507,7 +2800,36 @@
"ムと、データベースにある全てのイベントのリストが表示されます。最初のメソッド"
"はごく単純な HTML 出力です。"
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
+"\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+" }]]>"
+msgstr ""
+"private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/"
+">\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
msgid ""
"The <literal>listEvents()</literal> method uses the Hibernate "
@@ -1516,7 +2838,62 @@
"<literal>listEvents()</literal> メソッドは、現在のスレッドに結びつく "
"Hibernate の <literal>Session</literal> を使用して、クエリを実行します。"
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
+"dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" Iterator it = result.iterator();\n"
+" while (it.hasNext()) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate()) "
+"+ \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+" }]]>"
+msgstr ""
+"private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list"
+"();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" for (Iterator it = result.iterator(); it.hasNext();) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>"
+"\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate"
+"()) + \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
msgid ""
"Finally, the <literal>store</literal> action is dispatched to the "
@@ -1527,7 +2904,31 @@
"</literal> メソッドを呼び出します。このメソッドでも現在のスレッドの "
"<literal>Session</literal> を利用します。"
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) "
+"{\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+" }]]>"
+msgstr ""
+"protected void createAndStoreEvent(String title, Date theDate) {\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1060
#, no-c-format
msgid ""
"The servlet is now complete. A request to the servlet will be processed in a "
@@ -1550,11 +2951,13 @@
"Hibernate の Wiki を参照してください。"
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr "デプロイとテスト"
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
msgid ""
"To deploy this application for testing we must create a Web ARchive (WAR). "
@@ -1562,7 +2965,50 @@
"web.xml</filename>"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/"
+"xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
+"servlet-class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>]]>"
+msgstr ""
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n"
+" http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>events.EventManagerServlet</servlet-"
+"class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>"
+
#. Tag: para
+#: tutorial.xml:1084
#, no-c-format
msgid ""
"To build and deploy call <literal>mvn package</literal> in your project "
@@ -1574,10 +3020,11 @@
"Tomcat の <literal>webapp</literal> ディレクトリにコピーしてください。"
#. Tag: para
+#: tutorial.xml:1091
#, fuzzy, no-c-format
msgid ""
"If you do not have Tomcat installed, download it from <ulink url=\"http://"
-"tomcat.apache.org/\" /> and follow the installation instructions. Our "
+"tomcat.apache.org/\"></ulink> and follow the installation instructions. Our "
"application requires no changes to the standard Tomcat configuration."
msgstr ""
"まだ Tomcat をインストールしていなければ、ダウンロードして、インストールガイ"
@@ -1585,6 +3032,7 @@
"Tomcat の設定を変更する必要はありません。"
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
msgid ""
"Once deployed and Tomcat is running, access the application at "
@@ -1602,11 +3050,13 @@
"細を確認してください。"
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr "要約"
#. Tag: para
+#: tutorial.xml:1114
#, no-c-format
msgid ""
"This tutorial covered the basics of writing a simple standalone Hibernate "
@@ -1615,1181 +3065,3 @@
msgstr ""
"このチュートリアルでは、簡単なスタンドアローンの Hibernate アプリケーションと"
"小規模の Web アプリケーションを書くための基本を紹介しました。"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Event {\n"
-#~ " private Long id;\n"
-#~ "\n"
-#~ " private String title;\n"
-#~ " private Date date;\n"
-#~ "\n"
-#~ " public Event() {}\n"
-#~ "\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id = id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Date getDate() {\n"
-#~ " return date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setDate(Date date) {\n"
-#~ " this.date = date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getTitle() {\n"
-#~ " return title;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setTitle(String title) {\n"
-#~ " this.title = title;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Event {\n"
-#~ " private Long id;\n"
-#~ "\n"
-#~ " private String title;\n"
-#~ " private Date date;\n"
-#~ "\n"
-#~ " public Event() {}\n"
-#~ "\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id = id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Date getDate() {\n"
-#~ " return date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setDate(Date date) {\n"
-#~ " this.date = date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getTitle() {\n"
-#~ " return title;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setTitle(String title) {\n"
-#~ " this.title = title;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping>\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Event\" table=\"EVENTS\">\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/"
-#~ ">\n"
-#~ " <property name=\"title\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE"
-#~ "\"/>\n"
-#~ " <property name=\"title\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!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"
-#~ "\n"
-#~ " <session-factory>\n"
-#~ "\n"
-#~ " <!-- Database connection settings -->\n"
-#~ " <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
-#~ "property>\n"
-#~ " <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
-#~ "property>\n"
-#~ " <property name=\"connection.username\">sa</property>\n"
-#~ " <property name=\"connection.password\"></property>\n"
-#~ "\n"
-#~ " <!-- JDBC connection pool (use the built-in) -->\n"
-#~ " <property name=\"connection.pool_size\">1</property>\n"
-#~ "\n"
-#~ " <!-- SQL dialect -->\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Enable Hibernate's automatic session context management -->\n"
-#~ " <property name=\"current_session_context_class\">thread</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Disable the second-level cache -->\n"
-#~ " <property name=\"cache.provider_class\">org.hibernate.cache."
-#~ "NoCacheProvider</property>\n"
-#~ "\n"
-#~ " <!-- Echo all executed SQL to stdout -->\n"
-#~ " <property name=\"show_sql\">true</property>\n"
-#~ "\n"
-#~ " <!-- Drop and re-create the database schema on startup -->\n"
-#~ " <property name=\"hbm2ddl.auto\">update</property>\n"
-#~ "\n"
-#~ " <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/"
-#~ ">\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-#~ msgstr ""
-#~ "<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!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"
-#~ "\n"
-#~ " <session-factory>\n"
-#~ "\n"
-#~ " <!-- Database connection settings -->\n"
-#~ " <property name=\"connection.driver_class\">org.hsqldb."
-#~ "jdbcDriver</property>\n"
-#~ " <property name=\"connection.url\">jdbc:hsqldb:hsql://"
-#~ "localhost</property>\n"
-#~ " <property name=\"connection.username\">sa</property>\n"
-#~ " <property name=\"connection.password\"></property>\n"
-#~ "\n"
-#~ " <!-- JDBC connection pool (use the built-in) -->\n"
-#~ " <property name=\"connection.pool_size\">1</property>\n"
-#~ "\n"
-#~ " <!-- SQL dialect -->\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect."
-#~ "HSQLDialect</property>\n"
-#~ "\n"
-#~ " <!-- Enable Hibernate's automatic session context management --"
-#~ ">\n"
-#~ " <property name=\"current_session_context_class\">thread</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Disable the second-level cache -->\n"
-#~ " <property name=\"cache.provider_class\">org.hibernate.cache."
-#~ "NoCacheProvider</property>\n"
-#~ "\n"
-#~ " <!-- Echo all executed SQL to stdout -->\n"
-#~ " <property name=\"show_sql\">true</property>\n"
-#~ "\n"
-#~ " <!-- Drop and re-create the database schema on startup -->\n"
-#~ " <property name=\"hbm2ddl.auto\">create</property>\n"
-#~ "\n"
-#~ " <mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.util;\n"
-#~ "\n"
-#~ "import org.hibernate.SessionFactory;\n"
-#~ "import org.hibernate.cfg.Configuration;\n"
-#~ "\n"
-#~ "public class HibernateUtil {\n"
-#~ "\n"
-#~ " private static final SessionFactory sessionFactory = "
-#~ "buildSessionFactory();\n"
-#~ "\n"
-#~ " private static SessionFactory buildSessionFactory() {\n"
-#~ " try {\n"
-#~ " // Create the SessionFactory from hibernate.cfg.xml\n"
-#~ " return new Configuration().configure().buildSessionFactory"
-#~ "();\n"
-#~ " }\n"
-#~ " catch (Throwable ex) {\n"
-#~ " // Make sure you log the exception, as it might be swallowed\n"
-#~ " System.err.println(\"Initial SessionFactory creation failed."
-#~ "\" + ex);\n"
-#~ " throw new ExceptionInInitializerError(ex);\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " public static SessionFactory getSessionFactory() {\n"
-#~ " return sessionFactory;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package util;\n"
-#~ "\n"
-#~ "import org.hibernate.*;\n"
-#~ "import org.hibernate.cfg.*;\n"
-#~ "\n"
-#~ "public class HibernateUtil {\n"
-#~ "\n"
-#~ " private static final SessionFactory sessionFactory;\n"
-#~ "\n"
-#~ " static {\n"
-#~ " try {\n"
-#~ " // Create the SessionFactory from hibernate.cfg.xml\n"
-#~ " sessionFactory = new Configuration().configure()."
-#~ "buildSessionFactory();\n"
-#~ " } catch (Throwable ex) {\n"
-#~ " // Make sure you log the exception, as it might be swallowed\n"
-#~ " System.err.println(\"Initial SessionFactory creation failed."
-#~ "\" + ex);\n"
-#~ " throw new ExceptionInInitializerError(ex);\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " public static SessionFactory getSessionFactory() {\n"
-#~ " return sessionFactory;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial;\n"
-#~ "\n"
-#~ "import org.hibernate.Session;\n"
-#~ "\n"
-#~ "import java.util.*;\n"
-#~ "\n"
-#~ "import org.hibernate.tutorial.domain.Event;\n"
-#~ "import org.hibernate.tutorial.util.HibernateUtil;\n"
-#~ "\n"
-#~ "public class EventManager {\n"
-#~ "\n"
-#~ " public static void main(String[] args) {\n"
-#~ " EventManager mgr = new EventManager();\n"
-#~ "\n"
-#~ " if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory().close();\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void createAndStoreEvent(String title, Date theDate) {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ " session.save(theEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "import org.hibernate.Session;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "import util.HibernateUtil;\n"
-#~ "\n"
-#~ "public class EventManager {\n"
-#~ "\n"
-#~ " public static void main(String[] args) {\n"
-#~ " EventManager mgr = new EventManager();\n"
-#~ "\n"
-#~ " if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory().close();\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void createAndStoreEvent(String title, Date theDate) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ "\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " session.save(theEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, "
-#~ "EVENT_ID) values (?, ?, ?)]]>"
-#~ msgstr ""
-#~ "[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values "
-#~ "(?, ?, ?)"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ " else if (args[0].equals(\"list\")) {\n"
-#~ " List events = mgr.listEvents();\n"
-#~ " for (int i = 0; i < events.size(); i++) {\n"
-#~ " Event theEvent = (Event) events.get(i);\n"
-#~ " System.out.println(\n"
-#~ " \"Event: \" + theEvent.getTitle() + \" Time: \" + "
-#~ "theEvent.getDate()\n"
-#~ " );\n"
-#~ " }\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ "}\n"
-#~ "else if (args[0].equals(\"list\")) {\n"
-#~ " List events = mgr.listEvents();\n"
-#~ " for (int i = 0; i < events.size(); i++) {\n"
-#~ " Event theEvent = (Event) events.get(i);\n"
-#~ " System.out.println(\"Event: \" + theEvent.getTitle() +\n"
-#~ " \" Time: \" + theEvent.getDate());\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private List listEvents() {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ " List result = session.createQuery(\"from Event\").list();\n"
-#~ " session.getTransaction().commit();\n"
-#~ " return result;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private List listEvents() {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ "\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " List result = session.createQuery(\"from Event\").list();\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " return result;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Long id;\n"
-#~ " private int age;\n"
-#~ " private String firstname;\n"
-#~ " private String lastname;\n"
-#~ "\n"
-#~ " public Person() {}\n"
-#~ "\n"
-#~ " // Accessor methods for all properties, private setter for 'id'\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "\n"
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Long id;\n"
-#~ " private int age;\n"
-#~ " private String firstname;\n"
-#~ " private String lastname;\n"
-#~ "\n"
-#~ " public Person() {}\n"
-#~ "\n"
-#~ " // Accessor methods for all properties, private setter for 'id'\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "<mapping resource=\"events/Person.hbm.xml\"/>]]>"
-#~ msgstr ""
-#~ "<mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "<mapping resource=\"events/Person.hbm.xml\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[public class Person {\n"
-#~ "\n"
-#~ " private Set events = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Set events = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ "\n"
-#~ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"events.Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ "\n"
-#~ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <many-to-many column=\"EVENT_ID\" class=\"events.Event\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ " _____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | |\n"
-#~ " |_____________| |__________________| | PERSON |\n"
-#~ " | | | | |_____________|\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE |\n"
-#~ " |_____________| | FIRSTNAME |\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|\n"
-#~ " ]]>"
-#~ msgstr ""
-#~ "_____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | |\n"
-#~ " |_____________| |__________________| | PERSON |\n"
-#~ " | | | | |_____________|\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE |\n"
-#~ " |_____________| | FIRSTNAME |\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) "
-#~ "{\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ " aPerson.getEvents().add(anEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addPersonToEvent(Long personId, Long eventId) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) "
-#~ "{\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session\n"
-#~ " .createQuery(\"select p from Person p left join fetch p."
-#~ "events where p.id = :pid\")\n"
-#~ " .setParameter(\"pid\", personId)\n"
-#~ " .uniqueResult(); // Eager fetch the collection so we can "
-#~ "use it detached\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " // End of first unit of work\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) "
-#~ "is detached\n"
-#~ "\n"
-#~ " // Begin second unit of work\n"
-#~ "\n"
-#~ " Session session2 = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session2.beginTransaction();\n"
-#~ " session2.update(aPerson); // Reattachment of aPerson\n"
-#~ "\n"
-#~ " session2.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addPersonToEvent(Long personId, Long eventId) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session\n"
-#~ " .createQuery(\"select p from Person p left join fetch p."
-#~ "events where p.id = :pid\")\n"
-#~ " .setParameter(\"pid\", personId)\n"
-#~ " .uniqueResult(); // Eager fetch the collection so we can use "
-#~ "it detached\n"
-#~ "\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " // End of first unit of work\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
-#~ "detached\n"
-#~ "\n"
-#~ " // Begin second unit of work\n"
-#~ "\n"
-#~ " Session session2 = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session2.beginTransaction();\n"
-#~ "\n"
-#~ " session2.update(aPerson); // Reattachment of aPerson\n"
-#~ "\n"
-#~ " session2.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
-#~ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
-#~ "());\n"
-#~ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
-#~ " mgr.addPersonToEvent(personId, eventId);\n"
-#~ " System.out.println(\"Added person \" + personId + \" to event "
-#~ "\" + eventId);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "else if (args[0].equals(\"addpersontoevent\")) {\n"
-#~ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
-#~ " mgr.addPersonToEvent(personId, eventId);\n"
-#~ " System.out.println(\"Added person \" + personId + \" to event \" + "
-#~ "eventId);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private Set emailAddresses = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEmailAddresses() {\n"
-#~ " return emailAddresses;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEmailAddresses(Set emailAddresses) {\n"
-#~ " this.emailAddresses = emailAddresses;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private Set emailAddresses = new HashSet();\n"
-#~ "\n"
-#~ "public Set getEmailAddresses() {\n"
-#~ " return emailAddresses;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void setEmailAddresses(Set emailAddresses) {\n"
-#~ " this.emailAddresses = emailAddresses;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR"
-#~ "\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
-#~ " </set>]]>"
-#~ msgstr ""
-#~ "<set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ " _____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | | "
-#~ "___________________\n"
-#~ " |_____________| |__________________| | PERSON | "
-#~ "| |\n"
-#~ " | | | | |_____________| | "
-#~ "PERSON_EMAIL_ADDR |\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | | |"
-#~ "___________________|\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
-#~ "*PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE | | "
-#~ "*EMAIL_ADDR |\n"
-#~ " |_____________| | FIRSTNAME | |"
-#~ "___________________|\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|\n"
-#~ " ]]>"
-#~ msgstr ""
-#~ "_____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | | "
-#~ "___________________\n"
-#~ " |_____________| |__________________| | PERSON | "
-#~ "| |\n"
-#~ " | | | | |_____________| | "
-#~ "PERSON_EMAIL_ADDR |\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | "
-#~ "| |___________________|\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | "
-#~ "<--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE | | "
-#~ "*EMAIL_ADDR |\n"
-#~ " |_____________| | FIRSTNAME | |"
-#~ "___________________|\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addEmailToPerson(Long personId, String "
-#~ "emailAddress) {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " // adding to the emailAddress collection might trigger a lazy "
-#~ "load of the collection\n"
-#~ " aPerson.getEmailAddresses().add(emailAddress);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addEmailToPerson(Long personId, String emailAddress) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ "\n"
-#~ " // The getEmailAddresses() might trigger a lazy load of the "
-#~ "collection\n"
-#~ " aPerson.getEmailAddresses().add(emailAddress);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private Set participants = new HashSet();\n"
-#~ "\n"
-#~ " public Set getParticipants() {\n"
-#~ " return participants;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setParticipants(Set participants) {\n"
-#~ " this.participants = participants;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private Set participants = new HashSet();\n"
-#~ "\n"
-#~ "public Set getParticipants() {\n"
-#~ " return participants;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void setParticipants(Set participants) {\n"
-#~ " this.participants = participants;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" "
-#~ "inverse=\"true\">\n"
-#~ " <key column=\"EVENT_ID\"/>\n"
-#~ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
-#~ " </set>]]>"
-#~ msgstr ""
-#~ "<set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true"
-#~ "\">\n"
-#~ " <key column=\"EVENT_ID\"/>\n"
-#~ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ protected Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " protected void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void addToEvent(Event event) {\n"
-#~ " this.getEvents().add(event);\n"
-#~ " event.getParticipants().add(this);\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void removeFromEvent(Event event) {\n"
-#~ " this.getEvents().remove(event);\n"
-#~ " event.getParticipants().remove(this);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "protected Set getEvents() {\n"
-#~ " return events;\n"
-#~ "}\n"
-#~ "\n"
-#~ "protected void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void addToEvent(Event event) {\n"
-#~ " this.getEvents().add(event);\n"
-#~ " event.getParticipants().add(this);\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void removeFromEvent(Event event) {\n"
-#~ " this.getEvents().remove(event);\n"
-#~ " event.getParticipants().remove(this);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.web;\n"
-#~ "\n"
-#~ "// Imports\n"
-#~ "\n"
-#~ "public class EventManagerServlet extends HttpServlet {\n"
-#~ "\n"
-#~ " protected void doGet(\n"
-#~ " HttpServletRequest request,\n"
-#~ " HttpServletResponse response) throws ServletException, "
-#~ "IOException {\n"
-#~ "\n"
-#~ " SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM."
-#~ "yyyy\" );\n"
-#~ "\n"
-#~ " try {\n"
-#~ " // Begin unit of work\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "beginTransaction();\n"
-#~ "\n"
-#~ " // Process request and render page...\n"
-#~ "\n"
-#~ " // End unit of work\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "getTransaction().commit();\n"
-#~ " }\n"
-#~ " catch (Exception ex) {\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "getTransaction().rollback();\n"
-#~ " if ( ServletException.class.isInstance( ex ) ) {\n"
-#~ " throw ( ServletException ) ex;\n"
-#~ " }\n"
-#~ " else {\n"
-#~ " throw new ServletException( ex );\n"
-#~ " }\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "protected void doGet(HttpServletRequest request,\n"
-#~ " HttpServletResponse response)\n"
-#~ " throws ServletException, IOException {\n"
-#~ "\n"
-#~ " SimpleDateFormat dateFormatter = new SimpleDateFormat(\"dd.MM.yyyy"
-#~ "\");\n"
-#~ "\n"
-#~ " try {\n"
-#~ " // Begin unit of work\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().beginTransaction();\n"
-#~ "\n"
-#~ " // Process request and render page...\n"
-#~ "\n"
-#~ " // End unit of work\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().getTransaction().commit();\n"
-#~ "\n"
-#~ " } catch (Exception ex) {\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().getTransaction().rollback();\n"
-#~ " throw new ServletException(ex);\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ // Write HTML header\n"
-#~ " PrintWriter out = response.getWriter();\n"
-#~ " out.println(\"<html><head><title>Event Manager</title></"
-#~ "head><body>\");\n"
-#~ "\n"
-#~ " // Handle actions\n"
-#~ " if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
-#~ "\n"
-#~ " String eventTitle = request.getParameter(\"eventTitle\");\n"
-#~ " String eventDate = request.getParameter(\"eventDate\");\n"
-#~ "\n"
-#~ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
-#~ " out.println(\"<b><i>Please enter event title and date.</"
-#~ "i></b>\");\n"
-#~ " }\n"
-#~ " else {\n"
-#~ " createAndStoreEvent(eventTitle, dateFormatter.parse"
-#~ "(eventDate));\n"
-#~ " out.println(\"<b><i>Added event.</i></b>\");\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " // Print page\n"
-#~ " printEventForm(out);\n"
-#~ " listEvents(out, dateFormatter);\n"
-#~ "\n"
-#~ " // Write HTML footer\n"
-#~ " out.println(\"</body></html>\");\n"
-#~ " out.flush();\n"
-#~ " out.close();]]>"
-#~ msgstr ""
-#~ "// Write HTML header\n"
-#~ "PrintWriter out = response.getWriter();\n"
-#~ "out.println(\"<html><head><title>Event Manager</"
-#~ "title></head><body>\");\n"
-#~ "\n"
-#~ "// Handle actions\n"
-#~ "if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
-#~ "\n"
-#~ " String eventTitle = request.getParameter(\"eventTitle\");\n"
-#~ " String eventDate = request.getParameter(\"eventDate\");\n"
-#~ "\n"
-#~ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
-#~ " out.println(\"<b><i>Please enter event title and date."
-#~ "</i></b>\");\n"
-#~ " } else {\n"
-#~ " createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
-#~ " out.println(\"<b><i>Added event.</i></b>"
-#~ "\");\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "// Print page\n"
-#~ "printEventForm(out);\n"
-#~ "listEvents(out, dateFormatter);\n"
-#~ "\n"
-#~ "// Write HTML footer\n"
-#~ "out.println(\"</body></html>\");\n"
-#~ "out.flush();\n"
-#~ "out.close();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void printEventForm(PrintWriter out) {\n"
-#~ " out.println(\"<h2>Add new event:</h2>\");\n"
-#~ " out.println(\"<form>\");\n"
-#~ " out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
-#~ "\");\n"
-#~ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
-#~ "length='10'/><br/>\");\n"
-#~ " out.println(\"<input type='submit' name='action' value='store'/>"
-#~ "\");\n"
-#~ " out.println(\"</form>\");\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void printEventForm(PrintWriter out) {\n"
-#~ " out.println(\"<h2>Add new event:</h2>\");\n"
-#~ " out.println(\"<form>\");\n"
-#~ " out.println(\"Title: <input name='eventTitle' length='50'/><"
-#~ "br/>\");\n"
-#~ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
-#~ "length='10'/><br/>\");\n"
-#~ " out.println(\"<input type='submit' name='action' value='store'/>"
-#~ "\");\n"
-#~ " out.println(\"</form>\");\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
-#~ "dateFormatter) {\n"
-#~ "\n"
-#~ " List result = HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().createCriteria(Event.class).list();\n"
-#~ " if (result.size() > 0) {\n"
-#~ " out.println(\"<h2>Events in database:</h2>\");\n"
-#~ " out.println(\"<table border='1'>\");\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<th>Event title</th>\");\n"
-#~ " out.println(\"<th>Event date</th>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " Iterator it = result.iterator();\n"
-#~ " while (it.hasNext()) {\n"
-#~ " Event event = (Event) it.next();\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
-#~ " out.println(\"<td>\" + dateFormatter.format(event.getDate"
-#~ "()) + \"</td>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " }\n"
-#~ " out.println(\"</table>\");\n"
-#~ " }\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) "
-#~ "{\n"
-#~ "\n"
-#~ " List result = HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().createCriteria(Event.class).list"
-#~ "();\n"
-#~ " if (result.size() > 0) {\n"
-#~ " out.println(\"<h2>Events in database:</h2>\");\n"
-#~ " out.println(\"<table border='1'>\");\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<th>Event title</th>\");\n"
-#~ " out.println(\"<th>Event date</th>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " for (Iterator it = result.iterator(); it.hasNext();) {\n"
-#~ " Event event = (Event) it.next();\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<td>\" + event.getTitle() + \"</td>"
-#~ "\");\n"
-#~ " out.println(\"<td>\" + dateFormatter.format(event."
-#~ "getDate()) + \"</td>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " }\n"
-#~ " out.println(\"</table>\");\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ protected void createAndStoreEvent(String title, Date "
-#~ "theDate) {\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().save(theEvent);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "protected void createAndStoreEvent(String title, Date theDate) {\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().save(theEvent);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#~ "<web-app version=\"2.4\"\n"
-#~ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun."
-#~ "com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
-#~ "\n"
-#~ " <servlet>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
-#~ "servlet-class>\n"
-#~ " </servlet>\n"
-#~ "\n"
-#~ " <servlet-mapping>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <url-pattern>/eventmanager</url-pattern>\n"
-#~ " </servlet-mapping>\n"
-#~ "</web-app>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#~ "<web-app version=\"2.4\"\n"
-#~ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n"
-#~ " http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
-#~ "\n"
-#~ " <servlet>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <servlet-class>events.EventManagerServlet</servlet-"
-#~ "class>\n"
-#~ " </servlet>\n"
-#~ "\n"
-#~ " <servlet-mapping>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <url-pattern>/eventmanager</url-pattern>\n"
-#~ " </servlet-mapping>\n"
-#~ "</web-app>"
Modified: core/trunk/documentation/manual/src/main/docbook/pot/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,14 +1,16 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-03-31T00:33:04\n"
-"PO-Revision-Date: 2010-03-31T00:33:04\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Modified: core/trunk/documentation/manual/src/main/docbook/pot/author_group.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/author_group.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/author_group.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,149 +1,196 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-03-31T00:33:04\n"
-"PO-Revision-Date: 2010-03-31T00:33:04\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
+msgid "<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
+msgid "<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
+msgid "Graphic Design"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
+msgid "<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> <email>kreimer at bbs.frc.utn.edu.ar</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
+msgid "<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></othercredit>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
+msgid "<firstname>Alvaro</firstname> <surname>Netto</surname> <email>alvaronetto at cetip.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
+msgid "<firstname>Anderson</firstname> <surname>Braulio</surname> <email>andersonbraulio at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
+msgid "<firstname>Daniel Vieira</firstname> <surname>Costa</surname> <email>danielvc at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
+msgid "<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco.gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
+msgid "<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
+msgid "<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> <email>luizcarlos_rodrigues at yahoo.com.br</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
+msgid "<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel.castelo at gmail.com</email>"
msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
+msgid "<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail.com</email>"
msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
+msgid "<firstname>Pablo L.</firstname> <surname>de Miranda</surname> <email>pablolmiranda at gmail.com</email>"
msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
+msgid "<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail.com</email>"
msgstr ""
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid "<firstname>Rogério</firstname> <surname>Araújo</surname> <email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid "<firstname>Wanderson</firstname> <surname>Siqueira</surname> <email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid "<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> <orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
+
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/basic_mapping.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/basic_mapping.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/basic_mapping.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,1959 +1,5925 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr ""
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:36
#, no-c-format
-msgid "Object/relational mappings are usually defined in an XML document. The mapping document is designed to be readable and hand-editable. The mapping language is Java-centric, meaning that mappings are constructed around persistent class declarations and not table declarations."
+msgid "Object/relational mappings can be defined in three approaches:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:41
#, no-c-format
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:46
+#, no-c-format
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
+msgid "Annotations are split in two categories, the logical mapping annotations (describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid "JPA annotations are in the <literal>javax.persistence.*</literal> package. Hibernate specific extensions are in <literal>org.hibernate.annotations.*</literal>. You favorite IDE can auto-complete annotations and their attributes for you (even without a specific \"JPA\" plugin, since JPA annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
+#, no-c-format
+msgid "Here is an example of mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
+msgid ""
+ "package eg;\n"
+ "\n"
+ "@Entity \n"
+ "@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+ "@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", discriminatorType=CHAR)\n"
+ "public class Cat {\n"
+ " \n"
+ " @Id @GeneratedValue\n"
+ " public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " public BigDecimal getWeight() { return weight; }\n"
+ " public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+ " private BigDecimal weight;\n"
+ "\n"
+ " @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+ " public Date getBirthdate() { return birthdate; }\n"
+ " public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+ " private Date birthdate;\n"
+ "\n"
+ " @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+ " @NotNull @Column(updatable=false)\n"
+ " public ColorType getColor() { return color; }\n"
+ " public void setColor(ColorType color) { this.color = color; }\n"
+ " private ColorType color;\n"
+ "\n"
+ " @NotNull @Column(updatable=false)\n"
+ " public String getSex() { return sex; }\n"
+ " public void setSex(String sex) { this.sex = sex; }\n"
+ " private String sex;\n"
+ "\n"
+ " @NotNull @Column(updatable=false)\n"
+ " public Integer getLitterId() { return litterId; }\n"
+ " public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+ " private Integer litterId;\n"
+ "\n"
+ " @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+ " public Cat getMother() { return mother; }\n"
+ " public void setMother(Cat mother) { this.mother = mother; }\n"
+ " private Cat mother;\n"
+ "\n"
+ " @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+ " public Set<Cat> getKittens() { return kittens; }\n"
+ " public void setKittens(Set<Cat> kittens) { this.kittens = kittens; }\n"
+ " private Set<Cat> kittens = new HashSet<Cat>();\n"
+ "}\n"
+ "\n"
+ "@Entity @DiscriminatorValue(\"D\")\n"
+ "public class DomesticCat extends Cat {\n"
+ "\n"
+ " public String getName() { return name; }\n"
+ " public void setName(String name) { this.name = name }\n"
+ " private String name;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Dog { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:73
+#, no-c-format
+msgid "The legacy hbm.xml approach uses an XML schema designed to be readable and hand-editable. The mapping language is Java-centric, meaning that mappings are constructed around persistent class declarations and not table declarations."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:78
+#, no-c-format
msgid "Please note that even though many Hibernate users choose to write the XML by hand, a number of tools exist to generate the mapping document. These include XDoclet, Middlegen and AndroMDA."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:82
#, no-c-format
msgid "Here is an example mapping:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:84
+#, no-c-format
+msgid ""
+ "<?xml version=\"1.0\"?>\n"
+ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+ "\n"
+ "<hibernate-mapping package=\"eg\">\n"
+ "\n"
+ " <class name=\"Cat\"\n"
+ " table=\"cats\"\n"
+ " discriminator-value=\"C\">\n"
+ "\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"native\"/>\n"
+ " </id>\n"
+ "\n"
+ " <discriminator column=\"subclass\"\n"
+ " type=\"character\"/>\n"
+ "\n"
+ " <property name=\"weight\"/>\n"
+ "\n"
+ " <property name=\"birthdate\"\n"
+ " type=\"date\"\n"
+ " not-null=\"true\"\n"
+ " update=\"false\"/>\n"
+ "\n"
+ " <property name=\"color\"\n"
+ " type=\"eg.types.ColorUserType\"\n"
+ " not-null=\"true\"\n"
+ " update=\"false\"/>\n"
+ "\n"
+ " <property name=\"sex\"\n"
+ " not-null=\"true\"\n"
+ " update=\"false\"/>\n"
+ "\n"
+ " <property name=\"litterId\"\n"
+ " column=\"litterId\"\n"
+ " update=\"false\"/>\n"
+ "\n"
+ " <many-to-one name=\"mother\"\n"
+ " column=\"mother_id\"\n"
+ " update=\"false\"/>\n"
+ "\n"
+ " <set name=\"kittens\"\n"
+ " inverse=\"true\"\n"
+ " order-by=\"litter_id\">\n"
+ " <key column=\"mother_id\"/>\n"
+ " <one-to-many class=\"Cat\"/>\n"
+ " </set>\n"
+ "\n"
+ " <subclass name=\"DomesticCat\"\n"
+ " discriminator-value=\"D\">\n"
+ "\n"
+ " <property name=\"name\"\n"
+ " type=\"string\"/>\n"
+ "\n"
+ " </subclass>\n"
+ "\n"
+ " </class>\n"
+ "\n"
+ " <class name=\"Dog\">\n"
+ " <!-- mapping for Dog could go here -->\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:86
#, no-c-format
-msgid "We will now discuss the content of the mapping document. We will only describe, however, the document elements and attributes that are used by Hibernate at runtime. The mapping document also contains some extra optional attributes and elements that affect the database schemas exported by the schema export tool (for example, the <literal> not-null</literal> attribute)."
+msgid "We will now discuss the concepts of the mapping documents (both annotations and XML). We will only describe, however, the document elements and attributes that are used by Hibernate at runtime. The mapping document also contains some extra optional attributes and elements that affect the database schemas exported by the schema export tool (for example, the <literal> not-null</literal> attribute)."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:94
#, no-c-format
-msgid "Doctype"
+msgid "Entity"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "All XML mappings should declare the doctype shown. The actual DTD can be found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate will always look for the DTD in its classpath first. If you experience lookups of the DTD using an Internet connection, check the DTD declaration against the contents of your classpath."
+msgid "An entity is a regular Java object (aka POJO) which will be persisted by Hibernate."
msgstr ""
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:99
#, no-c-format
-msgid "EntityResolver"
+msgid "To mark an object as an entity in annotations, use the <classname>@Entity</classname> annotation."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:102
+#, 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
+#: basic_mapping.xml:104
#, no-c-format
-msgid "Hibernate will first attempt to resolve DTDs in its classpath. It does this is by registering a custom <literal>org.xml.sax.EntityResolver</literal> implementation with the SAXReader it uses to read in the xml files. This custom <literal>EntityResolver</literal> recognizes two different systemId namespaces:"
+msgid "That's pretty much it, the rest is optional. There are however any options to tweak your entity mapping, let's explore them."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:107
#, no-c-format
-msgid "a <literal>hibernate namespace</literal> is recognized whenever the resolver encounters a systemId starting with <literal>http://hibernate.sourceforge.net/</literal>. The resolver attempts to resolve these entities via the classloader which loaded the Hibernate classes."
+msgid "<classname>@Table</classname> lets you define the table the entity will be persisted into. If undefined, the table name is the unqualified class name of the entity. You can also optionally define the catalog, the schema as well as unique constraints on the table."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:112
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Table(name=\"TBL_FLIGHT\", \n"
+ " schema=\"AIR_COMMAND\", \n"
+ " uniqueConstraints=\n"
+ " @UniqueConstraint(\n"
+ " name=\"flight_number\", \n"
+ " columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+ "public class Flight implements Serializable {\n"
+ " @Column(name=\"comp_prefix\")\n"
+ " public String getCompagnyPrefix() { return companyPrefix; }\n"
+ "\n"
+ " @Column(name=\"flight_number\")\n"
+ " public String getNumber() { return number; }\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:114
#, no-c-format
-msgid "a <literal>user namespace</literal> is recognized whenever the resolver encounters a systemId using a <literal>classpath://</literal> URL protocol. The resolver will attempt to resolve these entities via (1) the current thread context classloader and (2) the classloader which loaded the Hibernate classes."
+msgid "The constraint name is optional (generated if left undefined). The column names composing the constraint correspond to the column names as defined before the Hibernate <classname>NamingStrategy</classname> is applied."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:119
#, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
+msgid "<literal>@Entity.name</literal> lets you define the shortcut name of the entity you can used in JP-QL and HQL queries. It defaults to the unqualified class name of the class."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:123
#, no-c-format
-msgid "Where <literal>types.xml</literal> is a resource in the <literal>your.domain</literal> package and contains a custom <link linkend=\"mapping-types-custom\">typedef</link>."
+msgid "Hibernate goes beyond the JPA specification and provide additional configurations. Some of them are hosted on <classname>@org.hibernate.annotations.Entity</classname>:"
msgstr ""
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:129
#, no-c-format
-msgid "Hibernate-mapping"
+msgid "<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> (defaults to false): specifies that <literal>INSERT</literal> / <literal>UPDATE</literal> SQL should be generated at runtime and contain only the columns whose values are not null. The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> settings are not inherited by subclasses. Although these settings can increase performance in some cases, they can actually decrease performance in others."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:140
#, no-c-format
-msgid "This element has several optional attributes. The <literal>schema</literal> and <literal>catalog</literal> attributes specify that tables referred to in this mapping belong to the named schema and/or catalog. If they are specified, tablenames will be qualified by the given schema and catalog names. If they are missing, tablenames will be unqualified. The <literal>default-cascade</literal> attribute specifies what cascade style should be assumed for properties and collections that do not specify a <literal>cascade</literal> attribute. By default, the <literal>auto-import</literal> attribute allows you to use unqualified class names in the query language."
+msgid "<literal>selectBeforeUpdate</literal> (defaults to false): specifies that Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</literal> unless it is certain that an object is actually modified. Only when a transient object has been associated with a new session using <literal>update()</literal>, will Hibernate perform an extra SQL <literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is actually required. Use of <literal>select-before-update</literal> will usually decrease performance. It is useful to prevent a database update trigger being called unnecessarily if you reattach a graph of detached instances to a <literal>Session</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:154
#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
+msgid "<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): determines whether implicit or explicit query polymorphisms is used. <emphasis>Implicit</emphasis> polymorphisms means that instances of the class will be returned by a query that names any superclass or implemented interface or class, and that instances of any subclass of the class will be returned by a query that names the class itself. <emphasis>Explicit</emphasis> polymorphisms means that class instances will be returned only by queries that explicitly name that class. Queries that name the class will return only instances of subclasses mapped. For most purposes, the default <literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit polymorphisms is useful when two different classes are mapped to the same table This allows a \"lightweight\" class that contains a subset of the table columns."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:171
#, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
+msgid "<literal>persister</literal>: specifies a custom <literal>ClassPersister</literal>. The <literal>persister</literal> attribute lets you customize the persistence strategy used for the class. You can, for example, specify your own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, or you can even provide a completely new implementation of the interface <literal>org.hibernate.persister.ClassPersister</literal> that implements, for example, persistence via stored procedure calls, serialization to flat files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for a simple example of \"persistence\" to a <literal>Hashtable</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:185
#, no-c-format
-msgid "<literal>default-cascade</literal> (optional - defaults to <literal>none</literal>): a default cascade style."
+msgid "<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): determines the optimistic locking strategy. If you enable <literal>dynamicUpdate</literal>, you will have a choice of optimistic locking strategies:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:192
#, no-c-format
-msgid "<literal>default-access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate should use for accessing all properties. It can be a custom implementation of <literal>PropertyAccessor</literal>."
+msgid "<literal>version</literal>: check the version/timestamp columns"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:197
#, no-c-format
-msgid "<literal>default-lazy</literal> (optional - defaults to <literal>true</literal>): the default value for unspecified <literal>lazy</literal> attributes of class and collection mappings."
+msgid "<literal>all</literal>: check all columns"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:201
#, no-c-format
-msgid "<literal>auto-import</literal> (optional - defaults to <literal>true</literal>): specifies whether we can use unqualified class names of classes in this mapping in the query language."
+msgid "<literal>dirty</literal>: check the changed columns, allowing some concurrent updates"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:206
#, no-c-format
-msgid "<literal>package</literal> (optional): specifies a package prefix to use for unqualified class names in the mapping document."
+msgid "<literal>none</literal>: do not use optimistic locking"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:211
#, no-c-format
-msgid "If you have two persistent classes with the same unqualified name, you should set <literal>auto-import=\"false\"</literal>. An exception will result if you attempt to assign two classes to the same \"imported\" name."
+msgid "It is <emphasis>strongly</emphasis> recommended that you use version/timestamp columns for optimistic locking with Hibernate. This strategy optimizes performance and correctly handles modifications made to detached instances (i.e. when <literal>Session.merge()</literal> is used)."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:220
#, no-c-format
-msgid "The <literal>hibernate-mapping</literal> element allows you to nest several persistent <literal><class></literal> mappings, as shown above. It is, however, good practice (and expected by some tools) to map only a single persistent class, or a single class hierarchy, in one mapping file and name it after the persistent superclass. For example, <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, <literal>Animal.hbm.xml</literal>."
+msgid "Be sure to import <classname>@javax.persistence.Entity</classname> to mark a class as an entity. It's a common mistake to import <classname>@org.hibernate.annotations.Entity</classname> by accident."
msgstr ""
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:227
#, no-c-format
-msgid "Class"
+msgid "Some entities are not mutable. They cannot be updated or deleted by the application. This allows Hibernate to make some minor performance optimizations.. Use the <classname>@Immutable</classname> annotation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:232
#, no-c-format
-msgid "You can declare a persistent class using the <literal>class</literal> element. For example:"
+msgid "You can also alter how Hibernate deals with lazy initialization for this class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false to disable lazy fetching (not recommended). You can also specify an interface to use for lazy initializing proxies (defaults to the class itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. Hibernate will initially return proxies (Javassist or CGLIB) that implement the named interface. The persistent object will load when a method of the proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:243
#, no-c-format
+msgid "<classname>@BatchSize</classname> specifies a \"batch size\" for fetching instances of this class by identifier. Not yet loaded instances are loaded batch-size at a time (default 1)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:247
+#, no-c-format
+msgid "You can specific an arbitrary SQL WHERE condition to be used when retrieving objects of this class. Use <classname>@Where</classname> for that."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:251
+#, no-c-format
+msgid "In the same vein, <classname>@Check</classname> lets you define an SQL expression used to generate a multi-row <emphasis>check</emphasis> constraint for automatic schema generation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:255
+#, no-c-format
+msgid "There is no difference between a view and a base table for a Hibernate mapping. This is transparent at the database level, although some DBMS do not support views properly, especially with updates. Sometimes you want to use a view, but you cannot create one in the database (i.e. with a legacy schema). In this case, you can map an immutable and read-only entity to a given SQL subselect expression using <classname>@org.hibernate.annotations.Subselect</classname>:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:263
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+ " + \"from item \"\n"
+ " + \"join bid on bid.item_id = item.id \"\n"
+ " + \"group by item.name\")\n"
+ "@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+ "public class Summary {\n"
+ " @Id\n"
+ " public String getId() { return id; }\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:265
+#, no-c-format
+msgid "Declare the tables to synchronize this entity with, ensuring that auto-flush happens correctly and that queries against the derived entity do not return stale data. The <literal><subselect></literal> is available both as an attribute and a nested mapping element."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:270
+#, no-c-format
+msgid "We will now explore the same options using the hbm.xml structure. You can declare a persistent class using the <literal>class</literal> element. For example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, no-c-format
+msgid ""
+ "<class\n"
+ " name=\"ClassName\"\n"
+ " table=\"tableName\"\n"
+ " discriminator-value=\"discriminator_value\"\n"
+ " mutable=\"true|false\"\n"
+ " schema=\"owner\"\n"
+ " catalog=\"catalog\"\n"
+ " proxy=\"ProxyInterface\"\n"
+ " dynamic-update=\"true|false\"\n"
+ " dynamic-insert=\"true|false\"\n"
+ " select-before-update=\"true|false\"\n"
+ " polymorphism=\"implicit|explicit\"\n"
+ " where=\"arbitrary sql where condition\"\n"
+ " persister=\"PersisterClass\"\n"
+ " batch-size=\"N\"\n"
+ " optimistic-lock=\"none|version|dirty|all\"\n"
+ " lazy=\"true|false\"\n"
+ " entity-name=\"EntityName\"\n"
+ " check=\"arbitrary sql check condition\"\n"
+ " rowid=\"rowid\"\n"
+ " subselect=\"SQL expression\"\n"
+ " abstract=\"true|false\"\n"
+ " node=\"element-name\"\n"
+ "/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:323
+#, no-c-format
msgid "<literal>name</literal> (optional): the fully qualified Java class name of the persistent class or interface. If this attribute is missing, it is assumed that the mapping is for a non-POJO entity."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:330
#, no-c-format
msgid "<literal>table</literal> (optional - defaults to the unqualified class name): the name of its database table."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:335
#, no-c-format
msgid "<literal>discriminator-value</literal> (optional - defaults to the class name): a value that distinguishes individual subclasses that is used for polymorphic behavior. Acceptable values include <literal>null</literal> and <literal>not null</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:343
#, no-c-format
msgid "<literal>mutable</literal> (optional - defaults to <literal>true</literal>): specifies that instances of the class are (not) mutable."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
#, no-c-format
msgid "<literal>schema</literal> (optional): overrides the schema name specified by the root <literal><hibernate-mapping></literal> element."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
#, no-c-format
msgid "<literal>catalog</literal> (optional): overrides the catalog name specified by the root <literal><hibernate-mapping></literal> element."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:361
#, no-c-format
msgid "<literal>proxy</literal> (optional): specifies an interface to use for lazy initializing proxies. You can specify the name of the class itself."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:367
#, no-c-format
msgid "<literal>dynamic-update</literal> (optional - defaults to <literal>false</literal>): specifies that <literal>UPDATE</literal> SQL should be generated at runtime and can contain only those columns whose values have changed."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:374
#, no-c-format
msgid "<literal>dynamic-insert</literal> (optional - defaults to <literal>false</literal>): specifies that <literal>INSERT</literal> SQL should be generated at runtime and contain only the columns whose values are not null."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:381
#, no-c-format
msgid "<literal>select-before-update</literal> (optional - defaults to <literal>false</literal>): specifies that Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</literal> unless it is certain that an object is actually modified. Only when a transient object has been associated with a new session using <literal>update()</literal>, will Hibernate perform an extra SQL <literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is actually required."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:393
#, no-c-format
-msgid "<literal>polymorphism</literal> (optional - defaults to <literal>implicit</literal>): determines whether implicit or explicit query polymorphism is used."
+msgid "<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</literal>): determines whether implicit or explicit query polymorphisms is used."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:399
#, no-c-format
msgid "<literal>where</literal> (optional): specifies an arbitrary SQL <literal>WHERE</literal> condition to be used when retrieving objects of this class."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:405
#, no-c-format
msgid "<literal>persister</literal> (optional): specifies a custom <literal>ClassPersister</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:410
#, no-c-format
msgid "<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): specifies a \"batch size\" for fetching instances of this class by identifier."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:416
#, no-c-format
msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>version</literal>): determines the optimistic locking strategy."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:422
#, no-c-format
msgid "<literal>lazy</literal> (optional): lazy fetching can be disabled by setting <literal>lazy=\"false\"</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:427
#, no-c-format
-msgid "<literal>entity-name</literal> (optional - defaults to the class name): Hibernate3 allows a class to be mapped multiple times, potentially to different tables. It also allows entity mappings that are represented by Maps or XML at the Java level. In these cases, you should provide an explicit arbitrary name for the entity. See <xref linkend=\"persistent-classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
+msgid "<literal>entity-name</literal> (optional - defaults to the class name): Hibernate3 allows a class to be mapped multiple times, potentially to different tables. It also allows entity mappings that are represented by Maps or XML at the Java level. In these cases, you should provide an explicit arbitrary name for the entity. See <xref linkend=\"persistent-classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:437
#, no-c-format
msgid "<literal>check</literal> (optional): an SQL expression used to generate a multi-row <emphasis>check</emphasis> constraint for automatic schema generation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:443
#, no-c-format
msgid "<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. On Oracle, for example, Hibernate can use the <literal>rowid</literal> extra column for fast updates once this option has been set to <literal>rowid</literal>. A ROWID is an implementation detail and represents the physical location of a stored tuple."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:452
#, no-c-format
msgid "<literal>subselect</literal> (optional): maps an immutable and read-only entity to a database subselect. This is useful if you want to have a view instead of a base table. See below for more information."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:459
#, no-c-format
msgid "<literal>abstract</literal> (optional): is used to mark abstract superclasses in <literal><union-subclass></literal> hierarchies."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:466
#, no-c-format
msgid "It is acceptable for the named persistent class to be an interface. You can declare implementing classes of that interface using the <literal><subclass></literal> element. You can persist any <emphasis>static</emphasis> inner class. Specify the class name using the standard form i.e. <literal>e.g.Foo$Bar</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:472
#, no-c-format
-msgid "Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated or deleted by the application. This allows Hibernate to make some minor performance optimizations."
+msgid "Here is how to do a virtual view (subselect) in XML:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:474
+#, no-c-format
+msgid ""
+ "<class name=\"Summary\">\n"
+ " <subselect>\n"
+ " select item.name, max(bid.amount), count(*)\n"
+ " from item\n"
+ " join bid on bid.item_id = item.id\n"
+ " group by item.name\n"
+ " </subselect>\n"
+ " <synchronize table=\"item\"/>\n"
+ " <synchronize table=\"bid\"/>\n"
+ " <id name=\"name\"/>\n"
+ " ...\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:476
#, no-c-format
-msgid "The optional <literal>proxy</literal> attribute enables lazy initialization of persistent instances of the class. Hibernate will initially return CGLIB proxies that implement the named interface. The persistent object will load when a method of the proxy is invoked. See \"Initializing collections and proxies\" below."
+msgid "The <literal><subselect></literal> is available both as an attribute and a nested mapping element."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:481
+#, no-c-format
+msgid "Identifiers"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:483
#, no-c-format
-msgid "<emphasis>Implicit</emphasis> polymorphism means that instances of the class will be returned by a query that names any superclass or implemented interface or class, and that instances of any subclass of the class will be returned by a query that names the class itself. <emphasis>Explicit</emphasis> polymorphism means that class instances will be returned only by queries that explicitly name that class. Queries that name the class will return only instances of subclasses mapped inside this <literal><class></literal> declaration as a <literal><subclass></literal> or <literal><joined-subclass></literal>. For most purposes, the default <literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit polymorphism is useful when two different classes are mapped to the same table This allows a \"lightweight\" class that contains a subset of the table columns."
+msgid "Mapped classes <emphasis>must</emphasis> declare the primary key column of the database table. Most classes will also have a JavaBeans-style property holding the unique identifier of an instance."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:488
#, no-c-format
-msgid "The <literal>persister</literal> attribute lets you customize the persistence strategy used for the class. You can, for example, specify your own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, or you can even provide a completely new implementation of the interface <literal>org.hibernate.persister.ClassPersister</literal> that implements, for example, persistence via stored procedure calls, serialization to flat files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgid "Mark the identifier property with <classname>@Id</classname>."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Person {\n"
+ " @Id Integer getId() { ... }\n"
+ " ...\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:493
#, no-c-format
-msgid "The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> settings are not inherited by subclasses, so they can also be specified on the <literal><subclass></literal> or <literal><joined-subclass></literal> elements. Although these settings can increase performance in some cases, they can actually decrease performance in others."
+msgid "In hbm.xml, use the <literal><id></literal> element which defines the mapping from that property to the primary key column."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:509
+#, no-c-format
+msgid ""
+ "<id\n"
+ " name=\"propertyName\"\n"
+ " type=\"typename\"\n"
+ " column=\"column_name\"\n"
+ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
+ " access=\"field|property|ClassName\">\n"
+ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+ "\n"
+ " <generator class=\"generatorClass\"/>\n"
+ "</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:513
#, no-c-format
-msgid "Use of <literal>select-before-update</literal> will usually decrease performance. It is useful to prevent a database update trigger being called unnecessarily if you reattach a graph of detached instances to a <literal>Session</literal>."
+msgid "<literal>name</literal> (optional): the name of the identifier property."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
#, no-c-format
-msgid "If you enable <literal>dynamic-update</literal>, you will have a choice of optimistic locking strategies:"
+msgid "<literal>type</literal> (optional): a name that indicates the Hibernate type."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:523
#, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
+msgid "<literal>column</literal> (optional - defaults to the property name): the name of the primary key column."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:528
#, no-c-format
-msgid "<literal>all</literal>: check all columns"
+msgid "<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" value): an identifier property value that indicates an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:536
#, no-c-format
-msgid "<literal>dirty</literal>: check the changed columns, allowing some concurrent updates"
+msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate should use for accessing the property value."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
+msgid "If the <literal>name</literal> attribute is missing, it is assumed that the class has no identifier property."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:546
#, no-c-format
-msgid "It is <emphasis>strongly</emphasis> recommended that you use version/timestamp columns for optimistic locking with Hibernate. This strategy optimizes performance and correctly handles modifications made to detached instances (i.e. when <literal>Session.merge()</literal> is used)."
+msgid "The <literal>unsaved-value</literal> attribute is almost never needed in Hibernate3 and indeed has no corresponding element in annotations."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:550
#, no-c-format
-msgid "There is no difference between a view and a base table for a Hibernate mapping. This is transparent at the database level, although some DBMS do not support views properly, especially with updates. Sometimes you want to use a view, but you cannot create one in the database (i.e. with a legacy schema). In this case, you can map an immutable and read-only entity to a given SQL subselect expression:"
+msgid "You can also declare the identifier as a composite identifier. This allows access to legacy data with composite keys. Its use is strongly discouraged for anything else."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:555
+#, no-c-format
+msgid "Composite identifier"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:557
#, no-c-format
-msgid "Declare the tables to synchronize this entity with, ensuring that auto-flush happens correctly and that queries against the derived entity do not return stale data. The <literal><subselect></literal> is available both as an attribute and a nested mapping element."
+msgid "You can define a composite primary key through several syntaxes:"
msgstr ""
+#. Tag: para
+#: basic_mapping.xml:562
+#, no-c-format
+msgid "use a component type to represent the identifier and map it as a property in the entity: you then annotated the property as <classname>@EmbeddedId</classname>. The component type has to be <classname>Serializable</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:569
+#, no-c-format
+msgid "map multiple properties as <classname>@Id</classname> properties: the identifier type is then the entity class itself and needs to be <classname>Serializable</classname>. This approach is unfortunately not standard and only supported by Hibernate."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:577
+#, no-c-format
+msgid "map multiple properties as <classname>@Id</classname> properties and declare an external class to be the identifier type. This class, which needs to be <classname>Serializable</classname>, is declared on the entity via the <classname>@IdClass</classname> annotation. The identifier type must contain the same properties as the identifier properties of the entity: each property name must be the same, its type must be the same as well if the entity property is of a basic type, its type must be the type of the primary key of the associated entity if the entity property is an association (either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</classname>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:592
+#, no-c-format
+msgid "As you can see the last case is far from obvious. It has been inherited from the dark ages of EJB 2 for backward compatibilities and we recommend you not to use it (for simplicity sake)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:596
+#, no-c-format
+msgid "Let's explore all three cases using examples."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:599
#, no-c-format
-msgid "id"
+msgid "id as a property using a component type"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:601
#, no-c-format
-msgid "Mapped classes <emphasis>must</emphasis> declare the primary key column of the database table. Most classes will also have a JavaBeans-style property holding the unique identifier of an instance. The <literal><id></literal> element defines the mapping from that property to the primary key column."
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class User {\n"
+ " @EmbeddedId\n"
+ " @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname\")\n"
+ " UserId id;\n"
+ "\n"
+ " Integer age;\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class UserId implements Serializable {\n"
+ " String firstName;\n"
+ " String lastName;\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:606
#, no-c-format
-msgid "<literal>name</literal> (optional): the name of the identifier property."
+msgid "You can notice that the <classname>UserId</classname> class is serializable. To override the column mapping, use <classname>@AttributeOverride</classname>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:610
#, no-c-format
-msgid "<literal>type</literal> (optional): a name that indicates the Hibernate type."
+msgid "An embedded id can itself contains the primary key of an associated entity."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class Customer {\n"
+ " @EmbeddedId CustomerId id;\n"
+ " boolean preferredCustomer;\n"
+ "\n"
+ " @MapsId(\"userId\")\n"
+ " @JoinColumns({\n"
+ " @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName\"),\n"
+ " @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName\")\n"
+ " })\n"
+ " @OneToOne User user;\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class CustomerId implements Serializable {\n"
+ " UserId userId;\n"
+ " String customerNumber;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "class User {\n"
+ " @EmbeddedId UserId id;\n"
+ " Integer age;\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class UserId implements Serializable {\n"
+ " String firstName;\n"
+ " String lastName;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:615
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of the primary key column."
+msgid "In the embedded id object, the association is represented as the identifier of the associated entity. But you can link its value to a regular association in the entity via the <classname>@MapsId</classname> annotation. The <classname>@MapsId</classname> value correspond to the property name of the embedded id object containing the associated entity's identifier. In the database, it means that the <literal>Customer.user</literal> and the <literal>CustomerId.userId</literal> properties share the same underlying column (<literal>user_fk</literal> in this case)."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:627
#, no-c-format
-msgid "<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" value): an identifier property value that indicates an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session."
+msgid "The component type used as identifier must implement <methodname>equals()</methodname> and <methodname>hashCode()</methodname>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:632
#, no-c-format
-msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate should use for accessing the property value."
+msgid "In practice, your code only sets the <literal>Customer.user</literal> property and the user id value is copied by Hibernate into the <literal>CustomerId.userId</literal> property."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:638
#, no-c-format
-msgid "If the <literal>name</literal> attribute is missing, it is assumed that the class has no identifier property."
+msgid "The id value can be copied as late as flush time, don't rely on it until after flush time."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:642
#, no-c-format
-msgid "The <literal>unsaved-value</literal> attribute is almost never needed in Hibernate3."
+msgid "While not supported in JPA, Hibernate lets you place your association directly in the embedded id component (instead of having to use the <classname>@MapsId</classname> annotation)."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class Customer {\n"
+ " @EmbeddedId CustomerId id;\n"
+ " boolean preferredCustomer;\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class CustomerId implements Serializable {\n"
+ " @OneToOne\n"
+ " @JoinColumns({\n"
+ " @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName\"),\n"
+ " @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName\")\n"
+ " }) \n"
+ " User user;\n"
+ " String customerNumber;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "class User {\n"
+ " @EmbeddedId UserId id;\n"
+ " Integer age;\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class UserId implements Serializable {\n"
+ " String firstName;\n"
+ " String lastName;\n"
+ "\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:648
#, no-c-format
-msgid "There is an alternative <literal><composite-id></literal> declaration that allows access to legacy data with composite keys. Its use is strongly discouraged for anything else."
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:651
+#, no-c-format
+msgid ""
+ "<composite-id\n"
+ " name=\"propertyName\"\n"
+ " class=\"ClassName\"\n"
+ " mapped=\"true|false\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " node=\"element-name|.\">\n"
+ "\n"
+ " <key-property name=\"propertyName\" type=\"typename\" column=\"column_name\"/>\n"
+ " <key-many-to-one name=\"propertyName\" class=\"ClassName\" column=\"column_name\"/>\n"
+ " ......\n"
+ "</composite-id>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:653
+#, no-c-format
+msgid "First a simple example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
+msgid ""
+ "<class name=\"User\">\n"
+ " <composite-id name=\"id\" class=\"UserId\">\n"
+ " <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+ " <key-property name=\"lastName\"/>\n"
+ " </composite-id>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:657
+#, no-c-format
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
+msgid ""
+ "<class name=\"Customer\">\n"
+ " <composite-id name=\"id\" class=\"CustomerId\">\n"
+ " <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+ " <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+ " <key-property name=\"customerNumber\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"preferredCustomer\"/>\n"
+ "\n"
+ " <many-to-one name=\"user\">\n"
+ " <column name=\"userfirstname_fk\" updatable=\"false\" insertable=\"false\"/>\n"
+ " <column name=\"userlastname_fk\" updatable=\"false\" insertable=\"false\"/>\n"
+ " </many-to-one>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"User\">\n"
+ " <composite-id name=\"id\" class=\"UserId\">\n"
+ " <key-property name=\"firstName\"/>\n"
+ " <key-property name=\"lastName\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"age\"/>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:662
+#, no-c-format
+msgid "Notice a few things in the previous example:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:666
+#, no-c-format
+msgid "the order of the properties (and column) matters. It must be the same between the association and the primary key of the associated entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:672
+#, no-c-format
+msgid "the many to one uses the same columns as the primary key and thus must be marked as read only (<literal>insertable</literal> and <literal>updatable</literal> to false)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:679
+#, no-c-format
+msgid "unlike with <classname>@MapsId</classname>, the id value of the associated entity is not transparently copied, check the <literal>foreign</literal> id generator for more information."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:686
+#, no-c-format
+msgid "The last example shows how to map association directly in the embedded id component."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+ "<class name=\"Customer\">\n"
+ " <composite-id name=\"id\" class=\"CustomerId\">\n"
+ " <key-many-to-one name=\"user\">\n"
+ " <column name=\"userfirstname_fk\"/>\n"
+ " <column name=\"userlastname_fk\"/>\n"
+ " </key-many-to-one>\n"
+ " <key-property name=\"customerNumber\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"preferredCustomer\"/>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"User\">\n"
+ " <composite-id name=\"id\" class=\"UserId\">\n"
+ " <key-property name=\"firstName\"/>\n"
+ " <key-property name=\"lastName\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"age\"/>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:691
+#, no-c-format
+msgid "This is the recommended approach to map composite identifier. The following options should not be considered unless some constraint are present."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:697
#, no-c-format
-msgid "Generator"
+msgid "Multiple id properties without identifier type"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:699
#, no-c-format
-msgid "The optional <literal><generator></literal> child element names a Java class used to generate unique identifiers for instances of the persistent class. If any parameters are required to configure or initialize the generator instance, they are passed using the <literal><param></literal> element."
+msgid "Another, arguably more natural, approach is to place <classname>@Id</classname> on multiple properties of your entity. This approach is only supported by Hibernate (not JPA compliant) but does not require an extra embeddable component."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class Customer implements Serializable {\n"
+ " @Id @OneToOne\n"
+ " @JoinColumns({\n"
+ " @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName\"),\n"
+ " @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName\")\n"
+ " })\n"
+ " User user;\n"
+ " \n"
+ " @Id String customerNumber;\n"
+ "\n"
+ " boolean preferredCustomer;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "class User {\n"
+ " @EmbeddedId UserId id;\n"
+ " Integer age;\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class UserId implements Serializable {\n"
+ " String firstName;\n"
+ " String lastName;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:706
#, no-c-format
+msgid "In this case <classname>Customer</classname> is its own identifier representation: it must implement <classname>Serializable</classname> and must implement <methodname>equals()</methodname> and <methodname>hashCode()</methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:712
+#, no-c-format
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+ "<class name=\"Customer\">\n"
+ " <composite-id>\n"
+ " <key-many-to-one name=\"user\">\n"
+ " <column name=\"userfirstname_fk\"/>\n"
+ " <column name=\"userlastname_fk\"/>\n"
+ " </key-many-to-one>\n"
+ " <key-property name=\"customerNumber\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"preferredCustomer\"/>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"User\">\n"
+ " <composite-id name=\"id\" class=\"UserId\">\n"
+ " <key-property name=\"firstName\"/>\n"
+ " <key-property name=\"lastName\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"age\"/>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:718
+#, no-c-format
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:721
+#, no-c-format
+msgid "<classname>@IdClass</classname> on an entity points to the class (component) representing the identifier of the class. The properties marked <classname>@Id</classname> on the entity must have their corresponding property on the <classname>@IdClass</classname>. The return type of search twin property must be either identical for basic properties or must correspond to the identifier class of the associated entity for an association."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:730
+#, no-c-format
+msgid "This approach is inherited from the EJB 2 days and we recommend against its use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@IdClass(CustomerId.class)\n"
+ "class Customer implements Serializable {\n"
+ " @Id @OneToOne\n"
+ " @JoinColumns({\n"
+ " @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName\"),\n"
+ " @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName\")\n"
+ " }) \n"
+ " User user;\n"
+ " \n"
+ " @Id String customerNumber;\n"
+ "\n"
+ " boolean preferredCustomer;\n"
+ "}\n"
+ "\n"
+ "class CustomerId implements Serializable {\n"
+ " UserId user;\n"
+ " String customerNumber;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "class User {\n"
+ " @EmbeddedId UserId id;\n"
+ " Integer age;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class UserId implements Serializable {\n"
+ " String firstName;\n"
+ " String lastName;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:737
+#, no-c-format
+msgid "<classname>Customer</classname> and <classname>CustomerId</classname> do have the same properties <literal>customerNumber</literal> as well as <literal>user</literal>. <classname>CustomerId</classname> must be <classname>Serializable</classname> and implement <classname>equals()</classname> and <classname>hashCode()</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:745
+#, no-c-format
+msgid "While not JPA standard, Hibernate let's you declare the vanilla associated property in the <classname>@IdClass</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@IdClass(CustomerId.class)\n"
+ "class Customer implements Serializable {\n"
+ " @Id @OneToOne\n"
+ " @JoinColumns({\n"
+ " @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName\"),\n"
+ " @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName\")\n"
+ " }) \n"
+ " User user;\n"
+ " \n"
+ " @Id String customerNumber;\n"
+ "\n"
+ " boolean preferredCustomer;\n"
+ "}\n"
+ "\n"
+ "class CustomerId implements Serializable {\n"
+ " @OneToOne User user;\n"
+ " String customerNumber;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "class User {\n"
+ " @EmbeddedId UserId id;\n"
+ " Integer age;\n"
+ "\n"
+ " //implements equals and hashCode\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "class UserId implements Serializable {\n"
+ " String firstName;\n"
+ " String lastName;\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:751
+#, no-c-format
+msgid "This feature is of limited interest though as you are likely to have chosen the <classname>@IdClass</classname> approach to stay JPA compliant or you have a quite twisted mind."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+ "<class name=\"Customer\">\n"
+ " <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+ " <key-many-to-one name=\"user\">\n"
+ " <column name=\"userfirstname_fk\"/>\n"
+ " <column name=\"userlastname_fk\"/>\n"
+ " </key-many-to-one>\n"
+ " <key-property name=\"customerNumber\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"preferredCustomer\"/>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"User\">\n"
+ " <composite-id name=\"id\" class=\"UserId\">\n"
+ " <key-property name=\"firstName\"/>\n"
+ " <key-property name=\"lastName\"/>\n"
+ " </composite-id>\n"
+ "\n"
+ " <property name=\"age\"/>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:762
+#, no-c-format
+msgid "Identifier generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:764
+#, no-c-format
+msgid "Hibernate can generate and populate identifier values for you automatically. This is the recommended approach over \"business\" or \"natural\" id (especially composite ids)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:768
+#, no-c-format
+msgid "Hibernate offers various generation strategies, let's explore the most common ones first that happens to be standardized by JPA:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:774
+#, no-c-format
+msgid "IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:781
+#, no-c-format
+msgid "SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo algorithm to efficiently generate identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>, given a named database sequence."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:788
+#, no-c-format
+msgid "TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>, given a table and column as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:798
+#, no-c-format
+msgid "AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or <literal>TABLE</literal> depending upon the capabilities of the underlying database."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:805
+#, no-c-format
+msgid "We recommend all new projects to use the new enhanced identifier generators. They are deactivated by default for entities using annotations but can be activated using <code>hibernate.id.new_generator_mappings=true</code>. These new generators are more efficient and closer to the JPA 2 specification semantic."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:812
+#, no-c-format
+msgid "However they are not backward compatible with existing Hibernate based application (if a sequence or a table is used for id generation). See XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how to activate them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:818
+#, no-c-format
+msgid "To mark an id property as generated, use the <classname>@GeneratedValue</classname> annotation. You can specify the strategy used (default to <literal>AUTO</literal>) by setting <literal>strategy</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Customer {\n"
+ " @Id @GeneratedValue\n"
+ " Integer getId() { ... };\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "public class Invoice {\n"
+ " @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+ " Integer getId() { ... };\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid "<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional configurations that you can set using <classname>@SequenceGenerator</classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
+#, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, no-c-format
+msgid "<literal>table</literal> / <literal>sequenceName</literal>: name of the table or the sequence (defaulting respectively to <literal>hibernate_sequences</literal> and <literal>hibernate_sequence</literal>)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:843
+#, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, no-c-format
+msgid "<literal>initialValue</literal>: the value from which the id is to start generating"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid "<literal>allocationSize</literal>: the amount to increment by when allocating id numbers from the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid "In addition, the <classname>TABLE</classname> strategy also let you customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
+#, no-c-format
+msgid "<literal>pkColumnName</literal>: the column name containing the entity identifier"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, no-c-format
+msgid "<literal>valueColumnName</literal>: the column name containing the identifier value"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:873
+#, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:878
+#, no-c-format
+msgid "<literal>uniqueConstraints</literal>: any potential column constraint on the table containing the ids"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:883
+#, no-c-format
+msgid "To link a table or sequence generator definition with an actual generated property, use the same name in both the definition <literal>name</literal> and the generator value <literal>generator</literal> as shown below."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+ "@Id \n"
+ "@GeneratedValue(\n"
+ " strategy=GenerationType.SEQUENCE, \n"
+ " generator=\"SEQ_GEN\")\n"
+ "@javax.persistence.SequenceGenerator(\n"
+ " name=\"SEQ_GEN\",\n"
+ " sequenceName=\"my_sequence\",\n"
+ " allocationSize=20\n"
+ ")\n"
+ "public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:890
+#, no-c-format
+msgid "The scope of a generator definition 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 in JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+ "@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"
+ "@javax.persistence.SequenceGenerator(\n"
+ " name=\"SEQ_GEN\",\n"
+ " sequenceName=\"my_sequence\",\n"
+ " allocationSize=20\n"
+ ")"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:898
+#, no-c-format
+msgid "If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</literal> are application level generators."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:904
+#, no-c-format
+msgid "Package level definition is not supported by the JPA specification. However, you can use the <literal>@GenericGenerator</literal> at the package level (see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:910
+#, no-c-format
+msgid "These are the four standard JPA generators. Hibernate goes beyond that and provide additional generators or additional options as we will see below. You can also write your own custom identifier generator by implementing <classname>org.hibernate.id.IdentifierGenerator</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:916
+#, no-c-format
+msgid "To define a custom generator, use the <classname>@GenericGenerator</classname> annotation (and its plural counter part <classname>@GenericGenerators</classname>) that describes the class of the identifier generator or its short cut name (as described below) and a list of key/value parameters. When using <classname>@GenericGenerator</classname> and assigning it via <classname>@GeneratedValue.generator</classname>, the <classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+ "@GenericGenerator(\n"
+ " name=\"trigger-generated\", \n"
+ " strategy = \"select\",\n"
+ " parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+ ")\n"
+ "public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, no-c-format
+msgid "The hbm.xml approach uses the optional <literal><generator></literal> child element inside <literal><id></literal>. If any parameters are required to configure or initialize the generator instance, they are passed using the <literal><param></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, no-c-format
+msgid ""
+ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+ " <param name=\"table\">uid_table</param>\n"
+ " <param name=\"column\">next_hi_value_column</param>\n"
+ " </generator>\n"
+ "</id>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:937
+#, no-c-format
+msgid "Various additional generators"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:939
+#, no-c-format
msgid "All generators implement the interface <literal>org.hibernate.id.IdentifierGenerator</literal>. This is a very simple interface. Some applications can choose to provide their own specialized implementations, however, Hibernate provides a range of built-in implementations. The shortcut names for the built-in generators are as follows:"
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:946
#, no-c-format
-msgid "<literal>increment</literal>"
+msgid "increment"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
msgid "generates identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal> that are unique only when no other process is inserting data into the same table. <emphasis>Do not use in a cluster.</emphasis>"
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:958
#, no-c-format
-msgid "<literal>identity</literal>"
+msgid "identity"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
msgid "supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:969
#, no-c-format
-msgid "<literal>sequence</literal>"
+msgid "sequence"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
msgid "uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>"
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:980
#, no-c-format
-msgid "<literal>hilo</literal>"
+msgid "hilo"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
msgid "uses a hi/lo algorithm to efficiently generate identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>, given a table and column (by default <literal>hibernate_unique_key</literal> and <literal>next_hi</literal> respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:996
#, no-c-format
-msgid "<literal>seqhilo</literal>"
+msgid "seqhilo"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
msgid "uses a hi/lo algorithm to efficiently generate identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>, given a named database sequence."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
#, no-c-format
-msgid "<literal>uuid</literal>"
+msgid "uuid"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1010
#, no-c-format
-msgid "uses a 128-bit UUID algorithm to generate identifiers of type string that are unique within a network (the IP address is used). The UUID is encoded as a string of 32 hexadecimal digits in length."
+msgid "Generates a 128-bit UUID based on a custom algorithm. The value generated is represented as a string of 32 hexidecimal digits. Users can also configure it to use a separator (config parameter \"separator\") which separates the hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator discussed below."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1023
#, no-c-format
-msgid "<literal>guid</literal>"
+msgid "uuid2"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
+msgid "Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact \"version\" (the RFC term) generated depends on the pluggable \"generation strategy\" used (see below). Capable of generating values as <classname>java.util.UUID</classname>, <classname>java.lang.String</classname> or as a byte array of length 16 (<literal>byte[16]</literal>). The \"generation strategy\" is defined by the interface <interfacename>org.hibernate.id.UUIDGenerationStrategy</interfacename>. The generator defines 2 configuration parameters for defining which generation strategy to use:"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1038
+#, no-c-format
+msgid "uuid_gen_strategy_class"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1041
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1047
+#, no-c-format
+msgid "uuid_gen_strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1050
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid "<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the default) - generates \"version 3\" (aka, \"random\") UUID values via the <methodname>randomUUID</methodname> method of <classname>java.util.UUID</classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid "<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - generates \"version 1\" UUID values, using IP address since mac address not available. If you need mac address to be used, consider leveraging one of the existing third party UUID generators which sniff out mac address and integrating it via the <interfacename>org.hibernate.id.UUIDGenerationStrategy</interfacename> contract. Two such libraries known at time of this writing include <ulink url=\"http://johannburkard.de/software/uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url=\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, no-c-format
+msgid "guid"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1094
#, no-c-format
-msgid "<literal>native</literal>"
+msgid "native"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1097
#, no-c-format
msgid "selects <literal>identity</literal>, <literal>sequence</literal> or <literal>hilo</literal> depending upon the capabilities of the underlying database."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1105
#, no-c-format
-msgid "<literal>assigned</literal>"
+msgid "assigned"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1108
#, no-c-format
msgid "lets the application assign an identifier to the object before <literal>save()</literal> is called. This is the default strategy if no <literal><generator></literal> element is specified."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1117
#, no-c-format
-msgid "<literal>select</literal>"
+msgid "select"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1120
#, no-c-format
msgid "retrieves a primary key, assigned by a database trigger, by selecting the row by some unique key and retrieving the primary key value."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1127
#, no-c-format
-msgid "<literal>foreign</literal>"
+msgid "foreign"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1130
#, no-c-format
msgid "uses the identifier of another associated object. It is usually used in conjunction with a <literal><one-to-one></literal> primary key association."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1138
#, no-c-format
-msgid "<literal>sequence-identity</literal>"
+msgid "sequence-identity"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1141
#, no-c-format
msgid "a specialized sequence generation strategy that utilizes a database sequence for the actual value generation, but combines this with JDBC3 getGeneratedKeys to return the generated identifier value as part of the insert statement execution. This strategy is only supported on Oracle 10g drivers targeted for JDK 1.4. Comments on these insert statements are disabled due to a bug in the Oracle drivers."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1157
#, no-c-format
msgid "The <literal>hilo</literal> and <literal>seqhilo</literal> generators provide two alternate implementations of the hi/lo algorithm. The first implementation requires a \"special\" database table to hold the next available \"hi\" value. Where supported, the second uses an Oracle-style sequence."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, no-c-format
+msgid ""
+ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+ " <generator class=\"hilo\">\n"
+ " <param name=\"table\">hi_value</param>\n"
+ " <param name=\"column\">next_value</param>\n"
+ " <param name=\"max_lo\">100</param>\n"
+ " </generator>\n"
+ "</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, no-c-format
+msgid ""
+ "<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+ " <generator class=\"seqhilo\">\n"
+ " <param name=\"sequence\">hi_value</param>\n"
+ " <param name=\"max_lo\">100</param>\n"
+ " </generator>\n"
+ "</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1167
#, no-c-format
msgid "Unfortunately, you cannot use <literal>hilo</literal> when supplying your own <literal>Connection</literal> to Hibernate. When Hibernate uses an application server datasource to obtain connections enlisted with JTA, you must configure the <literal>hibernate.transaction.manager_lookup_class</literal>."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1177
#, no-c-format
msgid "The UUID contains: IP address, startup time of the JVM that is accurate to a quarter second, system time and a counter value that is unique within the JVM. It is not possible to obtain a MAC address or memory address from Java code, so this is the best option without using JNI."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1187
#, no-c-format
msgid "For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), you can use <literal>identity</literal> key generation. For databases that support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you can use <literal>sequence</literal> style key generation. Both of these strategies require two SQL queries to insert a new object. For example:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, no-c-format
+msgid ""
+ "<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+ " <generator class=\"sequence\">\n"
+ " <param name=\"sequence\">person_id_sequence</param>\n"
+ " </generator>\n"
+ "</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, no-c-format
+msgid ""
+ "<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0\">\n"
+ " <generator class=\"identity\"/>\n"
+ "</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1199
#, no-c-format
msgid "For cross-platform development, the <literal>native</literal> strategy will, depending on the capabilities of the underlying database, choose from the <literal>identity</literal>, <literal>sequence</literal> and <literal>hilo</literal> strategies."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1209
#, no-c-format
-msgid "If you want the application to assign identifiers, as opposed to having Hibernate generate them, you can use the <literal>assigned</literal> generator. This special generator uses the identifier value already assigned to the object's identifier property. The generator is used when the primary key is a natural key instead of a surrogate key. This is the default behavior if you do not specify a <literal><generator></literal> element."
+msgid "If you want the application to assign identifiers, as opposed to having Hibernate generate them, you can use the <literal>assigned</literal> generator. This special generator uses the identifier value already assigned to the object's identifier property. The generator is used when the primary key is a natural key instead of a surrogate key. This is the default behavior if you do not specify <classname>@GeneratedValue</classname> nor <literal><generator></literal> elements."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1218
#, no-c-format
msgid "The <literal>assigned</literal> generator makes Hibernate use <literal>unsaved-value=\"undefined\"</literal>. This forces Hibernate to go to the database to determine if an instance is transient or detached, unless there is a version or timestamp property, or you define <literal>Interceptor.isUnsaved()</literal>."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1228
#, no-c-format
msgid "Hibernate does not generate DDL with triggers. It is for legacy schemas only."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, no-c-format
+msgid ""
+ "<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+ " <generator class=\"select\">\n"
+ " <param name=\"key\">socialSecurityNumber</param>\n"
+ " </generator>\n"
+ "</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1233
#, no-c-format
msgid "In the above example, there is a unique valued property named <literal>socialSecurityNumber</literal>. It is defined by the class, as a natural key and a surrogate key named <literal>person_id</literal>, whose value is generated by a trigger."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1241
#, no-c-format
+msgid "Identity copy (foreign generator)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1243
+#, no-c-format
+msgid "Finally, you can ask Hibernate to copy the identifier from another associated entity. In the Hibernate jargon, it is known as a foreign generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class MedicalHistory implements Serializable {\n"
+ " @Id @OneToOne\n"
+ " @JoinColumn(name = \"person_id\")\n"
+ " Person patient;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Person implements Serializable {\n"
+ " @Id @GeneratedValue Integer id;\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1250
+#, no-c-format
+msgid "Or alternatively"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class MedicalHistory implements Serializable {\n"
+ " @Id Integer id;\n"
+ "\n"
+ " @MapsId @OneToOne\n"
+ " @JoinColumn(name = \"patient_id\")\n"
+ " Person patient;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "class Person {\n"
+ " @Id @GeneratedValue Integer id;\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1254
+#, no-c-format
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, no-c-format
+msgid ""
+ "<class name=\"MedicalHistory\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"foreign\">\n"
+ " <param name=\"property\">patient</param>\n"
+ " </generator>\n"
+ " </id>\n"
+ " <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, no-c-format
msgid "Enhanced identifier generators"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
msgid "Starting with release 3.2.3, there are 2 new generators which represent a re-thinking of 2 different aspects of identifier generation. The first aspect is database portability; the second is optimization Optimization means that you do not have to query the database for every request for a new identifier value. These two new generators are intended to take the place of some of the named generators described above, starting in 3.3.x. However, they are included in the current releases and can be referenced by FQN."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
msgid "The first of these new generators is <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal> which is intended, firstly, as a replacement for the <literal>sequence</literal> generator and, secondly, as a better portability generator than <literal>native</literal>. This is because <literal>native</literal> generally chooses between <literal>identity</literal> and <literal>sequence</literal> which have largely different semantics that can cause subtle issues in applications eyeing portability. <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal>, however, achieves portability in a different manner. It chooses between a table or a sequence in the database to store its incrementing values, depending on the capabilities of the dialect being used. The difference between this and <literal>native</literal> is that table-based and sequence-based storage have the same exact semantic. In fact, sequences are exactly what Hibernate tries to emulate with!
its table-based generators. This generator has a number of configuration parameters:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1291
#, no-c-format
msgid "<literal>sequence_name</literal> (optional, defaults to <literal>hibernate_sequence</literal>): the name of the sequence or table to be used."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1297
#, no-c-format
msgid "<literal>initial_value</literal> (optional, defaults to <literal>1</literal>): the initial value to be retrieved from the sequence/table. In sequence creation terms, this is analogous to the clause typically named \"STARTS WITH\"."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1304
#, no-c-format
msgid "<literal>increment_size</literal> (optional - defaults to <literal>1</literal>): the value by which subsequent calls to the sequence/table should differ. In sequence creation terms, this is analogous to the clause typically named \"INCREMENT BY\"."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1312
#, no-c-format
msgid "<literal>force_table_use</literal> (optional - defaults to <literal>false</literal>): should we force the use of a table as the backing structure even though the dialect might support sequence?"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1319
#, no-c-format
msgid "<literal>value_column</literal> (optional - defaults to <literal>next_val</literal>): only relevant for table structures, it is the name of the column on the table which is used to hold the value."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1326
#, no-c-format
-msgid "<literal>optimizer</literal> (optional - defaults to <literal>none</literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+msgid "<literal>optimizer</literal> (optional - defaults to <literal>none</literal>): See"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
msgid "The second of these new generators is <literal>org.hibernate.id.enhanced.TableGenerator</literal>, which is intended, firstly, as a replacement for the <literal>table</literal> generator, even though it actually functions much more like <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal>, and secondly, as a re-implementation of <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal> that utilizes the notion of pluggable optimizers. Essentially this generator defines a table capable of holding a number of different increment values simultaneously by using multiple distinctly keyed rows. This generator has a number of configuration parameters:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1345
#, no-c-format
msgid "<literal>table_name</literal> (optional - defaults to <literal>hibernate_sequences</literal>): the name of the table to be used."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1351
#, no-c-format
msgid "<literal>value_column_name</literal> (optional - defaults to <literal>next_val</literal>): the name of the column on the table that is used to hold the value."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1357
#, no-c-format
msgid "<literal>segment_column_name</literal> (optional - defaults to <literal>sequence_name</literal>): the name of the column on the table that is used to hold the \"segment key\". This is the value which identifies which increment value to use."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1365
#, no-c-format
msgid "<literal>segment_value</literal> (optional - defaults to <literal>default</literal>): The \"segment key\" value for the segment from which we want to pull increment values for this generator."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1372
#, no-c-format
msgid "<literal>segment_value_length</literal> (optional - defaults to <literal>255</literal>): Used for schema generation; the column size to create this segment key column."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1378
#, no-c-format
msgid "<literal>initial_value</literal> (optional - defaults to <literal>1</literal>): The initial value to be retrieved from the table."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1384
#, no-c-format
msgid "<literal>increment_size</literal> (optional - defaults to <literal>1</literal>): The value by which subsequent calls to the table should differ."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1390
#, no-c-format
-msgid "<literal>optimizer</literal> (optional - defaults to <literal></literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+msgid "<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1397
#, no-c-format
msgid "Identifier generator optimization"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1399
#, no-c-format
-msgid "For identifier generators that store values in the database, it is inefficient for them to hit the database on each and every call to generate a new identifier value. Instead, you can group a bunch of them in memory and only hit the database when you have exhausted your in-memory value group. This is the role of the pluggable optimizers. Currently only the two enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> support this operation."
+msgid "For identifier generators that store values in the database, it is inefficient for them to hit the database on each and every call to generate a new identifier value. Instead, you can group a bunch of them in memory and only hit the database when you have exhausted your in-memory value group. This is the role of the pluggable optimizers. Currently only the two enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> support this operation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
msgid "<literal>none</literal> (generally this is the default if no optimizer was specified): this will not perform any optimizations and hit the database for each and every request."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
msgid "<literal>hilo</literal>: applies a hi/lo algorithm around the database retrieved values. The values from the database for this optimizer are expected to be sequential. The values retrieved from the database structure for this optimizer indicates the \"group number\". The <literal>increment_size</literal> is multiplied by that value in memory to define a group \"hi value\"."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
msgid "<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this optimizer attempts to minimize the number of hits to the database. Here, however, we simply store the starting value for the \"next group\" into the database structure rather than a sequential value in combination with an in-memory grouping algorithm. Here, <literal>increment_size</literal> refers to the values coming from the database."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1441
#, no-c-format
-msgid "composite-id"
+msgid "Partial identifier generation"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1443
#, no-c-format
-msgid "A table with a composite key can be mapped with multiple properties of the class as identifier properties. The <literal><composite-id></literal> element accepts <literal><key-property></literal> property mappings and <literal><key-many-to-one></literal> mappings as child elements."
+msgid "Hibernate supports the automatic generation of some of the identifier properties. Simply use the <classname>@GeneratedValue</classname> annotation on one or several id properties."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1449
#, no-c-format
-msgid "The persistent class <emphasis>must</emphasis> override <literal>equals()</literal> and <literal>hashCode()</literal> to implement composite identifier equality. It must also implement <literal>Serializable</literal>."
+msgid "The Hibernate team has always felt such a construct as fundamentally wrong. Try hard to fix your data model before using this feature."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1454
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class CustomerInventory implements Serializable {\n"
+ " @Id\n"
+ " @TableGenerator(name = \"inventory\",\n"
+ " table = \"U_SEQUENCES\",\n"
+ " pkColumnName = \"S_ID\",\n"
+ " valueColumnName = \"S_NEXTNUM\",\n"
+ " pkColumnValue = \"inventory\",\n"
+ " allocationSize = 1000)\n"
+ " @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory\")\n"
+ " Integer id;\n"
+ "\n"
+ "\n"
+ " @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+ " Customer customer;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Customer implements Serializable {\n"
+ " @Id\n"
+ " private int id;\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1456
#, no-c-format
-msgid "Unfortunately, this approach means that a persistent object is its own identifier. There is no convenient \"handle\" other than the object itself. You must instantiate an instance of the persistent class itself and populate its identifier properties before you can <literal>load()</literal> the persistent state associated with a composite key. We call this approach an <emphasis>embedded</emphasis> composite identifier, and discourage it for serious applications."
+msgid "You can also generate properties inside an <classname>@EmbeddedId</classname> class."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:1462
+#, no-c-format
+msgid "Optimistic locking properties (optional)"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1464
#, no-c-format
-msgid "A second approach is what we call a <emphasis>mapped</emphasis> composite identifier, where the identifier properties named inside the <literal><composite-id></literal> element are duplicated on both the persistent class and a separate identifier class."
+msgid "When using long transactions or conversations that span several database transactions, it is useful to store versioning data to ensure that if the same entity is updated by two conversations, the last to commit changes will be informed and not override the other conversation's work. It guarantees some isolation while still allowing for good scalability and works particularly well in read-often write-sometimes situations."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1472
#, no-c-format
-msgid "In this example, both the composite identifier class, <literal>MedicareId</literal>, and the entity class itself have properties named <literal>medicareNumber</literal> and <literal>dependent</literal>. The identifier class must override <literal>equals()</literal> and <literal>hashCode()</literal> and implement <literal>Serializable</literal>. The main disadvantage of this approach is code duplication."
+msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1475
#, no-c-format
-msgid "The following attributes are used to specify a mapped composite identifier:"
+msgid "A version or timestamp property should never be null for a detached instance. Hibernate will detect any instance with a null version or timestamp as transient, irrespective of what other <literal>unsaved-value</literal> strategies are specified. <emphasis>Declaring a nullable version or timestamp property is an easy way to avoid problems with transitive reattachment in Hibernate. It is especially useful for people using assigned identifiers or composite keys</emphasis>."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:1485
+#, no-c-format
+msgid "Version number"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1487
#, no-c-format
-msgid "<literal>mapped</literal> (optional - defaults to <literal>false</literal>): indicates that a mapped composite identifier is used, and that the contained property mappings refer to both the entity class and the composite identifier class."
+msgid "You can add optimistic locking capability to an entity using the <literal>@Version</literal> annotation:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1490
+#, 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
+#: basic_mapping.xml:1492
#, no-c-format
-msgid "<literal>class</literal> (optional - but required for a mapped composite identifier): the class used as a composite identifier."
+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
+#: basic_mapping.xml:1497
#, no-c-format
-msgid "We will describe a third, even more convenient approach, where the composite identifier is implemented as a component class in <xref linkend=\"components-compositeid\" />. The attributes described below apply only to this alternative approach:"
+msgid "The version column may be a numeric. Hibernate supports any kind of type provided that you define and implement the appropriate <classname>UserVersionType</classname>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1501
#, no-c-format
-msgid "<literal>name</literal> (optional - required for this approach): a property of component type that holds the composite identifier. Please see chapter 9 for more information."
+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>LockModeType.OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType.PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
+msgid "If the version number is generated by the database (via a trigger for example), make sure to use <code>@org.hibernate.annotations.Generated(GenerationTime.ALWAYS).</code>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1511
+#, no-c-format
+msgid "To declare a version property in hbm.xml, use:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1530
+#, no-c-format
+msgid ""
+ "<version\n"
+ " column=\"version_column\"\n"
+ " name=\"propertyName\"\n"
+ " type=\"typename\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " unsaved-value=\"null|negative|undefined\"\n"
+ " generated=\"never|always\"\n"
+ " insert=\"true|false\"\n"
+ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+ "/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1534
+#, no-c-format
+msgid "<literal>column</literal> (optional - defaults to the property name): the name of the column holding the version number."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1540
+#, no-c-format
+msgid "<literal>name</literal>: the name of a property of the persistent class."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1545
+#, no-c-format
+msgid "<literal>type</literal> (optional - defaults to <literal>integer</literal>): the type of the version number."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1551
+#, no-c-format
+msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses to access the property value."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1557
+#, no-c-format
+msgid "<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</literal>): a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. <literal>Undefined</literal> specifies that the identifier property value should be used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1567
+#, no-c-format
+msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this version property value is generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1575
+#, no-c-format
+msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>): specifies whether the version column should be included in SQL insert statements. It can be set to <literal>false</literal> if the database column is defined with a default value of <literal>0</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1586
+#, no-c-format
+msgid "Timestamp"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1588
+#, no-c-format
+msgid "Alternatively, you can use a timestamp. Timestamps are a less safe implementation of optimistic locking. However, sometimes the application might use the timestamps in other ways."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1592
+#, no-c-format
+msgid "Simply mark a property of type <classname>Date</classname> or <classname>Calendar</classname> as <classname>@Version</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1596
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Flight implements Serializable {\n"
+ "...\n"
+ " @Version\n"
+ " public Date getLastUpdate() { ... }\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1598
+#, no-c-format
+msgid "Like version numbers, the timestamp can be generated by the database instead of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated(GenerationTime.ALWAYS).</code>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1602
+#, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
+#, no-c-format
+msgid ""
+ "<timestamp\n"
+ " column=\"timestamp_column\"\n"
+ " name=\"propertyName\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " unsaved-value=\"null|undefined\"\n"
+ " source=\"vm|db\"\n"
+ " generated=\"never|always\"\n"
+ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+ "/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1624
+#, no-c-format
+msgid "<literal>column</literal> (optional - defaults to the property name): the name of a column holding the timestamp."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1630
+#, no-c-format
+msgid "<literal>name</literal>: the name of a JavaBeans style property of Java type <literal>Date</literal> or <literal>Timestamp</literal> of the persistent class."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380 basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
+#, no-c-format
msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses for accessing the property value."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1642
#, no-c-format
-msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the component class used as a composite identifier. Please see the next section for more information."
+msgid "<literal>unsaved-value</literal> (optional - defaults to <literal>null</literal>): a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. <literal>Undefined</literal> specifies that the identifier property value should be used."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1652
#, no-c-format
-msgid "The third approach, an <emphasis>identifier component</emphasis>, is recommended for almost all applications."
+msgid "<literal>source</literal> (optional - defaults to <literal>vm</literal>): Where should Hibernate retrieve the timestamp value from? From the database, or from the current JVM? Database-based timestamps incur an overhead because Hibernate must hit the database in order to determine the \"next value\". It is safer to use in clustered environments. Not all <literal>Dialects</literal> are known to support the retrieval of the database's current timestamp. Others may also be unsafe for usage in locking due to lack of precision (Oracle 8, for example)."
msgstr ""
+#. Tag: para
+#: basic_mapping.xml:1665
+#, no-c-format
+msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this timestamp property value is actually generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:1675
#, no-c-format
-msgid "Discriminator"
+msgid "Note"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1677
#, no-c-format
-msgid "The <literal><discriminator></literal> element is required for polymorphic persistence using the table-per-class-hierarchy mapping strategy. It declares a discriminator column of the table. The discriminator column contains marker values that tell the persistence layer what subclass to instantiate for a particular row. A restricted set of types can be used: <literal>string</literal>, <literal>character</literal>, <literal>integer</literal>, <literal>byte</literal>, <literal>short</literal>, <literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</literal>."
+msgid "<literal><Timestamp></literal> is equivalent to <literal><version type=\"timestamp\"></literal>. And <literal><timestamp source=\"db\"></literal> is equivalent to <literal><version type=\"dbtimestamp\"></literal>"
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:1686
+#, no-c-format
+msgid "Property"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1688
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to <literal>class</literal>): the name of the discriminator column."
+msgid "You need to decide which property needs to be made persistent in a given entity. This differs slightly between the annotation driven metadata and the hbm.xml files."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:1693
+#, no-c-format
+msgid "Property mapping with annotations"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1695
#, no-c-format
-msgid "<literal>type</literal> (optional - defaults to <literal>string</literal>): a name that indicates the Hibernate type"
+msgid "In the annotations world, every non static non transient property (field or method depending on the access type) of an entity 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."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1702
#, no-c-format
-msgid "<literal>force</literal> (optional - defaults to <literal>false</literal>): \"forces\" Hibernate to specify the allowed discriminator values, even when retrieving all instances of the root class."
+msgid "The <literal>@Basic</literal> annotation allows you to declare the fetching strategy for a property. If set to <literal>LAZY</literal>, specifies that this property should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation, if your classes are not instrumented, property level lazy loading is silently ignored. The default is <literal>EAGER</literal>. You can also mark a property as not optional thanks to the <classname>@Basic.optional</classname> attribute. This will ensure that the underlying column are not nullable (if possible). Note that a better approach is to use the <classname>@NotNull</classname> annotation of the Bean Validation specification."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1715
#, no-c-format
-msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>): set this to <literal>false</literal> if your discriminator column is also part of a mapped composite identifier. It tells Hibernate not to include the column in SQL <literal>INSERTs</literal>."
+msgid "Let's look at a few examples:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+ "@Temporal(TemporalType.TIME)\n"
+ "java.util.Date getDepartureTime() { ... } // persistent property \n"
+ "\n"
+ "@Enumerated(EnumType.STRING)\n"
+ "Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1719
#, no-c-format
-msgid "<literal>formula</literal> (optional): an arbitrary SQL expression that is executed when a type has to be evaluated. It allows content-based discrimination."
+msgid "<literal>counter</literal>, a transient field, and <literal>lengthInMeter</literal>, a method annotated as <literal>@Transient</literal>, and will be ignored by the Hibernate. <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). The recommended alternative is to use the projection capability of JP-QL (Java Persistence Query Language) or Criteria queries."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1732
#, no-c-format
-msgid "Actual values of the discriminator column are specified by the <literal>discriminator-value</literal> attribute of the <literal><class></literal> and <literal><subclass></literal> elements."
+msgid "JPA support property mapping of all basic types supported by Hibernate (all basic Java types , their respective wrappers and serializable classes). Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> annotation as shown in the <literal>note</literal> property example."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1742
#, no-c-format
-msgid "The <literal>force</literal> attribute is only useful if the table contains rows with \"extra\" discriminator values that are not mapped to a persistent class. This will not usually be the case."
+msgid "In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
#, no-c-format
-msgid "The <literal>formula</literal> attribute allows you to declare an arbitrary SQL expression that will be used to evaluate the type of a row. For example:"
+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 <classname>Serializable</classname> type will be persisted in a Blob."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
+#, 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
+#: basic_mapping.xml:1768
#, no-c-format
-msgid "Version (optional)"
+msgid "Type"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1770
#, no-c-format
-msgid "The <literal><version></literal> element is optional and indicates that the table contains versioned data. This is particularly useful if you plan to use <emphasis>long transactions</emphasis>. See below for more information:"
+msgid "You can also manually specify a type using the <literal>@org.hibernate.annotations.Type</literal> and some parameters if needed. <classname>@Type.type</classname> could be:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of the column holding the version number."
+msgid "The name of a Hibernate basic type: <literal>integer, string, character, date, timestamp, float, binary, serializable, object, blob</literal> etc."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
#, no-c-format
-msgid "<literal>name</literal>: the name of a property of the persistent class."
+msgid "The name of a Java class with a default basic type: <literal>int, float, char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</literal> etc."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
#, no-c-format
-msgid "<literal>type</literal> (optional - defaults to <literal>integer</literal>): the type of the version number."
+msgid "The name of a serializable Java class."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
#, no-c-format
-msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses to access the property value."
+msgid "The class name of a custom type: <literal>com.illflow.type.MyCustomType</literal> etc."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1798
#, no-c-format
-msgid "<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</literal>): a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. <literal>Undefined</literal> specifies that the identifier property value should be used."
+msgid "If you do not specify a type, Hibernate will use reflection upon the named property and guess the correct Hibernate type. Hibernate will attempt to interpret the name of the return class of the property getter using, in order, rules 2, 3, and 4."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1803
#, no-c-format
-msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this version property value is generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
+msgid "<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when defined at the class level). If the type is used on a single entity, you can place the definition on the entity itself. Otherwise, it is recommended to place the definition at the package level. In the example below, when Hibernate encounters a property of class <literal>PhoneNumer</literal>, it delegates the persistence strategy to the custom mapping type <literal>PhoneNumberType</literal>. However, properties belonging to other classes, too, can delegate their persistence strategy to <literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</literal> annotation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1819
#, no-c-format
-msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>): specifies whether the version column should be included in SQL insert statements. It can be set to <literal>false</literal> if the database column is defined with a default value of <literal>0</literal>."
+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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+ "@TypeDef(\n"
+ " name = \"phoneNumber\",\n"
+ " defaultForType = PhoneNumber.class,\n"
+ " typeClass = PhoneNumberType.class\n"
+ ")\n"
+ "\n"
+ "@Entity\n"
+ "public class ContactDetails {\n"
+ " [...]\n"
+ " private PhoneNumber localPhoneNumber;\n"
+ " @Type(type=\"phoneNumber\")\n"
+ " private OverseasPhoneNumber overseasPhoneNumber;\n"
+ " [...]\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1826
#, no-c-format
-msgid "Version numbers can be of Hibernate type <literal>long</literal>, <literal>integer</literal>, <literal>short</literal>, <literal>timestamp</literal> or <literal>calendar</literal>."
+msgid "The following example shows the usage of the <literal>parameters</literal> attribute to customize the TypeDef."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
#, no-c-format
-msgid "A version or timestamp property should never be null for a detached instance. Hibernate will detect any instance with a null version or timestamp as transient, irrespective of what other <literal>unsaved-value</literal> strategies are specified. <emphasis>Declaring a nullable version or timestamp property is an easy way to avoid problems with transitive reattachment in Hibernate. It is especially useful for people using assigned identifiers or composite keys</emphasis>."
+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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+ "@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
+#: basic_mapping.xml:1840
#, no-c-format
-msgid "Timestamp (optional)"
+msgid "Access type"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1842
#, no-c-format
-msgid "The optional <literal><timestamp></literal> element indicates that the table contains timestamped data. This provides an alternative to versioning. Timestamps are a less safe implementation of optimistic locking. However, sometimes the application might use the timestamps in other ways."
+msgid "By default the access type of a class hierarchy is defined by the position of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> annotations. If these annotations are on a field, then only fields are considered for persistence and the state is accessed via the field. If there annotations are on a getter, then only the getters are considered for persistence and the state is accessed via the getter/setter. That works well in practice and is the recommended approach."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1850
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of a column holding the timestamp."
+msgid "The placement of annotations within a class hierarchy has to be consistent (either field or on property) to be able to determine the default access type. It is recommended to stick to one single annotation placement strategy throughout your whole application."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1857
#, no-c-format
-msgid "<literal>name</literal>: the name of a JavaBeans style property of Java type <literal>Date</literal> or <literal>Timestamp</literal> of the persistent class."
+msgid "However in some situations, you need to:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1861
#, no-c-format
-msgid "<literal>unsaved-value</literal> (optional - defaults to <literal>null</literal>): a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. <literal>Undefined</literal> specifies that the identifier property value should be used."
+msgid "force the access type of the entity hierarchy"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1865
#, no-c-format
-msgid "<literal>source</literal> (optional - defaults to <literal>vm</literal>): Where should Hibernate retrieve the timestamp value from? From the database, or from the current JVM? Database-based timestamps incur an overhead because Hibernate must hit the database in order to determine the \"next value\". It is safer to use in clustered environments. Not all <literal>Dialects</literal> are known to support the retrieval of the database's current timestamp. Others may also be unsafe for usage in locking due to lack of precision (Oracle 8, for example)."
+msgid "override the access type of a specific entity in the class hierarchy"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1870
#, no-c-format
-msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this timestamp property value is actually generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
+msgid "override the access type of an embeddable type"
msgstr ""
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid "The best use case is an embeddable class used by several entities that might not use the same access type. In this case it is better to force the access type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid "To force the access type on a given class, use the <classname>@Access</classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Order {\n"
+ " @Id private Long id;\n"
+ " public Long getId() { return id; }\n"
+ " public void setId(Long id) { this.id = id; }\n"
+ "\n"
+ " @Embedded private Address address;\n"
+ " public Address getAddress() { return address; }\n"
+ " public void setAddress() { this.address = address; }\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class User {\n"
+ " private Long id;\n"
+ " @Id public Long getId() { return id; }\n"
+ " public void setId(Long id) { this.id = id; }\n"
+ "\n"
+ " private Address address;\n"
+ " @Embedded public Address getAddress() { return address; }\n"
+ " public void setAddress() { this.address = address; }\n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "@Access(AcessType.PROPERTY)\n"
+ "public class Address {\n"
+ " private String street1;\n"
+ " public String getStreet1() { return street1; }\n"
+ " public void setStreet1() { this.street1 = street1; }\n"
+ "\n"
+ " private hashCode; //not persistent\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid "You can also override the access type of a single property while keeping the other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Order {\n"
+ " @Id private Long id;\n"
+ " public Long getId() { return id; }\n"
+ " public void setId(Long id) { this.id = id; }\n"
+ " @Transient private String userId;\n"
+ " @Transient private String orderId;\n"
+ "\n"
+ " @Access(AccessType.PROPERTY)\n"
+ " public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+ " public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid "In this example, the default access type is <classname>FIELD</classname> except for the <literal>orderNumber</literal> property. Note that the corresponding field, if any must be marked as <classname>@Transient</classname> or <code>transient</code>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:1896
#, no-c-format
-msgid "Note"
+msgid "@org.hibernate.annotations.AccessType"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1898
#, no-c-format
-msgid "<literal><Timestamp></literal> is equivalent to <literal><version type=\"timestamp\"></literal>. And <literal><timestamp source=\"db\"></literal> is equivalent to <literal><version type=\"dbtimestamp\"></literal>"
+msgid "The annotation <classname>@org.hibernate.annotations.AccessType</classname> should be considered deprecated for FIELD and PROPERTY access. It is still useful however if you need to use a custom access type."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:1907
#, no-c-format
-msgid "Property"
+msgid "Optimistic lock"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:1909
#, 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
+#: basic_mapping.xml:1914
+#, no-c-format
+msgid "More formally, specifies that updates to this property do not require acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, no-c-format
+msgid "<literal>name</literal> (optional): the column name (default to the property name)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, no-c-format
+msgid "<literal>unique</literal> (optional): set a unique constraint on this column or not (default false)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, no-c-format
+msgid "<literal>nullable</literal> (optional): set the column as nullable (default true)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, 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
+#: basic_mapping.xml:2008
+#, 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
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid "<literal>columnDefinition</literal> (optional): override the sql DDL fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, no-c-format
+msgid "<literal>table</literal> (optional): define the targeted table (default primary table)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid "<literal><literal>length</literal></literal> (optional): column length (default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid "<literal><literal>precision</literal></literal> (optional): column decimal precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid "<literal><literal>scale</literal></literal> (optional): column decimal scale if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+ "@Formula(\"obj_length * obj_height * obj_width\")\n"
+ "public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid "The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid "Otherwise, if the type of the property is annotated as @Embeddable, it is mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid "Otherwise, if the type of the property is <classname>Serializable</classname>, it is mapped as <classname>@Basic</classname> in a column holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid "Otherwise, if the type of the property is <classname>java.sql.Clob</classname> or <classname>java.sql.Blob</classname>, it is mapped as <classname>@Lob</classname> with the appropriate <classname>LobType</classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, no-c-format
msgid "The <literal><property></literal> element declares a persistent JavaBean style property of the class."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, no-c-format
+msgid ""
+ "<property\n"
+ " name=\"propertyName\"\n"
+ " column=\"column_name\"\n"
+ " type=\"typename\"\n"
+ " update=\"true|false\"\n"
+ " insert=\"true|false\"\n"
+ " formula=\"arbitrary SQL expression\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " lazy=\"true|false\"\n"
+ " unique=\"true|false\"\n"
+ " not-null=\"true|false\"\n"
+ " optimistic-lock=\"true|false\"\n"
+ " generated=\"never|insert|always\"\n"
+ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+ " index=\"index_name\"\n"
+ " unique_key=\"unique_key_id\"\n"
+ " length=\"L\"\n"
+ " precision=\"P\"\n"
+ " scale=\"S\"\n"
+ "/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2129
#, no-c-format
msgid "<literal>name</literal>: the name of the property, with an initial lowercase letter."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2134
#, no-c-format
msgid "<literal>column</literal> (optional - defaults to the property name): the name of the mapped database table column. This can also be specified by nested <literal><column></literal> element(s)."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2146
#, no-c-format
msgid "<literal>update, insert</literal> (optional - defaults to <literal>true</literal>): specifies that the mapped columns should be included in SQL <literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. Setting both to <literal>false</literal> allows a pure \"derived\" property whose value is initialized from some other property that maps to the same column(s), or by a trigger or other application."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
msgid "<literal>formula</literal> (optional): an SQL expression that defines the value for a <emphasis>computed</emphasis> property. Computed properties do not have a column mapping of their own."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2169
#, no-c-format
msgid "<literal>lazy</literal> (optional - defaults to <literal>false</literal>): specifies that this property should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2176
#, no-c-format
msgid "<literal>unique</literal> (optional): enables the DDL generation of a unique constraint for the columns. Also, allow this to be the target of a <literal>property-ref</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2183
#, no-c-format
msgid "<literal>not-null</literal> (optional): enables the DDL generation of a nullability constraint for the columns."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, no-c-format
msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this property do or do not require acquisition of the optimistic lock. In other words, it determines if a version increment should occur when this property is dirty."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2196
#, no-c-format
msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this property value is actually generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2230
#, no-c-format
-msgid "The name of a Hibernate basic type: <literal>integer, string, character, date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgid "If you do not specify a type, Hibernate will use reflection upon the named property and guess the correct Hibernate type. Hibernate will attempt to interpret the name of the return class of the property getter using, in order, rules 2, 3, and 4. In certain cases you will need the <literal>type</literal> attribute. For example, to distinguish between <literal>Hibernate.DATE</literal> and <literal>Hibernate.TIMESTAMP</literal>, or to specify a custom type."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2239
#, no-c-format
-msgid "The name of a Java class with a default basic type: <literal>int, float, char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</literal> etc."
+msgid "The <literal>access</literal> attribute allows you to control how Hibernate accesses the property at runtime. By default, Hibernate will call the property get/set pair. If you specify <literal>access=\"field\"</literal>, Hibernate will bypass the get/set pair and access the field directly using reflection. You can specify your own strategy for property access by naming a class that implements the interface <literal>org.hibernate.property.PropertyAccessor</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2248
#, no-c-format
-msgid "The name of a serializable Java class."
+msgid "A powerful feature is derived properties. These properties are by definition read-only. The property value is computed at load time. You declare the computation as an SQL expression. This then translates to a <literal>SELECT</literal> clause subquery in the SQL query that loads an instance:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, no-c-format
+msgid ""
+ "<property name=\"totalPrice\"\n"
+ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product p\n"
+ " WHERE li.productId = p.productId\n"
+ " AND li.customerId = customerId\n"
+ " AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2256
#, no-c-format
-msgid "The class name of a custom type: <literal>com.illflow.type.MyCustomType</literal> etc."
+msgid "You can reference the entity table by not declaring an alias on a particular column. This would be <literal>customerId</literal> in the given example. You can also use the nested <literal><formula></literal> mapping element if you do not want to use the attribute."
msgstr ""
+#. Tag: title
+#: basic_mapping.xml:2265
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2267
#, no-c-format
-msgid "If you do not specify a type, Hibernate will use reflection upon the named property and guess the correct Hibernate type. Hibernate will attempt to interpret the name of the return class of the property getter using, in order, rules 2, 3, and 4. In certain cases you will need the <literal>type</literal> attribute. For example, to distinguish between <literal>Hibernate.DATE</literal> and <literal>Hibernate.TIMESTAMP</literal>, or to specify a custom type."
+msgid "Embeddable objects (or components) are objects whose properties are mapped to the same table as the owning entity's table. Components can, in turn, declare their own properties, components or collections"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2272
#, no-c-format
-msgid "The <literal>access</literal> attribute allows you to control how Hibernate accesses the property at runtime. By default, Hibernate will call the property get/set pair. If you specify <literal>access=\"field\"</literal>, Hibernate will bypass the get/set pair and access the field directly using reflection. You can specify your own strategy for property access by naming a class that implements the interface <literal>org.hibernate.property.PropertyAccessor</literal>."
+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
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+ "@Embeddable\n"
+ "public class Address implements Serializable {\n"
+ " String city;\n"
+ " Country nationality; //no overriding here\n"
+ "}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
#, no-c-format
-msgid "A powerful feature is derived properties. These properties are by definition read-only. The property value is computed at load time. You declare the computation as an SQL expression. This then translates to a <literal>SELECT</literal> clause subquery in the SQL query that loads an instance:"
+msgid "An embeddable object inherits the access type of its owning entity (note that you can override that using the <literal>@Access</literal> annotation)."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2290
#, no-c-format
-msgid "You can reference the entity table by not declaring an alias on a particular column. This would be <literal>customerId</literal> in the given example. You can also use the nested <literal><formula></literal> mapping element if you do not want to use the attribute."
+msgid "The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded objects of embedded objects is through dotted expressions."
msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:2305
#, no-c-format
-msgid "Many-to-one"
+msgid ""
+ "@Embedded\n"
+ " @AttributeOverrides( {\n"
+ " @AttributeOverride(name=\"city\", column = @Column(name=\"fld_city\") ),\n"
+ " @AttributeOverride(name=\"nationality.iso2\", column = @Column(name=\"nat_Iso2\") ),\n"
+ " @AttributeOverride(name=\"nationality.name\", column = @Column(name=\"nat_CountryName\") )\n"
+ " //nationality columns in homeAddress are overridden\n"
+ " } )\n"
+ " Address homeAddress;"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2307
#, no-c-format
-msgid "An ordinary association to another persistent class is declared using a <literal>many-to-one</literal> element. The relational model is a many-to-one association; a foreign key in one table is referencing the primary key column(s) of the target table."
+msgid "Hibernate Annotations supports something that is not explicitly supported by the JPA 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
+#: basic_mapping.xml:2313
#, no-c-format
+msgid "You can also use association annotations in an embeddable object (ie <literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, <classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To override the association columns you can use <literal>@AssociationOverride</literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2319
+#, 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 as several embedded objects would share the same set of columns. In plain JPA, you need to override at least one set of columns. Hibernate, however, allows you to enhance the default naming mechanism through the <classname>NamingStrategy</classname> interface. You can write a strategy that prevent name clashing in such a situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an example of this."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2329
+#, no-c-format
+msgid "If a property of the embedded object points back to the owning entity, annotate it with the <classname>@Parent</classname> annotation. Hibernate will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
+#, no-c-format
+msgid ""
+ "<component\n"
+ " name=\"propertyName\"\n"
+ " class=\"className\"\n"
+ " insert=\"true|false\"\n"
+ " update=\"true|false\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " lazy=\"true|false\"\n"
+ " optimistic-lock=\"true|false\"\n"
+ " unique=\"true|false\"\n"
+ " node=\"element-name|.\"\n"
+ ">\n"
+ "\n"
+ " <property ...../>\n"
+ " <many-to-one .... />\n"
+ " ........\n"
+ "</component>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
+#, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:2364
#, no-c-format
+msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the name of the component (child) class."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
+#, no-c-format
+msgid "<literal>insert</literal>: do the mapped columns appear in SQL <literal>INSERTs</literal>?"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
+#, no-c-format
+msgid "<literal>update</literal>: do the mapped columns appear in SQL <literal>UPDATEs</literal>?"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2386
+#, no-c-format
+msgid "<literal>lazy</literal> (optional - defaults to <literal>false</literal>): specifies that this component should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2393
+#, no-c-format
+msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this component either do or do not require acquisition of the optimistic lock. It determines if a version increment should occur when this property is dirty."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
+#, no-c-format
+msgid "<literal>unique</literal> (optional - defaults to <literal>false</literal>): specifies that a unique constraint exists upon all mapped columns of the component."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2408
+#, no-c-format
+msgid "The child <literal><property></literal> tags map properties of the child class to table columns."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2411
+#, no-c-format
+msgid "The <literal><component></literal> element allows a <literal><parent></literal> subelement that maps a property of the component class as a reference back to the containing entity."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2415
+#, no-c-format
+msgid "The <literal><dynamic-component></literal> element allows a <literal>Map</literal> to be mapped as a component, where the property names refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for more information. This feature is not supported in annotations."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2423
+#, no-c-format
+msgid "Inheritance strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2425
+#, no-c-format
+msgid "Java is a language supporting polymorphism: a class can inherit from another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2431
+#, no-c-format
+msgid "Single table per class hierarchy strategy: a single table hosts all the instances of a class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2436
+#, no-c-format
+msgid "Joined subclass strategy: one table per class and subclass is present and each table persist the properties specific to a given subclass. The state of the entity is then stored in its corresponding class table and all its superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2443
+#, no-c-format
+msgid "Table per class strategy: one table per concrete class and subclass is present and each table persist the properties of the class and its superclasses. The state of the entity is then stored entirely in the dedicated table for its class."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2453
+#, no-c-format
+msgid "With this approach the properties of all the subclasses in a given mapped class hierarchy are stored in a single table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2456
+#, no-c-format
+msgid "Each subclass declares its own persistent properties and subclasses. Version and id properties are assumed to be inherited from the root class. Each subclass in a hierarchy must define a unique discriminator value. If this is not specified, the fully qualified Java class name is used."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@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
+#: basic_mapping.xml:2464
+#, no-c-format
+msgid "In hbm.xml, for the table-per-class-hierarchy mapping strategy, the <literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, no-c-format
+msgid ""
+ "<subclass\n"
+ " name=\"ClassName\"\n"
+ " discriminator-value=\"discriminator_value\"\n"
+ " proxy=\"ProxyInterface\"\n"
+ " lazy=\"true|false\"\n"
+ " dynamic-update=\"true|false\"\n"
+ " dynamic-insert=\"true|false\"\n"
+ " entity-name=\"EntityName\"\n"
+ " node=\"element-name\"\n"
+ " extends=\"SuperclassName\">\n"
+ "\n"
+ " <property .... />\n"
+ " .....\n"
+ "</subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
+#, no-c-format
+msgid "<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2488
+#, no-c-format
+msgid "<literal>discriminator-value</literal> (optional - defaults to the class name): a value that distinguishes individual subclasses."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2494
+#, no-c-format
+msgid "<literal>proxy</literal> (optional): specifies a class or interface used for lazy initializing proxies."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2499
+#, no-c-format
+msgid "<literal>lazy</literal> (optional - defaults to <literal>true</literal>): setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, no-c-format
+msgid "For information about inheritance mappings see <xref linkend=\"inheritance\"/>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2511
+#, no-c-format
+msgid "Discriminator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2513
+#, no-c-format
+msgid "Discriminators are required for polymorphic persistence using the table-per-class-hierarchy mapping strategy. It declares a discriminator column of the table. The discriminator column contains marker values that tell the persistence layer what subclass to instantiate for a particular row. A restricted set of types can be used: <literal>string</literal>, <literal>character</literal>, <literal>integer</literal>, <literal>byte</literal>, <literal>short</literal>, <literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2523
+#, no-c-format
+msgid "Use the <classname>@DiscriminatorColumn</classname> to define the discriminator column as well as the discriminator type. Alternatively, you can also use <classname>@DiscriminatorFormula</classname> to express in SQL what would be in a virtual discriminator column. This is particularly handy when the discriminator value can be extracted from one or more columns of the table. Both <classname>@DiscriminatorColumn</classname> and <classname>@DiscriminatorFormula</classname> are to be set on the root entity (once per persisted hierarchy)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2534
+#, no-c-format
+msgid "Finally, use <classname>@DiscriminatorValue</classname> on each class of the hierarchy to specify the value stored in the discriminator column for a given entity. If you do not set <classname>@DiscriminatorValue</classname> on a class, the fully qualified class name is used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2542
+#, no-c-format
+msgid "In hbm.xml, the <literal><discriminator></literal> element is used to define the discriminator column or formula:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, no-c-format
+msgid ""
+ "<discriminator\n"
+ " column=\"discriminator_column\"\n"
+ " type=\"discriminator_type\"\n"
+ " force=\"true|false\"\n"
+ " insert=\"true|false\"\n"
+ " formula=\"arbitrary sql expression\"\n"
+ "/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2563
+#, no-c-format
+msgid "<literal>column</literal> (optional - defaults to <literal>class</literal>): the name of the discriminator column."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2569
+#, no-c-format
+msgid "<literal>type</literal> (optional - defaults to <literal>string</literal>): a name that indicates the Hibernate type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2575
+#, no-c-format
+msgid "<literal>force</literal> (optional - defaults to <literal>false</literal>): \"forces\" Hibernate to specify the allowed discriminator values, even when retrieving all instances of the root class."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2582
+#, no-c-format
+msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>): set this to <literal>false</literal> if your discriminator column is also part of a mapped composite identifier. It tells Hibernate not to include the column in SQL <literal>INSERTs</literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2590
+#, no-c-format
+msgid "<literal>formula</literal> (optional): an arbitrary SQL expression that is executed when a type has to be evaluated. It allows content-based discrimination."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2597
+#, no-c-format
+msgid "Actual values of the discriminator column are specified by the <literal>discriminator-value</literal> attribute of the <literal><class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2602
+#, no-c-format
+msgid "The <literal>force</literal> attribute is only useful if the table contains rows with \"extra\" discriminator values that are not mapped to a persistent class. This will not usually be the case."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2607
+#, no-c-format
+msgid "The <literal>formula</literal> attribute allows you to declare an arbitrary SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, no-c-format
+msgid ""
+ "<discriminator\n"
+ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+ " type=\"integer\"/>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, no-c-format
+msgid "Joined subclass strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2618
+#, no-c-format
+msgid "Each subclass can also be mapped to its own table. This is called the table-per-subclass mapping strategy. An inherited state is retrieved by joining with the table of the superclass. A discriminator column is not required for this mapping strategy. Each subclass must, however, declare a table column holding the object identifier. The primary key of this table is also a foreign key to the superclass table and described by the <classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
+#, no-c-format
+msgid ""
+ "@Entity @Table(name=\"CATS\")\n"
+ "@Inheritance(strategy=InheritanceType.JOINED)\n"
+ "public class Cat implements Serializable { \n"
+ " @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+ " @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+ " String getId() { return id; }\n"
+ "\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+ "@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+ "public class DomesticCat extends Cat { \n"
+ " public String getName() { return name; }\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2631
+#, no-c-format
+msgid "The table name still defaults to the non qualified class name. Also if <classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / foreign key columns are assumed to have the same names as the primary key columns of the primary table of the superclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2638
+#, no-c-format
+msgid "In hbm.xml, use the <literal><joined-subclass></literal> element. For example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, no-c-format
+msgid ""
+ "<joined-subclass\n"
+ " name=\"ClassName\"\n"
+ " table=\"tablename\"\n"
+ " proxy=\"ProxyInterface\"\n"
+ " lazy=\"true|false\"\n"
+ " dynamic-update=\"true|false\"\n"
+ " dynamic-insert=\"true|false\"\n"
+ " schema=\"schema\"\n"
+ " catalog=\"catalog\"\n"
+ " extends=\"SuperclassName\"\n"
+ " persister=\"ClassName\"\n"
+ " subselect=\"SQL expression\"\n"
+ " entity-name=\"EntityName\"\n"
+ " node=\"element-name\">\n"
+ "\n"
+ " <key .... >\n"
+ "\n"
+ " <property .... />\n"
+ " .....\n"
+ "</joined-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
+#, no-c-format
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
+#, no-c-format
+msgid "<literal>proxy</literal> (optional): specifies a class or interface to use for lazy initializing proxies."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
+#, no-c-format
+msgid "<literal>lazy</literal> (optional, defaults to <literal>true</literal>): setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2679
+#, no-c-format
+msgid "Use the <literal><key></literal> element to declare the primary key / foreign key column. The mapping at the start of the chapter would then be re-written as:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, no-c-format
+msgid ""
+ "<?xml version=\"1.0\"?>\n"
+ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+ "\n"
+ "<hibernate-mapping package=\"eg\">\n"
+ "\n"
+ " <class name=\"Cat\" table=\"CATS\">\n"
+ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
+ " <generator class=\"hilo\"/>\n"
+ " </id>\n"
+ " <property name=\"birthdate\" type=\"date\"/>\n"
+ " <property name=\"color\" not-null=\"true\"/>\n"
+ " <property name=\"sex\" not-null=\"true\"/>\n"
+ " <property name=\"weight\"/>\n"
+ " <many-to-one name=\"mate\"/>\n"
+ " <set name=\"kittens\">\n"
+ " <key column=\"MOTHER\"/>\n"
+ " <one-to-many class=\"Cat\"/>\n"
+ " </set>\n"
+ " <joined-subclass name=\"DomesticCat\" table=\"DOMESTIC_CATS\">\n"
+ " <key column=\"CAT\"/>\n"
+ " <property name=\"name\" type=\"string\"/>\n"
+ " </joined-subclass>\n"
+ " </class>\n"
+ "\n"
+ " <class name=\"eg.Dog\">\n"
+ " <!-- mapping for Dog could go here -->\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2692
+#, no-c-format
+msgid "A third option is to map only the concrete classes of an inheritance hierarchy to tables. This is called the table-per-concrete-class strategy. Each table defines all persistent states of the class, including the inherited state. In Hibernate, it is not necessary to explicitly map such inheritance hierarchies. You can map each class as a separate entity root. However, if you wish use polymorphic associations (e.g. an association to the superclass of your hierarchy), you need to use the union subclass mapping."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+ "public class Flight implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2703
+#, no-c-format
+msgid "Or in hbm.xml:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, no-c-format
+msgid ""
+ "<union-subclass\n"
+ " name=\"ClassName\"\n"
+ " table=\"tablename\"\n"
+ " proxy=\"ProxyInterface\"\n"
+ " lazy=\"true|false\"\n"
+ " dynamic-update=\"true|false\"\n"
+ " dynamic-insert=\"true|false\"\n"
+ " schema=\"schema\"\n"
+ " catalog=\"catalog\"\n"
+ " extends=\"SuperclassName\"\n"
+ " abstract=\"true|false\"\n"
+ " persister=\"ClassName\"\n"
+ " subselect=\"SQL expression\"\n"
+ " entity-name=\"EntityName\"\n"
+ " node=\"element-name\">\n"
+ "\n"
+ " <property .... />\n"
+ " .....\n"
+ "</union-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid "No discriminator column or key column is required for this mapping strategy."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2751
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2753
+#, 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>@MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
+#, 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
+#: basic_mapping.xml:2768
+#, no-c-format
+msgid "Properties from superclasses not mapped as <literal>@MappedSuperclass</literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2773
+#, no-c-format
+msgid "The default access type (field or methods) is used, unless you use the <literal>@Access</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2778
+#, 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
+#: basic_mapping.xml:2786
+#, 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
+#: basic_mapping.xml:2792
+#, 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
+#: basic_mapping.xml:2797
+#, 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
+#: basic_mapping.xml:2801
+#, 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( \n"
+ " name=\"propulsion\", \n"
+ " joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+ ")\n"
+ "public class Plane extends FlyingObject {\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2803
+#, 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
+#: basic_mapping.xml:2809
+#, 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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid "In hbm.xml, simply map the properties of the superclass in the <literal><class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2821
+#, no-c-format
+msgid "Mapping one entity to several tables"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2823
+#, no-c-format
+msgid "While not recommended for a fresh schema, some legacy databases force your to map a single entity on several tables."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2826
+#, no-c-format
+msgid "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>@JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Table(name=\"MainCat\")\n"
+ "@SecondaryTables({\n"
+ " @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+ " @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+ " ),\n"
+ " @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint(columnNames={\"storyPart2\"})})\n"
+ "})\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"
+ " @Column(table=\"Cat1\")\n"
+ " public String getStoryPart1() {\n"
+ " return storyPart1;\n"
+ " }\n"
+ "\n"
+ " @Column(table=\"Cat2\")\n"
+ " public String getStoryPart2() {\n"
+ " return storyPart2;\n"
+ " }\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2834
+#, 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
+#: basic_mapping.xml:2844
+#, no-c-format
+msgid "There is also additional tuning accessible via the <classname>@org.hibernate.annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, 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 <classname>SELECT</classname> 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
+#: basic_mapping.xml:2862
+#, 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
+#: basic_mapping.xml:2868
+#, 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
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid "Make sure to use the secondary table name in the <methodname>appliesto</methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Table(name=\"MainCat\")\n"
+ "@SecondaryTable(name=\"Cat1\")\n"
+ "@org.hibernate.annotations.Table(\n"
+ " appliesTo=\"Cat1\",\n"
+ " fetch=FetchMode.SELECT,\n"
+ " optional=true)\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"
+ " @Column(table=\"Cat1\")\n"
+ " public String getStoryPart1() {\n"
+ " return storyPart1;\n"
+ " }\n"
+ "\n"
+ " @Column(table=\"Cat2\")\n"
+ " public String getStoryPart2() {\n"
+ " return storyPart2;\n"
+ " }\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, no-c-format
+msgid ""
+ "<join\n"
+ " table=\"tablename\"\n"
+ " schema=\"owner\"\n"
+ " catalog=\"catalog\"\n"
+ " fetch=\"join|select\"\n"
+ " inverse=\"true|false\"\n"
+ " optional=\"true|false\">\n"
+ "\n"
+ " <key ... />\n"
+ "\n"
+ " <property ... />\n"
+ " ...\n"
+ "</join>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2907
+#, no-c-format
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2924
+#, no-c-format
+msgid "<literal>fetch</literal> (optional - defaults to <literal>join</literal>): if set to <literal>join</literal>, the default, Hibernate will use an inner join to retrieve a <literal><join></literal> defined by a class or its superclasses. It will use an outer join for a <literal><join></literal> defined by a subclass. If set to <literal>select</literal> then Hibernate will use a sequential select for a <literal><join></literal> defined on a subclass. This will be issued only if a row represents an instance of the subclass. Inner joins will still be used to retrieve a <literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2939
+#, no-c-format
+msgid "<literal>inverse</literal> (optional - defaults to <literal>false</literal>): if enabled, Hibernate will not insert or update the properties defined by this join."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, no-c-format
+msgid "<literal>optional</literal> (optional - defaults to <literal>false</literal>): if enabled, Hibernate will insert a row only if the properties defined by this join are non-null. It will always use an outer join to retrieve the properties."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, no-c-format
+msgid "For example, address information for a person can be mapped to a separate table while preserving value type semantics for all properties:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, no-c-format
+msgid ""
+ "<class name=\"Person\"\n"
+ " table=\"PERSON\">\n"
+ "\n"
+ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+ "\n"
+ " <join table=\"ADDRESS\">\n"
+ " <key column=\"ADDRESS_ID\"/>\n"
+ " <property name=\"address\"/>\n"
+ " <property name=\"zip\"/>\n"
+ " <property name=\"country\"/>\n"
+ " </join>\n"
+ " ..."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, no-c-format
+msgid "This feature is often only useful for legacy data models. We recommend fewer tables than classes and a fine-grained domain model. However, it is useful for switching between inheritance mapping strategies in a single hierarchy, as explained later."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2967
+#, no-c-format
+msgid "Mapping one to one and one to many associations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2969
+#, no-c-format
+msgid "To link one entity to an other, you need to map the association property as a to one association. In the relational model, you can either use a foreign key or an association table, or (a bit less common) share the same primary key value between the two entities."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2974
+#, no-c-format
+msgid "To mark an association, use either <classname>@ManyToOne</classname> or <classname>@OnetoOne</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2978
+#, no-c-format
+msgid "<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
+#, no-c-format
+msgid "Setting a value of the <literal>cascade</literal> attribute to any meaningful value other than nothing will propagate certain operations to the associated object. The meaningful values are divided into three categories."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2992
+#, no-c-format
+msgid "basic operations, which include: <literal>persist, merge, delete, save-update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2998
+#, no-c-format
+msgid "special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3003
+#, no-c-format
+msgid "comma-separated combinations of operation names: <literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note that single valued many-to-one associations do not support orphan delete."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3012
+#, no-c-format
+msgid "By default, single point associations are eagerly fetched in JPA 2. You can mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType.LAZY) </classname>in which case Hibernate will proxy the association and load it when the state of the associated entity is reached. You can force Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</classname>. In this case, the property is fetched lazily when the instance variable is first accessed. This requires build-time bytecode instrumentation. lazy=\"false\" specifies that the association will always be eagerly fetched."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid "With the default JPA options, single-ended associations are loaded with a subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used for <literal>EAGER</literal> associations. You can however adjust the fetching strategy, ie how data is fetched by using <literal>@Fetch</literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3041
+#, no-c-format
+msgid "<classname>@ManyToOne</classname> if several entities can point to the the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3046
+#, no-c-format
+msgid "<classname>@OneToOne</classname> if only a single entity can point to the the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3051
+#, no-c-format
+msgid "and a foreign key in one table is referencing the primary key column(s) of the target table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Flight implements Serializable {\n"
+ " @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+ " @JoinColumn(name=\"COMP_ID\")\n"
+ " public Company getCompany() {\n"
+ " return company;\n"
+ " }\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3056
+#, no-c-format
+msgid "The <literal>@JoinColumn</literal> attribute is optional, the default value(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Flight implements Serializable {\n"
+ " @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, targetEntity=CompanyImpl.class )\n"
+ " @JoinColumn(name=\"COMP_ID\")\n"
+ " public Company getCompany() {\n"
+ " return company;\n"
+ " }\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "public interface Company {\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3066
+#, no-c-format
+msgid "You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing the target entity table (through <literal>@JoinTable.inverseJoinColumns</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Flight implements Serializable {\n"
+ " @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+ " @JoinTable(name=\"Flight_Company\",\n"
+ " joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+ " inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+ " )\n"
+ " public Company getCompany() {\n"
+ " return company;\n"
+ " }\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3077
+#, no-c-format
+msgid "You can use a SQL fragment to simulate a physical join column using the <classname>@JoinColumnOrFormula</classname> / <classname>@JoinColumnOrformulas</classname> annotations (just like you can use a SQL fragment to simulate a property column via the <classname>@Formula</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Ticket implements Serializable {\n"
+ " @ManyToOne\n"
+ " @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+ " public Person getOwner() {\n"
+ " return person;\n"
+ " }\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid "You can mark an association as mandatory by using the <literal>optional=false</literal> attribute. We recommend to use Bean Validation's <classname>@NotNull</classname> annotation as a better alternative however. As a consequence, the foreign key column(s) will be marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid "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. 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."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3100
+#, no-c-format
+msgid "@NotFound annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
+#, no-c-format
+msgid "Sometimes you want to delegate to your database the deletion of cascade when a given entity is deleted. In this case Hibernate generates a cascade delete constraint at the database level."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
+#, no-c-format
+msgid "Foreign key constraints, while generated by Hibernate, have a fairly unreadable name. You can override the constraint name using <literal>@ForeignKey</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3120
+#, no-c-format
+msgid "@ForeignKey annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Child {\n"
+ " ...\n"
+ " @ManyToOne\n"
+ " @ForeignKey(name=\"FK_PARENT\")\n"
+ " public Parent getParent() { ... }\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "alter table Child add constraint FK_PARENT foreign key (parent_id) references Parent"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3125
+#, no-c-format
+msgid "Sometimes, you want to link one entity to an other not by the target entity primary key but by a different unique key. You can achieve that by referencing the unique key column(s) in <methodname>@JoinColumn.referenceColumnName</methodname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "class Person {\n"
+ " @Id Integer personNumber;\n"
+ " String firstName;\n"
+ " @Column(name=\"I\")\n"
+ " String initial;\n"
+ " String lastName;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "class Home {\n"
+ " @ManyToOne\n"
+ " @JoinColumns({\n"
+ " @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+ " @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+ " @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+ " })\n"
+ " Person owner\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3132
+#, no-c-format
+msgid "This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3135
+#, no-c-format
+msgid "In hbm.xml, mapping an association is similar. The main difference is that a <classname>@OneToOne</classname> is mapped as <literal><many-to-one unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, no-c-format
+msgid ""
+ "<many-to-one\n"
+ " name=\"propertyName\"\n"
+ " column=\"column_name\"\n"
+ " class=\"ClassName\"\n"
+ " cascade=\"cascade_style\"\n"
+ " fetch=\"join|select\"\n"
+ " update=\"true|false\"\n"
+ " insert=\"true|false\"\n"
+ " property-ref=\"propertyNameFromAssociatedClass\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " unique=\"true|false\"\n"
+ " not-null=\"true|false\"\n"
+ " optimistic-lock=\"true|false\"\n"
+ " lazy=\"proxy|no-proxy|false\"\n"
+ " not-found=\"ignore|exception\"\n"
+ " entity-name=\"EntityName\"\n"
+ " formula=\"arbitrary SQL expression\"\n"
+ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+ " embed-xml=\"true|false\"\n"
+ " index=\"index_name\"\n"
+ " unique_key=\"unique_key_id\"\n"
+ " foreign-key=\"foreign_key_name\"\n"
+ "/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
+#, no-c-format
msgid "<literal>column</literal> (optional): the name of the foreign key column. This can also be specified by nested <literal><column></literal> element(s)."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, no-c-format
msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the name of the associated class."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, no-c-format
msgid "<literal>cascade</literal> (optional): specifies which operations should be cascaded from the parent object to the associated object."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, no-c-format
msgid "<literal>fetch</literal> (optional - defaults to <literal>select</literal>): chooses between outer-join fetching or sequential select fetching."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3209
#, no-c-format
msgid "<literal>update, insert</literal> (optional - defaults to <literal>true</literal>): specifies that the mapped columns should be included in SQL <literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. Setting both to <literal>false</literal> allows a pure \"derived\" association whose value is initialized from another property that maps to the same column(s), or by a trigger or other application."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3219
#, no-c-format
msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to this foreign key. If not specified, the primary key of the associated class is used."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3232
#, no-c-format
msgid "<literal>unique</literal> (optional): enables the DDL generation of a unique constraint for the foreign-key column. By allowing this to be the target of a <literal>property-ref</literal>, you can make the association multiplicity one-to-one."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3240
#, no-c-format
msgid "<literal>not-null</literal> (optional): enables the DDL generation of a nullability constraint for the foreign key columns."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3254
#, no-c-format
msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): by default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed. This requires build-time bytecode instrumentation. <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3264
#, no-c-format
msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how foreign keys that reference missing rows will be handled. <literal>ignore</literal> will treat a missing row as a null association."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, no-c-format
msgid "<literal>entity-name</literal> (optional): the entity name of the associated class."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
msgid "<literal>formula</literal> (optional): an SQL expression that defines the value for a <emphasis>computed</emphasis> foreign key."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3284
#, no-c-format
-msgid "Setting a value of the <literal>cascade</literal> attribute to any meaningful value other than <literal>none</literal> will propagate certain operations to the associated object. The meaningful values are divided into three categories. First, basic operations, which include: <literal>persist, merge, delete, save-update, evict, replicate, lock and refresh</literal>; second, special values: <literal>delete-orphan</literal>; and third,<literal>all</literal> comma-separated combinations of operation names: <literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> for a full explanation. Note that single valued, many-to-one and one-to-one, associations do not support orphan delete."
+msgid "Setting a value of the <literal>cascade</literal> attribute to any meaningful value other than <literal>none</literal> will propagate certain operations to the associated object. The meaningful values are divided into three categories. First, basic operations, which include: <literal>persist, merge, delete, save-update, evict, replicate, lock and refresh</literal>; second, special values: <literal>delete-orphan</literal>; and third,<literal>all</literal> comma-separated combinations of operation names: <literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note that single valued, many-to-one and one-to-one, associations do not support orphan delete."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3298
#, no-c-format
msgid "Here is an example of a typical <literal>many-to-one</literal> declaration:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, no-c-format
+msgid "<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3303
#, no-c-format
msgid "The <literal>property-ref</literal> attribute should only be used for mapping legacy data where a foreign key refers to a unique key of the associated table other than the primary key. This is a complicated and confusing relational model. For example, if the <literal>Product</literal> class had a unique serial number that is not the primary key. The <literal>unique</literal> attribute controls Hibernate's DDL generation with the SchemaExport tool."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, no-c-format
+msgid "<property name=\"serialNumber\" unique=\"true\" type=\"string\" column=\"SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3313
#, no-c-format
msgid "Then the mapping for <literal>OrderItem</literal> might use:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, no-c-format
+msgid "<many-to-one name=\"product\" property-ref=\"serialNumber\" column=\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3318
#, no-c-format
msgid "This is not encouraged, however."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3320
#, no-c-format
msgid "If the referenced unique key comprises multiple properties of the associated entity, you should map the referenced properties inside a named <literal><properties></literal> element."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3324
#, no-c-format
msgid "If the referenced unique key is the property of a component, you can specify a property path:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, no-c-format
+msgid "<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column=\"OWNER_SSN\"/>"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3331
#, no-c-format
-msgid "One-to-one"
+msgid "Sharing the primary key with the associated entity"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3333
#, no-c-format
-msgid "A one-to-one association to another persistent class is declared using a <literal>one-to-one</literal> element."
+msgid "The second approach is to ensure an entity and its associated entity share the same primary key. In this case the primary key column is also a foreign key and there is no extra column. These associations are always one to one."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3339
#, no-c-format
-msgid "<literal>constrained</literal> (optional): specifies that a foreign key constraint on the primary key of the mapped table and references the table of the associated class. This option affects the order in which <literal>save()</literal> and <literal>delete()</literal> are cascaded, and determines whether the association can be proxied. It is also used by the schema export tool."
+msgid "One to One association"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Body {\n"
+ " @Id\n"
+ " public Long getId() { return id; }\n"
+ "\n"
+ " @OneToOne(cascade = CascadeType.ALL)\n"
+ " @MapsId\n"
+ " public Heart getHeart() {\n"
+ " return heart;\n"
+ " }\n"
+ " ...\n"
+ "} \n"
+ "\n"
+ "@Entity\n"
+ "public class Heart {\n"
+ " @Id\n"
+ " public Long getId() { ...}\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
-msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to the primary key of this class. If not specified, the primary key of the associated class is used."
+msgid "Many people got confused by these primary key based one to one associations. They can only be lazily loaded if Hibernate knows that the other side of the association is always present. To indicate to Hibernate that it is the case, use <classname>@OneToOne(optional=false)</classname>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3352
#, no-c-format
-msgid "<literal>formula</literal> (optional): almost all one-to-one associations map to the primary key of the owning entity. If this is not the case, you can specify another column, columns or expression to join on using an SQL formula. See <literal>org.hibernate.test.onetooneformula</literal> for an example."
+msgid "In hbm.xml, use the following mapping."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3377
+#, no-c-format
+msgid ""
+ "<one-to-one\n"
+ " name=\"propertyName\"\n"
+ " class=\"ClassName\"\n"
+ " cascade=\"cascade_style\"\n"
+ " constrained=\"true|false\"\n"
+ " fetch=\"join|select\"\n"
+ " property-ref=\"propertyNameFromAssociatedClass\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " formula=\"any SQL expression\"\n"
+ " lazy=\"proxy|no-proxy|false\"\n"
+ " entity-name=\"EntityName\"\n"
+ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+ " embed-xml=\"true|false\"\n"
+ " foreign-key=\"foreign_key_name\"\n"
+ "/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3397
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): by default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation. <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched. <emphasis>Note that if <literal>constrained=\"false\"</literal>, proxying is impossible and Hibernate will eagerly fetch the association</emphasis>."
+msgid "<literal>constrained</literal> (optional): specifies that a foreign key constraint on the primary key of the mapped table and references the table of the associated class. This option affects the order in which <literal>save()</literal> and <literal>delete()</literal> are cascaded, and determines whether the association can be proxied. It is also used by the schema export tool."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3413
#, no-c-format
-msgid "There are two varieties of one-to-one associations:"
+msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to the primary key of this class. If not specified, the primary key of the associated class is used."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3426
#, no-c-format
-msgid "primary key associations"
+msgid "<literal>formula</literal> (optional): almost all one-to-one associations map to the primary key of the owning entity. If this is not the case, you can specify another column, columns or expression to join on using an SQL formula. See <literal>org.hibernate.test.onetooneformula</literal> for an example."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3435
#, no-c-format
-msgid "unique foreign key associations"
+msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): by default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation. <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched. <emphasis>Note that if <literal>constrained=\"false\"</literal>, proxying is impossible and Hibernate will eagerly fetch the association</emphasis>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3454
#, no-c-format
msgid "Primary key associations do not need an extra table column. If two rows are related by the association, then the two table rows share the same primary key value. To relate two objects by a primary key association, ensure that they are assigned the same identifier value."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3460
#, no-c-format
msgid "For a primary key association, add the following mappings to <literal>Employee</literal> and <literal>Person</literal> respectively:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, no-c-format
+msgid "<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3468
#, no-c-format
msgid "Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE tables are equal. You use a special Hibernate identifier generation strategy called <literal>foreign</literal>:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, no-c-format
+msgid ""
+ "<class name=\"person\" table=\"PERSON\">\n"
+ " <id name=\"id\" column=\"PERSON_ID\">\n"
+ " <generator class=\"foreign\">\n"
+ " <param name=\"property\">employee</param>\n"
+ " </generator>\n"
+ " </id>\n"
+ " ...\n"
+ " <one-to-one name=\"employee\"\n"
+ " class=\"Employee\"\n"
+ " constrained=\"true\"/>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3474
#, no-c-format
msgid "A newly saved instance of <literal>Person</literal> is assigned the same primary key value as the <literal>Employee</literal> instance referred with the <literal>employee</literal> property of that <literal>Person</literal>."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3482
#, no-c-format
-msgid "Alternatively, a foreign key with a unique constraint, from <literal>Employee</literal> to <literal>Person</literal>, can be expressed as:"
+msgid "Natural-id"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3484
#, no-c-format
-msgid "This association can be made bidirectional by adding the following to the <literal>Person</literal> mapping:"
+msgid "Although we recommend the use of surrogate keys as primary keys, you should try to identify natural keys for all entities. A natural key is a property or combination of properties that is unique and non-null. It is also immutable. Map the properties of the natural key as <classname>@NaturalId</classname> or map them inside the <literal><natural-id></literal> element. Hibernate will generate the necessary unique key and nullability constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:3493
#, no-c-format
-msgid "Natural-id"
+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
+#: basic_mapping.xml:3495
#, no-c-format
-msgid "Although we recommend the use of surrogate keys as primary keys, you should try to identify natural keys for all entities. A natural key is a property or combination of properties that is unique and non-null. It is also immutable. Map the properties of the natural key inside the <literal><natural-id></literal> element. Hibernate will generate the necessary unique key and nullability constraints and, as a result, your mapping will be more self-documenting."
+msgid "Or in XML,"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3497
+#, no-c-format
+msgid ""
+ "<natural-id mutable=\"true|false\"/>\n"
+ " <property ... />\n"
+ " <many-to-one ... />\n"
+ " ......\n"
+ "</natural-id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3499
#, no-c-format
msgid "It is recommended that you implement <literal>equals()</literal> and <literal>hashCode()</literal> to compare the natural key properties of the entity."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3503
#, no-c-format
msgid "This mapping is not intended for use with entities that have natural primary keys."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3508
#, no-c-format
msgid "<literal>mutable</literal> (optional - defaults to <literal>false</literal>): by default, natural identifier properties are assumed to be immutable (constant)."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3516
#, no-c-format
-msgid "Component and dynamic-component"
+msgid "<title>Any</title>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3518
#, no-c-format
-msgid "The <literal><component></literal> element maps properties of a child object to columns of the table of a parent class. Components can, in turn, declare their own properties, components or collections. See the \"Component\" examples below:"
+msgid "There is one more type of property mapping. The <classname>@Any</classname> mapping defines a polymorphic association to classes from multiple tables. This type of mapping requires more than one column. The first column contains the type of the associated entity. The remaining columns contain the identifier. It is impossible to specify a foreign key constraint for this kind of association. This is not the usual way of mapping polymorphic associations and you should use this only in special cases. For example, for audit logs, user session data, etc."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3528
#, no-c-format
-msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the name of the component (child) class."
+msgid "The <classname>@Any</classname> 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. The <literal>metaType</literal> attribute allows the application to specify a custom type that maps database column values to persistent classes that have identifier properties of the type specified by <literal>idType</literal>. You must specify the mapping from values of the <literal>metaType</literal> to class names."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3538
+#, 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
+#: basic_mapping.xml:3540
#, no-c-format
-msgid "<literal>insert</literal>: do the mapped columns appear in SQL <literal>INSERTs</literal>?"
+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
+#: basic_mapping.xml:3544
+#, 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: para
+#: basic_mapping.xml:3546
#, no-c-format
-msgid "<literal>update</literal>: do the mapped columns appear in SQL <literal>UPDATEs</literal>?"
+msgid "The hbm.xml equivalent is:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3548
+#, no-c-format
+msgid ""
+ "<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+ " <column name=\"table_name\"/>\n"
+ " <column name=\"id\"/>\n"
+ "</any>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3551
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>false</literal>): specifies that this component should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation."
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3570
+#, no-c-format
+msgid ""
+ "<any\n"
+ " name=\"propertyName\"\n"
+ " id-type=\"idtypename\"\n"
+ " meta-type=\"metatypename\"\n"
+ " cascade=\"cascade_style\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " optimistic-lock=\"true|false\"\n"
+ ">\n"
+ " <meta-value ... />\n"
+ " <meta-value ... />\n"
+ " .....\n"
+ " <column .... />\n"
+ " <column .... />\n"
+ " .....\n"
+ "</any>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3574
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this component either do or do not require acquisition of the optimistic lock. It determines if a version increment should occur when this property is dirty."
+msgid "<literal>name</literal>: the property name."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3578
#, no-c-format
-msgid "<literal>unique</literal> (optional - defaults to <literal>false</literal>): specifies that a unique constraint exists upon all mapped columns of the component."
+msgid "<literal>id-type</literal>: the identifier type."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3582
#, no-c-format
-msgid "The child <literal><property></literal> tags map properties of the child class to table columns."
+msgid "<literal>meta-type</literal> (optional - defaults to <literal>string</literal>): any type that is allowed for a discriminator mapping."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
-msgid "The <literal><component></literal> element allows a <literal><parent></literal> subelement that maps a property of the component class as a reference back to the containing entity."
+msgid "<literal>cascade</literal> (optional- defaults to <literal>none</literal>): the cascade style."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3599
#, no-c-format
-msgid "The <literal><dynamic-component></literal> element allows a <literal>Map</literal> to be mapped as a component, where the property names refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for more information."
+msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this property either do or do not require acquisition of the optimistic lock. It defines whether a version increment should occur if this property is dirty."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
msgid "Properties"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3612
#, no-c-format
msgid "The <literal><properties></literal> element allows the definition of a named, logical grouping of the properties of a class. The most important use of the construct is that it allows a combination of properties to be the target of a <literal>property-ref</literal>. It is also a convenient way to define a multi-column unique constraint. For example:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, no-c-format
+msgid ""
+ "<properties\n"
+ " name=\"logicalName\"\n"
+ " insert=\"true|false\"\n"
+ " update=\"true|false\"\n"
+ " optimistic-lock=\"true|false\"\n"
+ " unique=\"true|false\"\n"
+ ">\n"
+ "\n"
+ " <property ...../>\n"
+ " <many-to-one .... />\n"
+ " ........\n"
+ "</properties>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3636
#, no-c-format
msgid "<literal>name</literal>: the logical name of the grouping. It is <emphasis>not</emphasis> an actual property name."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3651
#, no-c-format
msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to these properties either do or do not require acquisition of the optimistic lock. It determines if a version increment should occur when these properties are dirty."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
msgid "For example, if we have the following <literal><properties></literal> mapping:"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3669
#, no-c-format
-msgid "You might have some legacy data association that refers to this unique key of the <literal>Person</literal> table, instead of to the primary key:"
+msgid ""
+ "<class name=\"Person\">\n"
+ " <id name=\"personNumber\"/>\n"
+ "\n"
+ " ...\n"
+ " <properties name=\"name\"\n"
+ " unique=\"true\" update=\"false\">\n"
+ " <property name=\"firstName\"/>\n"
+ " <property name=\"initial\"/>\n"
+ " <property name=\"lastName\"/>\n"
+ " </properties>\n"
+ "</class>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3671
#, no-c-format
-msgid "The use of this outside the context of mapping legacy data is not recommended."
+msgid "You might have some legacy data association that refers to this unique key of the <literal>Person</literal> table, instead of to the primary key:"
msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:3675
#, no-c-format
-msgid "Subclass"
+msgid ""
+ "<many-to-one name=\"owner\"\n"
+ " class=\"Person\" property-ref=\"name\">\n"
+ " <column name=\"firstName\"/>\n"
+ " <column name=\"initial\"/>\n"
+ " <column name=\"lastName\"/>\n"
+ "</many-to-one>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3678
#, no-c-format
-msgid "Polymorphic persistence requires the declaration of each subclass of the root persistent class. For the table-per-class-hierarchy mapping strategy, the <literal><subclass></literal> declaration is used. For example:"
+msgid "When using annotations as a mapping strategy, such construct is not necessary as the binding between a column and its related column on the associated table is done directly"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3685
#, no-c-format
-msgid "<literal>name</literal>: the fully qualified class name of the subclass."
+msgid "The use of this outside the context of mapping legacy data is not recommended."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3690
#, no-c-format
-msgid "<literal>discriminator-value</literal> (optional - defaults to the class name): a value that distinguishes individual subclasses."
+msgid "Some hbm.xml specificities"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3692
#, no-c-format
-msgid "<literal>proxy</literal> (optional): specifies a class or interface used for lazy initializing proxies."
+msgid "The hbm.xml structure has some specificities naturally not present when using annotations, let's describe them briefly."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3696
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>true</literal>): setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgid "Doctype"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3698
#, no-c-format
-msgid "Each subclass declares its own persistent properties and subclasses. <literal><version></literal> and <literal><id></literal> properties are assumed to be inherited from the root class. Each subclass in a hierarchy must define a unique <literal>discriminator-value</literal>. If this is not specified, the fully qualified Java class name is used."
+msgid "All XML mappings should declare the doctype shown. The actual DTD can be found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate will always look for the DTD in its classpath first. If you experience lookups of the DTD using an Internet connection, check the DTD declaration against the contents of your classpath."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:3707
#, no-c-format
-msgid "For information about inheritance mappings see <xref linkend=\"inheritance\" />."
+msgid "EntityResolver"
msgstr ""
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3709
#, no-c-format
-msgid "Joined-subclass"
+msgid "Hibernate will first attempt to resolve DTDs in its classpath. It does this is by registering a custom <literal>org.xml.sax.EntityResolver</literal> implementation with the SAXReader it uses to read in the xml files. This custom <literal>EntityResolver</literal> recognizes two different systemId namespaces:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3718
#, no-c-format
-msgid "Each subclass can also be mapped to its own table. This is called the table-per-subclass mapping strategy. An inherited state is retrieved by joining with the table of the superclass. To do this you use the <literal><joined-subclass></literal> element. For example:"
+msgid "a <literal>hibernate namespace</literal> is recognized whenever the resolver encounters a systemId starting with <literal>http://hibernate.sourceforge.net/</literal>. The resolver attempts to resolve these entities via the classloader which loaded the Hibernate classes."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3726
#, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
+msgid "a <literal>user namespace</literal> is recognized whenever the resolver encounters a systemId using a <literal>classpath://</literal> URL protocol. The resolver will attempt to resolve these entities via (1) the current thread context classloader and (2) the classloader which loaded the Hibernate classes."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3735
#, no-c-format
-msgid "<literal>proxy</literal> (optional): specifies a class or interface to use for lazy initializing proxies."
+msgid "The following is an example of utilizing user namespacing:"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3738
#, no-c-format
-msgid "<literal>lazy</literal> (optional, defaults to <literal>true</literal>): setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgid ""
+ "<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+ " xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3740
#, no-c-format
-msgid "A discriminator column is not required for this mapping strategy. Each subclass must, however, declare a table column holding the object identifier using the <literal><key></literal> element. The mapping at the start of the chapter would then be re-written as:"
+msgid "Where <literal>types.xml</literal> is a resource in the <literal>your.domain</literal> package and contains a custom <link linkend=\"mapping-types-custom\">typedef</link>."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3747
#, no-c-format
-msgid "Union-subclass"
+msgid "Hibernate-mapping"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3749
#, no-c-format
-msgid "A third option is to map only the concrete classes of an inheritance hierarchy to tables. This is called the table-per-concrete-class strategy. Each table defines all persistent states of the class, including the inherited state. In Hibernate, it is not necessary to explicitly map such inheritance hierarchies. You can map each class with a separate <literal><class></literal> declaration. However, if you wish use polymorphic associations (e.g. an association to the superclass of your hierarchy), you need to use the <literal><union-subclass></literal> mapping. For example:"
+msgid "This element has several optional attributes. The <literal>schema</literal> and <literal>catalog</literal> attributes specify that tables referred to in this mapping belong to the named schema and/or catalog. If they are specified, tablenames will be qualified by the given schema and catalog names. If they are missing, tablenames will be unqualified. The <literal>default-cascade</literal> attribute specifies what cascade style should be assumed for properties and collections that do not specify a <literal>cascade</literal> attribute. By default, the <literal>auto-import</literal> attribute allows you to use unqualified class names in the query language."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3778
+#, no-c-format
+msgid ""
+ "<hibernate-mapping\n"
+ " schema=\"schemaName\"\n"
+ " catalog=\"catalogName\"\n"
+ " default-cascade=\"cascade_style\"\n"
+ " default-access=\"field|property|ClassName\"\n"
+ " default-lazy=\"true|false\"\n"
+ " auto-import=\"true|false\"\n"
+ " package=\"package.name\"\n"
+ " />"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3782
#, no-c-format
-msgid "No discriminator column or key column is required for this mapping strategy."
+msgid "<literal>schema</literal> (optional): the name of a database schema."
msgstr ""
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3787
#, no-c-format
-msgid "Join"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3792
#, no-c-format
-msgid "Using the <literal><join></literal> element, it is possible to map properties of one class to several tables that have a one-to-one relationship. For example:"
+msgid "<literal>default-cascade</literal> (optional - defaults to <literal>none</literal>): a default cascade style."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3797
#, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
+msgid "<literal>default-access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate should use for accessing all properties. It can be a custom implementation of <literal>PropertyAccessor</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3804
#, no-c-format
-msgid "<literal>fetch</literal> (optional - defaults to <literal>join</literal>): if set to <literal>join</literal>, the default, Hibernate will use an inner join to retrieve a <literal><join></literal> defined by a class or its superclasses. It will use an outer join for a <literal><join></literal> defined by a subclass. If set to <literal>select</literal> then Hibernate will use a sequential select for a <literal><join></literal> defined on a subclass. This will be issued only if a row represents an instance of the subclass. Inner joins will still be used to retrieve a <literal><join></literal> defined by the class and its superclasses."
+msgid "<literal>default-lazy</literal> (optional - defaults to <literal>true</literal>): the default value for unspecified <literal>lazy</literal> attributes of class and collection mappings."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3811
#, no-c-format
-msgid "<literal>inverse</literal> (optional - defaults to <literal>false</literal>): if enabled, Hibernate will not insert or update the properties defined by this join."
+msgid "<literal>auto-import</literal> (optional - defaults to <literal>true</literal>): specifies whether we can use unqualified class names of classes in this mapping in the query language."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3818
#, no-c-format
-msgid "<literal>optional</literal> (optional - defaults to <literal>false</literal>): if enabled, Hibernate will insert a row only if the properties defined by this join are non-null. It will always use an outer join to retrieve the properties."
+msgid "<literal>package</literal> (optional): specifies a package prefix to use for unqualified class names in the mapping document."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3825
#, no-c-format
-msgid "For example, address information for a person can be mapped to a separate table while preserving value type semantics for all properties:"
+msgid "If you have two persistent classes with the same unqualified name, you should set <literal>auto-import=\"false\"</literal>. An exception will result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3830
#, no-c-format
-msgid "This feature is often only useful for legacy data models. We recommend fewer tables than classes and a fine-grained domain model. However, it is useful for switching between inheritance mapping strategies in a single hierarchy, as explained later."
+msgid "The <literal>hibernate-mapping</literal> element allows you to nest several persistent <literal><class></literal> mappings, as shown above. It is, however, good practice (and expected by some tools) to map only a single persistent class, or a single class hierarchy, in one mapping file and name it after the persistent superclass. For example, <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, <literal>Animal.hbm.xml</literal>."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3841
#, no-c-format
-msgid "Key"
+msgid "<title>Key</title>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3843
#, no-c-format
-msgid "The <literal><key></literal> element has featured a few times within this guide. It appears anywhere the parent mapping element defines a join to a new table that references the primary key of the original table. It also defines the foreign key in the joined table:"
+msgid "The <literal><key></literal> element is featured a few times within this guide. It appears anywhere the parent mapping element defines a join to a new table that references the primary key of the original table. It also defines the foreign key in the joined table:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, no-c-format
+msgid ""
+ "<key\n"
+ " column=\"columnname\"\n"
+ " on-delete=\"noaction|cascade\"\n"
+ " property-ref=\"propertyName\"\n"
+ " not-null=\"true|false\"\n"
+ " update=\"true|false\"\n"
+ " unique=\"true|false\"\n"
+ "/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3874
#, no-c-format
msgid "<literal>on-delete</literal> (optional - defaults to <literal>noaction</literal>): specifies whether the foreign key constraint has database-level cascade delete enabled."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3880
#, no-c-format
msgid "<literal>property-ref</literal> (optional): specifies that the foreign key refers to columns that are not the primary key of the original table. It is provided for legacy data."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3886
#, no-c-format
msgid "<literal>not-null</literal> (optional): specifies that the foreign key columns are not nullable. This is implied whenever the foreign key is also part of the primary key."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3892
#, no-c-format
msgid "<literal>update</literal> (optional): specifies that the foreign key should never be updated. This is implied whenever the foreign key is also part of the primary key."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3898
#, no-c-format
msgid "<literal>unique</literal> (optional): specifies that the foreign key should have a unique constraint. This is implied whenever the foreign key is also the primary key."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3905
#, no-c-format
msgid "For systems where delete performance is important, we recommend that all keys should be defined <literal>on-delete=\"cascade\"</literal>. Hibernate uses a database-level <literal>ON CASCADE DELETE</literal> constraint, instead of many individual <literal>DELETE</literal> statements. Be aware that this feature bypasses Hibernate's usual optimistic locking strategy for versioned data."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3913
#, no-c-format
msgid "The <literal>not-null</literal> and <literal>update</literal> attributes are useful when mapping a unidirectional one-to-many association. If you map a unidirectional one-to-many association to a non-nullable foreign key, you <emphasis>must</emphasis> declare the key column using <literal><key not-null=\"true\"></literal>."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3922
#, no-c-format
-msgid "Column and formula elements"
+msgid "Import"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3924
#, no-c-format
-msgid "Mapping elements which accept a <literal>column</literal> attribute will alternatively accept a <literal><column></literal> subelement. Likewise, <literal><formula></literal> is an alternative to the <literal>formula</literal> attribute. For example:"
+msgid "If your application has two persistent classes with the same name, and you do not want to specify the fully qualified package name in Hibernate queries, classes can be \"imported\" explicitly, rather than relying upon <literal>auto-import=\"true\"</literal>. You can also import classes and interfaces that are not explicitly mapped:"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3930
#, no-c-format
-msgid "Most of the attributes on <literal>column</literal> provide a means of tailoring the DDL during automatic schema generation. The <literal>read</literal> and <literal>write</literal> attributes allow you to specify custom SQL that Hibernate will use to access the column's value. For more on this, see the discussion of <link linkend=\"mapping-column-read-and-write\">column read and write expressions</link>."
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3939
#, no-c-format
-msgid "The <literal>column</literal> and <literal>formula</literal> elements can even be combined within the same property or association mapping to express, for example, exotic join conditions."
+msgid ""
+ "<import\n"
+ " class=\"ClassName\"\n"
+ " rename=\"ShortName\"\n"
+ "/>"
msgstr ""
-#. Tag: title
-#, no-c-format
-msgid "Import"
-msgstr ""
-
#. Tag: para
+#: basic_mapping.xml:3943
#, no-c-format
-msgid "If your application has two persistent classes with the same name, and you do not want to specify the fully qualified package name in Hibernate queries, classes can be \"imported\" explicitly, rather than relying upon <literal>auto-import=\"true\"</literal>. You can also import classes and interfaces that are not explicitly mapped:"
+msgid "<literal>class</literal>: the fully qualified class name of any Java class."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3948
#, no-c-format
-msgid "<literal>class</literal>: the fully qualified class name of any Java class."
+msgid "<literal>rename</literal> (optional - defaults to the unqualified class name): a name that can be used in the query language."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3956
#, no-c-format
-msgid "<literal>rename</literal> (optional - defaults to the unqualified class name): a name that can be used in the query language."
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3962
#, no-c-format
-msgid "Any"
+msgid "Column and formula elements"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3964
#, no-c-format
-msgid "There is one more type of property mapping. The <literal><any></literal> mapping element defines a polymorphic association to classes from multiple tables. This type of mapping requires more than one column. The first column contains the type of the associated entity. The remaining columns contain the identifier. It is impossible to specify a foreign key constraint for this kind of association. This is not the usual way of mapping polymorphic associations and you should use this only in special cases. For example, for audit logs, user session data, etc."
+msgid "Mapping elements which accept a <literal>column</literal> attribute will alternatively accept a <literal><column></literal> subelement. Likewise, <literal><formula></literal> is an alternative to the <literal>formula</literal> attribute. For example:"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3970
#, no-c-format
-msgid "The <literal>meta-type</literal> attribute allows the application to specify a custom type that maps database column values to persistent classes that have identifier properties of the type specified by <literal>id-type</literal>. You must specify the mapping from values of the meta-type to class names."
+msgid ""
+ "<column\n"
+ " name=\"column_name\"\n"
+ " length=\"N\"\n"
+ " precision=\"N\"\n"
+ " scale=\"N\"\n"
+ " not-null=\"true|false\"\n"
+ " unique=\"true|false\"\n"
+ " unique-key=\"multicolumn_unique_key_name\"\n"
+ " index=\"index_name\"\n"
+ " sql-type=\"sql_type_name\"\n"
+ " check=\"SQL expression\"\n"
+ " default=\"SQL expression\"\n"
+ " read=\"SQL expression\"\n"
+ " write=\"SQL expression\"/>"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3972
#, no-c-format
-msgid "<literal>name</literal>: the property name."
+msgid "<formula>SQL expression</formula>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "<literal>id-type</literal>: the identifier type."
+msgid "Most of the attributes on <literal>column</literal> provide a means of tailoring the DDL during automatic schema generation. The <literal>read</literal> and <literal>write</literal> attributes allow you to specify custom SQL that Hibernate will use to access the column's value. For more on this, see the discussion of <link linkend=\"mapping-column-read-and-write\">column read and write expressions</link>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3982
#, no-c-format
-msgid "<literal>meta-type</literal> (optional - defaults to <literal>string</literal>): any type that is allowed for a discriminator mapping."
+msgid "The <literal>column</literal> and <literal>formula</literal> elements can even be combined within the same property or association mapping to express, for example, exotic join conditions."
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3986
#, no-c-format
-msgid "<literal>cascade</literal> (optional- defaults to <literal>none</literal>): the cascade style."
+msgid ""
+ "<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+ " insert=\"false\" update=\"false\">\n"
+ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+ " <formula>'MAILING'</formula>\n"
+ "</many-to-one>"
msgstr ""
-#. Tag: para
-#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this property either do or do not require acquisition of the optimistic lock. It defines whether a version increment should occur if this property is dirty."
-msgstr ""
-
#. Tag: title
+#: basic_mapping.xml:3992
#, no-c-format
msgid "Hibernate types"
msgstr ""
#. Tag: title
+#: basic_mapping.xml:3995
#, no-c-format
msgid "Entities and values"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
msgid "In relation to the persistence service, Java language-level objects are classified into two groups:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4000
#, no-c-format
msgid "An <emphasis>entity</emphasis> exists independently of any other objects holding references to the entity. Contrast this with the usual Java model, where an unreferenced object is garbage collected. Entities must be explicitly saved and deleted. Saves and deletions, however, can be <emphasis>cascaded</emphasis> from a parent entity to its children. This is different from the ODMG model of object persistence by reachability and corresponds more closely to how application objects are usually used in large systems. Entities support circular and shared references. They can also be versioned."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4010
#, no-c-format
msgid "An entity's persistent state consists of references to other entities and instances of <emphasis>value</emphasis> types. Values are primitives: collections (not what is inside a collection), components and certain immutable objects. Unlike entities, values in particular collections and components, <emphasis>are</emphasis> persisted and deleted by reachability. Since value objects and primitives are persisted and deleted along with their containing entity, they cannot be independently versioned. Values have no independent identity, so they cannot be shared by two entities or collections."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4020
#, no-c-format
msgid "Until now, we have been using the term \"persistent class\" to refer to entities. We will continue to do that. Not all user-defined classes with a persistent state, however, are entities. A <emphasis>component</emphasis> is a user-defined class with value semantics. A Java property of type <literal>java.lang.String</literal> also has value semantics. Given this definition, all types (classes) provided by the JDK have value type semantics in Java, while user-defined types can be mapped with entity or value type semantics. This decision is up to the application developer. An entity class in a domain model will normally have shared references to a single instance of that class, while composition or aggregation usually translates to a value type."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4033
#, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4036
#, no-c-format
msgid "The challenge is to map the Java type system, and the developers' definition of entities and value types, to the SQL/database type system. The bridge between both systems is provided by Hibernate. For entities, <literal><class></literal>, <literal><subclass></literal> and so on are used. For value types we use <literal><property></literal>, <literal><component></literal>etc., that usually have a <literal>type</literal> attribute. The value of this attribute is the name of a Hibernate <emphasis>mapping type</emphasis>. Hibernate provides a range of mappings for standard JDK value types out of the box. You can write your own mapping types and implement your own custom conversion strategies."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4049
#, no-c-format
msgid "With the exception of collections, all built-in Hibernate types support null semantics."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
msgid "Basic value types"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4056
#, no-c-format
msgid "The built-in <emphasis>basic mapping types</emphasis> can be roughly categorized into the following:"
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4059
#, no-c-format
-msgid "<literal>integer, long, short, float, double, character, byte, boolean, yes_no, true_false</literal>"
+msgid "integer, long, short, float, double, character, byte, boolean, yes_no, true_false"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
msgid "Type mappings from Java primitives or wrapper classes to appropriate (vendor-specific) SQL column types. <literal>boolean, yes_no</literal> and <literal>true_false</literal> are all alternative encodings for a Java <literal>boolean</literal> or <literal>java.lang.Boolean</literal>."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4073
#, no-c-format
-msgid "<literal>string</literal>"
+msgid "string"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
msgid "A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>)."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4083
#, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
+msgid "date, time, timestamp"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
msgid "Type mappings from <literal>java.util.Date</literal> and its subclasses to SQL types <literal>DATE</literal>, <literal>TIME</literal> and <literal>TIMESTAMP</literal> (or equivalent)."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4094
#, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
+msgid "calendar, calendar_date"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
msgid "Type mappings from <literal>java.util.Calendar</literal> to SQL types <literal>TIMESTAMP</literal> and <literal>DATE</literal> (or equivalent)."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4104
#, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
+msgid "big_decimal, big_integer"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4107
#, no-c-format
msgid "Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java.math.BigInteger</literal> to <literal>NUMERIC</literal> (or Oracle <literal>NUMBER</literal>)."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4115
#, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
+msgid "locale, timezone, currency"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4118
#, no-c-format
msgid "Type mappings from <literal>java.util.Locale</literal>, <literal>java.util.TimeZone</literal> and <literal>java.util.Currency</literal> to <literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>). Instances of <literal>Locale</literal> and <literal>Currency</literal> are mapped to their ISO codes. Instances of <literal>TimeZone</literal> are mapped to their <literal>ID</literal>."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4131
#, no-c-format
-msgid "<literal>class</literal>"
+msgid "class"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4134
#, no-c-format
msgid "A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>). A <literal>Class</literal> is mapped to its fully qualified name."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4142
#, no-c-format
-msgid "<literal>binary</literal>"
+msgid "binary"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4145
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4150
#, no-c-format
-msgid "<literal>text</literal>"
+msgid "text"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4153
#, no-c-format
msgid "Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</literal> type."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4159
#, no-c-format
-msgid "<literal>serializable</literal>"
+msgid "serializable"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4162
#, no-c-format
msgid "Maps serializable Java types to an appropriate SQL binary type. You can also indicate the Hibernate type <literal>serializable</literal> with the name of a serializable Java class or interface that does not default to a basic type."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4171
#, no-c-format
-msgid "<literal>clob, blob</literal>"
+msgid "clob, blob"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4174
#, no-c-format
msgid "Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and <literal>java.sql.Blob</literal>. These types can be inconvenient for some applications, since the blob or clob object cannot be reused outside of a transaction. Driver support is patchy and inconsistent."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4184
#, no-c-format
-msgid "<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, imm_serializable, imm_binary</literal>"
+msgid "imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, imm_serializable, imm_binary"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4188
#, no-c-format
msgid "Type mappings for what are considered mutable Java types. This is where Hibernate makes certain optimizations appropriate only for immutable Java types, and the application treats the object as immutable. For example, you should not call <literal>Date.setTime()</literal> for an instance mapped as <literal>imm_timestamp</literal>. To change the value of the property, and have that change made persistent, the application must assign a new, nonidentical, object to the property."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4200
#, no-c-format
msgid "Unique identifiers of entities and collections can be of any basic type except <literal>binary</literal>, <literal>blob</literal> and <literal>clob</literal>. Composite identifiers are also allowed. See below for more information."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4205
#, no-c-format
msgid "The basic value types have corresponding <literal>Type</literal> constants defined on <literal>org.hibernate.Hibernate</literal>. For example, <literal>Hibernate.STRING</literal> represents the <literal>string</literal> type."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
msgid "Custom value types"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4214
#, no-c-format
msgid "It is relatively easy for developers to create their own value types. For example, you might want to persist properties of type <literal>java.lang.BigInteger</literal> to <literal>VARCHAR</literal> columns. Hibernate does not provide a built-in type for this. Custom types are not limited to mapping a property, or collection element, to a single table column. So, for example, you might have a Java property <literal>getName()</literal>/<literal>setName()</literal> of type <literal>java.lang.String</literal> that is persisted to the columns <literal>FIRST_NAME</literal>, <literal>INITIAL</literal>, <literal>SURNAME</literal>."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4225
#, no-c-format
msgid "To implement a custom type, implement either <literal>org.hibernate.UserType</literal> or <literal>org.hibernate.CompositeUserType</literal> and declare properties using the fully qualified classname of the type. View <literal>org.hibernate.test.DoubleStringType</literal> to see the kind of things that are possible."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, no-c-format
+msgid ""
+ "<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType\">\n"
+ " <column name=\"first_string\"/>\n"
+ " <column name=\"second_string\"/>\n"
+ "</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4234
#, no-c-format
msgid "Notice the use of <literal><column></literal> tags to map a property to multiple columns."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4237
#, no-c-format
msgid "The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</literal>, <literal>UserCollectionType</literal>, and <literal>UserVersionType</literal> interfaces provide support for more specialized uses."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4243
#, no-c-format
msgid "You can even supply parameters to a <literal>UserType</literal> in the mapping file. To do this, your <literal>UserType</literal> must implement the <literal>org.hibernate.usertype.ParameterizedType</literal> interface. To supply parameters to your custom type, you can use the <literal><type></literal> element in your mapping files."
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:4250
#, no-c-format
-msgid "The <literal>UserType</literal> can now retrieve the value for the parameter named <literal>default</literal> from the <literal>Properties</literal> object passed to it."
+msgid ""
+ "<property name=\"priority\">\n"
+ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+ " <param name=\"default\">0</param>\n"
+ " </type>\n"
+ "</property>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4252
#, no-c-format
-msgid "If you regularly use a certain <literal>UserType</literal>, it is useful to define a shorter name for it. You can do this using the <literal><typedef></literal> element. Typedefs assign a name to a custom type, and can also contain a list of default parameter values if the type is parameterized."
+msgid "The <literal>UserType</literal> can now retrieve the value for the parameter named <literal>default</literal> from the <literal>Properties</literal> object passed to it."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4256
#, no-c-format
-msgid "It is also possible to override the parameters supplied in a typedef on a case-by-case basis by using type parameters on the property mapping."
+msgid "If you regularly use a certain <literal>UserType</literal>, it is useful to define a shorter name for it. You can do this using the <literal><typedef></literal> element. Typedefs assign a name to a custom type, and can also contain a list of default parameter values if the type is parameterized."
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:4262
#, no-c-format
-msgid "Even though Hibernate's rich range of built-in types and support for components means you will rarely need to use a custom type, it is considered good practice to use custom types for non-entity classes that occur frequently in your application. For example, a <literal>MonetaryAmount</literal> class is a good candidate for a <literal>CompositeUserType</literal>, even though it could be mapped as a component. One reason for this is abstraction. With a custom type, your mapping documents would be protected against changes to the way monetary values are represented."
+msgid ""
+ "<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name=\"default_zero\">\n"
+ " <param name=\"default\">0</param>\n"
+ "</typedef>"
msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:4264
#, no-c-format
-msgid "Mapping a class more than once"
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4266
#, no-c-format
-msgid "It is possible to provide more than one mapping for a particular persistent class. In this case, you must specify an <emphasis>entity name</emphasis> to disambiguate between instances of the two mapped entities. By default, the entity name is the same as the class name. Hibernate lets you specify the entity name when working with persistent objects, when writing queries, or when mapping associations to the named entity."
+msgid "It is also possible to override the parameters supplied in a typedef on a case-by-case basis by using type parameters on the property mapping."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4270
#, no-c-format
-msgid "Associations are now specified using <literal>entity-name</literal> instead of <literal>class</literal>."
+msgid "Even though Hibernate's rich range of built-in types and support for components means you will rarely need to use a custom type, it is considered good practice to use custom types for non-entity classes that occur frequently in your application. For example, a <literal>MonetaryAmount</literal> class is a good candidate for a <literal>CompositeUserType</literal>, even though it could be mapped as a component. One reason for this is abstraction. With a custom type, your mapping documents would be protected against changes to the way monetary values are represented."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
-msgid "SQL quoted identifiers"
+msgid "Mapping a class more than once"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4285
#, no-c-format
-msgid "You can force Hibernate to quote an identifier in the generated SQL by enclosing the table or column name in backticks in the mapping document. Hibernate will use the correct quotation style for the SQL <literal>Dialect</literal>. This is usually double quotes, but the SQL Server uses brackets and MySQL uses backticks."
+msgid "It is possible to provide more than one mapping for a particular persistent class. In this case, you must specify an <emphasis>entity name</emphasis> to disambiguate between instances of the two mapped entities. By default, the entity name is the same as the class name. Hibernate lets you specify the entity name when working with persistent objects, when writing queries, or when mapping associations to the named entity."
msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:4293
#, no-c-format
-msgid "Metadata alternatives"
+msgid ""
+ "<class name=\"Contract\" table=\"Contracts\"\n"
+ " entity-name=\"CurrentContract\">\n"
+ " ...\n"
+ " <set name=\"history\" inverse=\"true\"\n"
+ " order-by=\"effectiveEndDate desc\">\n"
+ " <key column=\"currentContractId\"/>\n"
+ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
+ " </set>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"Contract\" table=\"ContractHistory\"\n"
+ " entity-name=\"HistoricalContract\">\n"
+ " ...\n"
+ " <many-to-one name=\"currentContract\"\n"
+ " column=\"currentContractId\"\n"
+ " entity-name=\"CurrentContract\"/>\n"
+ "</class>"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4295
#, no-c-format
-msgid "XML does not suit all users so there are some alternative ways to define O/R mapping metadata in Hibernate."
+msgid "Associations are now specified using <literal>entity-name</literal> instead of <literal>class</literal>."
msgstr ""
-#. Tag: title
-#, no-c-format
-msgid "Using XDoclet markup"
-msgstr ""
-
#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
#, no-c-format
-msgid "Many Hibernate users prefer to embed mapping information directly in sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover this approach in this reference guide since it is considered part of XDoclet. However, we include the following example of the <literal>Cat</literal> class with XDoclet mappings:"
+msgid "This feature is not supported in Annotations"
msgstr ""
-#. Tag: para
-#, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr ""
-
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
-msgid "Using JDK 5.0 Annotations"
+msgid "SQL quoted identifiers"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4306
#, no-c-format
-msgid "JDK 5.0 introduced XDoclet-style annotations at the language level that are type-safe and checked at compile time. This mechanism is more powerful than XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, for example, supports auto-completion and syntax highlighting of JDK 5.0 annotations. The new revision of the EJB specification (JSR-220) uses JDK 5.0 annotations as the primary metadata mechanism for entity beans. Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the persistence API). Support for mapping metadata is available via the <emphasis>Hibernate Annotations</emphasis> package as a separate download. Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
+msgid "You can force Hibernate to quote an identifier in the generated SQL by enclosing the table or column name in backticks in the mapping document. Hibernate will use the correct quotation style for the SQL <literal>Dialect</literal>. This is usually double quotes, but the SQL Server uses brackets and MySQL uses backticks."
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:4312
#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+msgid ""
+ "@Entity @Table(name=\"`Line Item`\")\n"
+ "class LineItem {\n"
+ " @id @Column(name=\"`Item Id`\") Integer id;\n"
+ " @Column(name=\"`Item #`\") int itemNumber\n"
+ "}\n"
+ "\n"
+ "<class name=\"LineItem\" table=\"`Line Item`\">\n"
+ " <id name=\"id\" column=\"`Item Id`\"/><generator class=\"assigned\"/></id>\n"
+ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+ " ...\n"
+ "</class>"
msgstr ""
-#. Tag: para
-#, no-c-format
-msgid "Support for JDK 5.0 Annotations (and JSR-220) is currently under development. Please refer to the Hibernate Annotations module for more details."
-msgstr ""
-
#. Tag: title
+#: basic_mapping.xml:4316
#, no-c-format
msgid "Generated properties"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4318
#, no-c-format
msgid "Generated properties are properties that have their values generated by the database. Typically, Hibernate applications needed to <literal>refresh</literal> objects that contain any properties for which the database was generating values. Marking properties as generated, however, lets the application delegate this responsibility to Hibernate. When Hibernate issues an SQL INSERT or UPDATE for an entity that has defined generated properties, it immediately issues a select afterwards to retrieve the generated values."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4327
#, no-c-format
msgid "Properties marked as generated must additionally be non-insertable and non-updateable. Only <link linkend=\"mapping-declaration-version\">versions</link>, <link linkend=\"mapping-declaration-timestamp\">timestamps</link>, and <link linkend=\"mapping-declaration-property\">simple properties</link>, can be marked as generated."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4334
#, no-c-format
msgid "<literal>never</literal> (the default): the given property value is not generated within the database."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4337
#, no-c-format
msgid "<literal>insert</literal>: the given property value is generated on insert, but is not regenerated on subsequent updates. Properties like created-date fall into this category. Even though <link linkend=\"mapping-declaration-version\">version</link> and <link linkend=\"mapping-declaration-timestamp\">timestamp</link> properties can be marked as generated, this option is not available."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4344
#, no-c-format
msgid "<literal>always</literal>: the property value is generated both on insert and on update."
msgstr ""
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4354
#, no-c-format
-msgid "Hibernate allows you to customize the SQL it uses to read and write the values of columns mapped to <link linkend=\"mapping-declaration-property\">simple properties</link>. For example, if your database provides a set of data encryption functions, you can invoke them for individual columns like this: <programlisting role=\"XML\"><property name=\"creditCardNumber\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" write=\"encrypt(?)\"/> </property></programlisting>"
+msgid "Hibernate allows you to customize the SQL it uses to read and write the values of columns mapped to <link linkend=\"mapping-declaration-property\">simple properties</link>. For example, if your database provides a set of data encryption functions, you can invoke them for individual columns like this:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4359
+#, no-c-format
+msgid ""
+ "<property name=\"creditCardNumber\">\n"
+ " <column \n"
+ " name=\"credit_card_num\"\n"
+ " read=\"decrypt(credit_card_num)\"\n"
+ " write=\"encrypt(?)\"/>\n"
+ "</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
msgid "Hibernate applies the custom expressions automatically whenever the property is referenced in a query. This functionality is similar to a derived-property <literal>formula</literal> with two differences:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
msgid "The property is backed by one or more columns that are exported as part of automatic schema generation."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
msgid "The <literal>write</literal> expression, if specified, must contain exactly one '?' placeholder for the value."
msgstr ""
#. Tag: title
+#: basic_mapping.xml:4384
#, no-c-format
msgid "Auxiliary database objects"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4386
#, no-c-format
msgid "Auxiliary database objects allow for the CREATE and DROP of arbitrary database objects. In conjunction with Hibernate's schema evolution tools, they have the ability to fully define a user schema within the Hibernate mapping files. Although designed specifically for creating and dropping things like triggers or stored procedures, any SQL command that can be run via a <literal>java.sql.Statement.execute()</literal> method is valid (for example, ALTERs, INSERTS, etc.). There are essentially two modes for defining auxiliary database objects:"
msgstr ""
#. Tag: para
+#: basic_mapping.xml:4396
#, no-c-format
msgid "The first mode is to explicitly list the CREATE and DROP commands in the mapping file:"
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ " ...\n"
+ " <database-object>\n"
+ " <create>CREATE TRIGGER my_trigger ...</create>\n"
+ " <drop>DROP TRIGGER my_trigger</drop>\n"
+ " </database-object>\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4401
#, no-c-format
msgid "The second mode is to supply a custom class that constructs the CREATE and DROP commands. This custom class must implement the <literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal> interface."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ " ...\n"
+ " <database-object>\n"
+ " <definition class=\"MyTriggerDefinition\"/>\n"
+ " </database-object>\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4408
#, no-c-format
msgid "Additionally, these database objects can be optionally scoped so that they only apply when certain dialects are used."
msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ " ...\n"
+ " <database-object>\n"
+ " <definition class=\"MyTriggerDefinition\"/>\n"
+ " <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/>\n"
+ " <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/>\n"
+ " </database-object>\n"
+ "</hibernate-mapping>"
+msgstr ""
+
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/collection_mapping.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/collection_mapping.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/collection_mapping.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,624 +1,2165 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: collection_mapping.xml:31
#, no-c-format
msgid "Collection mapping"
msgstr ""
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:36
#, no-c-format
-msgid "Hibernate requires that persistent collection-valued fields be declared as an interface type. For example:"
+msgid "Naturally Hibernate also allows to persist collections. These persistent collections can contain almost any other Hibernate type, including: basic types, custom types, components and references to other entities. The distinction between value and reference semantics is in this context very important. An object in a collection might be handled with \"value\" semantics (its life cycle fully depends on the collection owner), or it might be a reference to another entity with its own life cycle. In the latter case, only the \"link\" between the two objects is considered to be a state held by the collection."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:46
#, no-c-format
-msgid "The actual interface might be <literal>java.util.Set</literal>, <literal>java.util.Collection</literal>, <literal>java.util.List</literal>, <literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, <literal>java.util.SortedMap</literal> or anything you like (\"anything you like\" means you will have to write an implementation of <literal>org.hibernate.usertype.UserCollectionType</literal>.)"
+msgid "As a requirement persistent collection-valued fields must be declared as an interface type (see <xref linkend=\"example.collection.mapping.annotations\"/>). The actual interface might be <literal>java.util.Set</literal>, <literal>java.util.Collection</literal>, <literal>java.util.List</literal>, <literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, <literal>java.util.SortedMap</literal> or anything you like (\"anything you like\" means you will have to write an implementation of <literal>org.hibernate.usertype.UserCollectionType</literal>)."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:57
#, no-c-format
-msgid "Notice how the instance variable was initialized with an instance of <literal>HashSet</literal>. This is the best way to initialize collection valued properties of newly instantiated (non-persistent) instances. When you make the instance persistent, by calling <literal>persist()</literal> for example, Hibernate will actually replace the <literal>HashSet</literal> with an instance of Hibernate's own implementation of <literal>Set</literal>. Be aware of the following errors:"
+msgid "Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the instance variable <literal>parts</literal> was initialized with an instance of <literal>HashSet</literal>. This is the best way to initialize collection valued properties of newly instantiated (non-persistent) instances. When you make the instance persistent, by calling <literal>persist()</literal>, Hibernate will actually replace the <literal>HashSet</literal> with an instance of Hibernate's own implementation of <literal>Set</literal>. Be aware of the following error:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:68
+#, no-c-format
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, no-c-format
+msgid ""
+ "Cat cat = new DomesticCat();\n"
+ "Cat kitten = new DomesticCat();\n"
+ "....\n"
+ "Set kittens = new HashSet();\n"
+ "kittens.add(kitten);\n"
+ "cat.setKittens(kittens);\n"
+ "session.persist(cat);\n"
+ "\n"
+ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+ "(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:73
#, no-c-format
msgid "The persistent collections injected by Hibernate behave like <literal>HashMap</literal>, <literal>HashSet</literal>, <literal>TreeMap</literal>, <literal>TreeSet</literal> or <literal>ArrayList</literal>, depending on the interface type."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:78
#, no-c-format
msgid "Collections instances have the usual behavior of value types. They are automatically persisted when referenced by a persistent object and are automatically deleted when unreferenced. If a collection is passed from one persistent object to another, its elements might be moved from one table to another. Two entities cannot share a reference to the same collection instance. Due to the underlying relational model, collection-valued properties do not support null value semantics. Hibernate does not distinguish between a null collection reference and an empty collection."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:89
#, no-c-format
-msgid "Use persistent collections the same way you use ordinary Java collections. However, please ensure you understand the semantics of bidirectional associations (these are discussed later)."
+msgid "Use persistent collections the same way you use ordinary Java collections. However, ensure you understand the semantics of bidirectional associations (see <xref linkend=\"collections-bidirectional\"/>)."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:97
#, no-c-format
-msgid "Collection mappings"
+msgid "How to map collections"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "There are quite a range of mappings that can be generated for collections that cover many common relational models. We suggest you experiment with the schema generation tool so that you understand how various mapping declarations translate to database tables."
+msgid "Using annotations you can map <classname>Collection</classname>s, <classname>List</classname>s, <classname>Map</classname>s and <classname>Set</classname>s of associated entities using @OneToMany and @ManyToMany. For collections of a basic or embeddable type use @ElementCollection. In the simplest case a collection mapping looks like this:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Product {\n"
+ "\n"
+ " private String serialNumber;\n"
+ " private Set<Part> parts = new HashSet<Part>();\n"
+ "\n"
+ " @Id\n"
+ " public String getSerialNumber() { return serialNumber; }\n"
+ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
+ " \n"
+ " @OneToMany\n"
+ " @JoinColumn(name=\"PART_ID\")\n"
+ " public Set<Part> getParts() { return parts; }\n"
+ " void setParts(Set parts) { this.parts = parts; }\n"
+ "}\n"
+ "\n"
+ "\n"
+ "@Entity\n"
+ "public class Part {\n"
+ " ...\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:112
#, no-c-format
-msgid "The Hibernate mapping element used for mapping a collection depends upon the type of interface. For example, a <literal><set></literal> element is used for mapping properties of type <literal>Set</literal>."
+msgid "Product describes a unidirectional relationship with Part using the join column PART_ID. In this unidirectional one to many scenario you can also use a join table as seen in <xref linkend=\"example-one-to-many-with-join-table\"/>."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Product {\n"
+ "\n"
+ " private String serialNumber;\n"
+ " private Set<Part> parts = new HashSet<Part>();\n"
+ "\n"
+ " @Id\n"
+ " public String getSerialNumber() { return serialNumber; }\n"
+ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
+ " \n"
+ " @OneToMany\n"
+ " @JoinTable(\n"
+ " name=\"PRODUCT_PARTS\",\n"
+ " joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+ " inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+ " )\n"
+ " public Set<Part> getParts() { return parts; }\n"
+ " void setParts(Set parts) { this.parts = parts; }\n"
+ "}\n"
+ "\n"
+ "\n"
+ "@Entity\n"
+ "public class Part {\n"
+ " ...\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:124
#, no-c-format
-msgid "Apart from <literal><set></literal>, there is also <literal><list></literal>, <literal><map></literal>, <literal><bag></literal>, <literal><array></literal> and <literal><primitive-array></literal> mapping elements. The <literal><map></literal> element is representative:"
+msgid "Without describing any physical mapping (no <classname>@JoinColumn</classname> or <classname>@JoinTable</classname>), a unidirectional one to many with join table is used. The table name is the concatenation of the owner table name, _, and the other side table name. The foreign key name(s) referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:135
#, no-c-format
+msgid "Lets have a look now how collections are mapped using Hibernate mapping files. In this case the first step is to chose the right mapping element. It depends on the type of interface. For example, a <literal><set></literal> element is used for mapping properties of type <literal>Set</literal>."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:142
+#, no-c-format
+msgid "Mapping a Set using <set>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, no-c-format
+msgid ""
+ "<class name=\"Product\">\n"
+ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+ " <set name=\"parts\">\n"
+ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+ " <one-to-many class=\"Part\"/>\n"
+ " </set>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:147
+#, no-c-format
+msgid "In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many association</emphasis> links the <literal>Product</literal> and <literal>Part</literal> entities. This association requires the existence of a foreign key column and possibly an index column to the <literal>Part</literal> table. This mapping loses certain semantics of normal Java collections:"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:156
+#, no-c-format
+msgid "An instance of the contained entity class cannot belong to more than one instance of the collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:161
+#, no-c-format
+msgid "An instance of the contained entity class cannot appear at more than one value of the collection index."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:166
+#, no-c-format
+msgid "Looking closer at the used <literal><one-to-many></literal> tag we see that it has the following options."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, no-c-format
+msgid ""
+ "<one-to-many\n"
+ " class=\"ClassName\"\n"
+ " not-found=\"ignore|exception\"\n"
+ " entity-name=\"EntityName\"\n"
+ " node=\"element-name\"\n"
+ " embed-xml=\"true|false\"\n"
+ " />"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:185
+#, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, no-c-format
+msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how cached identifiers that reference missing rows will be handled. <literal>ignore</literal> will treat a missing row as a null association."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, no-c-format
+msgid "<literal>entity-name</literal> (optional): the entity name of the associated class, as an alternative to <literal>class</literal>."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, no-c-format
+msgid "The <literal><one-to-many></literal> element does not need to declare any columns. Nor is it necessary to specify the <literal>table</literal> name anywhere."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, no-c-format
+msgid "If the foreign key column of a <literal><one-to-many></literal> association is declared <literal>NOT NULL</literal>, you must declare the <literal><key></literal> mapping <literal>not-null=\"true\"</literal> or <emphasis>use a bidirectional association</emphasis> with the collection mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend=\"collections-bidirectional\"/>."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, no-c-format
+msgid "Apart from the <literal><set> </literal>tag as shown in <xref linkend=\"example.collections.set\"/>, there is also <literal><list></literal>, <literal><map></literal>, <literal><bag></literal>, <literal><array></literal> and <literal><primitive-array></literal> mapping elements. The <literal><map></literal> element is representative:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, no-c-format
+msgid ""
+ "<map\n"
+ " name=\"propertyName\"\n"
+ " table=\"table_name\"\n"
+ " schema=\"schema_name\"\n"
+ " lazy=\"true|extra|false\"\n"
+ " inverse=\"true|false\"\n"
+ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+ " sort=\"unsorted|natural|comparatorClass\"\n"
+ " order-by=\"column_name asc|desc\"\n"
+ " where=\"arbitrary sql where condition\"\n"
+ " fetch=\"join|select|subselect\"\n"
+ " batch-size=\"N\"\n"
+ " access=\"field|property|ClassName\"\n"
+ " optimistic-lock=\"true|false\"\n"
+ " mutable=\"true|false\"\n"
+ " node=\"element-name|.\"\n"
+ " embed-xml=\"true|false\"\n"
+ ">\n"
+ "\n"
+ " <key .... />\n"
+ " <map-key .... />\n"
+ " <element .... />\n"
+ "</map>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:266
+#, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:270
#, no-c-format
msgid "<literal>table</literal> (optional - defaults to property name): the name of the collection table. It is not used for one-to-many associations."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:276
#, no-c-format
msgid "<literal>schema</literal> (optional): the name of a table schema to override the schema declared on the root element"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:281
#, no-c-format
msgid "<literal>lazy</literal> (optional - defaults to <literal>true</literal>): disables lazy fetching and specifies that the association is always eagerly fetched. It can also be used to enable \"extra-lazy\" fetching where most operations do not initialize the collection. This is suitable for large collections."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:290
#, no-c-format
msgid "<literal>inverse</literal> (optional - defaults to <literal>false</literal>): marks this collection as the \"inverse\" end of a bidirectional association."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:296
#, no-c-format
msgid "<literal>cascade</literal> (optional - defaults to <literal>none</literal>): enables operations to cascade to child entities."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:302
#, no-c-format
msgid "<literal>sort</literal> (optional): specifies a sorted collection with <literal>natural</literal> sort order or a given comparator class."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:308
#, no-c-format
-msgid "<literal>order-by</literal> (optional, JDK1.4 only): specifies a table column or columns that define the iteration order of the <literal>Map</literal>, <literal>Set</literal> or bag, together with an optional <literal>asc</literal> or <literal>desc</literal>."
+msgid "<literal>order-by</literal> (optional): specifies a table column or columns that define the iteration order of the <literal>Map</literal>, <literal>Set</literal> or bag, together with an optional <literal>asc</literal> or <literal>desc</literal>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:316
#, no-c-format
msgid "<literal>where</literal> (optional): specifies an arbitrary SQL <literal>WHERE</literal> condition that is used when retrieving or removing the collection. This is useful if the collection needs to contain only a subset of the available data."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:324
#, no-c-format
msgid "<literal>fetch</literal> (optional, defaults to <literal>select</literal>): chooses between outer-join fetching, fetching by sequential select, and fetching by sequential subselect."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:331
#, no-c-format
msgid "<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): specifies a \"batch size\" for lazily fetching instances of this collection."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:337
#, no-c-format
msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses for accessing the collection property value."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:343
#, no-c-format
msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that changes to the state of the collection results in increments of the owning entity's version. For one-to-many associations you may want to disable this setting."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:351
#, no-c-format
msgid "<literal>mutable</literal> (optional - defaults to <literal>true</literal>): a value of <literal>false</literal> specifies that the elements of the collection never change. This allows for minor performance optimization in some cases."
msgstr ""
+#. Tag: para
+#: collection_mapping.xml:360
+#, no-c-format
+msgid "After exploring the basic mapping of collections in the preceding paragraphs we will now focus details like physical mapping considerations, indexed collections and collections of value types."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:367
#, no-c-format
-msgid "Collection instances are distinguished in the database by the foreign key of the entity that owns the collection. This foreign key is referred to as the <emphasis>collection key column</emphasis>, or columns, of the collection table. The collection key column is mapped by the <literal><key></literal> element."
+msgid "On the database level collection instances are distinguished by the foreign key of the entity that owns the collection. This foreign key is referred to as the <emphasis>collection key column</emphasis>, or columns, of the collection table. The collection key column is mapped by the <literal>@JoinColumn</literal> annotation respectively the <literal><key></literal> XML element."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:374
#, no-c-format
-msgid "There can be a nullability constraint on the foreign key column. For most collections, this is implied. For unidirectional one-to-many associations, the foreign key column is nullable by default, so you may need to specify <literal>not-null=\"true\"</literal>."
+msgid "There can be a nullability constraint on the foreign key column. For most collections, this is implied. For unidirectional one-to-many associations, the foreign key column is nullable by default, so you may need to specify"
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:379
+#, no-c-format
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:381
#, no-c-format
-msgid "The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
+msgid "<para>or</para>"
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:383
+#, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:385
#, no-c-format
-msgid "See the previous chapter for a full definition of the <literal><key></literal> element."
+msgid "The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In XML this can be expressed via:"
msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: collection_mapping.xml:388
#, no-c-format
-msgid "Collection elements"
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:390
#, no-c-format
-msgid "Collections can contain almost any other Hibernate type, including: basic types, custom types, components and references to other entities. This is an important distinction. An object in a collection might be handled with \"value\" semantics (its life cycle fully depends on the collection owner), or it might be a reference to another entity with its own life cycle. In the latter case, only the \"link\" between the two objects is considered to be a state held by the collection."
+msgid "In annotations the Hibernate specific annotation @OnDelete has to be used."
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:393
+#, no-c-format
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:395
#, no-c-format
-msgid "The contained type is referred to as the <emphasis>collection element type</emphasis>. Collection elements are mapped by <literal><element></literal> or <literal><composite-element></literal>, or in the case of entity references, with <literal><one-to-many></literal> or <literal><many-to-many></literal>. The first two map elements with value semantics, the next two are used to map entity associations."
+msgid "See <xref lang=\"\" linkend=\"section.key\"/> for more information about the <literal><key></literal> element."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
msgid "Indexed collections"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:402
#, no-c-format
-msgid "All collection mappings, except those with set and bag semantics, need an <emphasis>index column</emphasis> in the collection table. An index column is a column that maps to an array index, or <literal>List</literal> index, or <literal>Map</literal> key. The index of a <literal>Map</literal> may be of any basic type, mapped with <literal><map-key></literal>. It can be an entity reference mapped with <literal><map-key-many-to-many></literal>, or it can be a composite type mapped with <literal><composite-map-key></literal>. The index of an array or list is always of type <literal>integer</literal> and is mapped using the <literal><list-index></literal> element. The mapped column contains sequential integers that are numbered from zero by default."
+msgid "In the following paragraphs we have a closer at the indexed collections <classname>List</classname> and <classname>Map</classname> how the their index can be mapped in Hibernate."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:407
+#, no-c-format
+msgid "Lists"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
-msgid "<literal>column_name</literal> (required): the name of the column holding the collection index values."
+msgid "Lists can be mapped in two different ways:"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:413
#, no-c-format
-msgid "<literal>base</literal> (optional - defaults to <literal>0</literal>): the value of the index column that corresponds to the first element of the list or array."
+msgid "as ordered lists, where the order is not materialized in the database"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:418
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the column holding the collection index values."
+msgid "as indexed lists, where the order is materialized in the database"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:423
#, no-c-format
-msgid "<literal>formula</literal> (optional): a SQL formula used to evaluate the key of the map."
+msgid "To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> to your property. This annotation takes as parameter a list of comma separated properties (of the target entity) and orders the collection accordingly (eg <code>firstname asc, age desc</code>), if the string is empty, the collection will be ordered by the primary key of the target entity."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:432
+#, no-c-format
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:434
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Customer {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " @OneToMany(mappedBy=\"customer\")\n"
+ " @OrderBy(\"number\")\n"
+ " public List<Order> getOrders() { return orders; }\n"
+ " public void setOrders(List<Order> orders) { this.orders = orders; }\n"
+ " private List<Order> orders;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Order {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " public String getNumber() { return number; }\n"
+ " public void setNumber(String number) { this.number = number; }\n"
+ " private String number;\n"
+ "\n"
+ " @ManyToOne\n"
+ " public Customer getCustomer() { return customer; }\n"
+ " public void setCustomer(Customer customer) { this.customer = customer; }\n"
+ " private Customer number;\n"
+ "}\n"
+ "\n"
+ "-- Table schema\n"
+ "|-------------| |----------|\n"
+ "| Order | | Customer |\n"
+ "|-------------| |----------|\n"
+ "| id | | id |\n"
+ "| number | |----------| \n"
+ "| customer_id |\n"
+ "|-------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:437
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
+msgid "To store the index value in a dedicated column, use the <classname>@javax.persistence.OrderColumn</classname> annotation on your property. This annotations describes the column name and attributes of the column keeping the index value. This column is hosted on the table containing the association foreign key. If the column name is not specified, the default is the name of the referencing property, followed by underscore, followed by <literal>ORDER</literal> (in the following example, it would be <literal>orders_ORDER</literal>)."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:448
+#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Customer {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " @OneToMany(mappedBy=\"customer\")\n"
+ " @OrderColumn(name=\"orders_index\")\n"
+ " public List<Order> getOrders() { return orders; }\n"
+ " public void setOrders(List<Order> orders) { this.orders = orders; }\n"
+ " private List<Order> orders;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Order {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " public String getNumber() { return number; }\n"
+ " public void setNumber(String number) { this.number = number; }\n"
+ " private String number;\n"
+ "\n"
+ " @ManyToOne\n"
+ " public Customer getCustomer() { return customer; }\n"
+ " public void setCustomer(Customer customer) { this.customer = customer; }\n"
+ " private Customer number;\n"
+ "}\n"
+ "\n"
+ "-- Table schema\n"
+ "|--------------| |----------|\n"
+ "| Order | | Customer |\n"
+ "|--------------| |----------|\n"
+ "| id | | id |\n"
+ "| number | |----------| \n"
+ "| customer_id |\n"
+ "| orders_order |\n"
+ "|--------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:455
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the foreign key column for the collection index values."
+msgid "We recommend you to convert <classname>the legacy @org.hibernate.annotations.IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless you are making use of the base property. The <literal>base</literal> property lets you define the index value of the first element (aka as base index). The usual value is <literal>0</literal> or <literal>1</literal>. The default is 0 like in Java."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:464
#, no-c-format
-msgid "<literal>formula</literal> (optional): a SQ formula used to evaluate the foreign key of the map key."
+msgid "Looking again at the Hibernate mapping file equivalent, the index of an array or list is always of type <literal>integer</literal> and is mapped using the <literal><list-index></literal> element. The mapped column contains sequential integers that are numbered from zero by default."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:471
+#, no-c-format
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:481
+#, no-c-format
+msgid ""
+ "<list-index\n"
+ " column=\"column_name\"\n"
+ " base=\"0|1|...\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:485
#, no-c-format
-msgid "<literal>class</literal> (required): the entity class used as the map key."
+msgid "<literal>column_name</literal> (required): the name of the column holding the collection index values."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:490
#, no-c-format
+msgid "<literal>base</literal> (optional - defaults to <literal>0</literal>): the value of the index column that corresponds to the first element of the list or array."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:498
+#, no-c-format
msgid "If your table does not have an index column, and you still wish to use <literal>List</literal> as the property type, you can map the property as a Hibernate <emphasis><bag></emphasis>. A bag does not retain its order when it is retrieved from the database, but it can be optionally sorted or ordered."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:506
#, no-c-format
-msgid "Collections of values and many-to-many associations"
+msgid "Maps"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:508
#, no-c-format
-msgid "Any collection of values or many-to-many associations requires a dedicated <emphasis>collection table</emphasis> with a foreign key column or columns, <emphasis>collection element column</emphasis> or columns, and possibly an index column or columns."
+msgid "The question with <classname>Map</classname>s is where the key value is stored. There are everal options. Maps can borrow their keys from one of the associated entity properties or have dedicated columns to store an explicit key."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:513
#, no-c-format
-msgid "For a collection of values use the <literal><element></literal> tag. For example:"
+msgid "To use one of the target entity property as a key of the map, use <literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</literal> is a property name in the target entity. When using <literal>@MapKey</literal> without the name attribuate, 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, because the map key 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."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:525
+#, no-c-format
+msgid "Use of target entity property as map key via <classname>@MapKey</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:528
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Customer {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " @OneToMany(mappedBy=\"customer\")\n"
+ " @MapKey(name=\"number\")\n"
+ " public Map<String,Order> getOrders() { return orders; }\n"
+ " public void setOrders(Map<String,Order> order) { this.orders = orders; }\n"
+ " private Map<String,Order> orders;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Order {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " public String getNumber() { return number; }\n"
+ " public void setNumber(String number) { this.number = number; }\n"
+ " private String number;\n"
+ "\n"
+ " @ManyToOne\n"
+ " public Customer getCustomer() { return customer; }\n"
+ " public void setCustomer(Customer customer) { this.customer = customer; }\n"
+ " private Customer number;\n"
+ "}\n"
+ "\n"
+ "-- Table schema\n"
+ "|-------------| |----------|\n"
+ "| Order | | Customer |\n"
+ "|-------------| |----------|\n"
+ "| id | | id |\n"
+ "| number | |----------| \n"
+ "| customer_id |\n"
+ "|-------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:531
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the column holding the collection element values."
+msgid "Alternatively the map key is mapped to a dedicated column or columns. In order to customize the mapping use one of the following annotations:"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:537
#, no-c-format
-msgid "<literal>formula</literal> (optional): an SQL formula used to evaluate the element."
+msgid "@<classname>MapKeyColumn</classname> if the map key is a basic type. If you don't specify the column name, the name of the property followed by underscore followed by <literal>KEY</literal> is used (for example <literal>orders_KEY</literal>)."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:544
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
+msgid "<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</classname> if the map key type is respectively an enum or a <classname>Date</classname>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:550
#, no-c-format
-msgid "A <emphasis>many-to-many association</emphasis> is specified using the <literal><many-to-many></literal> element."
+msgid "<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</classname> if the map key type is another entity."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:555
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the element foreign key column."
+msgid "<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</classname> when the map key is a embeddable object. Use <literal>key.</literal> as a prefix for your embeddable object property names."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:562
#, no-c-format
-msgid "<literal>formula</literal> (optional): an SQL formula used to evaluate the element foreign key value."
+msgid "You can also use <classname>@MapKeyClass</classname> to define the type of the key if you don't use generics."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:566
+#, no-c-format
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Customer {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+ " @MapKeyColumn(name=\"orders_number\")\n"
+ " public Map<String,Order> getOrders() { return orders; }\n"
+ " public void setOrders(Map<String,Order> orders) { this.orders = orders; }\n"
+ " private Map<String,Order> orders;\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "public class Order {\n"
+ " @Id @GeneratedValue public Integer getId() { return id; }\n"
+ " public void setId(Integer id) { this.id = id; }\n"
+ " private Integer id;\n"
+ "\n"
+ " public String getNumber() { return number; }\n"
+ " public void setNumber(String number) { this.number = number; }\n"
+ " private String number;\n"
+ "\n"
+ " @ManyToOne\n"
+ " public Customer getCustomer() { return customer; }\n"
+ " public void setCustomer(Customer customer) { this.customer = customer; }\n"
+ " private Customer number;\n"
+ "}\n"
+ "\n"
+ "-- Table schema\n"
+ "|-------------| |----------| |---------------|\n"
+ "| Order | | Customer | | Cust_Order |\n"
+ "|-------------| |----------| |---------------|\n"
+ "| id | | id | | customer_id |\n"
+ "| number | |----------| | order_id |\n"
+ "| customer_id | | orders_number |\n"
+ "|-------------| |---------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:573
#, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
+msgid "We recommend you to migrate from <classname>@org.hibernate.annotations.MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</classname> to the new standard approach described above"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:579
#, no-c-format
-msgid "<literal>fetch</literal> (optional - defaults to <literal>join</literal>): enables outer-join or sequential select fetching for this association. This is a special case; for full eager fetching in a single <literal>SELECT</literal> of an entity and its many-to-many relationships to other entities, you would enable <literal>join</literal> fetching,not only of the collection itself, but also with this attribute on the <literal><many-to-many></literal> nested element."
+msgid "Using Hibernate mapping files there exists equivalent concepts to the descibed annotations. You have to use <literal><map-key></literal>, <literal><map-key-many-to-many></literal> and <literal><composite-map-key></literal>. <literal><map-key></literal> is used for any basic type, <literal><map-key-many-to-many></literal> for an entity reference and <literal><composite-map-key></literal> for a composite type."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:590
+#, no-c-format
+msgid "map-key xml mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
+msgid ""
+ "<map-key\n"
+ " column=\"column_name\"\n"
+ " formula=\"any SQL expression\"\n"
+ " type=\"type_name\"\n"
+ " node=\"@attribute-name\"\n"
+ " length=\"N\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:605
#, no-c-format
-msgid "<literal>unique</literal> (optional): enables the DDL generation of a unique constraint for the foreign-key column. This makes the association multiplicity effectively one-to-many."
+msgid "<literal>column</literal> (optional): the name of the column holding the collection index values."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:610
#, no-c-format
-msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how foreign keys that reference missing rows will be handled: <literal>ignore</literal> will treat a missing row as a null association."
+msgid "<literal>formula</literal> (optional): a SQL formula used to evaluate the key of the map."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:615
#, no-c-format
-msgid "<literal>entity-name</literal> (optional): the entity name of the associated class, as an alternative to <literal>class</literal>."
+msgid "<literal>type</literal> (required): the type of the map keys."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:623
+#, no-c-format
+msgid "map-key-many-to-many"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
+#, no-c-format
+msgid ""
+ "<map-key-many-to-many\n"
+ " column=\"column_name\"\n"
+ " formula=\"any SQL expression\"\n"
+ " class=\"ClassName\"\n"
+ "/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:638
#, no-c-format
-msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to this foreign key. If not specified, the primary key of the associated class is used."
+msgid "<literal>column</literal> (optional): the name of the foreign key column for the collection index values."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:643
#, no-c-format
-msgid "Here are some examples."
+msgid "<literal>formula</literal> (optional): a SQ formula used to evaluate the foreign key of the map key."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:648
#, no-c-format
-msgid "A set of strings:"
+msgid "<literal>class</literal> (required): the entity class used as the map key."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:658
+#, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
-msgid "A bag containing integers with an iteration order determined by the <literal>order-by</literal> attribute:"
+msgid "In some situations you don't need to associate two entities but simply create a collection of basic types or embeddable objects. Use the <classname>@ElementCollection</classname> for this case."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:665
+#, no-c-format
+msgid "Collection of basic types mapped via <classname>@ElementCollection</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class User {\n"
+ " [...]\n"
+ " public String getLastname() { ...}\n"
+ "\n"
+ " @ElementCollection\n"
+ " @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name=\"user_id\"))\n"
+ " @Column(name=\"nickname\")\n"
+ " public Set<String> getNicknames() { ... } \n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:671
#, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
+msgid "The collection table holding the collection data is set using the <classname>@CollectionTable</classname> annotation. If omitted the collection table name defaults to the concatenation of the name of the containing entity and the name of the collection attribute, separated by an underscore. In our example, it would be <literal>User_nicknames</literal>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
-msgid "A map from string indices to dates:"
+msgid "The column holding the basic type is set using the <classname>@Column</classname> annotation. If omitted, the column name defaults to the property name: in our example, it would be <literal>nicknames</literal>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
+msgid "But you are not limited to basic types, the collection type can be any embeddable object. To override the columns of the embeddable object in the collection table, use the <classname>@AttributeOverride</classname> annotation."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:689
#, no-c-format
-msgid "One-to-many associations"
+msgid "@ElementCollection for embeddable objects"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:691
#, no-c-format
-msgid "A <emphasis>one-to-many association</emphasis> links the tables of two classes via a foreign key with no intervening collection table. This mapping loses certain semantics of normal Java collections:"
+msgid ""
+ "@Entity\n"
+ "public class User {\n"
+ " [...]\n"
+ " public String getLastname() { ...}\n"
+ "\n"
+ " @ElementCollection\n"
+ " @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name=\"user_id\"))\n"
+ " @AttributeOverrides({\n"
+ " @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street\"))\n"
+ " })\n"
+ " public Set<Address> getAddresses() { ... } \n"
+ "}\n"
+ "\n"
+ "@Embeddable\n"
+ "public class Address {\n"
+ " public String getStreet1() {...}\n"
+ " [...]\n"
+ "}"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:694
#, no-c-format
-msgid "An instance of the contained entity class cannot belong to more than one instance of the collection."
+msgid "Such an embeddable object cannot contains a collection itself."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:698
#, no-c-format
-msgid "An instance of the contained entity class cannot appear at more than one value of the collection index."
+msgid "in <classname>@AttributeOverride</classname>, you must use the <literal>value.</literal> prefix to override properties of the embeddable object used in the map value and the <literal>key.</literal> prefix to override properties of the embeddable object used in the map key."
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:704
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class User {\n"
+ " @ElementCollection\n"
+ " @AttributeOverrides({\n"
+ " @AttributeOverride(name=\"key.street1\", column=@Column(name=\"fld_street\")),\n"
+ " @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note\"))\n"
+ " })\n"
+ " public Map<Address,Rating> getFavHomes() { ... }"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:708
#, no-c-format
-msgid "An association from <literal>Product</literal> to <literal>Part</literal> requires the existence of a foreign key column and possibly an index column to the <literal>Part</literal> table. A <literal><one-to-many></literal> tag indicates that this is a one-to-many association."
+msgid "We recommend you to migrate from <classname>@org.hibernate.annotations.CollectionOfElements</classname> to the new <classname>@ElementCollection</classname> annotation."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:714
#, no-c-format
-msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how cached identifiers that reference missing rows will be handled. <literal>ignore</literal> will treat a missing row as a null association."
+msgid "Using the mapping file approach a collection of values is mapped using the <literal><element></literal> tag. For example:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:718
+#, no-c-format
+msgid "<element> tag for collection values using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
+msgid ""
+ "<element\n"
+ " column=\"column_name\"\n"
+ " formula=\"any SQL expression\"\n"
+ " type=\"typename\"\n"
+ " length=\"L\"\n"
+ " precision=\"P\"\n"
+ " scale=\"S\"\n"
+ " not-null=\"true|false\"\n"
+ " unique=\"true|false\"\n"
+ " node=\"element-name\"\n"
+ "/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:734
#, no-c-format
-msgid "The <literal><one-to-many></literal> element does not need to declare any columns. Nor is it necessary to specify the <literal>table</literal> name anywhere."
+msgid "<literal>column</literal> (optional): the name of the column holding the collection element values."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:739
#, no-c-format
-msgid "If the foreign key column of a <literal><one-to-many></literal> association is declared <literal>NOT NULL</literal>, you must declare the <literal><key></literal> mapping <literal>not-null=\"true\"</literal> or <emphasis>use a bidirectional association</emphasis> with the collection mapping marked <literal>inverse=\"true\"</literal>. See the discussion of bidirectional associations later in this chapter for more information."
+msgid "<literal>formula</literal> (optional): an SQL formula used to evaluate the element."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:744
#, no-c-format
-msgid "The following example shows a map of <literal>Part</literal> entities by name, where <literal>partName</literal> is a persistent property of <literal>Part</literal>. Notice the use of a formula-based index:"
+msgid "<literal>type</literal> (required): the type of the collection element."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr ""
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
-msgid "Hibernate supports collections implementing <literal>java.util.SortedMap</literal> and <literal>java.util.SortedSet</literal>. You must specify a comparator in the mapping file:"
+msgid "Hibernate supports collections implementing <literal>java.util.SortedMap</literal> and <literal>java.util.SortedSet</literal>. With annotations you declare a sort comparator using <literal>@Sort</literal>. You chose between the comparator types unsorted, natural or custom. If you want to use your own comparator implementation, you'll also have to specify 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: title
+#: collection_mapping.xml:770
+#, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+ "@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+ "@JoinColumn(name=\"CUST_ID\")\n"
+ "@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+ "public SortedSet<Ticket> getTickets() {\n"
+ " return tickets;\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
+msgid "Using Hibernate mapping files you specify a comparator in the mapping file with <literal><sort></literal>:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:779
+#, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, no-c-format
+msgid ""
+ "<set name=\"aliases\"\n"
+ " table=\"person_aliases\" \n"
+ " sort=\"natural\">\n"
+ " <key column=\"person\"/>\n"
+ " <element column=\"name\" type=\"string\"/>\n"
+ "</set>\n"
+ "\n"
+ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+ " <key column=\"year_id\"/>\n"
+ " <map-key column=\"hol_name\" type=\"string\"/>\n"
+ " <element column=\"hol_date\" type=\"date\"/>\n"
+ "</map>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:784
+#, no-c-format
msgid "Allowed values of the <literal>sort</literal> attribute are <literal>unsorted</literal>, <literal>natural</literal> and the name of a class implementing <literal>java.util.Comparator</literal>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
msgid "Sorted collections actually behave like <literal>java.util.TreeSet</literal> or <literal>java.util.TreeMap</literal>."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:794
#, no-c-format
-msgid "If you want the database itself to order the collection elements, use the <literal>order-by</literal> attribute of <literal>set</literal>, <literal>bag</literal> or <literal>map</literal> mappings. This solution is only available under JDK 1.4 or higher and is implemented using <literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This performs the ordering in the SQL query and not in the memory."
+msgid "If you want the database itself to order the collection elements, use the <literal>order-by</literal> attribute of <literal>set</literal>, <literal>bag</literal> or <literal>map</literal> mappings. This solution is implemented using <literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal> and performs the ordering in the SQL query and not in the memory."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, no-c-format
+msgid ""
+ "<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc\">\n"
+ " <key column=\"person\"/>\n"
+ " <element column=\"name\" type=\"string\"/>\n"
+ "</set>\n"
+ "\n"
+ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+ " <key column=\"year_id\"/>\n"
+ " <map-key column=\"hol_name\" type=\"string\"/>\n"
+ " <element column=\"hol_date type=\"date\"/>\n"
+ "</map>"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:810
#, no-c-format
msgid "The value of the <literal>order-by</literal> attribute is an SQL ordering, not an HQL ordering."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:814
#, no-c-format
msgid "Associations can even be sorted by arbitrary criteria at runtime using a collection <literal>filter()</literal>:"
msgstr ""
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, no-c-format
+msgid "sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list();"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
msgid "A <emphasis>bidirectional association</emphasis> allows navigation from both \"ends\" of the association. Two kinds of bidirectional association are supported:"
msgstr ""
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:834
#, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr ""
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:848
#, no-c-format
-msgid "You can specify a bidirectional many-to-many association by mapping two many-to-many associations to the same database table and declaring one end as <emphasis>inverse</emphasis>. You cannot select an indexed collection."
+msgid "Often there exists a many to one association which is the owner side of a bidirectional relationship. The corresponding one to many association is in this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:854
#, no-c-format
-msgid "Here is an example of a bidirectional many-to-many association that illustrates how each category can have many items and each item can be in many categories:"
+msgid "Bidirectional one to many with many to one side as association owner"
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+ "@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"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:860
#, no-c-format
-msgid "Changes made only to the inverse end of the association are <emphasis>not</emphasis> persisted. This means that Hibernate has two representations in memory for every bidirectional association: one link from A to B and another link from B to A. This is easier to understand if you think about the Java object model and how a many-to-many relationship in Javais created:"
+msgid "<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."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:865
#, no-c-format
-msgid "The non-inverse side is used to save the in-memory representation to the database."
+msgid "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 not optimized and will produce additional UPDATE statements."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:872
+#, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
+msgid ""
+ "@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"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:878
#, no-c-format
-msgid "You can define a bidirectional one-to-many association by mapping a one-to-many association to the same table column(s) as a many-to-one association and declaring the many-valued end <literal>inverse=\"true\"</literal>."
+msgid "How does the mappping of a bidirectional mapping look like in Hibernate mapping xml? There you define a bidirectional one-to-many association by mapping a one-to-many association to the same table column(s) as a many-to-one association and declaring the many-valued end <literal>inverse=\"true\"</literal>."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:885
+#, no-c-format
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, no-c-format
+msgid ""
+ "<class name=\"Parent\">\n"
+ " <id name=\"id\" column=\"parent_id\"/>\n"
+ " ....\n"
+ " <set name=\"children\" inverse=\"true\">\n"
+ " <key column=\"parent_id\"/>\n"
+ " <one-to-many class=\"Child\"/>\n"
+ " </set>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"Child\">\n"
+ " <id name=\"id\" column=\"child_id\"/>\n"
+ " ....\n"
+ " <many-to-one name=\"parent\" \n"
+ " class=\"Parent\" \n"
+ " column=\"parent_id\"\n"
+ " not-null=\"true\"/>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:890
#, no-c-format
msgid "Mapping one end of an association with <literal>inverse=\"true\"</literal> does not affect the operation of cascades as these are orthogonal concepts."
msgstr ""
+#. Tag: para
+#: collection_mapping.xml:894
+#, no-c-format
+msgid "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):"
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:903
#, no-c-format
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+ "@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"
+ "}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+ "@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"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:910
+#, no-c-format
+msgid "In this example <classname>@JoinTable</classname> defines a <literal>name</literal>, an array of join columns, 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\"). 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:919
+#, no-c-format
+msgid "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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+ "@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"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:938
+#, no-c-format
+msgid "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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid "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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:955
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+ "@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"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:961
+#, no-c-format
+msgid "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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:966
+#, no-c-format
+msgid "Using Hibernate mapping files you can map a bidirectional many-to-many association by mapping two many-to-many associations to the same database table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:970
+#, no-c-format
+msgid "You cannot select an indexed collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:973
+#, no-c-format
+msgid "shows a bidirectional many-to-many association that illustrates how each category can have many items and each item can be in many categories:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:979
+#, no-c-format
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, no-c-format
+msgid ""
+ "<class name=\"Category\">\n"
+ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+ " ...\n"
+ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+ " <key column=\"CATEGORY_ID\"/>\n"
+ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+ " </bag>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"Item\">\n"
+ " <id name=\"id\" column=\"ITEM_ID\"/>\n"
+ " ...\n"
+ "\n"
+ " <!-- inverse end -->\n"
+ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"
+ " <key column=\"ITEM_ID\"/>\n"
+ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+ " </bag>\n"
+ "</class>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:984
+#, no-c-format
+msgid "Changes made only to the inverse end of the association are <emphasis>not</emphasis> persisted. This means that Hibernate has two representations in memory for every bidirectional association: one link from A to B and another link from B to A. This is easier to understand if you think about the Java object model and how a many-to-many relationship in Javais created:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:992
+#, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:995
+#, no-c-format
+msgid ""
+ "category.getItems().add(item); // The category now \"knows\" about the relationship\n"
+ "item.getCategories().add(category); // The item now \"knows\" about the relationship\n"
+ "\n"
+ "session.persist(item); // The relationship won't be saved!\n"
+ "session.persist(category); // The relationship will be saved"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:998
+#, no-c-format
+msgid "The non-inverse side is used to save the in-memory representation to the database."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1003
+#, no-c-format
msgid "Bidirectional associations with indexed collections"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1005
#, no-c-format
-msgid "A bidirectional association where one end is represented as a <literal><list></literal> or <literal><map></literal>, requires special consideration. If there is a property of the child class that maps to the index column you can use <literal>inverse=\"true\"</literal> on the collection mapping:"
+msgid "There are some additional considerations for bidirectional mappings with indexed collections (where one end is represented as a <literal><list></literal> or <literal><map></literal>) when using Hibernate mapping files. If there is a property of the child class that maps to the index column you can use <literal>inverse=\"true\"</literal> on the collection mapping:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1013
+#, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, no-c-format
+msgid ""
+ "<class name=\"Parent\">\n"
+ " <id name=\"id\" column=\"parent_id\"/>\n"
+ " ....\n"
+ " <map name=\"children\" inverse=\"true\">\n"
+ " <key column=\"parent_id\"/>\n"
+ " <map-key column=\"name\" \n"
+ " type=\"string\"/>\n"
+ " <one-to-many class=\"Child\"/>\n"
+ " </map>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"Child\">\n"
+ " <id name=\"id\" column=\"child_id\"/>\n"
+ " ....\n"
+ " <property name=\"name\" \n"
+ " not-null=\"true\"/>\n"
+ " <many-to-one name=\"parent\" \n"
+ " class=\"Parent\" \n"
+ " column=\"parent_id\"\n"
+ " not-null=\"true\"/>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1018
#, no-c-format
msgid "If there is no such property on the child class, the association cannot be considered truly bidirectional. That is, there is information available at one end of the association that is not available at the other end. In this case, you cannot map the collection <literal>inverse=\"true\"</literal>. Instead, you could use the following mapping:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1026
+#, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, no-c-format
+msgid ""
+ "<class name=\"Parent\">\n"
+ " <id name=\"id\" column=\"parent_id\"/>\n"
+ " ....\n"
+ " <map name=\"children\">\n"
+ " <key column=\"parent_id\"\n"
+ " not-null=\"true\"/>\n"
+ " <map-key column=\"name\" \n"
+ " type=\"string\"/>\n"
+ " <one-to-many class=\"Child\"/>\n"
+ " </map>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"Child\">\n"
+ " <id name=\"id\" column=\"child_id\"/>\n"
+ " ....\n"
+ " <many-to-one name=\"parent\" \n"
+ " class=\"Parent\" \n"
+ " column=\"parent_id\"\n"
+ " insert=\"false\"\n"
+ " update=\"false\"\n"
+ " not-null=\"true\"/>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1032
#, no-c-format
msgid "Note that in this mapping, the collection-valued end of the association is responsible for updates to the foreign key."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:1037
#, no-c-format
msgid "Ternary associations"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1039
#, no-c-format
msgid "There are three possible approaches to mapping a ternary association. One approach is to use a <literal>Map</literal> with an association as its index:"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1044
#, no-c-format
-msgid "A second approach is to remodel the association as an entity class. This is the most common approach."
+msgid "Ternary association mapping"
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:1046
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "public class Company {\n"
+ " @Id \n"
+ " int id;\n"
+ " ...\n"
+ " @OneToMany // unidirectional\n"
+ " @MapKeyJoinColumn(name=\"employee_id\")\n"
+ " Map<Employee, Contract> contracts;\n"
+ "}\n"
+ "\n"
+ "// or\n"
+ "\n"
+ "<map name=\"contracts\">\n"
+ " <key column=\"employer_id\" not-null=\"true\"/>\n"
+ " <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+ " <one-to-many class=\"Contract\"/>\n"
+ "</map>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1049
#, no-c-format
-msgid "A final alternative is to use composite elements, which will be discussed later."
+msgid "A second approach is to remodel the association as an entity class. This is the most common approach. A final alternative is to use composite elements, which will be discussed later."
msgstr ""
-#. Tag: title
+#. Tag: literal
+#: collection_mapping.xml:1055
#, no-c-format
-msgid "<literal>Using an <idbag></literal>"
+msgid "Using an <idbag>"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1057
#, no-c-format
-msgid "The majority of the many-to-many associations and collections of values shown previously all map to tables with composite keys, even though it has been have suggested that entities should have synthetic identifiers (surrogate keys). A pure association table does not seem to benefit much from a surrogate key, although a collection of composite values <emphasis>might</emphasis>. It is for this reason that Hibernate provides a feature that allows you to map many-to-many associations and collections of values to a table with a surrogate key."
+msgid "The majority of the many-to-many associations and collections of values shown previously all map to tables with composite keys, even though it has been suggested that entities should have synthetic identifiers (surrogate keys). A pure association table does not seem to benefit much from a surrogate key, although a collection of composite values <emphasis>might</emphasis>. For this reason Hibernate provides a feature that allows you to map many-to-many associations and collections of values to a table with a surrogate key."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1066
#, no-c-format
msgid "The <literal><idbag></literal> element lets you map a <literal>List</literal> (or <literal>Collection</literal>) with bag semantics. For example:"
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, no-c-format
+msgid ""
+ "<idbag name=\"lovers\" table=\"LOVERS\">\n"
+ " <collection-id column=\"ID\" type=\"long\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </collection-id>\n"
+ " <key column=\"PERSON1\"/>\n"
+ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/>\n"
+ "</idbag>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1072
#, no-c-format
msgid "An <literal><idbag></literal> has a synthetic id generator, just like an entity class. A different surrogate key is assigned to each collection row. Hibernate does not, however, provide any mechanism for discovering the surrogate key value of a particular row."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1077
#, no-c-format
msgid "The update performance of an <literal><idbag></literal> supersedes a regular <literal><bag></literal>. Hibernate can locate individual rows efficiently and update or delete them individually, similar to a list, map or set."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1082
#, no-c-format
msgid "In the current implementation, the <literal>native</literal> identifier generation strategy is not supported for <literal><idbag></literal> collection identifiers."
msgstr ""
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1105
#, no-c-format
msgid "This section covers collection examples."
msgstr ""
#. Tag: para
+#: collection_mapping.xml:1107
#, no-c-format
msgid "The following class has a collection of <literal>Child</literal> instances:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid "Example classes <classname>Parent</classname> and <classname>Child</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+ "public class Parent {\n"
+ " private long id;\n"
+ " private Set<Child> children;\n"
+ "\n"
+ " // getter/setter\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "\n"
+ "public class Child {\n"
+ " private long id;\n"
+ " private String name\n"
+ "\n"
+ " \n"
+ " // getter/setter\n"
+ " ...\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, no-c-format
msgid "If each child has, at most, one parent, the most natural mapping is a one-to-many association:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid "One to many unidirectional <classname>Parent-Child</classname> relationship using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+ "public class Parent {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " @OneToMany\n"
+ " private Set<Child> children;\n"
+ "\n"
+ " // getter/setter\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "\n"
+ "public class Child {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ " private String name;\n"
+ "\n"
+ " \n"
+ " // getter/setter\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid "One to many unidirectional <classname>Parent-Child</classname> relationship using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ "\n"
+ " <class name=\"Parent\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <set name=\"children\">\n"
+ " <key column=\"parent_id\"/>\n"
+ " <one-to-many class=\"Child\"/>\n"
+ " </set>\n"
+ " </class>\n"
+ "\n"
+ " <class name=\"Child\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <property name=\"name\"/>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid "Table definitions for unidirectional <classname>Parent</classname>-<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, no-c-format
+msgid ""
+ "create table parent ( id bigint not null primary key )\n"
+ "create table child ( id bigint not null primary key, name varchar(255), parent_id bigint )\n"
+ "alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
msgid "If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-many association:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid "One to many bidirectional <classname>Parent-Child</classname> relationship using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+ "public class Parent {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " @OneToMany(mappedBy=\"parent\")\n"
+ " private Set<Child> children;\n"
+ "\n"
+ " // getter/setter\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "\n"
+ "public class Child {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " private String name;\n"
+ " \n"
+ " @ManyToOne\n"
+ " private Parent parent;\n"
+ "\n"
+ " \n"
+ " // getter/setter\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid "One to many bidirectional <classname>Parent-Child</classname> relationship using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ "\n"
+ " <class name=\"Parent\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <set name=\"children\" inverse=\"true\">\n"
+ " <key column=\"parent_id\"/>\n"
+ " <one-to-many class=\"Child\"/>\n"
+ " </set>\n"
+ " </class>\n"
+ "\n"
+ " <class name=\"Child\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <property name=\"name\"/>\n"
+ " <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id\" not-null=\"true\"/>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1164
+#, no-c-format
+msgid "Table definitions for bidirectional <classname>Parent</classname>-<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, no-c-format
+msgid ""
+ "create table parent ( id bigint not null primary key )\n"
+ "create table child ( id bigint not null\n"
+ " primary key,\n"
+ " name varchar(255),\n"
+ " parent_id bigint not null )\n"
+ "alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1171
#, no-c-format
-msgid "Alternatively, if this association must be unidirectional you can declare the <literal>NOT NULL</literal> constraint on the <literal><key></literal> mapping:"
+msgid "Alternatively, if this association must be unidirectional you can enforce the <literal>NOT NULL</literal> constraint."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1175
+#, no-c-format
+msgid "Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+ "public class Parent {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " @OneToMany(optional=false)\n"
+ " private Set<Child> children;\n"
+ "\n"
+ " // getter/setter\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "\n"
+ "public class Child {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ " private String name;\n"
+ "\n"
+ " \n"
+ " // getter/setter\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid "Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ "\n"
+ " <class name=\"Parent\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <set name=\"children\">\n"
+ " <key column=\"parent_id\" not-null=\"true\"/>\n"
+ " <one-to-many class=\"Child\"/>\n"
+ " </set>\n"
+ " </class>\n"
+ "\n"
+ " <class name=\"Child\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <property name=\"name\"/>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1188
#, no-c-format
-msgid "On the other hand, if a child has multiple parents, a many-to-many association is appropriate:"
+msgid "On the other hand, if a child has multiple parents, a many-to-many association is appropriate."
msgstr ""
+#. Tag: title
+#: collection_mapping.xml:1192
+#, no-c-format
+msgid "Many to many <classname>Parent-Child</classname> relationship using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+ "public class Parent {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " @ManyToMany\n"
+ " private Set<Child> children;\n"
+ "\n"
+ " // getter/setter\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "\n"
+ "public class Child {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " private String name;\n"
+ "\n"
+ " \n"
+ " // getter/setter\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid "Many to many <classname>Parent-Child</classname> relationship using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ "\n"
+ " <class name=\"Parent\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <set name=\"children\" table=\"childset\">\n"
+ " <key column=\"parent_id\"/>\n"
+ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+ " </set>\n"
+ " </class>\n"
+ "\n"
+ " <class name=\"Child\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ " <property name=\"name\"/>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1208
#, no-c-format
-msgid "For more examples and a complete explanation of a parent/child relationship mapping, see <xref linkend=\"example-parentchild\" /> for more information."
+msgid "Table definitions for many to many releationship"
msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, no-c-format
+msgid ""
+ "create table parent ( id bigint not null primary key )\n"
+ "create table child ( id bigint not null primary key, name varchar(255) )\n"
+ "create table childset ( parent_id bigint not null,\n"
+ " child_id bigint not null,\n"
+ " primary key ( parent_id, child_id ) )\n"
+ "alter table childset add constraint childsetfk0 (parent_id) references parent\n"
+ "alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1213
#, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
+msgid "For more examples and a complete explanation of a parent/child relationship mapping, see <xref linkend=\"example-parentchild\"/> for more information. Even more complex association mappings are covered in the next chapter."
msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/configuration.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/configuration.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/configuration.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,1663 +1,2242 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr ""
#. Tag: para
+#: configuration.xml:33
#, no-c-format
msgid "Hibernate is designed to operate in many different environments and, as such, there is a broad range of configuration parameters. Fortunately, most have sensible default values and Hibernate is distributed with an example <literal>hibernate.properties</literal> file in <literal>etc/</literal> that displays the various options. Simply put the example file in your classpath and customize it to suit your needs."
msgstr ""
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr ""
#. Tag: para
+#: configuration.xml:43
#, no-c-format
msgid "An instance of <classname>org.hibernate.cfg.Configuration</classname> represents an entire set of mappings of an application's Java types to an SQL database. The <classname>org.hibernate.cfg.Configuration</classname> is used to build an immutable <interfacename>org.hibernate.SessionFactory</interfacename>. The mappings are compiled from various XML mapping files."
msgstr ""
#. Tag: para
+#: configuration.xml:51
#, no-c-format
msgid "You can obtain a <classname>org.hibernate.cfg.Configuration</classname> instance by instantiating it directly and specifying XML mapping documents. If the mapping files are in the classpath, use <literal>addResource()</literal>. For example:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:57
+#, no-c-format
+msgid ""
+ "Configuration cfg = new Configuration()\n"
+ " .addResource(\"Item.hbm.xml\")\n"
+ " .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:59
#, no-c-format
msgid "An alternative way is to specify the mapped class and allow Hibernate to find the mapping document for you:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:62
+#, no-c-format
+msgid ""
+ "Configuration cfg = new Configuration()\n"
+ " .addClass(org.hibernate.auction.Item.class)\n"
+ " .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:64
#, no-c-format
msgid "Hibernate will then search for mapping files named <filename>/org/hibernate/auction/Item.hbm.xml</filename> and <filename>/org/hibernate/auction/Bid.hbm.xml</filename> in the classpath. This approach eliminates any hardcoded filenames."
msgstr ""
#. Tag: para
+#: configuration.xml:69
#, no-c-format
msgid "A <classname>org.hibernate.cfg.Configuration</classname> also allows you to specify configuration properties. For example:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:72
+#, no-c-format
+msgid ""
+ "Configuration cfg = new Configuration()\n"
+ " .addClass(org.hibernate.auction.Item.class)\n"
+ " .addClass(org.hibernate.auction.Bid.class)\n"
+ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect.MySQLInnoDBDialect\")\n"
+ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/test\")\n"
+ " .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:74
#, no-c-format
msgid "This is not the only way to pass configuration properties to Hibernate. Some alternative options include:"
msgstr ""
#. Tag: para
+#: configuration.xml:79
#, no-c-format
msgid "Pass an instance of <classname>java.util.Properties</classname> to <literal>Configuration.setProperties()</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:84
#, no-c-format
msgid "Place a file named <filename>hibernate.properties</filename> in a root directory of the classpath."
msgstr ""
#. Tag: para
+#: configuration.xml:89
#, no-c-format
msgid "Set <literal>System</literal> properties using <literal>java -Dproperty=value</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:94
#, no-c-format
msgid "Include <literal><property></literal> elements in <literal>hibernate.cfg.xml</literal> (this is discussed later)."
msgstr ""
#. Tag: para
+#: configuration.xml:99
#, no-c-format
msgid "If you want to get started quickly<filename>hibernate.properties</filename> is the easiest approach."
msgstr ""
#. Tag: para
+#: configuration.xml:103
#, no-c-format
msgid "The <classname>org.hibernate.cfg.Configuration</classname> is intended as a startup-time object that will be discarded once a <literal>SessionFactory</literal> is created."
msgstr ""
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr ""
#. Tag: para
+#: configuration.xml:111
#, no-c-format
msgid "When all mappings have been parsed by the <classname>org.hibernate.cfg.Configuration</classname>, the application must obtain a factory for <interfacename>org.hibernate.Session</interfacename> instances. This factory is intended to be shared by all application threads:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:117
+#, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:119
#, no-c-format
msgid "Hibernate does allow your application to instantiate more than one <interfacename>org.hibernate.SessionFactory</interfacename>. This is useful if you are using more than one database."
msgstr ""
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr ""
#. Tag: para
+#: configuration.xml:127
#, no-c-format
msgid "It is advisable to have the <interfacename>org.hibernate.SessionFactory</interfacename> create and pool JDBC connections for you. If you take this approach, opening a <interfacename>org.hibernate.Session</interfacename> is as simple as:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:133
+#, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:135
#, no-c-format
msgid "Once you start a task that requires access to the database, a JDBC connection will be obtained from the pool."
msgstr ""
#. Tag: para
+#: configuration.xml:138
#, no-c-format
msgid "Before you can do this, you first need to pass some JDBC connection properties to Hibernate. All Hibernate property names and semantics are defined on the class <classname>org.hibernate.cfg.Environment</classname>. The most important settings for JDBC connection configuration are outlined below."
msgstr ""
#. Tag: para
+#: configuration.xml:144
#, no-c-format
msgid "Hibernate will obtain and pool connections using <classname>java.sql.DriverManager</classname> if you set the following properties:"
msgstr ""
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr ""
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327 configuration.xml:495 configuration.xml:657 configuration.xml:753 configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr ""
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329 configuration.xml:497 configuration.xml:659 configuration.xml:755 configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:166
#, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+msgid "hibernate.connection.driver_class"
msgstr ""
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:168
#, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+msgid "JDBC driver class"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:172
#, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+msgid "hibernate.connection.url"
msgstr ""
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:174
#, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
+msgid "JDBC URL"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
#, no-c-format
-msgid "<property>hibernate.connection.username</property>"
+msgid "hibernate.connection.username"
msgstr ""
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:180
#, no-c-format
-msgid "<emphasis>database user</emphasis>"
+msgid "database user"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
#, no-c-format
-msgid "<property>hibernate.connection.password</property>"
+msgid "hibernate.connection.password"
msgstr ""
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:186
#, no-c-format
-msgid "<emphasis>database user password</emphasis>"
+msgid "database user password"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:190
#, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+msgid "hibernate.connection.pool_size"
msgstr ""
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:192
#, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+msgid "maximum number of pooled connections"
msgstr ""
#. Tag: para
+#: configuration.xml:199
#, no-c-format
msgid "Hibernate's own connection pooling algorithm is, however, quite rudimentary. It is intended to help you get started and is <emphasis>not intended for use in a production system</emphasis>, or even for performance testing. You should use a third party pool for best performance and stability. Just replace the <property>hibernate.connection.pool_size</property> property with connection pool specific settings. This will turn off Hibernate's internal pool. For example, you might like to use c3p0."
msgstr ""
#. Tag: para
+#: configuration.xml:208
#, no-c-format
msgid "C3P0 is an open source JDBC connection pool distributed along with Hibernate in the <filename>lib</filename> directory. Hibernate will use its <classname>org.hibernate.connection.C3P0ConnectionProvider</classname> for connection pooling if you set <property>hibernate.c3p0.*</property> properties. If you would like to use Proxool, refer to the packaged <filename>hibernate.properties</filename> and the Hibernate web site for more information."
msgstr ""
#. Tag: para
+#: configuration.xml:216
#, no-c-format
msgid "The following is an example <filename>hibernate.properties</filename> file for c3p0:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:219
+#, no-c-format
+msgid ""
+ "hibernate.connection.driver_class = org.postgresql.Driver\n"
+ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+ "hibernate.connection.username = myuser\n"
+ "hibernate.connection.password = secret\n"
+ "hibernate.c3p0.min_size=5\n"
+ "hibernate.c3p0.max_size=20\n"
+ "hibernate.c3p0.timeout=1800\n"
+ "hibernate.c3p0.max_statements=50\n"
+ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:221
#, no-c-format
msgid "For use inside an application server, you should almost always configure Hibernate to obtain connections from an application server <interfacename>javax.sql.Datasource</interfacename> registered in JNDI. You will need to set at least one of the following properties:"
msgstr ""
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:244
#, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+msgid "hibernate.connection.datasource"
msgstr ""
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:246
#, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
+msgid "datasource JNDI name"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:250
#, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+msgid "hibernate.jndi.url"
msgstr ""
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:257
#, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+msgid "hibernate.jndi.class"
msgstr ""
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
msgid "<emphasis>class of the JNDI <literal>InitialContextFactory</literal></emphasis> (optional)"
msgstr ""
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr ""
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
msgstr ""
#. Tag: para
+#: configuration.xml:280
#, no-c-format
msgid "Here is an example <filename>hibernate.properties</filename> file for an application server provided JNDI datasource:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:283
+#, no-c-format
+msgid ""
+ "hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+ "hibernate.transaction.factory_class = \\\n"
+ " org.hibernate.transaction.JTATransactionFactory\n"
+ "hibernate.transaction.manager_lookup_class = \\\n"
+ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
+ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
msgid "JDBC connections obtained from a JNDI datasource will automatically participate in the container-managed transactions of the application server."
msgstr ""
#. Tag: para
+#: configuration.xml:289
#, no-c-format
msgid "Arbitrary connection properties can be given by prepending \"<literal>hibernate.connection</literal>\" to the connection property name. For example, you can specify a <property>charSet</property> connection property using <property>hibernate.connection.charSet</property>."
msgstr ""
#. Tag: para
+#: configuration.xml:294
#, no-c-format
msgid "You can define your own plugin strategy for obtaining JDBC connections by implementing the interface <interfacename>org.hibernate.connection.ConnectionProvider</interfacename>, and specifying your custom implementation via the <property>hibernate.connection.provider_class</property> property."
msgstr ""
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr ""
#. Tag: para
+#: configuration.xml:304
#, no-c-format
msgid "There are a number of other properties that control the behavior of Hibernate at runtime. All are optional and have reasonable default values."
msgstr ""
#. Tag: para
+#: configuration.xml:309
#, no-c-format
msgid "<emphasis>Some of these properties are \"system-level\" only.</emphasis> System-level properties can be set only via <literal>java -Dproperty=value</literal> or <filename>hibernate.properties</filename>. They <emphasis>cannot</emphasis> be set by the other techniques described above."
msgstr ""
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:335
#, no-c-format
-msgid "<property>hibernate.dialect</property>"
+msgid "hibernate.dialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:337
#, no-c-format
msgid "The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</classname> which allows Hibernate to generate SQL optimized for a particular relational database."
msgstr ""
#. Tag: para
+#: configuration.xml:340
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of.Dialect</literal>"
msgstr ""
#. Tag: para
+#: configuration.xml:341
#, no-c-format
msgid "In most cases Hibernate will actually be able to choose the correct <classname>org.hibernate.dialect.Dialect</classname> implementation based on the <literal>JDBC metadata</literal> returned by the JDBC driver."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:349
#, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+msgid "hibernate.show_sql"
msgstr ""
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
msgid "Write all SQL statements to console. This is an alternative to setting the log category <literal>org.hibernate.SQL</literal> to <literal>debug</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426 configuration.xml:435 configuration.xml:443 configuration.xml:453 configuration.xml:468 configuration.xml:525 configuration.xml:545 configuration.xml:555 configuration.xml:598 configuration.xml:797 configuration.xml:808 configuration.xml:904
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | <literal>false</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:359
#, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+msgid "hibernate.format_sql"
msgstr ""
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:367
#, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+msgid "hibernate.default_schema"
msgstr ""
#. Tag: entry
+#: configuration.xml:369
#, no-c-format
msgid "Qualify unqualified table names with the given schema/tablespace in generated SQL."
msgstr ""
#. Tag: para
+#: configuration.xml:370
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:376
#, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+msgid "hibernate.default_catalog"
msgstr ""
#. Tag: entry
+#: configuration.xml:378
#, no-c-format
msgid "Qualifies unqualified table names with the given catalog in generated SQL."
msgstr ""
#. Tag: para
+#: configuration.xml:379
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:384
#, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+msgid "hibernate.session_factory_name"
msgstr ""
#. Tag: entry
+#: configuration.xml:386
#, no-c-format
msgid "The <interfacename>org.hibernate.SessionFactory</interfacename> will be automatically bound to this name in JNDI after it has been created."
msgstr ""
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:394
#, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+msgid "hibernate.max_fetch_depth"
msgstr ""
#. Tag: entry
+#: configuration.xml:396
#, no-c-format
msgid "Sets a maximum \"depth\" for the outer join fetch tree for single-ended associations (one-to-one, many-to-one). A <literal>0</literal> disables default outer join fetching."
msgstr ""
#. Tag: para
+#: configuration.xml:398
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> recommended values between <literal>0</literal> and <literal>3</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:404
#, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+msgid "hibernate.default_batch_fetch_size"
msgstr ""
#. Tag: entry
+#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr ""
#. Tag: para
+#: configuration.xml:407
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</literal>, <literal>8</literal>, <literal>16</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:413
#, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+msgid "hibernate.default_entity_mode"
msgstr ""
#. Tag: entry
+#: configuration.xml:415
#, no-c-format
msgid "Sets a default mode for entity representation for all sessions opened from this <literal>SessionFactory</literal>"
msgstr ""
#. Tag: para
+#: configuration.xml:416
#, no-c-format
msgid "<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:422
#, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+msgid "hibernate.order_updates"
msgstr ""
#. Tag: entry
+#: configuration.xml:424
#, no-c-format
msgid "Forces Hibernate to order SQL updates by the primary key value of the items being updated. This will result in fewer transaction deadlocks in highly concurrent systems."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:432
#, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
+msgid "hibernate.generate_statistics"
msgstr ""
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
msgid "If enabled, Hibernate will collect statistics useful for performance tuning."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:440
#, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+msgid "hibernate.use_identifier_rollback"
msgstr ""
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
msgid "If enabled, generated identifier properties will be reset to default values when objects are deleted."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:449
#, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
+msgid "hibernate.use_sql_comments"
msgstr ""
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
msgid "If turned on, Hibernate will generate comments inside the SQL, for easier debugging, defaults to <literal>false</literal>."
msgstr ""
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:460
+#, no-c-format
+msgid "Setting is relevant when using <classname>@GeneratedValue</classname>. It indicates whether or not the new <classname>IdentifierGenerator</classname> implementations are used for <classname>javax.persistence.GenerationType.AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</classname> and <classname>javax.persistence.GenerationType.SEQUENCE</classname>. Default to <literal>false</literal> to keep backward compatibility."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid "We recommend all new projects which make use of to use <classname>@GeneratedValue</classname> to also set <code>hibernate.id.new_generator_mappings=true</code> as the new generators are more efficient and closer to the JPA 2 specification semantic. However they are not backward compatible with existing databases (if a sequence or a table is used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:503
#, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+msgid "hibernate.jdbc.fetch_size"
msgstr ""
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
msgid "A non-zero value determines the JDBC fetch size (calls <literal>Statement.setFetchSize()</literal>)."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:510
#, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+msgid "hibernate.jdbc.batch_size"
msgstr ""
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr ""
#. Tag: para
+#: configuration.xml:513
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> recommended values between <literal>5</literal> and <literal>30</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:519
#, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr ""
#. Tag: entry
+#: configuration.xml:521
#, no-c-format
-msgid "Set this property to <literal>true</literal> if your JDBC driver returns correct row counts from <literal>executeBatch()</literal>. Iit is usually safe to turn this option on. Hibernate will then use batched DML for automatically versioned data. Defaults to <literal>false</literal>."
+msgid "Set this property to <literal>true</literal> if your JDBC driver returns correct row counts from <literal>executeBatch()</literal>. It is usually safe to turn this option on. Hibernate will then use batched DML for automatically versioned data. Defaults to <literal>false</literal>."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:531
#, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+msgid "hibernate.jdbc.factory_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:533
#, no-c-format
msgid "Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. Most applications will not need this configuration property."
msgstr ""
#. Tag: para
+#: configuration.xml:535
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.BatcherFactory</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:541
#, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr ""
#. Tag: entry
+#: configuration.xml:543
#, no-c-format
msgid "Enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user-supplied JDBC connections. Hibernate uses connection metadata otherwise."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:551
#, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr ""
#. Tag: entry
+#: configuration.xml:553
#, no-c-format
msgid "Use streams when writing/reading <literal>binary</literal> or <literal>serializable</literal> types to/from JDBC. <emphasis>*system-level property*</emphasis>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:561
#, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr ""
#. Tag: entry
+#: configuration.xml:563
#, no-c-format
msgid "Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> to retrieve natively generated keys after insert. Requires JDBC3+ driver and JRE1.4+, set to false if your driver has problems with the Hibernate identifier generators. By default, it tries to determine the driver capabilities using connection metadata."
msgstr ""
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687 configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:574
#, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+msgid "hibernate.connection.provider_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:576
#, no-c-format
msgid "The classname of a custom <interfacename>org.hibernate.connection.ConnectionProvider</interfacename> which provides JDBC connections to Hibernate."
msgstr ""
#. Tag: para
+#: configuration.xml:578
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.ConnectionProvider</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:584
#, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+msgid "hibernate.connection.isolation"
msgstr ""
#. Tag: entry
+#: configuration.xml:586
#, no-c-format
msgid "Sets the JDBC transaction isolation level. Check <interfacename>java.sql.Connection</interfacename> for meaningful values, but note that most databases do not support all isolation levels and some define additional, non-standard isolations."
msgstr ""
#. Tag: para
+#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:595
#, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+msgid "hibernate.connection.autocommit"
msgstr ""
#. Tag: entry
+#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr ""
-#. Tag: entry
+#. Tag: property
+#: configuration.xml:603
#, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+msgid "hibernate.connection.release_mode"
msgstr ""
#. Tag: entry
+#: configuration.xml:605
#, no-c-format
msgid "Specifies when Hibernate should release JDBC connections. By default, a JDBC connection is held until the session is explicitly closed or disconnected. For an application server JTA datasource, use <literal>after_statement</literal> to aggressively release connections after every JDBC call. For a non-JTA connection, it often makes sense to release the connection at the end of each transaction, by using <literal>after_transaction</literal>. <literal>auto</literal> will choose <literal>after_statement</literal> for the JTA and CMT transaction strategies and <literal>after_transaction</literal> for the JDBC transaction strategy."
msgstr ""
#. Tag: para
+#: configuration.xml:615
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) | <literal>on_close</literal> | <literal>after_transaction</literal> | <literal>after_statement</literal>"
msgstr ""
#. Tag: para
+#: configuration.xml:618
#, no-c-format
-msgid "This setting only affects <literal>Session</literal>s returned from <literal>SessionFactory.openSession</literal>. For <literal>Session</literal>s obtained through <literal>SessionFactory.getCurrentSession</literal>, the <literal>CurrentSessionContext</literal> implementation configured for use controls the connection release mode for those <literal>Session</literal>s. See <xref linkend=\"architecture-current-session\" />"
+msgid "This setting only affects <literal>Session</literal>s returned from <literal>SessionFactory.openSession</literal>. For <literal>Session</literal>s obtained through <literal>SessionFactory.getCurrentSession</literal>, the <literal>CurrentSessionContext</literal> implementation configured for use controls the connection release mode for those <literal>Session</literal>s. See"
msgstr ""
#. Tag: entry
+#: configuration.xml:630
#, no-c-format
msgid "<property>hibernate.connection.</property><emphasis><propertyName></emphasis>"
msgstr ""
#. Tag: entry
+#: configuration.xml:632
#, no-c-format
msgid "Pass the JDBC property <emphasis><propertyName></emphasis> to <literal>DriverManager.getConnection()</literal>."
msgstr ""
#. Tag: entry
+#: configuration.xml:638
#, no-c-format
msgid "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
msgstr ""
#. Tag: entry
+#: configuration.xml:640
#, no-c-format
msgid "Pass the property <emphasis><propertyName></emphasis> to the JNDI <literal>InitialContextFactory</literal>."
msgstr ""
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:665
#, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+msgid "hibernate.cache.provider_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:668
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.CacheProvider</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:673
#, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+msgid "hibernate.cache.use_minimal_puts"
msgstr ""
#. Tag: entry
+#: configuration.xml:675
#, no-c-format
msgid "Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This setting is most useful for clustered caches and, in Hibernate3, is enabled by default for clustered cache implementations."
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:684
#, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+msgid "hibernate.cache.use_query_cache"
msgstr ""
#. Tag: entry
+#: configuration.xml:686
#, no-c-format
msgid "Enables the query cache. Individual queries still have to be set cachable."
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:692
#, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+msgid "hibernate.cache.use_second_level_cache"
msgstr ""
#. Tag: entry
+#: configuration.xml:694
#, no-c-format
msgid "Can be used to completely disable the second level cache, which is enabled by default for classes which specify a <literal><cache></literal> mapping."
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:702
#, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+msgid "hibernate.cache.query_cache_factory"
msgstr ""
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
msgid "The classname of a custom <literal>QueryCache</literal> interface, defaults to the built-in <literal>StandardQueryCache</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:706
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:712
#, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+msgid "hibernate.cache.region_prefix"
msgstr ""
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr ""
#. Tag: para
+#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:720
#, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+msgid "hibernate.cache.use_structured_entries"
msgstr ""
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
msgid "Forces Hibernate to store data in the second-level cache in a more human-friendly format."
msgstr ""
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid "Setting used to give the name of the default <classname>org.hibernate.annotations.CacheConcurrencyStrategy</classname> to use when either <classname>@Cacheable</classname> or <classname>@Cache</classname> is used. <code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:761
#, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+msgid "hibernate.transaction.factory_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
msgid "The classname of a <literal>TransactionFactory</literal> to use with Hibernate <literal>Transaction</literal> API (defaults to <literal>JDBCTransactionFactory</literal>)."
msgstr ""
#. Tag: para
+#: configuration.xml:765
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.TransactionFactory</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:771
#, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+msgid "jta.UserTransaction"
msgstr ""
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
msgid "A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the JTA <literal>UserTransaction</literal> from the application server."
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:781
#, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+msgid "hibernate.transaction.manager_lookup_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:783
#, no-c-format
msgid "The classname of a <literal>TransactionManagerLookup</literal>. It is required when JVM-level caching is enabled or when using hilo generator in a JTA environment."
msgstr ""
#. Tag: para
+#: configuration.xml:786
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.TransactionManagerLookup</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:792
#, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+msgid "hibernate.transaction.flush_before_completion"
msgstr ""
#. Tag: entry
+#: configuration.xml:794
#, no-c-format
-msgid "If enabled, the session will be automatically flushed during the before completion phase of the transaction. Built-in and automatic session context management is preferred, see <xref linkend=\"architecture-current-session\" />."
+msgid "If enabled, the session will be automatically flushed during the before completion phase of the transaction. Built-in and automatic session context management is preferred, see <xref linkend=\"architecture-current-session\"/>."
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:803
#, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+msgid "hibernate.transaction.auto_close_session"
msgstr ""
#. Tag: entry
+#: configuration.xml:805
#, no-c-format
-msgid "If enabled, the session will be automatically closed during the after completion phase of the transaction. Built-in and automatic session context management is preferred, see <xref linkend=\"architecture-current-session\" />."
+msgid "If enabled, the session will be automatically closed during the after completion phase of the transaction. Built-in and automatic session context management is preferred, see <xref linkend=\"architecture-current-session\"/>."
msgstr ""
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:834
#, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+msgid "hibernate.current_session_context_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:836
#, no-c-format
-msgid "Supply a custom strategy for the scoping of the \"current\" <literal>Session</literal>. See <xref linkend=\"architecture-current-session\" /> for more information about the built-in strategies."
+msgid "Supply a custom strategy for the scoping of the \"current\" <literal>Session</literal>. See <xref linkend=\"architecture-current-session\"/> for more information about the built-in strategies."
msgstr ""
#. Tag: para
+#: configuration.xml:839
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | <literal>thread</literal> | <literal>managed</literal> | <literal>custom.Class</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:846
#, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+msgid "hibernate.query.factory_class"
msgstr ""
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr ""
#. Tag: para
+#: configuration.xml:848
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast.ASTQueryTranslatorFactory</literal> or <literal>org.hibernate.hql.classic.ClassicQueryTranslatorFactory</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:857
#, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
+msgid "hibernate.query.substitutions"
msgstr ""
#. Tag: entry
+#: configuration.xml:859
#, no-c-format
msgid "Is used to map from tokens in Hibernate queries to SQL tokens (tokens might be function or literal names, for example)."
msgstr ""
#. Tag: para
+#: configuration.xml:861
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:867
#, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+msgid "hibernate.hbm2ddl.auto"
msgstr ""
#. Tag: entry
+#: configuration.xml:869
#, no-c-format
msgid "Automatically validates or exports schema DDL to the database when the <literal>SessionFactory</literal> is created. With <literal>create-drop</literal>, the database schema will be dropped when the <literal>SessionFactory</literal> is closed explicitly."
msgstr ""
#. Tag: para
+#: configuration.xml:873
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | <literal>update</literal> | <literal>create</literal> | <literal>create-drop</literal>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:880
#, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+msgid "hibernate.hbm2ddl.import_file"
msgstr ""
+#. Tag: para
+#: configuration.xml:882
+#, no-c-format
+msgid "Comma-separated names of the optional files containing SQL DML statements executed during the <classname>SessionFactory</classname> creation. This is useful for testing or demoing: by adding INSERT statements for example you can populate your database with a minimal set of data when it is deployed."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:887
+#, no-c-format
+msgid "File order matters, the statements of a give file are executed before the statements of the following files. These statements are only executed if the schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to <literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:892
+#, no-c-format
+msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</literal>"
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:898
+#, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
+msgstr ""
+
#. Tag: entry
+#: configuration.xml:900
#, no-c-format
msgid "Enables the use of CGLIB instead of runtime reflection (System-level property). Reflection can sometimes be useful when troubleshooting. Hibernate always requires CGLIB even if you turn off the optimizer. You cannot set this property in <literal>hibernate.cfg.xml</literal>."
msgstr ""
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr ""
#. Tag: para
+#: configuration.xml:915
#, no-c-format
msgid "Always set the <literal>hibernate.dialect</literal> property to the correct <literal>org.hibernate.dialect.Dialect</literal> subclass for your database. If you specify a dialect, Hibernate will use sensible defaults for some of the other properties listed above. This means that you will not have to specify them manually."
msgstr ""
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr ""
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr ""
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
+msgid "<entry>DB2</entry>"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:943
#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:949
#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:955
#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:961
#, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:967
#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:973
#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:979
#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:985
#, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+msgid "org.hibernate.dialect.OracleDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:991
#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:997
#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1003
#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1009
#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1015
#, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1021
#, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1027
#, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+msgid "org.hibernate.dialect.InformixDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1033
#, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1039
#, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+msgid "org.hibernate.dialect.IngresDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1045
#, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1051
#, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1057
#, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1063
#, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1069
#, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr ""
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1075
#, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr ""
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr ""
#. Tag: para
+#: configuration.xml:1085
#, no-c-format
msgid "If your database supports ANSI, Oracle or Sybase style outer joins, <emphasis>outer join fetching</emphasis> will often increase performance by limiting the number of round trips to and from the database. This is, however, at the cost of possibly more work performed by the database itself. Outer join fetching allows a whole graph of objects connected by many-to-one, one-to-many, many-to-many and one-to-one associations to be retrieved in a single SQL <literal>SELECT</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:1094
#, no-c-format
msgid "Outer join fetching can be disabled <emphasis>globally</emphasis> by setting the property <literal>hibernate.max_fetch_depth</literal> to <literal>0</literal>. A setting of <literal>1</literal> or higher enables outer join fetching for one-to-one and many-to-one associations that have been mapped with <literal>fetch=\"join\"</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:1100
#, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr ""
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr ""
#. Tag: para
+#: configuration.xml:1107
#, no-c-format
msgid "Oracle limits the size of <literal>byte</literal> arrays that can be passed to and/or from its JDBC driver. If you wish to use large instances of <literal>binary</literal> or <literal>serializable</literal> type, you should enable <literal>hibernate.jdbc.use_streams_for_binary</literal>. <emphasis>This is a system-level setting only.</emphasis>"
msgstr ""
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr ""
#. Tag: para
+#: configuration.xml:1118
#, no-c-format
-msgid "The properties prefixed by <literal>hibernate.cache</literal> allow you to use a process or cluster scoped second-level cache system with Hibernate. See the <xref linkend=\"performance-cache\" /> for more information."
+msgid "The properties prefixed by <literal>hibernate.cache</literal> allow you to use a process or cluster scoped second-level cache system with Hibernate. See the <xref linkend=\"performance-cache\"/> for more information."
msgstr ""
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr ""
#. Tag: para
+#: configuration.xml:1127
#, no-c-format
msgid "You can define new Hibernate query tokens using <literal>hibernate.query.substitutions</literal>. For example:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1130
+#, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1132
#, no-c-format
msgid "This would cause the tokens <literal>true</literal> and <literal>false</literal> to be translated to integer literals in the generated SQL."
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1136
+#, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1138
#, no-c-format
msgid "This would allow you to rename the SQL <literal>LOWER</literal> function."
msgstr ""
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr ""
#. Tag: para
+#: configuration.xml:1145
#, no-c-format
msgid "If you enable <literal>hibernate.generate_statistics</literal>, Hibernate exposes a number of metrics that are useful when tuning a running system via <literal>SessionFactory.getStatistics()</literal>. Hibernate can even be configured to expose these statistics via JMX. Read the Javadoc of the interfaces in <literal>org.hibernate.stats</literal> for more information."
msgstr ""
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr ""
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
msgid "Hibernate 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 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 url=\"http://www.slf4j.org/manual.html\">documentation</ulink> for more detail. To use Log4j you will also need to place a <filename>log4j.properties</filename> file in your classpath. An example properties file is distributed with Hibernate in the <literal>src/</literal> directory."
msgstr ""
#. Tag: para
+#: configuration.xml:1171
#, no-c-format
msgid "It is recommended that you familiarize yourself with Hibernate's log messages. A lot of work has been put into making the Hibernate log as detailed as possible, without making it unreadable. It is an essential troubleshooting device. The most interesting log categories are the following:"
msgstr ""
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr ""
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr ""
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1195
#, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
+msgid "org.hibernate.SQL"
msgstr ""
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1201
#, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
+msgid "org.hibernate.type"
msgstr ""
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1207
#, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+msgid "org.hibernate.tool.hbm2ddl"
msgstr ""
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1213
#, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
+msgid "org.hibernate.pretty"
msgstr ""
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
msgid "Log the state of all entities (max 20 entities) associated with the session at flush time"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1220
#, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
+msgid "org.hibernate.cache"
msgstr ""
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1226
#, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+msgid "org.hibernate.transaction"
msgstr ""
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1232
#, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
+msgid "org.hibernate.jdbc"
msgstr ""
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1238
#, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+msgid "org.hibernate.hql.ast.AST"
msgstr ""
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1244
#, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
+msgid "org.hibernate.secure"
msgstr ""
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1250
#, no-c-format
-msgid "<literal>org.hibernate</literal>"
+msgid "org.hibernate"
msgstr ""
#. Tag: entry
+#: configuration.xml:1252
#, no-c-format
msgid "Log everything. This is a lot of information but it is useful for troubleshooting"
msgstr ""
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
msgid "When developing applications with Hibernate, you should almost always work with <literal>debug</literal> enabled for the category <literal>org.hibernate.SQL</literal>, or, alternatively, the property <literal>hibernate.show_sql</literal> enabled."
msgstr ""
#. Tag: title
+#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr ""
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
msgid "The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you to specify a \"naming standard\" for database objects and schema elements."
msgstr ""
#. Tag: para
+#: configuration.xml:1272
#, no-c-format
msgid "You can provide rules for automatically generating database identifiers from Java identifiers or for processing \"logical\" column and table names given in the mapping file into \"physical\" table and column names. This feature helps reduce the verbosity of the mapping document, eliminating repetitive noise (<literal>TBL_</literal> prefixes, for example). The default strategy used by Hibernate is quite minimal."
msgstr ""
#. Tag: para
+#: configuration.xml:1279
#, no-c-format
msgid "You can specify a different strategy by calling <literal>Configuration.setNamingStrategy()</literal> before adding mappings:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1283
+#, no-c-format
+msgid ""
+ "SessionFactory sf = new Configuration()\n"
+ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+ " .addFile(\"Item.hbm.xml\")\n"
+ " .addFile(\"Bid.hbm.xml\")\n"
+ " .buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
msgid "<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in strategy that might be a useful starting point for some applications."
msgstr ""
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr ""
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
msgid "An alternative approach to configuration is to specify a full configuration in a file named <literal>hibernate.cfg.xml</literal>. This file can be used as a replacement for the <literal>hibernate.properties</literal> file or, if both are present, to override properties."
msgstr ""
#. Tag: para
+#: configuration.xml:1299
#, no-c-format
msgid "The XML configuration file is by default expected to be in the root of your <literal>CLASSPATH</literal>. Here is an example:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1302
+#, no-c-format
+msgid ""
+ "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<!DOCTYPE hibernate-configuration PUBLIC\n"
+ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n"
+ "\n"
+ "<hibernate-configuration>\n"
+ "\n"
+ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
+ " <session-factory\n"
+ " name=\"java:hibernate/SessionFactory\">\n"
+ "\n"
+ " <!-- properties -->\n"
+ " <property name=\"connection.datasource\">java:/comp/env/jdbc/MyDB</property>\n"
+ " <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</property>\n"
+ " <property name=\"show_sql\">false</property>\n"
+ " <property name=\"transaction.factory_class\">\n"
+ " org.hibernate.transaction.JTATransactionFactory\n"
+ " </property>\n"
+ " <property name=\"jta.UserTransaction\">java:comp/UserTransaction</property>\n"
+ "\n"
+ " <!-- mapping files -->\n"
+ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+ "\n"
+ " <!-- cache settings -->\n"
+ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-write\"/>\n"
+ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only\"/>\n"
+ " <collection-cache collection=\"org.hibernate.auction.Item.bids\" usage=\"read-write\"/>\n"
+ "\n"
+ " </session-factory>\n"
+ "\n"
+ "</hibernate-configuration>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1304
#, no-c-format
msgid "The advantage of this approach is the externalization of the mapping file names to configuration. The <literal>hibernate.cfg.xml</literal> is also more convenient once you have to tune the Hibernate cache. It is your choice to use either <literal>hibernate.properties</literal> or <literal>hibernate.cfg.xml</literal>. Both are equivalent, except for the above mentioned benefits of using the XML syntax."
msgstr ""
#. Tag: para
+#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1314
+#, no-c-format
+msgid "SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1318
+#, no-c-format
+msgid ""
+ "SessionFactory sf = new Configuration()\n"
+ " .configure(\"catdb.cfg.xml\")\n"
+ " .buildSessionFactory();"
+msgstr ""
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr ""
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr ""
#. Tag: para
+#: configuration.xml:1329
#, no-c-format
msgid "<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC connections managed by the container and provided through JNDI. Usually, a JTA compatible <literal>TransactionManager</literal> and a <literal>ResourceManager</literal> take care of transaction management (CMT), especially distributed transaction handling across several datasources. You can also demarcate transaction boundaries programmatically (BMT), or you might want to use the optional Hibernate <literal>Transaction</literal> API for this to keep your code portable."
msgstr ""
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
msgid "<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its <literal>SessionFactory</literal> to JNDI after startup."
msgstr ""
#. Tag: para
+#: configuration.xml:1350
#, no-c-format
msgid "<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</literal> can be automatically bound to the scope of JTA transactions. Simply lookup the <literal>SessionFactory</literal> from JNDI and get the current <literal>Session</literal>. Let Hibernate manage flushing and closing the <literal>Session</literal> when your JTA transaction completes. Transaction demarcation is either declarative (CMT) or programmatic (BMT/UserTransaction)."
msgstr ""
#. Tag: para
+#: configuration.xml:1362
#, no-c-format
msgid "<emphasis>JMX deployment:</emphasis> if you have a JMX capable application server (e.g. JBoss AS), you can choose to deploy Hibernate as a managed MBean. This saves you the one line startup code to build your <literal>SessionFactory</literal> from a <literal>Configuration</literal>. The container will startup your <literal>HibernateService</literal> and also take care of service dependencies (datasource has to be available before Hibernate starts, etc)."
msgstr ""
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
msgid "Depending on your environment, you might have to set the configuration option <literal>hibernate.connection.aggressive_release</literal> to true if your application server shows \"connection containment\" exceptions."
msgstr ""
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr ""
#. Tag: para
+#: configuration.xml:1381
#, no-c-format
msgid "The Hibernate <literal>Session</literal> API is independent of any transaction demarcation system in your architecture. If you let Hibernate use JDBC directly through a connection pool, you can begin and end your transactions by calling the JDBC API. If you run in a J2EE application server, you might want to use bean-managed transactions and call the JTA API and <literal>UserTransaction</literal> when needed."
msgstr ""
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
msgid "To keep your code portable between these two (and other) environments we recommend the optional Hibernate <literal>Transaction</literal> API, which wraps and hides the underlying system. You have to specify a factory class for <literal>Transaction</literal> instances by setting the Hibernate configuration property <literal>hibernate.transaction.factory_class</literal>."
msgstr ""
#. Tag: para
+#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: configuration.xml:1401
#, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr ""
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: configuration.xml:1409
#, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr ""
#. Tag: para
+#: configuration.xml:1412
#, no-c-format
msgid "delegates to container-managed transactions if an existing transaction is underway in this context (for example, EJB session bean method). Otherwise, a new transaction is started and bean-managed transactions are used."
msgstr ""
-#. Tag: term
+#. Tag: literal
+#: configuration.xml:1420
#, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr ""
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr ""
#. Tag: para
+#: configuration.xml:1428
#, no-c-format
msgid "You can also define your own transaction strategies (for a CORBA transaction service, for example)."
msgstr ""
#. Tag: para
+#: configuration.xml:1431
#, no-c-format
msgid "Some features in Hibernate (i.e., the second level cache, Contextual Sessions with JTA, etc.) require access to the JTA <literal>TransactionManager</literal> in a managed environment. In an application server, since J2EE does not standardize a single mechanism, you have to specify how Hibernate should obtain a reference to the <literal>TransactionManager</literal>:"
msgstr ""
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr ""
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr ""
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1456
#, no-c-format
-msgid "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1462
#, no-c-format
-msgid "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1468
#, no-c-format
-msgid "<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1474
#, no-c-format
-msgid "<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</literal>"
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1480
#, no-c-format
-msgid "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1486
#, no-c-format
-msgid "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1492
#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1498
#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1504
#, no-c-format
-msgid "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1510
#, no-c-format
-msgid "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
msgstr ""
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr ""
#. Tag: title
+#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr ""
#. Tag: para
+#: configuration.xml:1522
#, no-c-format
msgid "A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the lookup function of the factory and create new <literal>Session</literal>s. This is not, however, related to a JNDI bound <literal>Datasource</literal>; both simply use the same registry."
msgstr ""
#. Tag: para
+#: configuration.xml:1528
#, no-c-format
msgid "If you wish to have the <literal>SessionFactory</literal> bound to a JNDI namespace, specify a name (e.g. <literal>java:hibernate/SessionFactory</literal>) using the property <literal>hibernate.session_factory_name</literal>. If this property is omitted, the <literal>SessionFactory</literal> will not be bound to JNDI. This is especially useful in environments with a read-only JNDI default implementation (in Tomcat, for example)."
msgstr ""
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
msgid "When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will use the values of <literal>hibernate.jndi.url</literal>, <literal>hibernate.jndi.class</literal> to instantiate an initial context. If they are not specified, the default <literal>InitialContext</literal> will be used."
msgstr ""
#. Tag: para
+#: configuration.xml:1542
#, no-c-format
msgid "Hibernate will automatically place the <literal>SessionFactory</literal> in JNDI after you call <literal>cfg.buildSessionFactory()</literal>. This means you will have this call in some startup code, or utility class in your application, unless you use JMX deployment with the <literal>HibernateService</literal> (this is discussed later in greater detail)."
msgstr ""
#. Tag: para
+#: configuration.xml:1550
#, no-c-format
msgid "If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other class, you can obtain the <literal>SessionFactory</literal> using a JNDI lookup."
msgstr ""
#. Tag: para
+#: configuration.xml:1554
#, no-c-format
-msgid "It is recommended that you bind the <literal>SessionFactory</literal> to JNDI in a managed environment and use a <literal>static</literal> singleton otherwise. To shield your application code from these details, we also recommend to hide the actual lookup code for a <literal>SessionFactory</literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory()</literal>. Note that such a class is also a convenient way to startup Hibernate—see chapter 1."
+msgid "It is recommended that you bind the <literal>SessionFactory</literal> to JNDI in a managed environment and use a <literal>static</literal> singleton otherwise. To shield your application code from these details, we also recommend to hide the actual lookup code for a <literal>SessionFactory</literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory()</literal>. Note that such a class is also a convenient way to startup Hibernate—see chapter 1."
msgstr ""
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr ""
#. Tag: para
+#: configuration.xml:1567
#, no-c-format
-msgid "The easiest way to handle <literal>Sessions</literal> and transactions is Hibernate's automatic \"current\" <literal>Session</literal> management. For a discussion of contextual sessions see <xref linkend=\"architecture-current-session\" />. Using the <literal>\"jta\"</literal> session context, if there is no Hibernate <literal>Session</literal> associated with the current JTA transaction, one will be started and associated with that JTA transaction the first time you call <literal>sessionFactory.getCurrentSession()</literal>. The <literal>Session</literal>s retrieved via <literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> context are set to automatically flush before the transaction completes, close after the transaction completes, and aggressively release JDBC connections after each statement. This allows the <literal>Session</literal>s to be managed by the life cycle of the JTA transaction to which it is associated, keeping user code clean of s!
uch management concerns. Your code can either use JTA programmatically through <literal>UserTransaction</literal>, or (recommended for portable code) use the Hibernate <literal>Transaction</literal> API to set transaction boundaries. If you run in an EJB container, declarative transaction demarcation with CMT is preferred."
+msgid "The easiest way to handle <literal>Sessions</literal> and transactions is Hibernate's automatic \"current\" <literal>Session</literal> management. For a discussion of contextual sessions see <xref linkend=\"architecture-current-session\"/>. Using the <literal>\"jta\"</literal> session context, if there is no Hibernate <literal>Session</literal> associated with the current JTA transaction, one will be started and associated with that JTA transaction the first time you call <literal>sessionFactory.getCurrentSession()</literal>. The <literal>Session</literal>s retrieved via <literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> context are set to automatically flush before the transaction completes, close after the transaction completes, and aggressively release JDBC connections after each statement. This allows the <literal>Session</literal>s to be managed by the life cycle of the JTA transaction to which it is associated, keeping user code clean of s!
uch management concerns. Your code can either use JTA programmatically through <literal>UserTransaction</literal>, or (recommended for portable code) use the Hibernate <literal>Transaction</literal> API to set transaction boundaries. If you run in an EJB container, declarative transaction demarcation with CMT is preferred."
msgstr ""
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr ""
#. Tag: para
+#: configuration.xml:1592
#, no-c-format
msgid "The line <literal>cfg.buildSessionFactory()</literal> still has to be executed somewhere to get a <literal>SessionFactory</literal> into JNDI. You can do this either in a <literal>static</literal> initializer block, like the one in <literal>HibernateUtil</literal>, or you can deploy Hibernate as a <emphasis>managed service</emphasis>."
msgstr ""
#. Tag: para
+#: configuration.xml:1598
#, no-c-format
msgid "Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</literal> for deployment on an application server with JMX capabilities, such as JBoss AS. The actual deployment and configuration is vendor-specific. Here is an example <literal>jboss-service.xml</literal> for JBoss 4.0.x:"
msgstr ""
+#. Tag: programlisting
+#: configuration.xml:1604
+#, no-c-format
+msgid ""
+ "<?xml version=\"1.0\"?>\n"
+ "<server>\n"
+ "\n"
+ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+ "\n"
+ " <!-- Required services -->\n"
+ " <depends>jboss.jca:service=RARDeployer</depends>\n"
+ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+ "\n"
+ " <!-- Bind the Hibernate service to JNDI -->\n"
+ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</attribute>\n"
+ "\n"
+ " <!-- Datasource settings -->\n"
+ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+ " <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</attribute>\n"
+ "\n"
+ " <!-- Transaction integration -->\n"
+ " <attribute name=\"TransactionStrategy\">\n"
+ " org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
+ " org.hibernate.transaction.JBossTransactionManagerLookup</attribute>\n"
+ " <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
+ " <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
+ "\n"
+ " <!-- Fetching options -->\n"
+ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+ "\n"
+ " <!-- Second-level caching -->\n"
+ " <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
+ " <attribute name=\"CacheProviderClass\">org.hibernate.cache.EhCacheProvider</attribute>\n"
+ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+ "\n"
+ " <!-- Logging -->\n"
+ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+ "\n"
+ " <!-- Mapping files -->\n"
+ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/Category.hbm.xml</attribute>\n"
+ "\n"
+ "</mbean>\n"
+ "\n"
+ "</server>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1606
#, no-c-format
msgid "This file is deployed in a directory called <literal>META-INF</literal> and packaged in a JAR file with the extension <literal>.sar</literal> (service archive). You also need to package Hibernate, its required third-party libraries, your compiled persistent classes, as well as your mapping files in the same archive. Your enterprise beans (usually session beans) can be kept in their own JAR file, but you can include this EJB JAR file in the main service archive to get a single (hot-)deployable unit. Consult the JBoss AS documentation for more information about JMX service and EJB deployment."
msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/filters.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/filters.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/filters.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,93 +1,248 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr ""
#. Tag: para
+#: filters.xml:33
#, no-c-format
msgid "Hibernate3 provides an innovative new approach to handling data with \"visibility\" rules. A <emphasis>Hibernate filter</emphasis> is a global, named, parameterized filter that can be enabled or disabled for a particular Hibernate session."
msgstr ""
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr ""
#. Tag: para
+#: filters.xml:41
#, no-c-format
msgid "Hibernate3 has the ability to pre-define filter criteria and attach those filters at both a class level and a collection level. A filter criteria allows you to define a restriction clause similar to the existing \"where\" attribute available on the class and various collection elements. These filter conditions, however, can be parameterized. The application can then decide at runtime whether certain filters should be enabled and what their parameter values should be. Filters can be used like database views, but they are parameterized inside the application."
msgstr ""
#. Tag: para
+#: filters.xml:50
#, no-c-format
-msgid "In order to use filters, they must first be defined and then attached to the appropriate mapping elements. To define a filter, use the <literal><filter-def/></literal> element within a <literal><hibernate-mapping/></literal> element:"
+msgid "Using annotatons filters are defined via <literal>@org.hibernate.annotations.FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</literal>. A filter definition has a <methodname>name()</methodname> 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 <methodname>defaultCondition()</methodname> parameter for a given <literal>@FilterDef</literal> to set the default condition to use when none are defined in each individual <literal>@Filter</literal>. <literal>@FilterDef</literal>(s) can be defined at the class or package level."
msgstr ""
#. Tag: para
+#: filters.xml:63
#, no-c-format
-msgid "This filter can then be attached to a class:"
+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. The connection between <classname>@FilterName</classname> and <classname>@Filter</classname> is a matching name."
msgstr ""
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
#, no-c-format
-msgid "Or, to a collection:"
+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 want to target the association table, use the <literal>@FilterJoinTable</literal> annotation."
msgstr ""
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid "Using <classname>@FilterJoinTable</classname> for filterting on the association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
#, no-c-format
-msgid "Or, to both or multiples of each at the same time."
+msgid "Using Hibernate mapping files for defining filters the situtation is very similar. The filters must first be defined and then attached to the appropriate mapping elements. To define a filter, use the <literal><filter-def/></literal> element within a <literal><hibernate-mapping/></literal> element:"
msgstr ""
+#. Tag: title
+#: filters.xml:97
+#, no-c-format
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:100
+#, no-c-format
+msgid ""
+ "<filter-def name=\"myFilter\">\n"
+ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+ "</filter-def>"
+msgstr ""
+
#. Tag: para
+#: filters.xml:103
#, no-c-format
+msgid "This filter can then be attached to a class or collection (or, to both or multiples of each at the same time):"
+msgstr ""
+
+#. Tag: title
+#: filters.xml:107
+#, no-c-format
+msgid "Attaching a filter to a class or collection using <literal><filter></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:110
+#, no-c-format
+msgid ""
+ "<class name=\"myClass\" ...>\n"
+ " ...\n"
+ " <filter name=\"myFilter\" condition=\":myFilterParam = MY_FILTERED_COLUMN\"/>\n"
+ "\n"
+ " <set ...>\n"
+ " <filter name=\"myFilter\" condition=\":myFilterParam = MY_FILTERED_COLUMN\"/>\n"
+ " </set> \n"
+ "</class>"
+msgstr ""
+
+#. Tag: para
+#: filters.xml:113
+#, no-c-format
msgid "The methods on <literal>Session</literal> are: <literal>enableFilter(String filterName)</literal>, <literal>getEnabledFilter(String filterName)</literal>, and <literal>disableFilter(String filterName)</literal>. By default, filters are <emphasis>not</emphasis> enabled for a given session. Filters must be enabled through use of the <literal>Session.enableFilter()</literal> method, which returns an instance of the <literal>Filter</literal> interface. If you used the simple filter defined above, it would look like this:"
msgstr ""
+#. Tag: programlisting
+#: filters.xml:123
+#, no-c-format
+msgid "session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-value\");"
+msgstr ""
+
#. Tag: para
+#: filters.xml:125
#, no-c-format
msgid "Methods on the org.hibernate.Filter interface do allow the method-chaining common to much of Hibernate."
msgstr ""
#. Tag: para
+#: filters.xml:128
#, no-c-format
msgid "The following is a full example, using temporal data with an effective record date pattern:"
msgstr ""
+#. Tag: programlisting
+#: filters.xml:131
+#, no-c-format
+msgid ""
+ "<filter-def name=\"effectiveDate\">\n"
+ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+ "</filter-def>\n"
+ "\n"
+ "<class name=\"Employee\" ...>\n"
+ "...\n"
+ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department\"/>\n"
+ " <property name=\"effectiveStartDate\" type=\"date\" column=\"eff_start_dt\"/>\n"
+ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt\"/>\n"
+ "...\n"
+ " <!--\n"
+ " Note that this assumes non-terminal records have an eff_end_dt set to\n"
+ " a max db date for simplicity-sake\n"
+ " -->\n"
+ " <filter name=\"effectiveDate\"\n"
+ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/>\n"
+ "</class>\n"
+ "\n"
+ "<class name=\"Department\" ...>\n"
+ "...\n"
+ " <set name=\"employees\" lazy=\"true\">\n"
+ " <key column=\"dept_id\"/>\n"
+ " <one-to-many class=\"Employee\"/>\n"
+ " <filter name=\"effectiveDate\"\n"
+ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/>\n"
+ " </set>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: filters.xml:133
#, no-c-format
msgid "In order to ensure that you are provided with currently effective records, enable the filter on the session prior to retrieving employee data:"
msgstr ""
+#. Tag: programlisting
+#: filters.xml:137
+#, no-c-format
+msgid ""
+ "Session session = ...;\n"
+ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date());\n"
+ "List results = session.createQuery(\"from Employee as e where e.salary > :targetSalary\")\n"
+ " .setLong(\"targetSalary\", new Long(1000000))\n"
+ " .list();"
+msgstr ""
+
#. Tag: para
+#: filters.xml:139
#, no-c-format
msgid "Even though a salary constraint was mentioned explicitly on the results in the above HQL, because of the enabled filter, the query will return only currently active employees who have a salary greater than one million dollars."
msgstr ""
#. Tag: para
+#: filters.xml:144
#, no-c-format
msgid "If you want to use filters with outer joining, either through HQL or load fetching, be careful of the direction of the condition expression. It is safest to set this up for left outer joining. Place the parameter first followed by the column name(s) after the operator."
msgstr ""
#. Tag: para
+#: filters.xml:149
#, no-c-format
msgid "After being defined, a filter might be attached to multiple entities and/or collections each with its own condition. This can be problematic when the conditions are the same each time. Using <literal><filter-def/></literal> allows you to definine a default condition, either as an attribute or CDATA:"
msgstr ""
+#. Tag: programlisting
+#: filters.xml:155
+#, no-c-format
+msgid ""
+ "<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</filter-def>\n"
+ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+
#. Tag: para
+#: filters.xml:157
#, no-c-format
msgid "This default condition will be used whenever the filter is attached to something without specifying a condition. This means you can give a specific condition as part of the attachment of the filter that overrides the default condition in that particular case."
msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/performance.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/performance.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/performance.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,1103 +1,1898 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr ""
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr ""
#. Tag: para
+#: performance.xml:36
#, no-c-format
msgid "Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve associated objects if the application needs to navigate the association. Fetch strategies can be declared in the O/R mapping metadata, or over-ridden by a particular HQL or <literal>Criteria</literal> query."
msgstr ""
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr ""
#. Tag: para
+#: performance.xml:46
#, no-c-format
msgid "<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated instance or collection in the same <literal>SELECT</literal>, using an <literal>OUTER JOIN</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:53
#, no-c-format
msgid "<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is used to retrieve the associated entity or collection. Unless you explicitly disable lazy fetching by specifying <literal>lazy=\"false\"</literal>, this second select will only be executed when you access the association."
msgstr ""
#. Tag: para
+#: performance.xml:61
#, no-c-format
msgid "<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> is used to retrieve the associated collections for all entities retrieved in a previous query or fetch. Unless you explicitly disable lazy fetching by specifying <literal>lazy=\"false\"</literal>, this second select will only be executed when you access the association."
msgstr ""
#. Tag: para
+#: performance.xml:70
#, no-c-format
msgid "<emphasis>Batch fetching</emphasis>: an optimization strategy for select fetching. Hibernate retrieves a batch of entity instances or collections in a single <literal>SELECT</literal> by specifying a list of primary or foreign keys."
msgstr ""
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr ""
#. Tag: para
+#: performance.xml:81
#, no-c-format
msgid "<emphasis>Immediate fetching</emphasis>: an association, collection or attribute is fetched immediately when the owner is loaded."
msgstr ""
#. Tag: para
+#: performance.xml:87
#, no-c-format
msgid "<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when the application invokes an operation upon that collection. This is the default for collections."
msgstr ""
#. Tag: para
+#: performance.xml:93
#, no-c-format
msgid "<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements of the collection are accessed from the database as needed. Hibernate tries not to fetch the whole collection into memory unless absolutely needed. It is suitable for large collections."
msgstr ""
#. Tag: para
+#: performance.xml:101
#, no-c-format
msgid "<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched when a method other than the identifier getter is invoked upon the associated object."
msgstr ""
#. Tag: para
+#: performance.xml:107
#, no-c-format
msgid "<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is fetched when the instance variable is accessed. Compared to proxy fetching, this approach is less lazy; the association is fetched even when only the identifier is accessed. It is also more transparent, since no proxy is visible to the application. This approach requires buildtime bytecode instrumentation and is rarely necessary."
msgstr ""
#. Tag: para
+#: performance.xml:117
#, no-c-format
msgid "<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued association is fetched when the instance variable is accessed. This approach requires buildtime bytecode instrumentation and is rarely necessary."
msgstr ""
#. Tag: para
+#: performance.xml:124
#, no-c-format
msgid "We have two orthogonal notions here: <emphasis>when</emphasis> is the association fetched and <emphasis>how</emphasis> is it fetched. It is important that you do not confuse them. We use <literal>fetch</literal> to tune performance. We can use <literal>lazy</literal> to define a contract for what data is always available in any detached instance of a particular class."
msgstr ""
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr ""
#. Tag: para
+#: performance.xml:134
#, no-c-format
msgid "By default, Hibernate3 uses lazy select fetching for collections and lazy proxy fetching for single-valued associations. These defaults make sense for most associations in the majority of applications."
msgstr ""
#. Tag: para
+#: performance.xml:138
#, no-c-format
msgid "If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate will use the batch fetch optimization for lazy fetching. This optimization can also be enabled at a more granular level."
msgstr ""
#. Tag: para
+#: performance.xml:142
#, no-c-format
msgid "Please be aware that access to a lazy association outside of the context of an open Hibernate session will result in an exception. For example:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:146
+#, no-c-format
+msgid ""
+ "s = sessions.openSession();\n"
+ "Transaction tx = s.beginTransaction();\n"
+ " \n"
+ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+ " .setString(\"userName\", userName).uniqueResult();\n"
+ "Map permissions = u.getPermissions();\n"
+ "\n"
+ "tx.commit();\n"
+ "s.close();\n"
+ "\n"
+ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+
#. Tag: para
+#: performance.xml:148
#, no-c-format
msgid "Since the permissions collection was not initialized when the <literal>Session</literal> was closed, the collection will not be able to load its state. <emphasis>Hibernate does not support lazy initialization for detached objects</emphasis>. This can be fixed by moving the code that reads from the collection to just before the transaction is committed."
msgstr ""
#. Tag: para
+#: performance.xml:155
#, no-c-format
msgid "Alternatively, you can use a non-lazy collection or association, by specifying <literal>lazy=\"false\"</literal> for the association mapping. However, it is intended that lazy initialization be used for almost all collections and associations. If you define too many non-lazy associations in your object model, Hibernate will fetch the entire database into memory in every transaction."
msgstr ""
#. Tag: para
+#: performance.xml:162
#, no-c-format
msgid "On the other hand, you can use join fetching, which is non-lazy by nature, instead of select fetching in a particular transaction. We will now explain how to customize the fetching strategy. In Hibernate3, the mechanisms for choosing a fetch strategy are identical for single-valued associations and collections."
msgstr ""
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr ""
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid "Select fetching (the default) is extremely vulnerable to N+1 selects problems, so we might want to enable join fetching in the mapping document:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:176
+#, no-c-format
+msgid ""
+ "<set name=\"permissions\"\n"
+ " fetch=\"join\">\n"
+ " <key column=\"userId\"/>\n"
+ " <one-to-many class=\"Permission\"/>\n"
+ "</set"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:178
+#, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid "The <literal>fetch</literal> strategy defined in the mapping document affects:"
msgstr ""
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr ""
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr ""
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr ""
#. Tag: para
+#: performance.xml:204
#, no-c-format
msgid "Irrespective of the fetching strategy you use, the defined non-lazy graph is guaranteed to be loaded into memory. This might, however, result in several immediate selects being used to execute a particular HQL query."
msgstr ""
#. Tag: para
+#: performance.xml:209
#, no-c-format
msgid "Usually, the mapping document is not used to customize fetching. Instead, we keep the default behavior, and override it for a particular transaction, using <literal>left join fetch</literal> in HQL. This tells Hibernate to fetch the association eagerly in the first select, using an outer join. In the <literal>Criteria</literal> query API, you would use <literal>setFetchMode(FetchMode.JOIN)</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:216
#, no-c-format
msgid "If you want to change the fetching strategy used by <literal>get()</literal> or <literal>load()</literal>, you can use a <literal>Criteria</literal> query. For example:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:220
+#, no-c-format
+msgid ""
+ "User user = (User) session.createCriteria(User.class)\n"
+ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+ " .add( Restrictions.idEq(userId) )\n"
+ " .uniqueResult();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:222
#, no-c-format
msgid "This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan\"."
msgstr ""
#. Tag: para
+#: performance.xml:225
#, no-c-format
msgid "A completely different approach to problems with N+1 selects is to use the second-level cache."
msgstr ""
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr ""
#. Tag: para
+#: performance.xml:232
#, no-c-format
msgid "Lazy fetching for collections is implemented using Hibernate's own implementation of persistent collections. However, a different mechanism is needed for lazy behavior in single-ended associations. The target entity of the association must be proxied. Hibernate implements lazy initializing proxies for persistent objects using runtime bytecode enhancement which is accessed via the CGLIB library."
msgstr ""
#. Tag: para
+#: performance.xml:239
#, no-c-format
msgid "At startup, Hibernate3 generates proxies by default for all persistent classes and uses them to enable lazy fetching of <literal>many-to-one</literal> and <literal>one-to-one</literal> associations."
msgstr ""
#. Tag: para
+#: performance.xml:244
#, no-c-format
msgid "The mapping file may declare an interface to use as the proxy interface for that class, with the <literal>proxy</literal> attribute. By default, Hibernate uses a subclass of the class. <emphasis>The proxied class must implement a default constructor with at least package visibility. This constructor is recommended for all persistent classes</emphasis>."
msgstr ""
#. Tag: para
+#: performance.xml:251
#, no-c-format
msgid "There are potential problems to note when extending this approach to polymorphic classes.For example:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:254
+#, no-c-format
+msgid ""
+ "<class name=\"Cat\" proxy=\"Cat\">\n"
+ " ......\n"
+ " <subclass name=\"DomesticCat\">\n"
+ " .....\n"
+ " </subclass>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid "Firstly, instances of <literal>Cat</literal> will never be castable to <literal>DomesticCat</literal>, even if the underlying instance is an instance of <literal>DomesticCat</literal>:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:260
+#, no-c-format
+msgid ""
+ "Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does not hit the db)\n"
+ "if ( cat.isDomesticCat() ) { // hit the db to initialize the proxy\n"
+ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
+ " ....\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:265
+#, no-c-format
+msgid ""
+ "Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat proxy\n"
+ "DomesticCat dc = \n"
+ " (DomesticCat) session.load(DomesticCat.class, id); // acquire new DomesticCat proxy!\n"
+ "System.out.println(cat==dc); // false"
+msgstr ""
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid "However, the situation is not quite as bad as it looks. Even though we now have two references to different proxy objects, the underlying instance will still be the same object:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:271
+#, no-c-format
+msgid ""
+ "cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+ "System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+
#. Tag: para
+#: performance.xml:273
#, no-c-format
msgid "Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or a class with any <literal>final</literal> methods."
msgstr ""
#. Tag: para
+#: performance.xml:276
#, no-c-format
msgid "Finally, if your persistent object acquires any resources upon instantiation (e.g. in initializers or default constructor), then those resources will also be acquired by the proxy. The proxy class is an actual subclass of the persistent class."
msgstr ""
#. Tag: para
+#: performance.xml:281
#, no-c-format
msgid "These problems are all due to fundamental limitations in Java's single inheritance model. To avoid these problems your persistent classes must each implement an interface that declares its business methods. You should specify these interfaces in the mapping file where <literal>CatImpl</literal> implements the interface <literal>Cat</literal> and <literal>DomesticCatImpl</literal> implements the interface <literal>DomesticCat</literal>. For example:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:289
+#, no-c-format
+msgid ""
+ "<class name=\"CatImpl\" proxy=\"Cat\">\n"
+ " ......\n"
+ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+ " .....\n"
+ " </subclass>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:291
#, no-c-format
msgid "Then proxies for instances of <literal>Cat</literal> and <literal>DomesticCat</literal> can be returned by <literal>load()</literal> or <literal>iterate()</literal>."
msgstr ""
+#. Tag: programlisting
+#: performance.xml:295
+#, no-c-format
+msgid ""
+ "Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+ "Iterator iter = session.createQuery(\"from CatImpl as cat where cat.name='fritz'\").iterate();\n"
+ "Cat fritz = (Cat) iter.next();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr ""
#. Tag: para
+#: performance.xml:300
#, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr ""
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid "Relationships are also lazily initialized. This means you must declare any properties to be of type <literal>Cat</literal>, not <literal>CatImpl</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:308
#, no-c-format
msgid "Certain operations do <emphasis>not</emphasis> require proxy initialization:"
msgstr ""
#. Tag: para
+#: performance.xml:313
#, no-c-format
msgid "<literal>equals()</literal>: if the persistent class does not override <literal>equals()</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:318
#, no-c-format
msgid "<literal>hashCode()</literal>: if the persistent class does not override <literal>hashCode()</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr ""
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid "Hibernate will detect persistent classes that override <literal>equals()</literal> or <literal>hashCode()</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:330
#, no-c-format
msgid "By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default <literal>lazy=\"proxy\"</literal>, you can avoid problems associated with typecasting. However, buildtime bytecode instrumentation is required, and all operations will result in immediate proxy initialization."
msgstr ""
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr ""
#. Tag: para
+#: performance.xml:340
#, no-c-format
msgid "A <literal>LazyInitializationException</literal> will be thrown by Hibernate if an uninitialized collection or proxy is accessed outside of the scope of the <literal>Session</literal>, i.e., when the entity owning the collection or having the reference to the proxy is in the detached state."
msgstr ""
#. Tag: para
+#: performance.xml:346
#, no-c-format
msgid "Sometimes a proxy or collection needs to be initialized before closing the <literal>Session</literal>. You can force initialization by calling <literal>cat.getSex()</literal> or <literal>cat.getKittens().size()</literal>, for example. However, this can be confusing to readers of the code and it is not convenient for generic code."
msgstr ""
#. Tag: para
+#: performance.xml:353
#, no-c-format
msgid "The static methods <literal>Hibernate.initialize()</literal> and <literal>Hibernate.isInitialized()</literal>, provide the application with a convenient way of working with lazily initialized collections or proxies. <literal>Hibernate.initialize(cat)</literal> will force the initialization of a proxy, <literal>cat</literal>, as long as its <literal>Session</literal> is still open. <literal>Hibernate.initialize( cat.getKittens() )</literal> has a similar effect for the collection of kittens."
msgstr ""
#. Tag: para
+#: performance.xml:362
#, no-c-format
msgid "Another option is to keep the <literal>Session</literal> open until all required collections and proxies have been loaded. In some application architectures, particularly where the code that accesses data using Hibernate, and the code that uses it are in different application layers or different physical processes, it can be a problem to ensure that the <literal>Session</literal> is open when a collection is initialized. There are two basic ways to deal with this issue:"
msgstr ""
#. Tag: para
+#: performance.xml:372
#, no-c-format
msgid "In a web-based application, a servlet filter can be used to close the <literal>Session</literal> only at the end of a user request, once the rendering of the view is complete (the <emphasis>Open Session in View</emphasis> pattern). Of course, this places heavy demands on the correctness of the exception handling of your application infrastructure. It is vitally important that the <literal>Session</literal> is closed and the transaction ended before returning to the user, even when an exception occurs during rendering of the view. See the Hibernate Wiki for examples of this \"Open Session in View\" pattern."
msgstr ""
#. Tag: para
+#: performance.xml:385
#, no-c-format
msgid "In an application with a separate business tier, the business logic must \"prepare\" all collections that the web tier needs before returning. This means that the business tier should load all the data and return all the data already initialized to the presentation/web tier that is required for a particular use case. Usually, the application calls <literal>Hibernate.initialize()</literal> for each collection that will be needed in the web tier (this call must occur before the session is closed) or retrieves the collection eagerly using a Hibernate query with a <literal>FETCH</literal> clause or a <literal>FetchMode.JOIN</literal> in <literal>Criteria</literal>. This is usually easier if you adopt the <emphasis>Command</emphasis> pattern instead of a <emphasis>Session Facade</emphasis>."
msgstr ""
#. Tag: para
+#: performance.xml:401
#, no-c-format
msgid "You can also attach a previously loaded object to a new <literal>Session</literal> with <literal>merge()</literal> or <literal>lock()</literal> before accessing uninitialized collections or other proxies. Hibernate does not, and certainly <emphasis>should</emphasis> not, do this automatically since it would introduce impromptu transaction semantics."
msgstr ""
#. Tag: para
+#: performance.xml:410
#, no-c-format
msgid "Sometimes you do not want to initialize a large collection, but still need some information about it, like its size, for example, or a subset of the data."
msgstr ""
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid "You can use a collection filter to get the size of a collection without initializing it:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:417
+#, no-c-format
+msgid "( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get(0) ).intValue()"
+msgstr ""
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid "The <literal>createFilter()</literal> method is also used to efficiently retrieve subsets of a collection without needing to initialize the whole collection:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:423
+#, no-c-format
+msgid "s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10).list();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr ""
#. Tag: para
+#: performance.xml:429
#, no-c-format
msgid "Using batch fetching, Hibernate can load several uninitialized proxies if one proxy is accessed. Batch fetching is an optimization of the lazy select fetching strategy. There are two ways you can configure batch fetching: on the class level and the collection level."
msgstr ""
#. Tag: para
+#: performance.xml:434
#, no-c-format
msgid "Batch fetching for classes/entities is easier to understand. Consider the following example: at runtime you have 25 <literal>Cat</literal> instances loaded in a <literal>Session</literal>, and each <literal>Cat</literal> has a reference to its <literal>owner</literal>, a <literal>Person</literal>. The <literal>Person</literal> class is mapped with a proxy, <literal>lazy=\"true\"</literal>. If you now iterate through all cats and call <literal>getOwner()</literal> on each, Hibernate will, by default, execute 25 <literal>SELECT</literal> statements to retrieve the proxied owners. You can tune this behavior by specifying a <literal>batch-size</literal> in the mapping of <literal>Person</literal>:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:447
+#, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:449
#, no-c-format
msgid "Hibernate will now execute only three queries: the pattern is 10, 10, 5."
msgstr ""
#. Tag: para
+#: performance.xml:452
#, no-c-format
msgid "You can also enable batch fetching of collections. For example, if each <literal>Person</literal> has a lazy collection of <literal>Cat</literal>s, and 10 persons are currently loaded in the <literal>Session</literal>, iterating through all persons will generate 10 <literal>SELECT</literal>s, one for every call to <literal>getCats()</literal>. If you enable batch fetching for the <literal>cats</literal> collection in the mapping of <literal>Person</literal>, Hibernate can pre-fetch collections:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:461
+#, no-c-format
+msgid ""
+ "<class name=\"Person\">\n"
+ " <set name=\"cats\" batch-size=\"3\">\n"
+ " ...\n"
+ " </set>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:463
#, no-c-format
msgid "With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 collections in four <literal>SELECT</literal>s. Again, the value of the attribute depends on the expected number of uninitialized collections in a particular <literal>Session</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:468
#, no-c-format
msgid "Batch fetching of collections is particularly useful if you have a nested tree of items, i.e. the typical bill-of-materials pattern. However, a <emphasis>nested set</emphasis> or a <emphasis>materialized path</emphasis> might be a better option for read-mostly trees."
msgstr ""
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr ""
#. Tag: para
+#: performance.xml:477
#, no-c-format
msgid "If one lazy collection or single-valued proxy has to be fetched, Hibernate will load all of them, re-running the original query in a subselect. This works in the same way as batch-fetching but without the piecemeal loading."
msgstr ""
#. Tag: title
+#: performance.xml:486
#, no-c-format
msgid "Fetch profiles"
msgstr ""
#. Tag: para
+#: performance.xml:488
#, no-c-format
-msgid "Another way to affect the fetching strategy for loading associated objects is through something called a fetch profile, which is a named configuration associated with the <interfacename>org.hibernate.SessionFactory</interfacename> but enabled, by name, on the <interfacename>org.hibernate.Session</interfacename>. Once enabled on a <interfacename>org.hibernate.Session</interfacename>, the fetch profile wull be in affect for that <interfacename>org.hibernate.Session</interfacename> until it is explicitly disabled."
+msgid "Another way to affect the fetching strategy for loading associated objects is through something called a fetch profile, which is a named configuration associated with the <interfacename>org.hibernate.SessionFactory</interfacename> but enabled, by name, on the <interfacename>org.hibernate.Session</interfacename>. Once enabled on a <interfacename>org.hibernate.Session</interfacename>, the fetch profile will be in affect for that <interfacename>org.hibernate.Session</interfacename> until it is explicitly disabled."
msgstr ""
#. Tag: para
+#: performance.xml:498
#, no-c-format
-msgid "So what does that mean? Well lets explain that by way of an example. Say we have the following mappings:"
+msgid "So what does that mean? Well lets explain that by way of an example which show the different available approaches to configure a fetch profile:"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: performance.xml:503
#, no-c-format
-msgid "Now normally when you get a reference to a particular customer, that customer's set of orders will be lazy meaning we will not yet have loaded those orders from the database. Normally this is a good thing. Now lets say that you have a certain use case where it is more efficient to load the customer and their orders together. One way certainly is to use \"dynamic fetching\" strategies via an HQL or criteria queries. But another option is to use a fetch profile to achieve that. Just add the following to your mapping:"
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+ " @FetchProfile.FetchOverride(entity = Customer.class, association = \"orders\", mode = FetchMode.JOIN)\n"
+ "})\n"
+ "public class Customer {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private long id;\n"
+ "\n"
+ " private String name;\n"
+ "\n"
+ " private long customerNumber;\n"
+ "\n"
+ " @OneToMany\n"
+ " private Set<Order> orders;\n"
+ "\n"
+ " // standard getter/setter\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid "Specifying a fetch profile using <literal><fetch-profile></literal> outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ " <class name=\"Customer\">\n"
+ " ...\n"
+ " <set name=\"orders\" inverse=\"true\">\n"
+ " <key column=\"cust_id\"/>\n"
+ " <one-to-many class=\"Order\"/>\n"
+ " </set>\n"
+ " </class>\n"
+ " <class name=\"Order\">\n"
+ " ...\n"
+ " </class>\n"
+ " <fetch-profile name=\"customer-with-orders\">\n"
+ " <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/>\n"
+ " </fetch-profile>\n"
+ "</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid "Specifying a fetch profile using <literal><fetch-profile></literal> inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ " <class name=\"Customer\">\n"
+ " ...\n"
+ " <set name=\"orders\" inverse=\"true\">\n"
+ " <key column=\"cust_id\"/>\n"
+ " <one-to-many class=\"Order\"/>\n"
+ " </set>\n"
+ " <fetch-profile name=\"customer-with-orders\">\n"
+ " <fetch association=\"orders\" style=\"join\"/>\n"
+ " </fetch-profile>\n"
+ " </class>\n"
+ " <class name=\"Order\">\n"
+ " ...\n"
+ " </class>\n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:525
#, no-c-format
-msgid "or even:"
+msgid "Now normally when you get a reference to a particular customer, that customer's set of orders will be lazy meaning we will not yet have loaded those orders from the database. Normally this is a good thing. Now lets say that you have a certain use case where it is more efficient to load the customer and their orders together. One way certainly is to use \"dynamic fetching\" strategies via an HQL or criteria queries. But another option is to use a fetch profile to achieve that. The following code will load both the customer <emphasis>and</emphasis>their orders:"
msgstr ""
+#. Tag: title
+#: performance.xml:536
+#, no-c-format
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+ "Session session = ...;\n"
+ "session.enableFetchProfile( \"customer-with-orders\" ); // name matches from mapping\n"
+ "Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
-msgid "Now the following code will actually load both the customer <emphasis>and their orders</emphasis>:"
+msgid "<classname>@FetchProfile </classname>definitions are global and it does not matter on which class you place them. You can place the <classname>@FetchProfile</classname> annotation either onto a class or package (package-info.java). In order to define multiple fetch profiles for the same class or package <classname>@FetchProfiles</classname> can be used."
msgstr ""
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid "Currently only join style fetch profiles are supported, but they plan is to support additional styles. See <ulink url=\"http://opensource.atlassian.com/projects/hibernate/browse/HHH-3414\">HHH-3414</ulink> for details."
msgstr ""
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr ""
#. Tag: para
+#: performance.xml:560
#, no-c-format
msgid "Hibernate3 supports the lazy fetching of individual properties. This optimization technique is also known as <emphasis>fetch groups</emphasis>. Please note that this is mostly a marketing feature; optimizing row reads is much more important than optimization of column reads. However, only loading some properties of a class could be useful in extreme cases. For example, when legacy tables have hundreds of columns and the data model cannot be improved."
msgstr ""
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid "To enable lazy property loading, set the <literal>lazy</literal> attribute on your particular property mappings:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:571
+#, no-c-format
+msgid ""
+ "<class name=\"Document\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"native\"/>\n"
+ " </id>\n"
+ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy=\"true\"/>\n"
+ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true\"/>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:573
#, no-c-format
msgid "Lazy property loading requires buildtime bytecode instrumentation. If your persistent classes are not enhanced, Hibernate will ignore lazy property settings and return to immediate fetching."
msgstr ""
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:579
+#, no-c-format
+msgid ""
+ "<target name=\"instrument\" depends=\"compile\">\n"
+ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool.instrument.InstrumentTask\">\n"
+ " <classpath path=\"${jar.path}\"/>\n"
+ " <classpath path=\"${classes.dir}\"/>\n"
+ " <classpath refid=\"lib.class.path\"/>\n"
+ " </taskdef>\n"
+ "\n"
+ " <instrument verbose=\"true\">\n"
+ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"
+ " <include name=\"*.class\"/>\n"
+ " </fileset>\n"
+ " </instrument>\n"
+ "</target>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:581
#, no-c-format
msgid "A different way of avoiding unnecessary column reads, at least for read-only transactions, is to use the projection features of HQL or Criteria queries. This avoids the need for buildtime bytecode processing and is certainly a preferred solution."
msgstr ""
#. Tag: para
+#: performance.xml:586
#, no-c-format
msgid "You can force the usual eager fetching of properties using <literal>fetch all properties</literal> in HQL."
msgstr ""
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr ""
#. Tag: para
+#: performance.xml:594
#, no-c-format
msgid "A Hibernate <literal>Session</literal> is a transaction-level cache of persistent data. It is possible to configure a cluster or JVM-level (<literal>SessionFactory</literal>-level) cache on a class-by-class and collection-by-collection basis. You can even plug in a clustered cache. Be aware that caches are not aware of changes made to the persistent store by another application. They can, however, be configured to regularly expire cached data."
msgstr ""
#. Tag: para
+#: performance.xml:602
#, no-c-format
-msgid "You have the option to tell Hibernate which caching implementation to use by specifying the name of a class that implements <literal>org.hibernate.cache.CacheProvider</literal> using the property <literal>hibernate.cache.provider_class</literal>. Hibernate is bundled with a number of built-in integrations with the open-source cache providers that are listed below. You can also implement your own and plug it in as outlined above. Note that versions prior to 3.2 use EhCache as the default cache provider."
+msgid "You have the option to tell Hibernate which caching implementation to use by specifying the name of a class that implements <literal>org.hibernate.cache.CacheProvider</literal> using the property <literal>hibernate.cache.provider_class</literal>. Hibernate is bundled with a number of built-in integrations with the open-source cache providers that are listed in <xref linkend=\"cacheproviders\"/>. You can also implement your own and plug it in as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as the default cache provider."
msgstr ""
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr ""
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr ""
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr ""
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr ""
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr ""
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr ""
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:644
#, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr ""
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr ""
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674 performance.xml:992 performance.xml:994 performance.xml:996 performance.xml:1004 performance.xml:1006 performance.xml:1008 performance.xml:1016 performance.xml:1018 performance.xml:1020 performance.xml:1028 performance.xml:1030 performance.xml:1040 performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
+msgid "<entry>yes</entry>"
msgstr ""
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:656
#, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr ""
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr ""
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:668
#, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr ""
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:680
#, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr ""
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr ""
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr ""
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:692
#, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr ""
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr ""
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr ""
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr ""
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: performance.xml:704
#, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr ""
#. Tag: entry
+#: performance.xml:708
#, no-c-format
msgid "yes (replication or invalidation)"
msgstr ""
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr ""
#. Tag: para
+#: performance.xml:719
#, no-c-format
-msgid "The <literal><cache></literal> element of a class or collection mapping has the following form:"
+msgid "As we have done in previous chapters we are looking at the two different possibiltites to configure caching. First configuration via annotations and then via Hibernate mapping files."
msgstr ""
#. Tag: para
+#: performance.xml:723
#, no-c-format
+msgid "By default, entities are not part of the second level cache and we recommend you to stick to this setting. However, you can override this by setting the <literal>shared-cache-mode</literal> element in your <filename>persistence.xml</filename> file or by using the <literal>javax.persistence.sharedCache.mode </literal>property in your configuration. The following values are possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid "<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid "<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid "<literal>ALL</literal>: all entities are always cached even if marked as non cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid "<literal>NONE</literal>: no entity are cached even if marked as cacheable. This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid "The cache concurrency strategy used by default can be set globaly via the <literal>hibernate.cache.default_cache_concurrency_strategy</literal> configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:765
+#, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:769
+#, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:773
+#, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid "It is recommended to define the cache concurrency strategy per entity rather than using a global one. Use the <classname>@org.hibernate.annotations.Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid "Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+ "@Entity \n"
+ "@Cacheable\n"
+ "@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+ "public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid "Hibernate also let's you cache the content of a collection or the identifiers if the collection contains other entities. Use the <classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, no-c-format
+msgid "Caching collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+ "@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: para
+#: performance.xml:802
+#, no-c-format
+msgid "shows the<literal> @org.hibernate.annotations.Cache</literal> annotations with its attributes. It allows you to define the caching strategy and region of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+ "@Cache(\n"
+ " CacheConcurrencyStrategy usage();\n"
+ " String region() default \"\";\n"
+ " String include() default \"all\";\n"
+ ")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid "usage: the given cache concurrency strategy (NONE, READ_ONLY, NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid "Let's now take a look at Hibernate mapping files. There the <literal><cache></literal> element of a class or collection mapping is used to configure the second level cache. Looking at <xref linkend=\"example-hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, no-c-format
+msgid ""
+ "<cache\n"
+ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+ " region=\"RegionName\"\n"
+ " include=\"all|non-lazy\"\n"
+ "/>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
msgid "<literal>usage</literal> (required) specifies the caching strategy: <literal>transactional</literal>, <literal>read-write</literal>, <literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:874
#, no-c-format
msgid "<literal>region</literal> (optional: defaults to the class or collection role name): specifies the name of the second level cache region"
msgstr ""
#. Tag: para
+#: performance.xml:880
#, no-c-format
msgid "<literal>include</literal> (optional: defaults to <literal>all</literal>) <literal>non-lazy</literal>: specifies that properties of the entity mapped with <literal>lazy=\"true\"</literal> cannot be cached when attribute-level lazy fetching is enabled"
msgstr ""
#. Tag: para
+#: performance.xml:890
#, no-c-format
-msgid "Alternatively, you can specify <literal><class-cache></literal> and <literal><collection-cache></literal> elements in <literal>hibernate.cfg.xml</literal>."
+msgid "Alternatively to <literal><cache></literal>, you can use <literal><class-cache></literal> and <literal><collection-cache></literal> elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid "The <literal>usage</literal> attribute specifies a <emphasis>cache concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr ""
#. Tag: para
+#: performance.xml:902
#, no-c-format
msgid "If your application needs to read, but not modify, instances of a persistent class, a <literal>read-only</literal> cache can be used. This is the simplest and optimal performing strategy. It is even safe for use in a cluster."
msgstr ""
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr ""
#. Tag: para
+#: performance.xml:911
#, no-c-format
msgid "If the application needs to update data, a <literal>read-write</literal> cache might be appropriate. This cache strategy should never be used if serializable transaction isolation level is required. If the cache is used in a JTA environment, you must specify the property <literal>hibernate.transaction.manager_lookup_class</literal> and naming a strategy for obtaining the JTA <literal>TransactionManager</literal>. In other environments, you should ensure that the transaction is completed when <literal>Session.close()</literal> or <literal>Session.disconnect()</literal> is called. If you want to use this strategy in a cluster, you should ensure that the underlying cache implementation supports locking. The built-in cache providers <emphasis>do not</emphasis> support locking."
msgstr ""
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr ""
#. Tag: para
+#: performance.xml:929
#, no-c-format
msgid "If the application only occasionally needs to update data (i.e. if it is extremely unlikely that two transactions would try to update the same item simultaneously), and strict transaction isolation is not required, a <literal>nonstrict-read-write</literal> cache might be appropriate. If the cache is used in a JTA environment, you must specify <literal>hibernate.transaction.manager_lookup_class</literal>. In other environments, you should ensure that the transaction is completed when <literal>Session.close()</literal> or <literal>Session.disconnect()</literal> is called."
msgstr ""
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr ""
#. Tag: para
+#: performance.xml:943
#, no-c-format
msgid "The <literal>transactional</literal> cache strategy provides support for fully transactional cache providers such as JBoss TreeCache. Such a cache can only be used in a JTA environment and you must specify <literal>hibernate.transaction.manager_lookup_class</literal>."
msgstr ""
#. Tag: title
+#: performance.xml:950
#, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr ""
#. Tag: para
+#: performance.xml:953
#, no-c-format
msgid "None of the cache providers support all of the cache concurrency strategies."
msgstr ""
#. Tag: para
+#: performance.xml:957
#, no-c-format
msgid "The following table shows which providers are compatible with which concurrency strategies."
msgstr ""
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr ""
#. Tag: entry
+#: performance.xml:978
#, no-c-format
-msgid "read-only"
+msgid "<entry>read-only</entry>"
msgstr ""
#. Tag: entry
+#: performance.xml:980
#, no-c-format
-msgid "nonstrict-read-write"
+msgid "<entry>nonstrict-read-write</entry>"
msgstr ""
#. Tag: entry
+#: performance.xml:982
#, no-c-format
-msgid "read-write"
+msgid "<entry>read-write</entry>"
msgstr ""
#. Tag: entry
+#: performance.xml:984
#, no-c-format
-msgid "transactional"
+msgid "<entry>transactional</entry>"
msgstr ""
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr ""
#. Tag: para
+#: performance.xml:1069
#, no-c-format
msgid "Whenever you pass an object to <literal>save()</literal>, <literal>update()</literal> or <literal>saveOrUpdate()</literal>, and whenever you retrieve an object using <literal>load()</literal>, <literal>get()</literal>, <literal>list()</literal>, <literal>iterate()</literal> or <literal>scroll()</literal>, that object is added to the internal cache of the <literal>Session</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:1076
#, no-c-format
msgid "When <literal>flush()</literal> is subsequently called, the state of that object will be synchronized with the database. If you do not want this synchronization to occur, or if you are processing a huge number of objects and need to manage memory efficiently, the <literal>evict()</literal> method can be used to remove the object and its collections from the first-level cache."
msgstr ""
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid "Explcitly evicting a cached instance from the first level cache using <methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, no-c-format
+msgid ""
+ "ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a huge result set\n"
+ "while ( cats.next() ) {\n"
+ " Cat cat = (Cat) cats.get(0);\n"
+ " doSomethingWithACat(cat);\n"
+ " sess.evict(cat);\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid "The <literal>Session</literal> also provides a <literal>contains()</literal> method to determine if an instance belongs to the session cache."
msgstr ""
#. Tag: para
+#: performance.xml:1094
#, no-c-format
msgid "To evict all objects from the session cache, call <literal>Session.clear()</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid "For the second-level cache, there are methods defined on <literal>SessionFactory</literal> for evicting the cached state of an instance, entire class, collection instance or entire collection role."
msgstr ""
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid "Second-level cache eviction via <methodname>SessionFactoty.evict() </methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, no-c-format
+msgid ""
+ "sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+ "sessionFactory.evict(Cat.class); //evict all Cats\n"
+ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular collection of kittens\n"
+ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten collections"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1110
#, no-c-format
msgid "The <literal>CacheMode</literal> controls how a particular session interacts with the second-level cache:"
msgstr ""
#. Tag: para
+#: performance.xml:1115
#, no-c-format
msgid "<literal>CacheMode.NORMAL</literal>: will read items from and write items to the second-level cache"
msgstr ""
#. Tag: para
+#: performance.xml:1120
#, no-c-format
msgid "<literal>CacheMode.GET</literal>: will read items from the second-level cache. Do not write to the second-level cache except when updating data"
msgstr ""
#. Tag: para
+#: performance.xml:1126
#, no-c-format
msgid "<literal>CacheMode.PUT</literal>: will write items to the second-level cache. Do not read from the second-level cache"
msgstr ""
#. Tag: para
+#: performance.xml:1131
#, no-c-format
msgid "<literal>CacheMode.REFRESH</literal>: will write items to the second-level cache. Do not read from the second-level cache. Bypass the effect of <literal>hibernate.cache.use_minimal_puts</literal> forcing a refresh of the second-level cache for all items read from the database"
msgstr ""
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid "To browse the contents of a second-level or query cache region, use the <literal>Statistics</literal> API:"
msgstr ""
+#. Tag: title
+#: performance.xml:1143
+#, no-c-format
+msgid "Browsing the second-level cache entries via the <classname>Statistics</classname> API"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, no-c-format
+msgid ""
+ "Map cacheEntries = sessionFactory.getStatistics()\n"
+ " .getSecondLevelCacheStatistics(regionName)\n"
+ " .getEntries();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1149
#, no-c-format
msgid "You will need to enable statistics and, optionally, force Hibernate to keep the cache entries in a more readable format:"
msgstr ""
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, no-c-format
+msgid ""
+ "hibernate.generate_statistics true\n"
+ "hibernate.cache.use_structured_entries true"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr ""
#. Tag: para
+#: performance.xml:1162
#, no-c-format
msgid "Query result sets can also be cached. This is only useful for queries that are run frequently with the same parameters."
msgstr ""
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr ""
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid "Caching of query results introduces some overhead in terms of your applications normal transactional processing. For example, if you cache results of a query against Person Hibernate will need to keep track of when those results should be invalidated because changes have been committed against Person. That, coupled with the fact that most applications simply gain no benefit from caching query results, leads Hibernate to disable caching of query results by default. To use query caching, you will first need to enable the query cache:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1177
+#, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr ""
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid "<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the cached query results"
msgstr ""
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid "<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding timestamps of the most recent updates to queryable tables. These are used to validate the results as they are served from the query cache."
msgstr ""
#. Tag: para
+#: performance.xml:1194
#, no-c-format
-msgid "If you configure your underlying cache implementation to use expiry or timeouts is is very important that the cache timeout of the underlying cache region for the UpdateTimestampsCache be set to a higher value than the timeouts of any of the query caches. In fact, we recommend that the the UpdateTimestampsCache region not be configured for expiry at all. Note, in particular, that an LRU cache expiry policy is never appropriate."
+msgid "If you configure your underlying cache implementation to use expiry or timeouts is very important that the cache timeout of the underlying cache region for the UpdateTimestampsCache be set to a higher value than the timeouts of any of the query caches. In fact, we recommend that the the UpdateTimestampsCache region not be configured for expiry at all. Note, in particular, that an LRU cache expiry policy is never appropriate."
msgstr ""
#. Tag: para
+#: performance.xml:1203
#, no-c-format
msgid "As mentioned above, most queries do not benefit from caching or their results. So by default, individual queries are not cached even after enabling query caching. To enable results caching for a particular query, call <literal>org.hibernate.Query.setCacheable(true)</literal>. This call allows the query to look for existing cache results or add its results to the cache when it is executed."
msgstr ""
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid "The query cache does not cache the state of the actual entities in the cache; it caches only identifier values and results of value type. For this reaso, the query cache should always be used in conjunction with the second-level cache for those entities expected to be cached as part of a query result cache (just as with collection caching)."
msgstr ""
#. Tag: title
+#: performance.xml:1221
#, no-c-format
msgid "Query cache regions"
msgstr ""
#. Tag: para
+#: performance.xml:1223
#, no-c-format
msgid "If you require fine-grained control over query cache expiration policies, you can specify a named cache region for a particular query by calling <literal>Query.setCacheRegion()</literal>."
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1227
+#, no-c-format
+msgid ""
+ "List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger\")\n"
+ " .setEntity(\"blogger\", blogger)\n"
+ " .setMaxResults(15)\n"
+ " .setCacheable(true)\n"
+ " .setCacheRegion(\"frontpages\")\n"
+ " .list();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1229
#, no-c-format
msgid "If you want to force the query cache to refresh one of its regions (disregard any cached results it finds there) you can use <literal>org.hibernate.Query.setCacheMode(CacheMode.REFRESH)</literal>. In conjunction with the region you have defined for the given query, Hibernate will selectively force the results cached in that particular region to be refreshed. This is particularly useful in cases where underlying data may have been updated via a separate process and is a far more efficient alternative to bulk eviction of the region via <literal>org.hibernate.SessionFactory.evictQueries()</literal>."
msgstr ""
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr ""
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid "In the previous sections we have covered collections and their applications. In this section we explore some more issues in relation to collections at runtime."
msgstr ""
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr ""
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr ""
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr ""
#. Tag: para
+#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr ""
#. Tag: para
+#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr ""
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid "This classification distinguishes the various table and foreign key relationships but does not tell us quite everything we need to know about the relational model. To fully understand the relational structure and performance characteristics, we must also consider the structure of the primary key that is used by Hibernate to update or delete collection rows. This suggests the following classification:"
msgstr ""
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr ""
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr ""
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr ""
#. Tag: para
+#: performance.xml:1288
#, no-c-format
msgid "All indexed collections (maps, lists, and arrays) have a primary key consisting of the <literal><key></literal> and <literal><index></literal> columns. In this case, collection updates are extremely efficient. The primary key can be efficiently indexed and a particular row can be efficiently located when Hibernate tries to update or delete it."
msgstr ""
#. Tag: para
+#: performance.xml:1295
#, no-c-format
msgid "Sets have a primary key consisting of <literal><key></literal> and element columns. This can be less efficient for some types of collection element, particularly composite elements or large text or binary fields, as the database may not be able to index a complex primary key as efficiently. However, for one-to-many or many-to-many associations, particularly in the case of synthetic identifiers, it is likely to be just as efficient. If you want <literal>SchemaExport</literal> to actually create the primary key of a <literal><set></literal>, you must declare all columns as <literal>not-null=\"true\"</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:1306
#, no-c-format
msgid "<literal><idbag></literal> mappings define a surrogate key, so they are efficient to update. In fact, they are the best case."
msgstr ""
#. Tag: para
+#: performance.xml:1309
#, no-c-format
msgid "Bags are the worst case since they permit duplicate element values and, as they have no index column, no primary key can be defined. Hibernate has no way of distinguishing between duplicate rows. Hibernate resolves this problem by completely removing in a single <literal>DELETE</literal> and recreating the collection whenever it changes. This can be inefficient."
msgstr ""
#. Tag: para
+#: performance.xml:1316
#, no-c-format
msgid "For a one-to-many association, the \"primary key\" may not be the physical primary key of the database table. Even in this case, the above classification is still useful. It reflects how Hibernate \"locates\" individual rows of the collection."
msgstr ""
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid "Lists, maps, idbags and sets are the most efficient collections to update"
msgstr ""
#. Tag: para
+#: performance.xml:1326
#, no-c-format
msgid "From the discussion above, it should be clear that indexed collections and sets allow the most efficient operation in terms of adding, removing and updating elements."
msgstr ""
#. Tag: para
+#: performance.xml:1330
#, no-c-format
msgid "There is, arguably, one more advantage that indexed collections have over sets for many-to-many associations or collections of values. Because of the structure of a <literal>Set</literal>, Hibernate does not <literal>UPDATE</literal> a row when an element is \"changed\". Changes to a <literal>Set</literal> always work via <literal>INSERT</literal> and <literal>DELETE</literal> of individual rows. Once again, this consideration does not apply to one-to-many associations."
msgstr ""
#. Tag: para
+#: performance.xml:1338
#, no-c-format
msgid "After observing that arrays cannot be lazy, you can conclude that lists, maps and idbags are the most performant (non-inverse) collection types, with sets not far behind. You can expect sets to be the most common kind of collection in Hibernate applications. This is because the \"set\" semantics are most natural in the relational model."
msgstr ""
#. Tag: para
+#: performance.xml:1344
#, no-c-format
msgid "However, in well-designed Hibernate domain models, most collections are in fact one-to-many associations with <literal>inverse=\"true\"</literal>. For these associations, the update is handled by the many-to-one end of the association, and so considerations of collection update performance simply do not apply."
msgstr ""
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr ""
#. Tag: para
+#: performance.xml:1354
#, no-c-format
msgid "There is a particular case, however, in which bags, and also lists, are much more performant than sets. For a collection with <literal>inverse=\"true\"</literal>, the standard bidirectional one-to-many relationship idiom, for example, we can add elements to a bag or list without needing to initialize (fetch) the bag elements. This is because, unlike a <literal>set</literal>, <literal>Collection.add()</literal> or <literal>Collection.addAll()</literal> must always return true for a bag or <literal>List</literal>. This can make the following common code much faster:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1365
+#, no-c-format
+msgid ""
+ "Parent p = (Parent) sess.load(Parent.class, id);\n"
+ "Child c = new Child();\n"
+ "c.setParent(p);\n"
+ "p.getChildren().add(c); //no need to fetch the collection!\n"
+ "sess.flush();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr ""
#. Tag: para
+#: performance.xml:1371
#, no-c-format
msgid "Deleting collection elements one by one can sometimes be extremely inefficient. Hibernate knows not to do that in the case of an newly-empty collection (if you called <literal>list.clear()</literal>, for example). In this case, Hibernate will issue a single <literal>DELETE</literal>."
msgstr ""
#. Tag: para
+#: performance.xml:1377
#, no-c-format
msgid "Suppose you added a single element to a collection of size twenty and then remove two elements. Hibernate will issue one <literal>INSERT</literal> statement and two <literal>DELETE</literal> statements, unless the collection is a bag. This is certainly desirable."
msgstr ""
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid "However, suppose that we remove eighteen elements, leaving two and then add thee new elements. There are two possible ways to proceed"
msgstr ""
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr ""
#. Tag: para
+#: performance.xml:1394
#, no-c-format
msgid "remove the whole collection in one SQL <literal>DELETE</literal> and insert all five current elements one by one"
msgstr ""
#. Tag: para
+#: performance.xml:1400
#, no-c-format
msgid "Hibernate cannot know that the second option is probably quicker. It would probably be undesirable for Hibernate to be that intuitive as such behavior might confuse database triggers, etc."
msgstr ""
#. Tag: para
+#: performance.xml:1404
#, no-c-format
msgid "Fortunately, you can force this behavior (i.e. the second strategy) at any time by discarding (i.e. dereferencing) the original collection and returning a newly instantiated collection with all the current elements."
msgstr ""
#. Tag: para
+#: performance.xml:1409
#, no-c-format
msgid "One-shot-delete does not apply to collections mapped <literal>inverse=\"true\"</literal>."
msgstr ""
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr ""
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid "Optimization is not much use without monitoring and access to performance numbers. Hibernate provides a full range of figures about its internal operations. Statistics in Hibernate are available per <literal>SessionFactory</literal>."
msgstr ""
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr ""
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid "You can access <literal>SessionFactory</literal> metrics in two ways. Your first option is to call <literal>sessionFactory.getStatistics()</literal> and read or display the <literal>Statistics</literal> yourself."
msgstr ""
#. Tag: para
+#: performance.xml:1430
#, no-c-format
msgid "Hibernate can also use JMX to publish metrics if you enable the <literal>StatisticsService</literal> MBean. You can enable a single MBean for all your <literal>SessionFactory</literal> or one per factory. See the following code for minimalistic configuration examples:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1435
+#, no-c-format
+msgid ""
+ "// MBean service registration for a specific SessionFactory\n"
+ "Hashtable tb = new Hashtable();\n"
+ "tb.put(\"type\", \"statistics\");\n"
+ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+ "\n"
+ "StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+ "stats.setSessionFactory(sessionFactory); // Bind the stats to a SessionFactory\n"
+ "server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, no-c-format
+msgid ""
+ "// MBean service registration for all SessionFactory's\n"
+ "Hashtable tb = new Hashtable();\n"
+ "tb.put(\"type\", \"statistics\");\n"
+ "tb.put(\"sessionFactory\", \"all\");\n"
+ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+ "\n"
+ "StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+ "server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1439
#, no-c-format
msgid "You can activate and deactivate the monitoring for a <literal>SessionFactory</literal>:"
msgstr ""
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid "at configuration time, set <literal>hibernate.generate_statistics</literal> to <literal>false</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid "at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> or <literal>hibernateStatsBean.setStatisticsEnabled(true)</literal>"
msgstr ""
#. Tag: para
+#: performance.xml:1458
#, no-c-format
msgid "Statistics can be reset programmatically using the <literal>clear()</literal> method. A summary can be sent to a logger (info level) using the <literal>logSummary()</literal> method."
msgstr ""
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr ""
#. Tag: para
+#: performance.xml:1466
#, no-c-format
msgid "Hibernate provides a number of metrics, from basic information to more specialized information that is only relevant in certain scenarios. All available counters are described in the <literal>Statistics</literal> interface API, in three categories:"
msgstr ""
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid "Metrics related to the general <literal>Session</literal> usage, such as number of open sessions, retrieved JDBC connections, etc."
msgstr ""
#. Tag: para
+#: performance.xml:1479
#, no-c-format
msgid "Metrics related to the entities, collections, queries, and caches as a whole (aka global metrics)."
msgstr ""
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid "Detailed metrics related to a particular entity, collection, query or cache region."
msgstr ""
#. Tag: para
+#: performance.xml:1489
#, no-c-format
msgid "For example, you can check the cache hit, miss, and put ratio of entities, collections and queries, and the average time a query needs. Be aware that the number of milliseconds is subject to approximation in Java. Hibernate is tied to the JVM precision and on some platforms this might only be accurate to 10 seconds."
msgstr ""
#. Tag: para
+#: performance.xml:1495
#, no-c-format
msgid "Simple getters are used to access the global metrics (i.e. not tied to a particular entity, collection, cache region, etc.). You can access the metrics of a particular entity, collection or cache region through its name, and through its HQL or SQL representation for queries. Please refer to the <literal>Statistics</literal>, <literal>EntityStatistics</literal>, <literal>CollectionStatistics</literal>, <literal>SecondLevelCacheStatistics</literal>, and <literal>QueryStatistics</literal> API Javadoc for more information. The following code is a simple example:"
msgstr ""
+#. Tag: programlisting
+#: performance.xml:1506
+#, no-c-format
+msgid ""
+ "Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+ "\n"
+ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+ "double queryCacheHitRatio =\n"
+ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+ "\n"
+ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+ "\n"
+ "EntityStatistics entityStats =\n"
+ " stats.getEntityStatistics( Cat.class.getName() );\n"
+ "long changes =\n"
+ " entityStats.getInsertCount()\n"
+ " + entityStats.getUpdateCount()\n"
+ " + entityStats.getDeleteCount();\n"
+ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1508
#, no-c-format
msgid "You can work on all entities, collections, queries and region caches, by retrieving the list of names of entities, collections, queries and region caches using the following methods: <literal>getQueries()</literal>, <literal>getEntityNames()</literal>, <literal>getCollectionRoleNames()</literal>, and <literal>getSecondLevelCacheRegionNames()</literal>."
msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/persistent_classes.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/persistent_classes.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/persistent_classes.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,283 +1,762 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:34
#, no-c-format
-msgid "Persistent classes are classes in an application that implement the entities of the business problem (e.g. Customer and Order in an E-commerce application). Not all instances of a persistent class are considered to be in the persistent state. For example, an instance can instead be transient or detached."
+msgid "Persistent classes are classes in an application that implement the entities of the business problem (e.g. Customer and Order in an E-commerce application). The term \"persistent\" here means that the classes are able to be persisted, not that they are in the persistent state (see <xref linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:41
#, no-c-format
-msgid "Hibernate works best if these classes follow some simple rules, also known as the Plain Old Java Object (POJO) programming model. However, none of these rules are hard requirements. Indeed, Hibernate3 assumes very little about the nature of your persistent objects. You can express a domain model in other ways (using trees of <literal>Map</literal> instances, for example)."
+msgid "Hibernate works best if these classes follow some simple rules, also known as the Plain Old Java Object (POJO) programming model. However, none of these rules are hard requirements. Indeed, Hibernate assumes very little about the nature of your persistent objects. You can express a domain model in other ways (using trees of <interfacename>java.util.Map</interfacename> instances, for example)."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
#, no-c-format
-msgid "Most Java applications require a persistent class representing felines. For example:"
+msgid "Simple POJO representing a cat"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:53
+#, no-c-format
+msgid ""
+ "package eg;\n"
+ "import java.util.Set;\n"
+ "import java.util.Date;\n"
+ "\n"
+ "public class Cat {\n"
+ "private Long id; // identifier\n"
+ "\n"
+ "private Date birthdate;\n"
+ "private Color color;\n"
+ "private char sex;\n"
+ "private float weight;\n"
+ " private int litterId;\n"
+ "\n"
+ " private Cat mother;\n"
+ " private Set kittens = new HashSet();\n"
+ "\n"
+ " private void setId(Long id) {\n"
+ " this.id=id;\n"
+ " }\n"
+ " public Long getId() {\n"
+ " return id;\n"
+ " }\n"
+ "\n"
+ " void setBirthdate(Date date) {\n"
+ " birthdate = date;\n"
+ " }\n"
+ " public Date getBirthdate() {\n"
+ " return birthdate;\n"
+ " }\n"
+ "\n"
+ " void setWeight(float weight) {\n"
+ " this.weight = weight;\n"
+ " }\n"
+ " public float getWeight() {\n"
+ " return weight;\n"
+ " }\n"
+ "\n"
+ " public Color getColor() {\n"
+ " return color;\n"
+ " }\n"
+ " void setColor(Color color) {\n"
+ " this.color = color;\n"
+ " }\n"
+ "\n"
+ " void setSex(char sex) {\n"
+ " this.sex=sex;\n"
+ " }\n"
+ " public char getSex() {\n"
+ " return sex;\n"
+ " }\n"
+ "\n"
+ " void setLitterId(int id) {\n"
+ " this.litterId = id;\n"
+ " }\n"
+ " public int getLitterId() {\n"
+ " return litterId;\n"
+ " }\n"
+ "\n"
+ " void setMother(Cat mother) {\n"
+ " this.mother = mother;\n"
+ " }\n"
+ " public Cat getMother() {\n"
+ " return mother;\n"
+ " }\n"
+ " void setKittens(Set kittens) {\n"
+ " this.kittens = kittens;\n"
+ " }\n"
+ " public Set getKittens() {\n"
+ " return kittens;\n"
+ " }\n"
+ "\n"
+ " // addKitten not needed by Hibernate\n"
+ " public void addKitten(Cat kitten) {\n"
+ " kitten.setMother(this);\n"
+ " kitten.setLitterId( kittens.size() );\n"
+ " kittens.add(kitten);\n"
+ " }\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
msgid "The four main rules of persistent classes are explored in more detail in the following sections."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:64
#, no-c-format
-msgid "<literal>Cat</literal> has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using <literal>Constructor.newInstance()</literal>. It is recommended that you have a default constructor with at least <emphasis>package</emphasis> visibility for runtime proxy generation in Hibernate."
+msgid "<classname>Cat</classname> has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using <literal><classname>java.lang.reflect.Constructor</classname>.newInstance()</literal>. It is recommended that this constructor be defined with at least <emphasis>package</emphasis> visibility in order for runtime proxy generation to work properly."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:74
#, no-c-format
-msgid "Provide an identifier property (optional)"
+msgid "Provide an identifier property"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:77
#, no-c-format
-msgid "<literal>Cat</literal> has a property called <literal>id</literal>. This property maps to the primary key column of a database table. The property might have been called anything, and its type might have been any primitive type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or <literal>java.util.Date</literal>. If your legacy database table has composite keys, you can use a user-defined class with properties of these types (see the section on composite identifiers later in the chapter.)"
+msgid "Historically this was considered option. While still not (yet) enforced, this should be considered a deprecated feature as it will be completely required to provide a identifier property in an upcoming release."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
-msgid "The identifier property is strictly optional. You can leave them off and let Hibernate keep track of object identifiers internally. We do not recommend this, however."
+msgid "<classname>Cat</classname> has a property named <literal>id</literal>. This property maps to the primary key column(s) of the underlying database table. The type of the identifier property can be any \"basic\" type (see <xref linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:92
#, no-c-format
-msgid "In fact, some functionality is available only to classes that declare an identifier property:"
+msgid "Identifiers do not necessarily need to identify column(s) in the database physically defined as a primary key. They should just identify columns that can be used to uniquely identify rows in the underlying table."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:99
#, no-c-format
-msgid "Transitive reattachment for detached objects (cascade update or cascade merge) - see <xref linkend=\"objectstate-transitive\" />"
+msgid "We recommend that you declare consistently-named identifier properties on persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:107
#, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
+msgid "Prefer non-final classes (semi-optional)"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
-msgid "<literal>Session.merge()</literal>"
+msgid "A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), depends upon the persistent class being either non-final, or the implementation of an interface that declares all public methods. You can persist <literal>final</literal> classes that do not implement an interface with Hibernate; you will not, however, be able to use proxies for lazy association fetching which will ultimately limit your options for performance tuning. To persist a <literal>final</literal> class which does not implement a \"full\" interface you must disable proxy generation. See <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/>."
msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:121
#, no-c-format
-msgid "We recommend that you declare consistently-named identifier properties on persistent classes and that you use a nullable (i.e., non-primitive) type."
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:122
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:126
#, no-c-format
-msgid "Prefer non-final classes (optional)"
+msgid "Disabling proxies in annotations"
msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:127
#, no-c-format
-msgid "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon the persistent class being either non-final, or the implementation of an interface that declares all public methods."
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:130
#, no-c-format
-msgid "You can persist <literal>final</literal> classes that do not implement an interface with Hibernate. You will not, however, be able to use proxies for lazy association fetching which will ultimately limit your options for performance tuning."
+msgid "If the <literal>final</literal> class does implement a proper interface, you could alternatively tell Hibernate to use the interface instead when generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-final-example-proxy-interface-ann\"/>."
msgstr ""
+#. Tag: title
+#: persistent_classes.xml:139
+#, no-c-format
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:144
+#, no-c-format
+msgid "Proxying an interface in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:145
+#, no-c-format
+msgid "<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements ICat { ... }]]>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:148
#, no-c-format
-msgid "You should also avoid declaring <literal>public final</literal> methods on the non-final classes. If you want to use a class with a <literal>public final</literal> method, you must explicitly disable proxying by setting <literal>lazy=\"false\"</literal>."
+msgid "You should also avoid declaring <literal>public final</literal> methods as this will again limit the ability to generate <emphasis>proxies</emphasis> from this class. If you want to use a class with <literal>public final</literal> methods, you must explicitly disable proxying. Again, see <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/>."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:160
#, no-c-format
-msgid "<literal>Cat</literal> declares accessor methods for all its persistent fields. Many other ORM tools directly persist instance variables. It is better to provide an indirection between the relational schema and internal data structures of the class. By default, Hibernate persists JavaBeans style properties and recognizes method names of the form <literal>getFoo</literal>, <literal>isFoo</literal> and <literal>setFoo</literal>. If required, you can switch to direct field access for particular properties."
+msgid "<classname>Cat</classname> declares accessor methods for all its persistent fields. Many other ORM tools directly persist instance variables. It is better to provide an indirection between the relational schema and internal data structures of the class. By default, Hibernate persists JavaBeans style properties and recognizes method names of the form <literal>getFoo</literal>, <literal>isFoo</literal> and <literal>setFoo</literal>. If required, you can switch to direct field access for particular properties."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:169
#, no-c-format
-msgid "Properties need <emphasis>not</emphasis> be declared public - Hibernate can persist a property with a default, <literal>protected</literal> or <literal>private</literal> get / set pair."
+msgid "Properties need <emphasis>not</emphasis> be declared public. Hibernate can persist a property declared with <literal>package</literal>, <literal>protected</literal> or <literal>private</literal> visibility as well."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:180
#, no-c-format
msgid "A subclass must also observe the first and second rules. It inherits its identifier property from the superclass, <literal>Cat</literal>. For example:"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, no-c-format
+msgid ""
+ "package eg;\n"
+ "\n"
+ "public class DomesticCat extends Cat {\n"
+ " private String name;\n"
+ "\n"
+ " public String getName() {\n"
+ " return name;\n"
+ " }\n"
+ " protected void setName(String name) {\n"
+ " this.name=name;\n"
+ " }\n"
+ "}"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:188
#, no-c-format
msgid "Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:191
#, no-c-format
msgid "You have to override the <literal>equals()</literal> and <literal>hashCode()</literal> methods if you:"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:196
#, no-c-format
msgid "intend to put instances of persistent classes in a <literal>Set</literal> (the recommended way to represent many-valued associations); <emphasis>and</emphasis>"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:206
#, no-c-format
msgid "Hibernate guarantees equivalence of persistent identity (database row) and Java identity only inside a particular session scope. When you mix instances retrieved in different sessions, you must implement <literal>equals()</literal> and <literal>hashCode()</literal> if you wish to have meaningful semantics for <literal>Set</literal>s."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:212
#, no-c-format
msgid "The most obvious way is to implement <literal>equals()</literal>/<literal>hashCode()</literal> by comparing the identifier value of both objects. If the value is the same, both must be the same database row, because they are equal. If both are added to a <literal>Set</literal>, you will only have one element in the <literal>Set</literal>). Unfortunately, you cannot use that approach with generated identifiers. Hibernate will only assign identifier values to objects that are persistent; a newly created instance will not have any identifier value. Furthermore, if an instance is unsaved and currently in a <literal>Set</literal>, saving it will assign an identifier value to the object. If <literal>equals()</literal> and <literal>hashCode()</literal> are based on the identifier value, the hash code would change, breaking the contract of the <literal>Set</literal>. See the Hibernate website for a full discussion of this problem. This is not a Hibernate issue, but normal Ja!
va semantics of object identity and equality."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:228
#, no-c-format
msgid "It is recommended that you implement <literal>equals()</literal> and <literal>hashCode()</literal> using <emphasis>Business key equality</emphasis>. Business key equality means that the <literal>equals()</literal> method compares only the properties that form the business key. It is a key that would identify our instance in the real world (a <emphasis>natural</emphasis> candidate key):"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:235
+#, no-c-format
+msgid ""
+ "public class Cat {\n"
+ "\n"
+ " ...\n"
+ " public boolean equals(Object other) {\n"
+ " if (this == other) return true;\n"
+ " if ( !(other instanceof Cat) ) return false;\n"
+ "\n"
+ " final Cat cat = (Cat) other;\n"
+ "\n"
+ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+ "\n"
+ " return true;\n"
+ " }\n"
+ "\n"
+ " public int hashCode() {\n"
+ " int result;\n"
+ " result = getMother().hashCode();\n"
+ " result = 29 * result + getLitterId();\n"
+ " return result;\n"
+ " }\n"
+ "\n"
+ "}"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:237
#, no-c-format
-msgid "A business key does not have to be as solid as a database primary key candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable or unique properties are usually good candidates for a business key."
+msgid "A business key does not have to be as solid as a database primary key candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable or unique properties are usually good candidates for a business key."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr ""
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr ""
-#. Tag: para
+#. Tag: emphasis
+#: persistent_classes.xml:249
#, no-c-format
-msgid "<emphasis>The following features are currently considered experimental and may change in the near future.</emphasis>"
+msgid "The following features are currently considered experimental and may change in the near future."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:253
#, no-c-format
msgid "Persistent entities do not necessarily have to be represented as POJO classes or as JavaBean objects at runtime. Hibernate also supports dynamic models (using <literal>Map</literal>s of <literal>Map</literal>s at runtime) and the representation of entities as DOM4J trees. With this approach, you do not write persistent classes, only mapping files."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:259
#, no-c-format
-msgid "By default, Hibernate works in normal POJO mode. You can set a default entity representation mode for a particular <literal>SessionFactory</literal> using the <literal>default_entity_mode</literal> configuration option (see <xref linkend=\"configuration-optional-properties\" />)."
+msgid "By default, Hibernate works in normal POJO mode. You can set a default entity representation mode for a particular <literal>SessionFactory</literal> using the <literal>default_entity_mode</literal> configuration option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:265
#, no-c-format
msgid "The following examples demonstrate the representation using <literal>Map</literal>s. First, in the mapping file an <literal>entity-name</literal> has to be declared instead of, or in addition to, a class name:"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ "\n"
+ " <class entity-name=\"Customer\">\n"
+ "\n"
+ " <id name=\"id\"\n"
+ " type=\"long\"\n"
+ " column=\"ID\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ "\n"
+ " <property name=\"name\"\n"
+ " column=\"NAME\"\n"
+ " type=\"string\"/>\n"
+ "\n"
+ " <property name=\"address\"\n"
+ " column=\"ADDRESS\"\n"
+ " type=\"string\"/>\n"
+ "\n"
+ " <many-to-one name=\"organization\"\n"
+ " column=\"ORGANIZATION_ID\"\n"
+ " class=\"Organization\"/>\n"
+ "\n"
+ " <bag name=\"orders\"\n"
+ " inverse=\"true\"\n"
+ " lazy=\"false\"\n"
+ " cascade=\"all\">\n"
+ " <key column=\"CUSTOMER_ID\"/>\n"
+ " <one-to-many class=\"Order\"/>\n"
+ " </bag>\n"
+ "\n"
+ " </class>\n"
+ " \n"
+ "</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:272
#, no-c-format
msgid "Even though associations are declared using target class names, the target type of associations can also be a dynamic entity instead of a POJO."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:276
#, no-c-format
msgid "After setting the default entity mode to <literal>dynamic-map</literal> for the <literal>SessionFactory</literal>, you can, at runtime, work with <literal>Map</literal>s of <literal>Map</literal>s:"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, no-c-format
+msgid ""
+ "Session s = openSession();\n"
+ "Transaction tx = s.beginTransaction();\n"
+ "\n"
+ "// Create a customer\n"
+ "Map david = new HashMap();\n"
+ "david.put(\"name\", \"David\");\n"
+ "\n"
+ "// Create an organization\n"
+ "Map foobar = new HashMap();\n"
+ "foobar.put(\"name\", \"Foobar Inc.\");\n"
+ "\n"
+ "// Link both\n"
+ "david.put(\"organization\", foobar);\n"
+ "\n"
+ "// Save both\n"
+ "s.save(\"Customer\", david);\n"
+ "s.save(\"Organization\", foobar);\n"
+ "\n"
+ "tx.commit();\n"
+ "s.close();"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:283
#, no-c-format
msgid "One of the main advantages of dynamic mapping is quick turnaround time for prototyping, without the need for entity class implementation. However, you lose compile-time type checking and will likely deal with many exceptions at runtime. As a result of the Hibernate mapping, the database schema can easily be normalized and sound, allowing to add a proper domain model implementation on top later on."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
msgid "Entity representation modes can also be set on a per <literal>Session</literal> basis:"
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, no-c-format
+msgid ""
+ "Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+ "\n"
+ "// Create a customer\n"
+ "Map david = new HashMap();\n"
+ "david.put(\"name\", \"David\");\n"
+ "dynamicSession.save(\"Customer\", david);\n"
+ "...\n"
+ "dynamicSession.flush();\n"
+ "dynamicSession.close()\n"
+ "...\n"
+ "// Continue on pojoSession"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:295
#, no-c-format
msgid "Please note that the call to <literal>getSession()</literal> using an <literal>EntityMode</literal> is on the <literal>Session</literal> API, not the <literal>SessionFactory</literal>. That way, the new <literal>Session</literal> shares the underlying JDBC connection, transaction, and other context information. This means you do not have to call <literal>flush()</literal> and <literal>close()</literal> on the secondary <literal>Session</literal>, and also leave the transaction and connection handling to the primary unit of work."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:304
#, no-c-format
-msgid "More information about the XML representation capabilities can be found in <xref linkend=\"xml\" />."
+msgid "More information about the XML representation capabilities can be found in <xref linkend=\"xml\"/>."
msgstr ""
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:312
#, no-c-format
-msgid "<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO through its constructor. It also knows how to access the POJO properties using the defined property accessors."
+msgid "<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-interfaces are responsible for managing a particular representation of a piece of data given that representation's <classname>org.hibernate.EntityMode</classname>. If a given piece of data is thought of as a data structure, then a tuplizer is the thing that knows how to create such a data structure, how to extract values from such a data structure and how to inject values into such a data structure. For example, for the POJO entity mode, the corresponding tuplizer knows how create the POJO through its constructor. It also knows how to access the POJO properties using the defined property accessors."
msgstr ""
#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
-msgid "There are two high-level types of Tuplizers, represented by the <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate.tuple.component.ComponentTuplizer</literal> interfaces. <literal>EntityTuplizer</literal>s are responsible for managing the above mentioned contracts in regards to entities, while <literal>ComponentTuplizer</literal>s do the same for components."
+msgid "There are two (high-level) types of Tuplizers:"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:326
#, no-c-format
-msgid "Users can also plug in their own tuplizers. Perhaps you require that a <literal>java.util.Map</literal> implementation other than <literal>java.util.HashMap</literal> be used while in the dynamic-map entity-mode. Or perhaps you need to define a different proxy generation strategy than the one used by default. Both would be achieved by defining a custom tuplizer implementation. Tuplizer definitions are attached to the entity or component mapping they are meant to manage. Going back to the example of our customer entity:"
+msgid "<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> which is responsible for managing the above mentioned contracts in regards to entities"
msgstr ""
+#. Tag: para
+#: persistent_classes.xml:332
+#, no-c-format
+msgid "<interfacename>org.hibernate.tuple.component.ComponentTuplizer</interfacename> which does the same for components"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:340
+#, no-c-format
+msgid "Users can also plug in their own tuplizers. Perhaps you require that <interfacename>java.util.Map</interfacename> implementation other than <classname>java.util.HashMap</classname> be used while in the dynamic-map entity-mode. Or perhaps you need to define a different proxy generation strategy than the one used by default. Both would be achieved by defining a custom tuplizer implementation. Tuplizer definitions are attached to the entity or component mapping they are meant to manage. Going back to the example of our <classname>Customer</classname> entity, <xref linkend=\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom <interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml\"/> shows how to do the same in <literal>hbm.xml</literal>"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:353
#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+ " @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+ " public Country getCountry();\n"
+ " public void setCountry(Country country);\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+ "<hibernate-mapping>\n"
+ " <class entity-name=\"Customer\">\n"
+ " <!--\n"
+ " Override the dynamic-map entity-mode\n"
+ " tuplizer for the customer entity\n"
+ " -->\n"
+ " <tuplizer entity-mode=\"dynamic-map\"\n"
+ " class=\"CustomMapTuplizerImpl\"/>\n"
+ "\n"
+ " <id name=\"id\" type=\"long\" column=\"ID\">\n"
+ " <generator class=\"sequence\"/>\n"
+ " </id>\n"
+ "\n"
+ " <!-- other properties -->\n"
+ " ...\n"
+ " </class>\n"
+ "</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
+#, no-c-format
msgid "EntityNameResolvers"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:365
#, no-c-format
-msgid "The <interfacename>org.hibernate.EntityNameResolver</interfacename> interface is a contract for resolving the entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname> which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and would indicate that the resolver does not know how to resolve the entity name of the given entity instance). Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The hibernate test suite has an example of this exact style of usage under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package for illustration."
+msgid "<interfacename>org.hibernate.EntityNameResolver</interfacename> is a contract for resolving the entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname> which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and would indicate that the resolver does not know how to resolve the entity name of the given entity instance). Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The hibernate test suite has an example of this exact style of usage under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package for illustration."
msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, no-c-format
+msgid ""
+ "/**\n"
+ " * A very trivial JDK Proxy InvocationHandler implementation where we proxy an\n"
+ " * interface as the domain model and simply store persistent state in an internal\n"
+ " * Map. This is an extremely trivial example meant only for illustration.\n"
+ " */\n"
+ "public final class DataProxyHandler implements InvocationHandler {\n"
+ " private String entityName;\n"
+ " private HashMap data = new HashMap();\n"
+ "\n"
+ " public DataProxyHandler(String entityName, Serializable id) {\n"
+ " this.entityName = entityName;\n"
+ " data.put( \"Id\", id );\n"
+ " }\n"
+ "\n"
+ " public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n"
+ " String methodName = method.getName();\n"
+ " if ( methodName.startsWith( \"set\" ) ) {\n"
+ " String propertyName = methodName.substring( 3 );\n"
+ " data.put( propertyName, args[0] );\n"
+ " }\n"
+ " else if ( methodName.startsWith( \"get\" ) ) {\n"
+ " String propertyName = methodName.substring( 3 );\n"
+ " return data.get( propertyName );\n"
+ " }\n"
+ " else if ( \"toString\".equals( methodName ) ) {\n"
+ " return entityName + \"#\" + data.get( \"Id\" );\n"
+ " }\n"
+ " else if ( \"hashCode\".equals( methodName ) ) {\n"
+ " return new Integer( this.hashCode() );\n"
+ " }\n"
+ " return null;\n"
+ " }\n"
+ "\n"
+ " public String getEntityName() {\n"
+ " return entityName;\n"
+ " }\n"
+ "\n"
+ " public HashMap getData() {\n"
+ " return data;\n"
+ " }\n"
+ "}\n"
+ "\n"
+ "public class ProxyHelper {\n"
+ " public static String extractEntityName(Object object) {\n"
+ " // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+ " // their appropriate entity name, so we simply extract it from there\n"
+ " // if this represents one of our proxies; otherwise, we return null\n"
+ " if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+ " InvocationHandler handler = Proxy.getInvocationHandler( object );\n"
+ " if ( DataProxyHandler.class.isAssignableFrom( handler.getClass() ) ) {\n"
+ " DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+ " return myHandler.getEntityName();\n"
+ " }\n"
+ " }\n"
+ " return null;\n"
+ " }\n"
+ "\n"
+ " // various other utility methods ....\n"
+ "\n"
+ "}\n"
+ "\n"
+ "/**\n"
+ " * The EntityNameResolver implementation.\n"
+ " *\n"
+ " * IMPL NOTE : An EntityNameResolver really defines a strategy for how entity names\n"
+ " * should be resolved. Since this particular impl can handle resolution for all of our\n"
+ " * entities we want to take advantage of the fact that SessionFactoryImpl keeps these\n"
+ " * in a Set so that we only ever have one instance registered. Why? Well, when it\n"
+ " * comes time to resolve an entity name, Hibernate must iterate over all the registered\n"
+ " * resolvers. So keeping that number down helps that process be as speedy as possible.\n"
+ " * Hence the equals and hashCode implementations as is\n"
+ " */\n"
+ "public class MyEntityNameResolver implements EntityNameResolver {\n"
+ " public static final MyEntityNameResolver INSTANCE = new MyEntityNameResolver();\n"
+ "\n"
+ " public String resolveEntityName(Object entity) {\n"
+ " return ProxyHelper.extractEntityName( entity );\n"
+ " }\n"
+ "\n"
+ " public boolean equals(Object obj) {\n"
+ " return getClass().equals( obj.getClass() );\n"
+ " }\n"
+ "\n"
+ " public int hashCode() {\n"
+ " return getClass().hashCode();\n"
+ " }\n"
+ "}\n"
+ "\n"
+ "public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+ " public MyEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {\n"
+ " super( entityMetamodel, mappedEntity );\n"
+ " }\n"
+ "\n"
+ " public EntityNameResolver[] getEntityNameResolvers() {\n"
+ " return new EntityNameResolver[] { MyEntityNameResolver.INSTANCE };\n"
+ " }\n"
+ "\n"
+ " public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {\n"
+ " String entityName = ProxyHelper.extractEntityName( entityInstance );\n"
+ " if ( entityName == null ) {\n"
+ " entityName = super.determineConcreteSubclassEntityName( entityInstance, factory );\n"
+ " }\n"
+ " return entityName;\n"
+ " }\n"
+ "\n"
+ " ..."
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
msgid "In order to register an <interfacename>org.hibernate.EntityNameResolver</interfacename> users must either:"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:383
#, no-c-format
-msgid "Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</link>, implementing the <methodname>getEntityNameResolvers</methodname> method."
+msgid "Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers\"/>), implementing the <methodname>getEntityNameResolvers</methodname> method"
msgstr ""
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
msgid "Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</classname> (which is the implementation class for <interfacename>org.hibernate.SessionFactory</interfacename>) using the <methodname>registerEntityNameResolver</methodname> method."
msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/preface.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/preface.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/preface.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,84 +1,160 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr ""
#. Tag: para
+#: preface.xml:35
#, no-c-format
-msgid "Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. Hibernate is an Object/Relational Mapping tool for Java environments. The term Object/Relational Mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema."
+msgid "Working with both Object-Oriented software and Relational Databases can be cumbersome and time consuming. Development costs are significantly higher due to a paradigm mismatch between how data is represented in objects versus relational databases. Hibernate is an Object/Relational Mapping solution for Java environments. The term Object/Relational Mapping refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema; see <ulink url=\"http://en.wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/Object-relational_mapping</ulink> for a discussion."
msgstr ""
#. Tag: para
+#: preface.xml:46
#, no-c-format
+msgid "While having a strong background in SQL is not required to use Hibernate, having a basic understanding of the concepts can greatly help you understand Hibernate more fully and quickly. Probably the single best background is an understanding of data modeling principles. You might want to consider these resources as a good starting point:"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:54
+#, no-c-format
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:59
+#, no-c-format
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
+
+#. Tag: para
+#: preface.xml:66
+#, no-c-format
msgid "Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. It can also significantly reduce development time otherwise spent with manual data handling in SQL and JDBC."
msgstr ""
#. Tag: para
+#: preface.xml:72
#, no-c-format
-msgid "Hibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects."
+msgid "Hibernate’s design goal is to relieve the developer from 95% of common data persistence-related programming tasks by eliminating the need for manual, hand-crafted data processing using SQL and JDBC. However, unlike many other persistence solutions, Hibernate does not hide the power of SQL from you and guarantees that your investment in relational technology and knowledge is as valid as always."
msgstr ""
#. Tag: para
+#: preface.xml:79
#, no-c-format
+msgid "Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:88
+#, no-c-format
msgid "If you are new to Hibernate and Object/Relational Mapping or even Java, please follow these steps:"
msgstr ""
#. Tag: para
+#: preface.xml:95
#, no-c-format
-msgid "Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step instructions. The source code for the tutorial is included in the distribution in the <literal>doc/reference/tutorial/</literal> directory."
+msgid "Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step instructions. The source code for the tutorial is included in the distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
#. Tag: para
+#: preface.xml:103
#, no-c-format
-msgid "Read <xref linkend=\"architecture\" /> to understand the environments where Hibernate can be used."
+msgid "Read <xref linkend=\"architecture\"/> to understand the environments where Hibernate can be used."
msgstr ""
#. Tag: para
+#: preface.xml:109
#, no-c-format
msgid "View the <literal>eg/</literal> directory in the Hibernate distribution. It contains a simple standalone application. Copy your JDBC driver to the <literal>lib/</literal> directory and edit <literal>etc/hibernate.properties</literal>, specifying correct values for your database. From a command prompt in the distribution directory, type <literal>ant eg</literal> (using Ant), or under Windows, type <literal>build eg</literal>."
msgstr ""
#. Tag: para
+#: preface.xml:120
#, no-c-format
-msgid "Use this reference documentation as your primary source of information. Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+msgid "Use this reference documentation as your primary source of information. Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and download the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
msgstr ""
#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr ""
#. Tag: para
+#: preface.xml:135
#, no-c-format
msgid "Links to third party demos, examples, and tutorials are maintained on the Hibernate website."
msgstr ""
#. Tag: para
+#: preface.xml:141
#, no-c-format
msgid "The Community Area on the Hibernate website is a good resource for design patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, etc.)."
msgstr ""
#. Tag: para
+#: preface.xml:149
#, no-c-format
-msgid "If you have questions, use the user forum linked on the Hibernate website. We also provide a JIRA issue tracking system for bug reports and feature requests. If you are interested in the development of Hibernate, join the developer mailing list. If you are interested in translating this documentation into your language, contact us on the developer mailing list."
+msgid "There are a number of ways to become involved in the Hibernate community, including"
msgstr ""
#. Tag: para
+#: preface.xml:153
#, no-c-format
-msgid "Commercial development support, production support, and training for Hibernate is available through JBoss Inc. (see http://www.hibernate.org/SupportTraining/). Hibernate is a Professional Open Source project and a critical component of the JBoss Enterprise Middleware System (JEMS) suite of products."
+msgid "Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
msgstr ""
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid "Trying your hand at fixing some bugs or implementing enhancements. Again, see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid "<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid "There are forums for users to ask questions and receive help from the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid "There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid "Helping improve or translate this documentation. Contact us on the developer mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
+
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/query_sql.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/query_sql.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/query_sql.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,594 +1,1504 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr ""
#. Tag: para
+#: query_sql.xml:33
#, no-c-format
msgid "You can also express queries in the native SQL dialect of your database. This is useful if you want to utilize database-specific features such as query hints or the <literal>CONNECT</literal> keyword in Oracle. It also provides a clean migration path from a direct SQL/JDBC based application to Hibernate."
msgstr ""
#. Tag: para
+#: query_sql.xml:39
#, no-c-format
msgid "Hibernate3 allows you to specify handwritten SQL, including stored procedures, for all create, update, delete, and load operations."
msgstr ""
#. Tag: title
+#: query_sql.xml:43
#, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr ""
#. Tag: para
+#: query_sql.xml:45
#, no-c-format
msgid "Execution of native SQL queries is controlled via the <literal>SQLQuery</literal> interface, which is obtained by calling <literal>Session.createSQLQuery()</literal>. The following sections describe how to use this API for querying."
msgstr ""
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr ""
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:56
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:58
#, no-c-format
msgid "These will return a List of Object arrays (Object[]) with scalar values for each column in the CATS table. Hibernate will use ResultSetMetadata to deduce the actual order and types of the returned scalar values."
msgstr ""
#. Tag: para
+#: query_sql.xml:63
#, no-c-format
msgid "To avoid the overhead of using <literal>ResultSetMetadata</literal>, or simply to be more explicit in what is returned, one can use <literal>addScalar()</literal>:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:67
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+ " .addScalar(\"ID\", Hibernate.LONG)\n"
+ " .addScalar(\"NAME\", Hibernate.STRING)\n"
+ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr ""
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr ""
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr ""
#. Tag: para
+#: query_sql.xml:81
#, no-c-format
msgid "This will return Object arrays, but now it will not use <literal>ResultSetMetadata</literal> but will instead explicitly get the ID, NAME and BIRTHDATE column as respectively a Long, String and a Short from the underlying resultset. This also means that only these three columns will be returned, even though the query is using <literal>*</literal> and could return more than the three listed columns."
msgstr ""
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
msgid "It is possible to leave out the type information for all or some of the scalars."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:92
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+ " .addScalar(\"ID\", Hibernate.LONG)\n"
+ " .addScalar(\"NAME\")\n"
+ " .addScalar(\"BIRTHDATE\")"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:94
#, no-c-format
msgid "This is essentially the same query as before, but now <literal>ResultSetMetaData</literal> is used to determine the type of NAME and BIRTHDATE, where as the type of ID is explicitly specified."
msgstr ""
#. Tag: para
+#: query_sql.xml:99
#, no-c-format
msgid "How the java.sql.Types returned from ResultSetMetaData is mapped to Hibernate types is controlled by the Dialect. If a specific type is not mapped, or does not result in the expected type, it is possible to customize it via calls to <literal>registerHibernateType</literal> in the Dialect."
msgstr ""
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr ""
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
msgid "The above queries were all about returning scalar values, basically returning the \"raw\" values from the resultset. The following shows how to get entity objects from a native sql query via <literal>addEntity()</literal>."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:114
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat.class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr ""
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
msgid "Assuming that Cat is mapped as a class with the columns ID, NAME and BIRTHDATE the above queries will both return a List where each element is a Cat entity."
msgstr ""
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
msgid "If the entity is mapped with a <literal>many-to-one</literal> to another entity it is required to also return this when performing the native query, otherwise a database specific \"column not found\" error will occur. The additional columns will automatically be returned when using the * notation, but we prefer to be explicit as in the following example for a <literal>many-to-one</literal> to a <literal>Dog</literal>:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:140
+#, no-c-format
+msgid "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\").addEntity(Cat.class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr ""
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr ""
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
msgid "It is possible to eagerly join in the <literal>Dog</literal> to avoid the possible extra roundtrip for initializing the proxy. This is done via the <literal>addJoin()</literal> method, which allows you to join in an association or collection."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:153
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ " .addJoin(\"cat.dog\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:155
#, no-c-format
msgid "In this example, the returned <literal>Cat</literal>'s will have their <literal>dog</literal> property fully initialized without any extra roundtrip to the database. Notice that you added an alias name (\"cat\") to be able to specify the target property path of the join. It is possible to do the same eager joining for collections, e.g. if the <literal>Cat</literal> had a one-to-many to <literal>Dog</literal> instead."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:163
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ " .addJoin(\"cat.dogs\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:165
#, no-c-format
msgid "At this stage you are reaching the limits of what is possible with native queries, without starting to enhance the sql queries to make them usable in Hibernate. Problems can arise when returning multiple entities of the same type or when the default alias/column names are not enough."
msgstr ""
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr ""
#. Tag: para
+#: query_sql.xml:175
#, no-c-format
msgid "Until now, the result set column names are assumed to be the same as the column names specified in the mapping document. This can be problematic for SQL queries that join multiple tables, since the same column names can appear in more than one table."
msgstr ""
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
msgid "Column alias injection is needed in the following query (which most likely will fail):"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:183
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID = c.ID\")\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ " .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:185
#, no-c-format
msgid "The query was intended to return two Cat instances per row: a cat and its mother. The query will, however, fail because there is a conflict of names; the instances are mapped to the same column names. Also, on some databases the returned column aliases will most likely be on the form \"c.ID\", \"c.NAME\", etc. which are not equal to the columns specified in the mappings (\"ID\" and \"NAME\")."
msgstr ""
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:195
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE c.MOTHER_ID = c.ID\")\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ " .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
msgid "the SQL query string, with placeholders for Hibernate to inject column aliases"
msgstr ""
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr ""
#. Tag: para
+#: query_sql.xml:210
#, no-c-format
msgid "The {cat.*} and {mother.*} notation used above is a shorthand for \"all properties\". Alternatively, you can list the columns explicitly, but even in this case Hibernate injects the SQL column aliases for each property. The placeholder for a column alias is just the property name qualified by the table alias. In the following example, you retrieve Cats and their mothers from a different table (cat_log) to the one declared in the mapping metadata. You can even use the property aliases in the where clause."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:219
+#, no-c-format
+msgid ""
+ "String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} \" +\n"
+ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+ "\n"
+ "List loggedCats = sess.createSQLQuery(sql)\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ " .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr ""
#. Tag: para
+#: query_sql.xml:224
#, no-c-format
msgid "In most cases the above alias injection is needed. For queries relating to more complex mappings, like composite properties, inheritance discriminators, collections etc., you can use specific aliases that allow Hibernate to inject the proper aliases."
msgstr ""
#. Tag: para
+#: query_sql.xml:229
#, no-c-format
msgid "The following table shows the different ways you can use the alias injection. Please note that the alias names in the result are simply examples; each alias will have a unique and probably different name when used."
msgstr ""
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr ""
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr ""
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr ""
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr ""
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:258
#, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+msgid "{[aliasname].[propertyname]"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:260
#, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
+msgid "A_NAME as {item.name}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:266
#, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:268
#, no-c-format
-msgid "<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</literal>"
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:275
#, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
+msgid "{[aliasname].class}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:277
#, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
+msgid "DISC as {item.class}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
#, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
+msgid "{[aliasname].*}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:285
#, no-c-format
-msgid "<literal>{item.*}</literal>"
+msgid "{item.*}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:291
#, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
+msgid "{[aliasname].key}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:293
#, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
+msgid "ORGID as {coll.key}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:299
#, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
+msgid "{[aliasname].id}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:301
#, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
+msgid "EMPID as {coll.id}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:307
#, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
+msgid "{[aliasname].element}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:309
#, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
+msgid "XID as {coll.element}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:313
#, no-c-format
msgid "property of the element in the collection"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:315
#, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+msgid "{[aliasname].element.[propertyname]}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:317
#, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
+msgid "NAME as {coll.element.name}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:323
#, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
+msgid "{[aliasname].element.*}"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:325
#, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
+msgid "{coll.element.*}"
msgstr ""
#. Tag: entry
+#: query_sql.xml:329
#, no-c-format
-msgid "All properties of the the collection"
+msgid "All properties of the collection"
msgstr ""
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:333
#, no-c-format
-msgid "<literal>{coll.*}</literal>"
+msgid "{coll.*}"
msgstr ""
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr ""
#. Tag: para
+#: query_sql.xml:344
#, no-c-format
msgid "It is possible to apply a ResultTransformer to native SQL queries, allowing it to return non-managed entities."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:347
+#, no-c-format
+msgid ""
+ "sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr ""
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
msgid "The above query will return a list of <literal>CatDTO</literal> which has been instantiated and injected the values of NAME and BIRTHNAME into its corresponding properties or fields."
msgstr ""
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr ""
#. Tag: para
+#: query_sql.xml:369
#, no-c-format
msgid "Native SQL queries which query for entities that are mapped as part of an inheritance must include all properties for the baseclass and all its subclasses."
msgstr ""
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr ""
#. Tag: para
+#: query_sql.xml:377
#, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:380
+#, no-c-format
+msgid ""
+ "Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\").addEntity(Cat.class);\n"
+ "List pusList = query.setString(0, \"Pus%\").list();\n"
+ " \n"
+ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\").addEntity(Cat.class);\n"
+ "List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr ""
#. Tag: para
+#: query_sql.xml:387
#, no-c-format
-msgid "Named SQL queries can be defined in the mapping document and called in exactly the same way as a named HQL query. In this case, you do <emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
+msgid "Named SQL queries can also be defined in the mapping document and called in exactly the same way as a named HQL query (see <xref linkend=\"objectstate-querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
msgstr ""
+#. Tag: title
+#: query_sql.xml:394
+#, no-c-format
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:397
+#, no-c-format
+msgid ""
+ "<sql-query name=\"persons\">\n"
+ " <return alias=\"person\" class=\"eg.Person\"/>\n"
+ " SELECT person.NAME AS {person.name},\n"
+ " person.AGE AS {person.age},\n"
+ " person.SEX AS {person.sex}\n"
+ " FROM PERSON person\n"
+ " WHERE person.NAME LIKE :namePattern\n"
+ "</sql-query>"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, no-c-format
+msgid ""
+ "List people = sess.getNamedQuery(\"persons\")\n"
+ " .setString(\"namePattern\", namePattern)\n"
+ " .setMaxResults(50)\n"
+ " .list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:406
#, no-c-format
msgid "The <literal><return-join></literal> element is use to join associations and the <literal><load-collection></literal> element is used to define queries which initialize collections,"
msgstr ""
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, no-c-format
+msgid ""
+ "<sql-query name=\"personsWith\">\n"
+ " <return alias=\"person\" class=\"eg.Person\"/>\n"
+ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
+ " SELECT person.NAME AS {person.name},\n"
+ " person.AGE AS {person.age},\n"
+ " person.SEX AS {person.sex},\n"
+ " address.STREET AS {address.street},\n"
+ " address.CITY AS {address.city},\n"
+ " address.STATE AS {address.state},\n"
+ " address.ZIP AS {address.zip}\n"
+ " FROM PERSON person\n"
+ " JOIN ADDRESS address\n"
+ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+ " WHERE person.NAME LIKE :namePattern\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
msgid "A named SQL query may return a scalar value. You must declare the column alias and Hibernate type using the <literal><return-scalar></literal> element:"
msgstr ""
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, no-c-format
+msgid ""
+ "<sql-query name=\"mySqlQuery\">\n"
+ " <return-scalar column=\"name\" type=\"string\"/>\n"
+ " <return-scalar column=\"age\" type=\"long\"/>\n"
+ " SELECT p.NAME AS name, \n"
+ " p.AGE AS age,\n"
+ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:426
#, no-c-format
msgid "You can externalize the resultset mapping information in a <literal><resultset></literal> element which will allow you to either reuse them across several named queries or through the <literal>setResultSetMapping()</literal> API."
msgstr ""
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, no-c-format
+msgid ""
+ "<resultset name=\"personAddress\">\n"
+ " <return alias=\"person\" class=\"eg.Person\"/>\n"
+ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
+ "</resultset>\n"
+ "\n"
+ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+ " SELECT person.NAME AS {person.name},\n"
+ " person.AGE AS {person.age},\n"
+ " person.SEX AS {person.sex},\n"
+ " address.STREET AS {address.street},\n"
+ " address.CITY AS {address.city},\n"
+ " address.STATE AS {address.state},\n"
+ " address.ZIP AS {address.zip}\n"
+ " FROM PERSON person\n"
+ " JOIN ADDRESS address\n"
+ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+ " WHERE person.NAME LIKE :namePattern\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:438
#, no-c-format
msgid "You can, alternatively, use the resultset mapping information in your hbm files directly in java code."
msgstr ""
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, no-c-format
+msgid ""
+ "List cats = sess.createSQLQuery(\n"
+ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten.mother = cat.id\"\n"
+ " )\n"
+ " .setResultSetMapping(\"catAndKitten\")\n"
+ " .list();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid "So far we have only looked at externalizing SQL queries using Hibernate mapping files. The same concept is also available with anntations and is called named native queries. You can use <classname>@NamedNativeQuery</classname> (<classname>@NamedNativeQueries</classname>) in conjunction with <literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</literal>). Like <literal>@NamedQuery</literal>, <classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</literal> can be defined at class level, but their scope is global to the application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid "shows how 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. In the example 2 entities, <literal>Night</literal> and <literal>Area</literal>, are returned and each property is declared and associated to a column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid "In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set mapping is implicit. We only describe the entity class of the result set mapping. The property / column mappings is done using the entity mapping values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid "Finally, 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. This can be seen in <xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid "Named SQL query using <classname>@NamedNativeQuery</classname> together with <classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+ " resultSetMapping=\"joinMapping\")\n"
+ "@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+ " @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@SqlResultSetMapping(name=\"implicit\",\n"
+ " entities=@EntityResult(entityClass=SpaceShip.class))\n"
+ "@NamedNativeQuery(name=\"implicitSample\", \n"
+ " query=\"select * from SpaceShip\", \n"
+ " resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@SqlResultSetMapping(name=\"compositekey\",\n"
+ " entities=@EntityResult(entityClass=SpaceShip.class,\n"
+ " fields = {\n"
+ " @FieldResult(name=\"name\", column = \"name\"),\n"
+ " @FieldResult(name=\"model\", column = \"model\"),\n"
+ " @FieldResult(name=\"speed\", column = \"speed\"),\n"
+ " @FieldResult(name=\"captain.firstname\", column = \"firstn\"),\n"
+ " @FieldResult(name=\"captain.lastname\", column = \"lastn\"),\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"
+ "@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
+#: query_sql.xml:510
+#, no-c-format
+msgid "If you retrieve a single entity using the default mapping, you can specify the <literal>resultClass</literal> attribute instead of <literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+ "@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip\", resultClass=SpaceShip.class)\n"
+ "public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+ "@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension\"))\n"
+ "@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr ""
#. Tag: para
+#: query_sql.xml:538
#, no-c-format
msgid "You can explicitly tell Hibernate what column aliases to use with <literal><return-property></literal>, instead of using the <literal>{}</literal>-syntax to let Hibernate inject its own aliases.For example:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:543
+#, no-c-format
+msgid ""
+ "<sql-query name=\"mySqlQuery\">\n"
+ " <return alias=\"person\" class=\"eg.Person\">\n"
+ " <return-property name=\"name\" column=\"myName\"/>\n"
+ " <return-property name=\"age\" column=\"myAge\"/>\n"
+ " <return-property name=\"sex\" column=\"mySex\"/>\n"
+ " </return>\n"
+ " SELECT person.NAME AS myName,\n"
+ " person.AGE AS myAge,\n"
+ " person.SEX AS mySex,\n"
+ " FROM PERSON person WHERE person.NAME LIKE :name\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:545
#, no-c-format
msgid "<literal><return-property></literal> also works with multiple columns. This solves a limitation with the <literal>{}</literal>-syntax which cannot allow fine grained control of multi-column properties."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:550
+#, no-c-format
+msgid ""
+ "<sql-query name=\"organizationCurrentEmployments\">\n"
+ " <return alias=\"emp\" class=\"Employment\">\n"
+ " <return-property name=\"salary\">\n"
+ " <return-column name=\"VALUE\"/>\n"
+ " <return-column name=\"CURRENCY\"/>\n"
+ " </return-property>\n"
+ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+ " </return>\n"
+ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+ " FROM EMPLOYMENT\n"
+ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+ " ORDER BY STARTDATE ASC\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:552
#, no-c-format
msgid "In this example <literal><return-property></literal> was used in combination with the <literal>{}</literal>-syntax for injection. This allows users to choose how they want to refer column and properties."
msgstr ""
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
msgid "If your mapping has a discriminator you must use <literal><return-discriminator></literal> to specify the discriminator column."
msgstr ""
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr ""
#. Tag: para
+#: query_sql.xml:565
#, no-c-format
msgid "Hibernate3 provides support for queries via stored procedures and functions. Most of the following documentation is equivalent for both. The stored procedure/function must return a resultset as the first out-parameter to be able to work with Hibernate. An example of such a stored function in Oracle 9 and higher is as follows:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:571
+#, no-c-format
+msgid ""
+ "CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+ " RETURN SYS_REFCURSOR\n"
+ "AS\n"
+ " st_cursor SYS_REFCURSOR;\n"
+ "BEGIN\n"
+ " OPEN st_cursor FOR\n"
+ " SELECT EMPLOYEE, EMPLOYER,\n"
+ " STARTDATE, ENDDATE,\n"
+ " REGIONCODE, EID, VALUE, CURRENCY\n"
+ " FROM EMPLOYMENT;\n"
+ " RETURN st_cursor;\n"
+ " END;"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:576
+#, no-c-format
+msgid ""
+ "<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+ " <return alias=\"emp\" class=\"Employment\">\n"
+ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+ " <return-property name=\"id\" column=\"EID\"/>\n"
+ " <return-property name=\"salary\">\n"
+ " <return-column name=\"VALUE\"/>\n"
+ " <return-column name=\"CURRENCY\"/>\n"
+ " </return-property>\n"
+ " </return>\n"
+ " { ? = call selectAllEmployments() }\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:578
#, no-c-format
msgid "Stored procedures currently only return scalars and entities. <literal><return-join></literal> and <literal><load-collection></literal> are not supported."
msgstr ""
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr ""
#. Tag: para
+#: query_sql.xml:585
#, no-c-format
msgid "You cannot use stored procedures with Hibernate unless you follow some procedure/function rules. If they do not follow those rules they are not usable with Hibernate. If you still want to use these procedures you have to execute them via <literal>session.connection()</literal>. The rules are different for each database, since database vendors have different stored procedure semantics/syntax."
msgstr ""
#. Tag: para
+#: query_sql.xml:593
#, no-c-format
msgid "Stored procedure queries cannot be paged with <literal>setFirstResult()/setMaxResults()</literal>."
msgstr ""
#. Tag: para
+#: query_sql.xml:596
#, no-c-format
msgid "The recommended call form is standard SQL92: <literal>{ ? = call functionName(<parameters>) }</literal> or <literal>{ ? = call procedureName(<parameters>}</literal>. Native call syntax is not supported."
msgstr ""
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr ""
#. Tag: para
+#: query_sql.xml:605
#, no-c-format
msgid "A function must return a result set. The first parameter of a procedure must be an <literal>OUT</literal> that returns a result set. This is done by using a <literal>SYS_REFCURSOR</literal> type in Oracle 9 or 10. In Oracle you need to define a <literal>REF CURSOR</literal> type. See Oracle literature for further information."
msgstr ""
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr ""
#. Tag: para
+#: query_sql.xml:618
#, no-c-format
msgid "The procedure must return a result set. Note that since these servers can return multiple result sets and update counts, Hibernate will iterate the results and take the first result that is a result set as its return value. Everything else will be discarded."
msgstr ""
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
msgid "If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it will probably be more efficient, but this is not a requirement."
msgstr ""
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr ""
#. Tag: para
+#: query_sql.xml:638
#, no-c-format
-msgid "Hibernate3 can use custom SQL for create, update, and delete operations. The SQL can be overridden at the statement level or inidividual column level. This section describes statement overrides. For columns, see <xref linkend=\"mapping-column-read-and-write\" />."
+msgid "Hibernate3 can use custom SQL for create, update, and delete operations. The SQL can be overridden at the statement level or inidividual column level. This section describes statement overrides. For columns, see <xref linkend=\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-annotations\"/> shows how to define custom SQL operatons using annotations."
msgstr ""
+#. Tag: title
+#: query_sql.xml:646
+#, no-c-format
+msgid "Custom CRUD via annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:648
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Table(name=\"CHAOS\")\n"
+ "@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"
+ "@Loader(namedQuery = \"chaos\")\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
+#: query_sql.xml:651
#, no-c-format
-msgid "The class and collection persisters in Hibernate already contain a set of configuration time generated strings (insertsql, deletesql, updatesql etc.). The mapping tags <literal><sql-insert></literal>, <literal><sql-delete></literal>, and <literal><sql-update></literal> override these strings:"
+msgid "<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, <literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can be achieved using Hibernate mapping files and the <literal><sql-insert></literal>, <literal><sql-update></literal> and <literal><sql-delete></literal> nodes. This can be seen in <xref linkend=\"example-custom-crdu-via-xml\"/>."
msgstr ""
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
+#, no-c-format
+msgid ""
+ "<class name=\"Person\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"increment\"/>\n"
+ " </id>\n"
+ " <property name=\"name\" not-null=\"true\"/>\n"
+ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</sql-insert>\n"
+ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-update>\n"
+ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:666
#, no-c-format
-msgid "The SQL is directly executed in your database, so you can use any dialect you like. This will reduce the portability of your mapping if you use database specific SQL."
+msgid "If you expect to call a store procedure, be sure to set the <literal>callable</literal> attribute to <constant>true</constant>. In annotations as well as in xml."
msgstr ""
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
-msgid "Stored procedures are supported if the <literal>callable</literal> attribute is set:"
+msgid "To check that the execution happens correctly, Hibernate allows you to define one of those three strategies:"
msgstr ""
#. Tag: para
+#: query_sql.xml:675
#, no-c-format
-msgid "The order of the positional parameters is vital, as they must be in the same sequence as Hibernate expects them."
+msgid "none: no check is performed: the store procedure is expected to fail upon issues"
msgstr ""
#. Tag: para
+#: query_sql.xml:680
#, no-c-format
-msgid "You can view 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 view the expected sequence, do not include your custom SQL in the mapping files, as this will override the Hibernate generated static SQL."
+msgid "count: use of rowcount to check that the update is successful"
msgstr ""
#. Tag: para
+#: query_sql.xml:685
#, no-c-format
-msgid "The stored procedures are in most cases required to return the number of rows inserted, updated and deleted, as Hibernate has some runtime checks for the success of the statement. Hibernate always registers the first statement parameter as a numeric output parameter for the CUD operations:"
+msgid "param: like COUNT but using an output parameter rather that the standard mechanism"
msgstr ""
+#. Tag: para
+#: query_sql.xml:690
+#, no-c-format
+msgid "To define the result check style, use the <literal>check</literal> parameter which is again available in annoations as well as in xml."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:693
+#, no-c-format
+msgid "You can use the exact same set of annotations respectively xml nodes to override the collection related statements -see <xref linkend=\"example-overriding-sql-collections-annotations\"/>."
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:698
#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+ "@OneToMany\n"
+ "@JoinColumn(name=\"chaos_fk\")\n"
+ "@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+ "@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?\")\n"
+ "private Set<CasimirParticle> particles = new HashSet<CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:705
+#, no-c-format
+msgid "The parameter order is important and is defined by the order Hibernate handles 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 or mapping files as that will override the Hibernate generated static sql)"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:715
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables is also possible using <literal>@org.hibernate.annotations.Table</literal> and either (or all) attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, <literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@SecondaryTables({\n"
+ " @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+ " @SecondaryTable(name = \"Cat2\"})\n"
+ "@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"
+ " sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values(upper(?), ?)\") )\n"
+ "} )\n"
+ "public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:726
+#, no-c-format
+msgid "The previous example also shows that you can give a comment to a given table (primary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:731
+#, no-c-format
+msgid "The SQL is directly executed in your database, so you can use any dialect you like. This will, however, reduce the portability of your mapping if you use database specific SQL."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:736
+#, no-c-format
+msgid "Last but not least, stored procedures are in most cases required to return the number of rows inserted, updated and deleted. Hibernate always registers the first statement parameter as a numeric output parameter for the CUD operations:"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:742
+#, no-c-format
+msgid "Stored procedures and their return value"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:744
+#, no-c-format
+msgid ""
+ "CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+ " RETURN NUMBER IS\n"
+ "BEGIN\n"
+ "\n"
+ " update PERSON\n"
+ " set\n"
+ " NAME = uname,\n"
+ " where\n"
+ " ID = uid;\n"
+ "\n"
+ " return SQL%ROWCOUNT;\n"
+ "\n"
+ "END updatePerson;"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
msgid "Custom SQL for loading"
msgstr ""
#. Tag: para
+#: query_sql.xml:751
#, no-c-format
-msgid "You can also declare your own SQL (or HQL) queries for entity loading. As with inserts, updates, and deletes, this can be done at the individual column level as described in <xref linkend=\"mapping-column-read-and-write\" /> or at the statement level. Here is an example of a statement level override:"
+msgid "You can also declare your own SQL (or HQL) queries for entity loading. As with inserts, updates, and deletes, this can be done at the individual column level as described in <xref linkend=\"mapping-column-read-and-write\"/> or at the statement level. Here is an example of a statement level override:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:757
+#, no-c-format
+msgid ""
+ "<sql-query name=\"person\">\n"
+ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+ " FROM PERSON\n"
+ " WHERE ID=?\n"
+ " FOR UPDATE\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:759
#, no-c-format
msgid "This is just a named query declaration, as discussed earlier. You can reference this named query in a class mapping:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:762
+#, no-c-format
+msgid ""
+ "<class name=\"Person\">\n"
+ " <id name=\"id\">\n"
+ " <generator class=\"increment\"/>\n"
+ " </id>\n"
+ " <property name=\"name\" not-null=\"true\"/>\n"
+ " <loader query-ref=\"person\"/>\n"
+ "</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:764
#, no-c-format
msgid "This even works with stored procedures."
msgstr ""
#. Tag: para
+#: query_sql.xml:766
#, no-c-format
msgid "You can even define a query for collection loading:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:768
+#, no-c-format
+msgid ""
+ "<set name=\"employments\" inverse=\"true\">\n"
+ " <key/>\n"
+ " <one-to-many class=\"Employment\"/>\n"
+ " <loader query-ref=\"employments\"/>\n"
+ "</set>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:770
+#, no-c-format
+msgid ""
+ "<sql-query name=\"employments\">\n"
+ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+ " SELECT {emp.*}\n"
+ " FROM EMPLOYMENT emp\n"
+ " WHERE EMPLOYER = :id\n"
+ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+ "</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:772
#, no-c-format
msgid "You can also define an entity loader that loads a collection by join fetching:"
msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:775
+#, no-c-format
+msgid ""
+ "<sql-query name=\"person\">\n"
+ " <return alias=\"pers\" class=\"Person\"/>\n"
+ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+ " SELECT NAME AS {pers.*}, {emp.*}\n"
+ " FROM PERSON pers\n"
+ " LEFT OUTER JOIN EMPLOYMENT emp\n"
+ " ON pers.ID = emp.PERSON_ID\n"
+ " WHERE ID=?\n"
+ "</sql-query>"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid "The annotation equivalent <literal><loader></literal> is the @Loader annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/>."
+msgstr ""
+
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/session_api.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/session_api.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/session_api.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,759 +1,1477 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr ""
#. Tag: para
+#: session_api.xml:33
#, no-c-format
msgid "Hibernate is a full object/relational mapping solution that not only shields the developer from the details of the underlying database management system, but also offers <emphasis>state management</emphasis> of objects. This is, contrary to the management of SQL <literal>statements</literal> in common JDBC/SQL persistence layers, a natural object-oriented view of persistence in Java applications."
msgstr ""
#. Tag: para
+#: session_api.xml:40
#, no-c-format
msgid "In other words, Hibernate application developers should always think about the <emphasis>state</emphasis> of their objects, and not necessarily about the execution of SQL statements. This part is taken care of by Hibernate and is only relevant for the application developer when tuning the performance of the system."
msgstr ""
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr ""
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr ""
#. Tag: para
+#: session_api.xml:53
#, no-c-format
msgid "<emphasis>Transient</emphasis> - an object is transient if it has just been instantiated using the <literal>new</literal> operator, and it is not associated with a Hibernate <literal>Session</literal>. It has no persistent representation in the database and no identifier value has been assigned. Transient instances will be destroyed by the garbage collector if the application does not hold a reference anymore. Use the Hibernate <literal>Session</literal> to make an object persistent (and let Hibernate take care of the SQL statements that need to be executed for this transition)."
msgstr ""
#. Tag: para
+#: session_api.xml:65
#, no-c-format
msgid "<emphasis>Persistent</emphasis> - a persistent instance has a representation in the database and an identifier value. It might just have been saved or loaded, however, it is by definition in the scope of a <literal>Session</literal>. Hibernate will detect any changes made to an object in persistent state and synchronize the state with the database when the unit of work completes. Developers do not execute manual <literal>UPDATE</literal> statements, or <literal>DELETE</literal> statements when an object should be made transient."
msgstr ""
#. Tag: para
+#: session_api.xml:77
#, no-c-format
msgid "<emphasis>Detached</emphasis> - a detached instance is an object that has been persistent, but its <literal>Session</literal> has been closed. The reference to the object is still valid, of course, and the detached instance might even be modified in this state. A detached instance can be reattached to a new <literal>Session</literal> at a later point in time, making it (and all the modifications) persistent again. This feature enables a programming model for long running units of work that require user think-time. We call them <emphasis>application transactions</emphasis>, i.e., a unit of work from the point of view of the user."
msgstr ""
#. Tag: para
+#: session_api.xml:90
#, no-c-format
msgid "We will now discuss the states and state transitions (and the Hibernate methods that trigger a transition) in more detail."
msgstr ""
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr ""
#. Tag: para
+#: session_api.xml:97
#, no-c-format
-msgid "Newly instantiated instances of a a persistent class are considered <emphasis>transient</emphasis> by Hibernate. We can make a transient instance <emphasis>persistent</emphasis> by associating it with a session:"
+msgid "Newly instantiated instances of a persistent class are considered <emphasis>transient</emphasis> by Hibernate. We can make a transient instance <emphasis>persistent</emphasis> by associating it with a session:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:102
+#, no-c-format
+msgid ""
+ "DomesticCat fritz = new DomesticCat();\n"
+ "fritz.setColor(Color.GINGER);\n"
+ "fritz.setSex('M');\n"
+ "fritz.setName(\"Fritz\");\n"
+ "Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:104
#, no-c-format
msgid "If <literal>Cat</literal> has a generated identifier, the identifier is generated and assigned to the <literal>cat</literal> when <literal>save()</literal> is called. If <literal>Cat</literal> has an <literal>assigned</literal> identifier, or a composite key, the identifier should be assigned to the <literal>cat</literal> instance before calling <literal>save()</literal>. You can also use <literal>persist()</literal> instead of <literal>save()</literal>, with the semantics defined in the EJB3 early draft."
msgstr ""
#. Tag: para
+#: session_api.xml:115
#, no-c-format
msgid "<literal>persist()</literal> makes a transient instance persistent. However, it does not guarantee that the identifier value will be assigned to the persistent instance immediately, the assignment might happen at flush time. <literal>persist()</literal> also guarantees that it will not execute an <literal>INSERT</literal> statement if it is called outside of transaction boundaries. This is useful in long-running conversations with an extended Session/persistence context."
msgstr ""
#. Tag: para
+#: session_api.xml:126
#, no-c-format
msgid "<literal>save()</literal> does guarantee to return an identifier. If an INSERT has to be executed to get the identifier ( e.g. \"identity\" generator, not \"sequence\"), this INSERT happens immediately, no matter if you are inside or outside of a transaction. This is problematic in a long-running conversation with an extended Session/persistence context."
msgstr ""
#. Tag: para
+#: session_api.xml:135
#, no-c-format
msgid "Alternatively, you can assign the identifier using an overloaded version of <literal>save()</literal>."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:138
+#, no-c-format
+msgid ""
+ "DomesticCat pk = new DomesticCat();\n"
+ "pk.setColor(Color.TABBY);\n"
+ "pk.setSex('F');\n"
+ "pk.setName(\"PK\");\n"
+ "pk.setKittens( new HashSet() );\n"
+ "pk.addKitten(fritz);\n"
+ "sess.save( pk, new Long(1234) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:140
#, no-c-format
msgid "If the object you make persistent has associated objects (e.g. the <literal>kittens</literal> collection in the previous example), these objects can be made persistent in any order you like unless you have a <literal>NOT NULL</literal> constraint upon a foreign key column. There is never a risk of violating foreign key constraints. However, you might violate a <literal>NOT NULL</literal> constraint if you <literal>save()</literal> the objects in the wrong order."
msgstr ""
#. Tag: para
+#: session_api.xml:148
#, no-c-format
msgid "Usually you do not bother with this detail, as you will normally use Hibernate's <emphasis>transitive persistence</emphasis> feature to save the associated objects automatically. Then, even <literal>NOT NULL</literal> constraint violations do not occur - Hibernate will take care of everything. Transitive persistence is discussed later in this chapter."
msgstr ""
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr ""
#. Tag: para
+#: session_api.xml:159
#, no-c-format
msgid "The <literal>load()</literal> methods of <literal>Session</literal> provide a way of retrieving a persistent instance if you know its identifier. <literal>load()</literal> takes a class object and loads the state into a newly instantiated instance of that class in a persistent state."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:165
+#, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, no-c-format
+msgid ""
+ "// you need to wrap primitive identifiers\n"
+ "long id = 1234;\n"
+ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:171
+#, no-c-format
+msgid ""
+ "Cat cat = new DomesticCat();\n"
+ "// load pk's state into cat\n"
+ "sess.load( cat, new Long(pkId) );\n"
+ "Set kittens = cat.getKittens();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:173
#, no-c-format
msgid "Be aware that <literal>load()</literal> will throw an unrecoverable exception if there is no matching database row. If the class is mapped with a proxy, <literal>load()</literal> just returns an uninitialized proxy and does not actually hit the database until you invoke a method of the proxy. This is useful if you wish to create an association to an object without actually loading it from the database. It also allows multiple instances to be loaded as a batch if <literal>batch-size</literal> is defined for the class mapping."
msgstr ""
#. Tag: para
+#: session_api.xml:182
#, no-c-format
msgid "If you are not certain that a matching row exists, you should use the <literal>get()</literal> method which hits the database immediately and returns null if there is no matching row."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:186
+#, no-c-format
+msgid ""
+ "Cat cat = (Cat) sess.get(Cat.class, id);\n"
+ "if (cat==null) {\n"
+ " cat = new Cat();\n"
+ " sess.save(cat, id);\n"
+ "}\n"
+ "return cat;"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:188
#, no-c-format
msgid "You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</literal>, using a <literal>LockMode</literal>. See the API documentation for more information."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:192
+#, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:194
#, no-c-format
msgid "Any associated instances or contained collections will <emphasis>not</emphasis> be selected <literal>FOR UPDATE</literal>, unless you decide to specify <literal>lock</literal> or <literal>all</literal> as a cascade style for the association."
msgstr ""
#. Tag: para
+#: session_api.xml:199
#, no-c-format
msgid "It is possible to re-load an object and all its collections at any time, using the <literal>refresh()</literal> method. This is useful when database triggers are used to initialize some of the properties of the object."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:204
+#, no-c-format
+msgid ""
+ "sess.save(cat);\n"
+ "sess.flush(); //force the SQL INSERT\n"
+ "sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:206
#, no-c-format
-msgid "How much does Hibernate load from the database and how many SQL <literal>SELECT</literal>s will it use? This depends on the <emphasis>fetching strategy</emphasis>. This is explained in <xref linkend=\"performance-fetching\" />."
+msgid "How much does Hibernate load from the database and how many SQL <literal>SELECT</literal>s will it use? This depends on the <emphasis>fetching strategy</emphasis>. This is explained in <xref linkend=\"performance-fetching\"/>."
msgstr ""
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr ""
#. Tag: para
+#: session_api.xml:215
#, no-c-format
msgid "If you do not know the identifiers of the objects you are looking for, you need a query. Hibernate supports an easy-to-use but powerful object oriented query language (HQL). For programmatic query creation, Hibernate supports a sophisticated Criteria and Example query feature (QBC and QBE). You can also express your query in the native SQL of your database, with optional support from Hibernate for result set conversion into objects."
msgstr ""
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr ""
#. Tag: para
+#: session_api.xml:226
#, no-c-format
msgid "HQL and native SQL queries are represented with an instance of <literal>org.hibernate.Query</literal>. This interface offers methods for parameter binding, result set handling, and for the execution of the actual query. You always obtain a <literal>Query</literal> using the current <literal>Session</literal>:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:232
+#, no-c-format
+msgid ""
+ "List cats = session.createQuery(\n"
+ " \"from Cat as cat where cat.birthdate < ?\")\n"
+ " .setDate(0, date)\n"
+ " .list();\n"
+ "\n"
+ "List mothers = session.createQuery(\n"
+ " \"select mother from Cat as cat join cat.mother as mother where cat.name = ?\")\n"
+ " .setString(0, name)\n"
+ " .list();\n"
+ "\n"
+ "List kittens = session.createQuery(\n"
+ " \"from Cat as cat where cat.mother = ?\")\n"
+ " .setEntity(0, pk)\n"
+ " .list();\n"
+ "\n"
+ "Cat mother = (Cat) session.createQuery(\n"
+ " \"select cat.mother from Cat as cat where cat = ?\")\n"
+ " .setEntity(0, izi)\n"
+ " .uniqueResult();]]\n"
+ "\n"
+ "Query mothersWithKittens = (Cat) session.createQuery(\n"
+ " \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+ "Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:234
#, no-c-format
msgid "A query is usually executed by invoking <literal>list()</literal>. The result of the query will be loaded completely into a collection in memory. Entity instances retrieved by a query are in a persistent state. The <literal>uniqueResult()</literal> method offers a shortcut if you know your query will only return a single object. Queries that make use of eager fetching of collections usually return duplicates of the root objects, but with their collections initialized. You can filter these duplicates through a <literal>Set</literal>."
msgstr ""
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr ""
#. Tag: para
+#: session_api.xml:246
#, no-c-format
msgid "Occasionally, you might be able to achieve better performance by executing the query using the <literal>iterate()</literal> method. This will usually be the case if you expect that the actual entity instances returned by the query will already be in the session or second-level cache. If they are not already cached, <literal>iterate()</literal> will be slower than <literal>list()</literal> and might require many database hits for a simple query, usually <emphasis>1</emphasis> for the initial select which only returns identifiers, and <emphasis>n</emphasis> additional selects to initialize the actual instances."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:257
+#, no-c-format
+msgid ""
+ "// fetch ids\n"
+ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\").iterate();\n"
+ "while ( iter.hasNext() ) {\n"
+ " Qux qux = (Qux) iter.next(); // fetch the object\n"
+ " // something we couldnt express in the query\n"
+ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
+ " // delete the current instance\n"
+ " iter.remove();\n"
+ " // dont need to process the rest\n"
+ " break;\n"
+ " }\n"
+ "}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr ""
#. Tag: para
+#: session_api.xml:263
#, no-c-format
msgid "Hibernate queries sometimes return tuples of objects. Each tuple is returned as an array:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:266
+#, no-c-format
+msgid ""
+ "Iterator kittensAndMothers = sess.createQuery(\n"
+ " \"select kitten, mother from Cat kitten join kitten.mother mother\")\n"
+ " .list()\n"
+ " .iterator();\n"
+ "\n"
+ "while ( kittensAndMothers.hasNext() ) {\n"
+ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+ " Cat kitten = (Cat) tuple[0];\n"
+ " Cat mother = (Cat) tuple[1];\n"
+ " ....\n"
+ "}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr ""
#. Tag: para
+#: session_api.xml:272
#, no-c-format
msgid "Queries can specify a property of a class in the <literal>select</literal> clause. They can even call SQL aggregate functions. Properties or aggregates are considered \"scalar\" results and not entities in persistent state."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:277
+#, no-c-format
+msgid ""
+ "Iterator results = sess.createQuery(\n"
+ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" +\n"
+ " \"group by cat.color\")\n"
+ " .list()\n"
+ " .iterator();\n"
+ "\n"
+ "while ( results.hasNext() ) {\n"
+ " Object[] row = (Object[]) results.next();\n"
+ " Color type = (Color) row[0];\n"
+ " Date oldest = (Date) row[1];\n"
+ " Integer count = (Integer) row[2];\n"
+ " .....\n"
+ "}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr ""
#. Tag: para
+#: session_api.xml:283
#, no-c-format
msgid "Methods on <literal>Query</literal> are provided for binding values to named parameters or JDBC-style <literal>?</literal> parameters. <emphasis>Contrary to JDBC, Hibernate numbers parameters from zero.</emphasis> Named parameters are identifiers of the form <literal>:name</literal> in the query string. The advantages of named parameters are as follows:"
msgstr ""
#. Tag: para
+#: session_api.xml:292
#, no-c-format
msgid "named parameters are insensitive to the order they occur in the query string"
msgstr ""
#. Tag: para
+#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr ""
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:305
+#, no-c-format
+msgid ""
+ "//named parameter (preferred)\n"
+ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name\");\n"
+ "q.setString(\"name\", \"Fritz\");\n"
+ "Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, no-c-format
+msgid ""
+ "//positional parameter\n"
+ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+ "q.setString(0, \"Izi\");\n"
+ "Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, no-c-format
+msgid ""
+ "//named parameter list\n"
+ "List names = new ArrayList();\n"
+ "names.add(\"Izi\");\n"
+ "names.add(\"Fritz\");\n"
+ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:namesList)\");\n"
+ "q.setParameterList(\"namesList\", names);\n"
+ "List cats = q.list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr ""
#. Tag: para
+#: session_api.xml:315
#, no-c-format
msgid "If you need to specify bounds upon your result set, that is, the maximum number of rows you want to retrieve and/or the first row you want to retrieve, you can use methods of the <literal>Query</literal> interface:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:320
+#, no-c-format
+msgid ""
+ "Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+ "q.setFirstResult(20);\n"
+ "q.setMaxResults(10);\n"
+ "List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
msgid "Hibernate knows how to translate this limit query into the native SQL of your DBMS."
msgstr ""
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr ""
#. Tag: para
+#: session_api.xml:329
#, no-c-format
msgid "If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the <literal>Query</literal> interface can be used to obtain a <literal>ScrollableResults</literal> object that allows flexible navigation of the query results."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:334
+#, no-c-format
+msgid ""
+ "Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+ " \"order by cat.name\");\n"
+ "ScrollableResults cats = q.scroll();\n"
+ "if ( cats.first() ) {\n"
+ "\n"
+ " // find the first name on each page of an alphabetical list of cats by name\n"
+ " firstNamesOfPages = new ArrayList();\n"
+ " do {\n"
+ " String name = cats.getString(0);\n"
+ " firstNamesOfPages.add(name);\n"
+ " }\n"
+ " while ( cats.scroll(PAGE_SIZE) );\n"
+ "\n"
+ " // Now get the first page of cats\n"
+ " pageOfCats = new ArrayList();\n"
+ " cats.beforeFirst();\n"
+ " int i=0;\n"
+ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add( cats.get(1) );\n"
+ "\n"
+ "}\n"
+ "cats.close()"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:336
#, no-c-format
msgid "Note that an open database connection and cursor is required for this functionality. Use <literal>setMaxResult()</literal>/<literal>setFirstResult()</literal> if you need offline pagination functionality."
msgstr ""
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr ""
#. Tag: para
+#: session_api.xml:345
#, no-c-format
-msgid "You can also define named queries in the mapping document. Remember to use a <literal>CDATA</literal> section if your query contains characters that could be interpreted as markup."
+msgid "Queries can also be configured as so called named queries using annotations or Hibernate mapping documents. <literal>@NamedQuery</literal> and <literal>@NamedQueries</literal> can be defined at the class level as seen in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@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
+#: session_api.xml:361
#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+msgid "Using a mapping document can be configured using the <literal><query></literal> node. Remember to use a <literal>CDATA</literal> section if your query contains characters that could be interpreted as markup."
msgstr ""
+#. Tag: title
+#: session_api.xml:367
+#, no-c-format
+msgid "Defining a named query using <literal><query></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, no-c-format
+msgid ""
+ "<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+ " from eg.DomesticCat as cat\n"
+ " where cat.name = ?\n"
+ " and cat.weight > ?\n"
+ "] ]></query>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:373
#, no-c-format
+msgid "Parameter binding and executing is done programatically as seen in <xref linkend=\"example-parameter-binding-named-query\"/>."
+msgstr ""
+
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, no-c-format
+msgid ""
+ "Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+ "q.setString(0, name);\n"
+ "q.setInt(1, minWeight);\n"
+ "List cats = q.list();"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:382
+#, no-c-format
msgid "The actual program code is independent of the query language that is used. You can also define native SQL queries in metadata, or migrate existing queries to Hibernate by placing them in mapping files."
msgstr ""
#. Tag: para
+#: session_api.xml:387
#, no-c-format
msgid "Also note that a query declaration inside a <literal><hibernate-mapping></literal> element requires a global unique name for the query, while a query declaration inside a <literal><class></literal> element is made unique automatically by prepending the fully qualified name of the class. For example <literal>eg.Cat.ByNameAndMaximumWeight</literal>."
msgstr ""
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr ""
#. Tag: para
+#: session_api.xml:399
#, no-c-format
msgid "A collection <emphasis>filter</emphasis> is a special type of query that can be applied to a persistent collection or array. The query string can refer to <literal>this</literal>, meaning the current collection element."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:404
+#, no-c-format
+msgid ""
+ "Collection blackKittens = session.createFilter(\n"
+ " pk.getKittens(), \n"
+ " \"where this.color = ?\")\n"
+ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+ " .list()\n"
+ ");"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:406
#, no-c-format
msgid "The returned collection is considered a bag that is a copy of the given collection. The original collection is not modified. This is contrary to the implication of the name \"filter\", but consistent with expected behavior."
msgstr ""
#. Tag: para
+#: session_api.xml:411
#, no-c-format
msgid "Observe that filters do not require a <literal>from</literal> clause, although they can have one if required. Filters are not limited to returning the collection elements themselves."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:415
+#, no-c-format
+msgid ""
+ "Collection blackKittenMates = session.createFilter(\n"
+ " pk.getKittens(), \n"
+ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+ " .list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:417
#, no-c-format
msgid "Even an empty filter query is useful, e.g. to load a subset of elements in a large collection:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:420
+#, no-c-format
+msgid ""
+ "Collection tenKittens = session.createFilter(\n"
+ " mother.getKittens(), \"\")\n"
+ " .setFirstResult(0).setMaxResults(10)\n"
+ " .list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr ""
#. Tag: para
+#: session_api.xml:426
#, no-c-format
msgid "HQL is extremely powerful, but some developers prefer to build queries dynamically using an object-oriented API, rather than building query strings. Hibernate provides an intuitive <literal>Criteria</literal> query API for these cases:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:431
+#, no-c-format
+msgid ""
+ "Criteria crit = session.createCriteria(Cat.class);\n"
+ "crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+ "crit.setMaxResults(10);\n"
+ "List cats = crit.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:433
#, no-c-format
-msgid "The <literal>Criteria</literal> and the associated <literal>Example</literal> API are discussed in more detail in <xref linkend=\"querycriteria\" />."
+msgid "The <literal>Criteria</literal> and the associated <literal>Example</literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/>."
msgstr ""
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr ""
#. Tag: para
+#: session_api.xml:441
#, no-c-format
msgid "You can express a query in SQL, using <literal>createSQLQuery()</literal> and let Hibernate manage the mapping from result sets to objects. You can at any time call <literal>session.connection()</literal> and use the JDBC <literal>Connection</literal> directly. If you choose to use the Hibernate API, you must enclose SQL aliases in braces:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:448
+#, no-c-format
+msgid ""
+ "List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10\")\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ ".list();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, no-c-format
+msgid ""
+ "List cats = session.createSQLQuery(\n"
+ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" +\n"
+ " \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+ " .addEntity(\"cat\", Cat.class)\n"
+ ".list()"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:452
#, no-c-format
-msgid "SQL queries can contain named and positional parameters, just like Hibernate queries. More information about native SQL queries in Hibernate can be found in <xref linkend=\"querysql\" />."
+msgid "SQL queries can contain named and positional parameters, just like Hibernate queries. More information about native SQL queries in Hibernate can be found in <xref linkend=\"querysql\"/>."
msgstr ""
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr ""
#. Tag: para
+#: session_api.xml:461
#, no-c-format
msgid "<emphasis>Transactional persistent instances</emphasis> (i.e. objects loaded, saved, created or queried by the <literal>Session</literal>) can be manipulated by the application, and any changes to persistent state will be persisted when the <literal>Session</literal> is <emphasis>flushed</emphasis>. This is discussed later in this chapter. There is no need to call a particular method (like <literal>update()</literal>, which has a different purpose) to make your modifications persistent. The most straightforward way to update the state of an object is to <literal>load()</literal> it and then manipulate it directly while the <literal>Session</literal> is open:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:473
+#, no-c-format
+msgid ""
+ "DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+ "cat.setName(\"PK\");\n"
+ "sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:475
#, no-c-format
msgid "Sometimes this programming model is inefficient, as it requires in the same session both an SQL <literal>SELECT</literal> to load an object and an SQL <literal>UPDATE</literal> to persist its updated state. Hibernate offers an alternate approach by using detached instances."
msgstr ""
#. Tag: para
+#: session_api.xml:481
#, no-c-format
-msgid "Hibernate does not offer its own API for direct execution of <literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate is a <emphasis>state management</emphasis> service, you do not have to think in <emphasis>statements</emphasis> to use it. JDBC is a perfect API for executing SQL statements, you can get a JDBC <literal>Connection</literal> at any time by calling <literal>session.connection()</literal>. Furthermore, the notion of mass operations conflicts with object/relational mapping for online transaction processing-oriented applications. Future versions of Hibernate can, however, provide special mass operation functions. See <xref linkend=\"batch\" /> for some possible batch operation tricks."
+msgid "Hibernate does not offer its own API for direct execution of <literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate is a <emphasis>state management</emphasis> service, you do not have to think in <emphasis>statements</emphasis> to use it. JDBC is a perfect API for executing SQL statements, you can get a JDBC <literal>Connection</literal> at any time by calling <literal>session.connection()</literal>. Furthermore, the notion of mass operations conflicts with object/relational mapping for online transaction processing-oriented applications. Future versions of Hibernate can, however, provide special mass operation functions. See <xref linkend=\"batch\"/> for some possible batch operation tricks."
msgstr ""
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr ""
#. Tag: para
+#: session_api.xml:499
#, no-c-format
msgid "Many applications need to retrieve an object in one transaction, send it to the UI layer for manipulation, then save the changes in a new transaction. Applications that use this kind of approach in a high-concurrency environment usually use versioned data to ensure isolation for the \"long\" unit of work."
msgstr ""
#. Tag: para
+#: session_api.xml:505
#, no-c-format
msgid "Hibernate supports this model by providing for reattachment of detached instances using the <literal>Session.update()</literal> or <literal>Session.merge()</literal> methods:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:509
+#, no-c-format
+msgid ""
+ "// in the first session\n"
+ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+ "Cat potentialMate = new Cat();\n"
+ "firstSession.save(potentialMate);\n"
+ "\n"
+ "// in a higher layer of the application\n"
+ "cat.setMate(potentialMate);\n"
+ "\n"
+ "// later, in a new session\n"
+ "secondSession.update(cat); // update cat\n"
+ "secondSession.update(mate); // update mate"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
msgid "If the <literal>Cat</literal> with identifier <literal>catId</literal> had already been loaded by <literal>secondSession</literal> when the application tried to reattach it, an exception would have been thrown."
msgstr ""
#. Tag: para
+#: session_api.xml:516
#, no-c-format
msgid "Use <literal>update()</literal> if you are certain that the session does not contain an already persistent instance with the same identifier. Use <literal>merge()</literal> if you want to merge your modifications at any time without consideration of the state of the session. In other words, <literal>update()</literal> is usually the first method you would call in a fresh session, ensuring that the reattachment of your detached instances is the first operation that is executed."
msgstr ""
#. Tag: para
+#: session_api.xml:524
#, no-c-format
-msgid "The application should individually <literal>update()</literal> detached instances that are reachable from the given detached instance <emphasis>only</emphasis> if it wants their state to be updated. This can be automated using <emphasis>transitive persistence</emphasis>. See <xref linkend=\"objectstate-transitive\" /> for more information."
+msgid "The application should individually <literal>update()</literal> detached instances that are reachable from the given detached instance <emphasis>only</emphasis> if it wants their state to be updated. This can be automated using <emphasis>transitive persistence</emphasis>. See <xref linkend=\"objectstate-transitive\"/> for more information."
msgstr ""
#. Tag: para
+#: session_api.xml:530
#, no-c-format
msgid "The <literal>lock()</literal> method also allows an application to reassociate an object with a new session. However, the detached instance has to be unmodified."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:534
+#, no-c-format
+msgid ""
+ "//just reassociate:\n"
+ "sess.lock(fritz, LockMode.NONE);\n"
+ "//do a version check, then reassociate:\n"
+ "sess.lock(izi, LockMode.READ);\n"
+ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+ "sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:536
#, no-c-format
msgid "Note that <literal>lock()</literal> can be used with various <literal>LockMode</literal>s. See the API documentation and the chapter on transaction handling for more information. Reattachment is not the only usecase for <literal>lock()</literal>."
msgstr ""
#. Tag: para
+#: session_api.xml:541
#, no-c-format
-msgid "Other models for long units of work are discussed in <xref linkend=\"transactions-optimistic\" />."
+msgid "Other models for long units of work are discussed in <xref linkend=\"transactions-optimistic\"/>."
msgstr ""
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr ""
#. Tag: para
+#: session_api.xml:548
#, no-c-format
msgid "Hibernate users have requested a general purpose method that either saves a transient instance by generating a new identifier or updates/reattaches the detached instances associated with its current identifier. The <literal>saveOrUpdate()</literal> method implements this functionality."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:554
+#, no-c-format
+msgid ""
+ "// in the first session\n"
+ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+ "\n"
+ "// in a higher tier of the application\n"
+ "Cat mate = new Cat();\n"
+ "cat.setMate(mate);\n"
+ "\n"
+ "// later, in a new session\n"
+ "secondSession.saveOrUpdate(cat); // update existing state (cat has a non-null id)\n"
+ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a null id)"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
msgid "The usage and semantics of <literal>saveOrUpdate()</literal> seems to be confusing for new users. Firstly, so long as you are not trying to use instances from one session in another new session, you should not need to use <literal>update()</literal>, <literal>saveOrUpdate()</literal>, or <literal>merge()</literal>. Some whole applications will never use either of these methods."
msgstr ""
#. Tag: para
+#: session_api.xml:563
#, no-c-format
msgid "Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are used in the following scenario:"
msgstr ""
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr ""
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr ""
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr ""
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr ""
#. Tag: para
+#: session_api.xml:585
#, no-c-format
msgid "the application persists these modifications by calling <literal>update()</literal> in a second session"
msgstr ""
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr ""
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr ""
#. Tag: para
+#: session_api.xml:599
#, no-c-format
msgid "if another object associated with the session has the same identifier, throw an exception"
msgstr ""
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
msgstr ""
#. Tag: para
+#: session_api.xml:609
#, no-c-format
msgid "if the object's identifier has the value assigned to a newly instantiated object, <literal>save()</literal> it"
msgstr ""
#. Tag: para
+#: session_api.xml:614
#, no-c-format
msgid "if the object is versioned by a <literal><version></literal> or <literal><timestamp></literal>, and the version property value is the same value assigned to a newly instantiated object, <literal>save()</literal> it"
msgstr ""
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
msgstr ""
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr ""
#. Tag: para
+#: session_api.xml:630
#, no-c-format
msgid "if there is a persistent instance with the same identifier currently associated with the session, copy the state of the given object onto the persistent instance"
msgstr ""
#. Tag: para
+#: session_api.xml:636
#, no-c-format
msgid "if there is no persistent instance currently associated with the session, try to load it from the database, or create a new persistent instance"
msgstr ""
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr ""
#. Tag: para
+#: session_api.xml:646
#, no-c-format
msgid "the given instance does not become associated with the session, it remains detached"
msgstr ""
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr ""
#. Tag: para
+#: session_api.xml:655
#, no-c-format
msgid "<literal>Session.delete()</literal> will remove an object's state from the database. Your application, however, can still hold a reference to a deleted object. It is best to think of <literal>delete()</literal> as making a persistent instance, transient."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:660
+#, no-c-format
+msgid "sess.delete(cat);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:662
#, no-c-format
msgid "You can delete objects in any order, without risk of foreign key constraint violations. It is still possible to violate a <literal>NOT NULL</literal> constraint on a foreign key column by deleting objects in the wrong order, e.g. if you delete the parent, but forget to delete the children."
msgstr ""
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr ""
#. Tag: para
+#: session_api.xml:672
#, no-c-format
msgid "It is sometimes useful to be able to take a graph of persistent instances and make them persistent in a different datastore, without regenerating identifier values."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:676
+#, no-c-format
+msgid ""
+ "//retrieve a cat from one database\n"
+ "Session session1 = factory1.openSession();\n"
+ "Transaction tx1 = session1.beginTransaction();\n"
+ "Cat cat = session1.get(Cat.class, catId);\n"
+ "tx1.commit();\n"
+ "session1.close();\n"
+ "\n"
+ "//reconcile with a second database\n"
+ "Session session2 = factory2.openSession();\n"
+ "Transaction tx2 = session2.beginTransaction();\n"
+ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+ "tx2.commit();\n"
+ "session2.close();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:678
#, no-c-format
msgid "The <literal>ReplicationMode</literal> determines how <literal>replicate()</literal> will deal with conflicts with existing rows in the database:"
msgstr ""
#. Tag: para
+#: session_api.xml:684
#, no-c-format
msgid "<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is an existing database row with the same identifier"
msgstr ""
#. Tag: para
+#: session_api.xml:689
#, no-c-format
msgid "<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing database row with the same identifier"
msgstr ""
#. Tag: para
+#: session_api.xml:694
#, no-c-format
msgid "<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there is an existing database row with the same identifier"
msgstr ""
#. Tag: para
+#: session_api.xml:700
#, no-c-format
msgid "<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its version number is earlier than the version number of the object, or ignore the object otherwise"
msgstr ""
#. Tag: para
+#: session_api.xml:706
#, no-c-format
msgid "Usecases for this feature include reconciling data entered into different database instances, upgrading system configuration information during product upgrades, rolling back changes made during non-ACID transactions and more."
msgstr ""
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr ""
#. Tag: para
+#: session_api.xml:715
#, no-c-format
msgid "Sometimes the <literal>Session</literal> will execute the SQL statements needed to synchronize the JDBC connection's state with the state of objects held in memory. This process, called <emphasis>flush</emphasis>, occurs by default at the following points:"
msgstr ""
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr ""
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:736
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr ""
#. Tag: para
+#: session_api.xml:740
#, no-c-format
msgid "all entity insertions in the same order the corresponding objects were saved using <literal>Session.save()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr ""
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr ""
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr ""
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr ""
#. Tag: para
+#: session_api.xml:761
#, no-c-format
msgid "all entity deletions in the same order the corresponding objects were deleted using <literal>Session.delete()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:766
#, no-c-format
msgid "An exception is that objects using <literal>native</literal> ID generation are inserted when they are saved."
msgstr ""
#. Tag: para
+#: session_api.xml:769
#, no-c-format
msgid "Except when you explicitly <literal>flush()</literal>, there are absolutely no guarantees about <emphasis>when</emphasis> the <literal>Session</literal> executes the JDBC calls, only the <emphasis>order</emphasis> in which they are executed. However, Hibernate does guarantee that the <literal>Query.list(..)</literal> will never return stale or incorrect data."
msgstr ""
#. Tag: para
+#: session_api.xml:776
#, no-c-format
-msgid "It is possible to change the default behavior so that flush occurs less frequently. The <literal>FlushMode</literal> class defines three different modes: only flush at commit time when the Hibernate <literal>Transaction</literal> API is used, flush automatically using the explained routine, or never flush unless <literal>flush()</literal> is called explicitly. The last mode is useful for long running units of work, where a <literal>Session</literal> is kept open and disconnected for a long time (see <xref linkend=\"transactions-optimistic-longsession\" />)."
+msgid "It is possible to change the default behavior so that flush occurs less frequently. The <literal>FlushMode</literal> class defines three different modes: only flush at commit time when the Hibernate <literal>Transaction</literal> API is used, flush automatically using the explained routine, or never flush unless <literal>flush()</literal> is called explicitly. The last mode is useful for long running units of work, where a <literal>Session</literal> is kept open and disconnected for a long time (see <xref linkend=\"transactions-optimistic-longsession\"/>)."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:786
+#, no-c-format
+msgid ""
+ "sess = sf.openSession();\n"
+ "Transaction tx = sess.beginTransaction();\n"
+ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+ "\n"
+ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
+ "izi.setName(iznizi);\n"
+ "\n"
+ "// might return stale data\n"
+ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+ "\n"
+ "// change to izi is not flushed!\n"
+ "...\n"
+ "tx.commit(); // flush occurs\n"
+ "sess.close();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:788
#, no-c-format
-msgid "During flush, an exception might occur (e.g. if a DML operation violates a constraint). Since handling exceptions involves some understanding of Hibernate's transactional behavior, we discuss it in <xref linkend=\"transactions\" />."
+msgid "During flush, an exception might occur (e.g. if a DML operation violates a constraint). Since handling exceptions involves some understanding of Hibernate's transactional behavior, we discuss it in <xref linkend=\"transactions\"/>."
msgstr ""
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr ""
#. Tag: para
+#: session_api.xml:797
#, no-c-format
msgid "It is quite cumbersome to save, delete, or reattach individual objects, especially if you deal with a graph of associated objects. A common case is a parent/child relationship. Consider the following example:"
msgstr ""
#. Tag: para
+#: session_api.xml:802
#, no-c-format
msgid "If the children in a parent/child relationship would be value typed (e.g. a collection of addresses or strings), their life cycle would depend on the parent and no further action would be required for convenient \"cascading\" of state changes. When the parent is saved, the value-typed child objects are saved and when the parent is deleted, the children will be deleted, etc. This works for operations such as the removal of a child from the collection. Since value-typed objects cannot have shared references, Hibernate will detect this and delete the child from the database."
msgstr ""
#. Tag: para
+#: session_api.xml:812
#, no-c-format
msgid "Now consider the same scenario with parent and child objects being entities, not value-types (e.g. categories and items, or parent and child cats). Entities have their own life cycle and support shared references. Removing an entity from the collection does not mean it can be deleted), and there is by default no cascading of state from one entity to any other associated entities. Hibernate does not implement <emphasis>persistence by reachability</emphasis> by default."
msgstr ""
#. Tag: para
+#: session_api.xml:820
#, no-c-format
msgid "For each basic operation of the Hibernate session - including <literal>persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), evict(), replicate()</literal> - there is a corresponding cascade style. Respectively, the cascade styles are named <literal>create, merge, save-update, delete, lock, refresh, evict, replicate</literal>. If you want an operation to be cascaded along an association, you must indicate that in the mapping document. For example:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:828
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:832
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:834
#, no-c-format
msgid "You can even use <literal>cascade=\"all\"</literal> to specify that <emphasis>all</emphasis> operations should be cascaded along the association. The default <literal>cascade=\"none\"</literal> specifies that no operations are to be cascaded."
msgstr ""
#. Tag: para
+#: session_api.xml:839
#, no-c-format
-msgid "A special cascade style, <literal>delete-orphan</literal>, applies only to one-to-many associations, and indicates that the <literal>delete()</literal> operation should be applied to any child object that is removed from the association."
+msgid "In case you are using annotatons you probably have noticed the <literal>cascade</literal> attribute taking an array of <classname>CascadeType</classname> as a value. The cascade concept in JPA is very is similar to the transitive persistence and cascading of operations as described above, but with slightly different semantics and cascading types:"
msgstr ""
#. Tag: para
+#: session_api.xml:848
#, no-c-format
+msgid "<literal>CascadeType.PERSIST</literal>: cascades the persist (create) operation to associated entities persist() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:854
+#, no-c-format
+msgid "<literal>CascadeType.MERGE</literal>: cascades the merge operation to associated entities if merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:860
+#, no-c-format
+msgid "<literal>CascadeType.REMOVE</literal>: cascades the remove operation to associated entities if delete() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:865
+#, no-c-format
+msgid "<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to associated entities if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:870
+#, no-c-format
+msgid "<literal>CascadeType.DETACH:</literal> cascades the detach operation to associated entities if detach() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:875
+#, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:880
+#, no-c-format
+msgid "CascadeType.ALL also covers Hibernate specific operations like save-update, lock etc..."
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:884
+#, no-c-format
+msgid "A special cascade style, <literal>delete-orphan</literal>, applies only to one-to-many associations, and indicates that the <literal>delete()</literal> operation should be applied to any child object that is removed from the association. Using annotations there is no <literal>CascadeType.DELETE-ORPHAN</literal> equivalent. Instead you can use the attribute <literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-many-with-orphan-removal\"/>. If an entity is removed from a <classname>@OneToMany</classname> collection or an associated entity is dereferenced from a <classname>@OneToOne</classname> association, this associated entity can be marked for deletion if <literal>orphanRemoval</literal> is set to true."
+msgstr ""
+
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+ "@Entity \n"
+ "public class Customer {\n"
+ " private Set<Order> orders;\n"
+ "\n"
+ " @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+ " public Set<Order> getOrders() { return orders; }\n"
+ "\n"
+ " public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+ "\n"
+ " [...]\n"
+ "}\n"
+ "\n"
+ "@Entity \n"
+ "public class Order { ... }\n"
+ "\n"
+ "Customer customer = em.find(Customer.class, 1l);\n"
+ "Order order = em.find(Order.class, 1l);\n"
+ "customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:903
+#, no-c-format
msgid "Recommendations:"
msgstr ""
#. Tag: para
+#: session_api.xml:907
#, no-c-format
-msgid "It does not usually make sense to enable cascade on a <literal><many-to-one></literal> or <literal><many-to-many></literal> association. Cascade is often useful for <literal><one-to-one></literal> and <literal><one-to-many></literal> associations."
+msgid "It does not usually make sense to enable cascade on a many-to-one or many-to-many association. In fact the <literal>@ManyToOne</literal> and <literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</literal> attribute. Cascading is often useful for one-to-one and one-to-many associations."
msgstr ""
#. Tag: para
+#: session_api.xml:915
#, no-c-format
-msgid "If the child object's lifespan is bounded by the lifespan of the parent object, make it a <emphasis>life cycle object</emphasis> by specifying <literal>cascade=\"all,delete-orphan\"</literal>."
+msgid "If the child object's lifespan is bounded by the lifespan of the parent object, make it a <emphasis>life cycle object</emphasis> by specifying <literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
msgstr ""
#. Tag: para
+#: session_api.xml:923
#, no-c-format
msgid "Otherwise, you might not need cascade at all. But if you think that you will often be working with the parent and children together in the same transaction, and you want to save yourself some typing, consider using <literal>cascade=\"persist,merge,save-update\"</literal>."
msgstr ""
#. Tag: para
+#: session_api.xml:931
#, no-c-format
msgid "Mapping an association (either a single valued association, or a collection) with <literal>cascade=\"all\"</literal> marks the association as a <emphasis>parent/child</emphasis> style relationship where save/update/delete of the parent results in save/update/delete of the child or children."
msgstr ""
#. Tag: para
+#: session_api.xml:937
#, no-c-format
-msgid "Furthermore, a mere reference to a child from a persistent parent will result in save/update of the child. This metaphor is incomplete, however. A child which becomes unreferenced by its parent is <emphasis>not</emphasis> automatically deleted, except in the case of a <literal><one-to-many></literal> association mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise semantics of cascading operations for a parent/child relationship are as follows:"
+msgid "Furthermore, a mere reference to a child from a persistent parent will result in save/update of the child. This metaphor is incomplete, however. A child which becomes unreferenced by its parent is <emphasis>not</emphasis> automatically deleted, except in the case of a one-to-many association mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise semantics of cascading operations for a parent/child relationship are as follows:"
msgstr ""
#. Tag: para
+#: session_api.xml:948
#, no-c-format
msgid "If a parent is passed to <literal>persist()</literal>, all children are passed to <literal>persist()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:953
#, no-c-format
msgid "If a parent is passed to <literal>merge()</literal>, all children are passed to <literal>merge()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:958
#, no-c-format
msgid "If a parent is passed to <literal>save()</literal>, <literal>update()</literal> or <literal>saveOrUpdate()</literal>, all children are passed to <literal>saveOrUpdate()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:964
#, no-c-format
msgid "If a transient or detached child becomes referenced by a persistent parent, it is passed to <literal>saveOrUpdate()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:970
#, no-c-format
msgid "If a parent is deleted, all children are passed to <literal>delete()</literal>"
msgstr ""
#. Tag: para
+#: session_api.xml:975
#, no-c-format
msgid "If a child is dereferenced by a persistent parent, <emphasis>nothing special happens</emphasis> - the application should explicitly delete the child if necessary - unless <literal>cascade=\"delete-orphan\"</literal>, in which case the \"orphaned\" child is deleted."
msgstr ""
#. Tag: para
+#: session_api.xml:983
#, no-c-format
msgid "Finally, note that cascading of operations can be applied to an object graph at <emphasis>call time</emphasis> or at <emphasis>flush time</emphasis>. All operations, if enabled, are cascaded to associated entities reachable when the operation is executed. However, <literal>save-update</literal> and <literal>delete-orphan</literal> are transitive for all associated entities reachable during flush of the <literal>Session</literal>."
msgstr ""
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr ""
#. Tag: para
+#: session_api.xml:995
#, no-c-format
msgid "Hibernate requires a rich meta-level model of all entity and value types. This model can be useful to the application itself. For example, the application might use Hibernate's metadata to implement a \"smart\" deep-copy algorithm that understands which objects should be copied (eg. mutable value types) and which objects that should not (e.g. immutable value types and, possibly, associated entities)."
msgstr ""
#. Tag: para
+#: session_api.xml:1002
#, no-c-format
msgid "Hibernate exposes metadata via the <literal>ClassMetadata</literal> and <literal>CollectionMetadata</literal> interfaces and the <literal>Type</literal> hierarchy. Instances of the metadata interfaces can be obtained from the <literal>SessionFactory</literal>."
msgstr ""
+#. Tag: programlisting
+#: session_api.xml:1007
+#, no-c-format
+msgid ""
+ "Cat fritz = ......;\n"
+ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+ "\n"
+ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+ "String[] propertyNames = catMeta.getPropertyNames();\n"
+ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+ "\n"
+ "// get a Map of all properties which are not collections or associations\n"
+ "Map namedValues = new HashMap();\n"
+ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
+ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i].isCollectionType() ) {\n"
+ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
+ " }\n"
+ "}"
+msgstr ""
+
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/tutorial.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/tutorial.pot 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/tutorial.pot 2010-07-21 01:11:34 UTC (rev 19979)
@@ -1,698 +1,1582 @@
-#
-# AUTHOR <EMAIL at ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
-"PO-Revision-Date: 2010-02-11T05:38:16\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc at kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr ""
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
msgid "Intended for new users, this chapter provides an step-by-step introduction to Hibernate, starting with a simple application using an in-memory database. The tutorial is based on an earlier tutorial developed by Michael Gloegl. All code is contained in the <filename>tutorials/web</filename> directory of the project source."
msgstr ""
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
msgid "This tutorial expects the user have knowledge of both Java and SQL. If you have a limited knowledge of JAVA or SQL, it is advised that you start with a good introduction to that technology prior to attempting to learn Hibernate."
msgstr ""
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
msgid "The distribution contains another example application under the <filename>tutorial/eg</filename> project source directory."
msgstr ""
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr ""
#. Tag: para
+#: tutorial.xml:64
#, no-c-format
msgid "For this example, we will set up a small database application that can store events we want to attend and information about the host(s) of these events."
msgstr ""
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
msgid "Although you can use whatever database you feel comfortable using, we will use <ulink url=\"http://hsqldb.org/\">HSQLDB</ulink> (an in-memory, Java database) to avoid describing installation/setup of any particular database servers."
msgstr ""
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr ""
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
msgid "The first thing we need to do is to set up the development environment. We will be using the \"standard layout\" advocated by alot of build tools such as <ulink url=\"http://maven.org\">Maven</ulink>. Maven, in particular, has a good resource describing this <ulink url=\"http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html\">layout</ulink>. As this tutorial is to be a web application, we will be creating and making use of <filename>src/main/java</filename>, <filename>src/main/resources</filename> and <filename>src/main/webapp</filename> directories."
msgstr ""
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
msgid "We will be using Maven in this tutorial, taking advantage of its transitive dependency management capabilities as well as the ability of many IDEs to automatically set up a project for us based on the maven descriptor."
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:97
+#, no-c-format
+msgid ""
+ "<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+ " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n"
+ "\n"
+ " <modelVersion>4.0.0</modelVersion>\n"
+ "\n"
+ " <groupId>org.hibernate.tutorials</groupId>\n"
+ " <artifactId>hibernate-tutorial</artifactId>\n"
+ " <version>1.0.0-SNAPSHOT</version>\n"
+ " <name>First Hibernate Tutorial</name>\n"
+ "\n"
+ " <build>\n"
+ " <!-- we dont want the version to be part of the generated war file name -->\n"
+ " <finalName>${artifactId}</finalName>\n"
+ " </build>\n"
+ "\n"
+ " <dependencies>\n"
+ " <dependency>\n"
+ " <groupId>org.hibernate</groupId>\n"
+ " <artifactId>hibernate-core</artifactId>\n"
+ " </dependency>\n"
+ "\n"
+ " <!-- Because this is a web app, we also have a dependency on the servlet api. -->\n"
+ " <dependency>\n"
+ " <groupId>javax.servlet</groupId>\n"
+ " <artifactId>servlet-api</artifactId>\n"
+ " </dependency>\n"
+ "\n"
+ " <!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->\n"
+ " <dependency>\n"
+ " <groupId>org.slf4j</groupId>\n"
+ " <artifactId>slf4j-simple</artifactId>\n"
+ " </dependency>\n"
+ "\n"
+ " <!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->\n"
+ " <dependency>\n"
+ " <groupId>javassist</groupId>\n"
+ " <artifactId>javassist</artifactId>\n"
+ " </dependency>\n"
+ " </dependencies>\n"
+ "\n"
+ "</project>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:100
#, no-c-format
-msgid "It is not a requirement to use Maven. If you wish to use something else to build this tutoial (such as Ant), the layout will remain the same. The only change is that you will need to manually account for all the needed dependencies. If you use something like <ulink url=\"http://ant.apache.org/ivy/\">Ivy</ulink> providing transitive dependency management you would still use the dependencies mentioned below. Otherwise, you'd need to grab <emphasis>all</emphasis> dependencies, both explicit and transitive, and add them to the project's classpath. If working from the Hibernate distribution bundle, this would mean <filename>hibernate3.jar</filename>, all artifacts in the <filename>lib/required</filename> directory and all files from either the <filename>lib/bytecode/cglib</filename> or <filename>lib/bytecode/javassist</filename> directory; additionally you will need both the servlet-api jar and one of the slf4j logging backends."
+msgid "It is not a requirement to use Maven. If you wish to use something else to build this tutorial (such as Ant), the layout will remain the same. The only change is that you will need to manually account for all the needed dependencies. If you use something like <ulink url=\"http://ant.apache.org/ivy/\">Ivy</ulink> providing transitive dependency management you would still use the dependencies mentioned below. Otherwise, you'd need to grab <emphasis>all</emphasis> dependencies, both explicit and transitive, and add them to the project's classpath. If working from the Hibernate distribution bundle, this would mean <filename>hibernate3.jar</filename>, all artifacts in the <filename>lib/required</filename> directory and all files from either the <filename>lib/bytecode/cglib</filename> or <filename>lib/bytecode/javassist</filename> directory; additionally you will need both the servlet-api jar and one of the slf4j logging backends."
msgstr ""
#. Tag: para
+#: tutorial.xml:117
#, no-c-format
msgid "Save this file as <filename>pom.xml</filename> in the project root directory."
msgstr ""
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr ""
#. Tag: para
+#: tutorial.xml:126
#, no-c-format
msgid "Next, we create a class that represents the event we want to store in the database; it is a simple JavaBean class with some properties:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:131
+#, no-c-format
+msgid ""
+ "<![CDATA[package org.hibernate.tutorial.domain;\n"
+ "\n"
+ "import java.util.Date;\n"
+ "\n"
+ "public class Event {\n"
+ " private Long id;\n"
+ "\n"
+ " private String title;\n"
+ " private Date date;\n"
+ "\n"
+ " public Event() {}\n"
+ "\n"
+ " public Long getId() {\n"
+ " return id;\n"
+ " }\n"
+ "\n"
+ " private void setId(Long id) {\n"
+ " this.id = id;\n"
+ " }\n"
+ "\n"
+ " public Date getDate() {\n"
+ " return date;\n"
+ " }\n"
+ "\n"
+ " public void setDate(Date date) {\n"
+ " this.date = date;\n"
+ " }\n"
+ "\n"
+ " public String getTitle() {\n"
+ " return title;\n"
+ " }\n"
+ "\n"
+ " public void setTitle(String title) {\n"
+ " this.title = title;\n"
+ " }\n"
+ "}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:133
#, no-c-format
msgid "This class uses standard JavaBean naming conventions for property getter and setter methods, as well as private visibility for the fields. Although this is the recommended design, it is not required. Hibernate can also access fields directly, the benefit of accessor methods is robustness for refactoring."
msgstr ""
#. Tag: para
+#: tutorial.xml:141
#, no-c-format
msgid "The <literal>id</literal> property holds a unique identifier value for a particular event. All persistent entity classes (there are less important dependent classes as well) will need such an identifier property if we want to use the full feature set of Hibernate. In fact, most applications, especially web applications, need to distinguish objects by identifier, so you should consider this a feature rather than a limitation. However, we usually do not manipulate the identity of an object, hence the setter method should be private. Only Hibernate will assign identifiers when an object is saved. Hibernate can access public, private, and protected accessor methods, as well as public, private and protected fields directly. The choice is up to you and you can match it to fit your application design."
msgstr ""
#. Tag: para
+#: tutorial.xml:156
#, no-c-format
msgid "The no-argument constructor is a requirement for all persistent classes; Hibernate has to create objects for you, using Java Reflection. The constructor can be private, however package or public visibility is required for runtime proxy generation and efficient data retrieval without bytecode instrumentation."
msgstr ""
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
msgid "Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</filename> directory."
msgstr ""
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr ""
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
msgid "Hibernate needs to know how to load and store objects of the persistent class. This is where the Hibernate mapping file comes into play. The mapping file tells Hibernate what table in the database it has to access, and what columns in that table it should use."
msgstr ""
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:185
+#, no-c-format
+msgid ""
+ "<![CDATA[<?xml version=\"1.0\"?>\n"
+ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+ "\n"
+ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+ "[...]\n"
+ "</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:187
#, no-c-format
msgid "Hibernate DTD is sophisticated. You can use it for auto-completion of XML mapping elements and attributes in your editor or IDE. Opening up the DTD file in your text editor is the easiest way to get an overview of all elements and attributes, and to view the defaults, as well as some comments. Hibernate will not load the DTD file from the web, but first look it up from the classpath of the application. The DTD file is included in <filename>hibernate-core.jar</filename> (it is also included in the <filename>hibernate3.jar</filename>, if using the distribution bundle)."
msgstr ""
#. Tag: para
+#: tutorial.xml:200
#, no-c-format
msgid "We will omit the DTD declaration in future examples to shorten the code. It is, of course, not optional."
msgstr ""
#. Tag: para
+#: tutorial.xml:206
#, no-c-format
msgid "Between the two <literal>hibernate-mapping</literal> tags, include a <literal>class</literal> element. All persistent entity classes (again, there might be dependent classes later on, which are not first-class entities) need a mapping to a table in the SQL database:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:213
+#, no-c-format
+msgid ""
+ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+ "\n"
+ " <class name=\"Event\" table=\"EVENTS\">\n"
+ "\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:215
#, no-c-format
msgid "So far we have told Hibernate how to persist and load object of class <literal>Event</literal> to the table <literal>EVENTS</literal>. Each instance is now represented by a row in that table. Now we can continue by mapping the unique identifier property to the tables primary key. As we do not want to care about handling this identifier, we configure Hibernate's identifier generation strategy for a surrogate primary key column:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:225
+#, no-c-format
+msgid ""
+ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+ "\n"
+ " <class name=\"Event\" table=\"EVENTS\">\n"
+ " <id name=\"id\" column=\"EVENT_ID\">\n"
+ " <generator class=\"native\"/>\n"
+ " </id>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
msgid "The <literal>id</literal> element is the declaration of the identifier property. The <literal>name=\"id\"</literal> mapping attribute declares the name of the JavaBean property and tells Hibernate to use the <literal>getId()</literal> and <literal>setId()</literal> methods to access the property. The column attribute tells Hibernate which column of the <literal>EVENTS</literal> table holds the primary key value."
msgstr ""
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
msgid "The nested <literal>generator</literal> element specifies the identifier generation strategy (aka how are identifier values generated?). In this case we choose <literal>native</literal>, which offers a level of portability depending on the configured database dialect. Hibernate supports database generated, globally unique, as well as application assigned, identifiers. Identifier value generation is also one of Hibernate's many extension points and you can plugin in your own strategy."
msgstr ""
#. Tag: para
+#: tutorial.xml:249
#, no-c-format
-msgid "<literal>native</literal> is no longer consider the best strategy in terms of portability. for further discussion, see <xref linkend=\"portability-idgen\" />"
+msgid "<literal>native</literal> is no longer consider the best strategy in terms of portability. for further discussion, see"
msgstr ""
#. Tag: para
+#: tutorial.xml:255
#, no-c-format
msgid "Lastly, we need to tell Hibernate about the remaining entity class properties. By default, no properties of the class are considered persistent:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:261
+#, no-c-format
+msgid ""
+ "<![CDATA[\n"
+ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+ "\n"
+ " <class name=\"Event\" table=\"EVENTS\">\n"
+ " <id name=\"id\" column=\"EVENT_ID\">\n"
+ " <generator class=\"native\"/>\n"
+ " </id>\n"
+ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+ " <property name=\"title\"/>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:263
#, no-c-format
msgid "Similar to the <literal>id</literal> element, the <literal>name</literal> attribute of the <literal>property</literal> element tells Hibernate which getter and setter methods to use. In this case, Hibernate will search for <literal>getDate()</literal>, <literal>setDate()</literal>, <literal>getTitle()</literal> and <literal>setTitle()</literal> methods."
msgstr ""
#. Tag: para
+#: tutorial.xml:274
#, no-c-format
msgid "Why does the <literal>date</literal> property mapping include the <literal>column</literal> attribute, but the <literal>title</literal> does not? Without the <literal>column</literal> attribute, Hibernate by default uses the property name as the column name. This works for <literal>title</literal>, however, <literal>date</literal> is a reserved keyword in most databases so you will need to map it to a different name."
msgstr ""
#. Tag: para
+#: tutorial.xml:284
#, no-c-format
msgid "The <literal>title</literal> mapping also lacks a <literal>type</literal> attribute. The types declared and used in the mapping files are not Java data types; they are not SQL database types either. These types are called <emphasis>Hibernate mapping types</emphasis>, converters which can translate from Java to SQL data types and vice versa. Again, Hibernate will try to determine the correct conversion and mapping type itself if the <literal>type</literal> attribute is not present in the mapping. In some cases this automatic detection using Reflection on the Java class might not have the default you expect or need. This is the case with the <literal>date</literal> property. Hibernate cannot know if the property, which is of <literal>java.util.Date</literal>, should map to a SQL <literal>date</literal>, <literal>timestamp</literal>, or <literal>time</literal> column. Full date and time information is preserved by mapping the property with a <literal>timestamp</literal>!
converter."
msgstr ""
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
msgid "Hibernate makes this mapping type determination using reflection when the mapping files are processed. This can take time and resources, so if startup performance is important you should consider explicitly defining the type to use."
msgstr ""
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
msgid "Save this mapping file as <filename>src/main/resources/org/hibernate/tutorial/domain/Event.hbm.xml</filename>."
msgstr ""
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr ""
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
msgid "At this point, you should have the persistent class and its mapping file in place. It is now time to configure Hibernate. First let's set up HSQLDB to run in \"server mode\""
msgstr ""
#. Tag: para
+#: tutorial.xml:324
#, no-c-format
msgid "We do this do that the data remains between runs."
msgstr ""
#. Tag: para
+#: tutorial.xml:329
#, no-c-format
msgid "We will utilize the Maven exec plugin to launch the HSQLDB server by running: <command> mvn exec:java -Dexec.mainClass=\"org.hsqldb.Server\" -Dexec.args=\"-database.0 file:target/data/tutorial\"</command> You will see it start up and bind to a TCP/IP socket; this is where our application will connect later. If you want to start with a fresh database during this tutorial, shutdown HSQLDB, delete all files in the <filename>target/data</filename> directory, and start HSQLDB again."
msgstr ""
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
msgid "Hibernate will be connecting to the database on behalf of your application, so it needs to know how to obtain connections. For this tutorial we will be using a standalone connection pool (as opposed to a <interfacename>javax.sql.DataSource</interfacename>). Hibernate comes with support for two third-party open source JDBC connection pools: <ulink url=\"https://sourceforge.net/projects/c3p0\">c3p0</ulink> and <ulink url=\"http://proxool.sourceforge.net/\">proxool</ulink>. However, we will be using the Hibernate built-in connection pool for this tutorial."
msgstr ""
#. Tag: para
+#: tutorial.xml:351
#, no-c-format
msgid "The built-in Hibernate connection pool is in no way intended for production use. It lacks several features found on any decent connection pool."
msgstr ""
#. Tag: para
+#: tutorial.xml:357
#, no-c-format
msgid "For Hibernate's configuration, we can use a simple <literal>hibernate.properties</literal> file, a more sophisticated <literal>hibernate.cfg.xml</literal> file, or even complete programmatic setup. Most users prefer the XML configuration file:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:363
+#, no-c-format
+msgid ""
+ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+ "<!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"
+ "\n"
+ " <session-factory>\n"
+ "\n"
+ " <!-- Database connection settings -->\n"
+ " <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</property>\n"
+ " <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</property>\n"
+ " <property name=\"connection.username\">sa</property>\n"
+ " <property name=\"connection.password\"></property>\n"
+ "\n"
+ " <!-- JDBC connection pool (use the built-in) -->\n"
+ " <property name=\"connection.pool_size\">1</property>\n"
+ "\n"
+ " <!-- SQL dialect -->\n"
+ " <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</property>\n"
+ "\n"
+ " <!-- Enable Hibernate's automatic session context management -->\n"
+ " <property name=\"current_session_context_class\">thread</property>\n"
+ "\n"
+ " <!-- Disable the second-level cache -->\n"
+ " <property name=\"cache.provider_class\">org.hibernate.cache.NoCacheProvider</property>\n"
+ "\n"
+ " <!-- Echo all executed SQL to stdout -->\n"
+ " <property name=\"show_sql\">true</property>\n"
+ "\n"
+ " <!-- Drop and re-create the database schema on startup -->\n"
+ " <property name=\"hbm2ddl.auto\">update</property>\n"
+ "\n"
+ " <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+ "\n"
+ " </session-factory>\n"
+ "\n"
+ "</hibernate-configuration>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr ""
#. Tag: para
+#: tutorial.xml:369
#, no-c-format
msgid "You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory is a global factory responsible for a particular database. If you have several databases, for easier startup you should use several <literal><session-factory></literal> configurations in several configuration files."
msgstr ""
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
msgid "The first four <literal>property</literal> elements contain the necessary configuration for the JDBC connection. The dialect <literal>property</literal> element specifies the particular SQL variant Hibernate generates."
msgstr ""
#. Tag: para
+#: tutorial.xml:383
#, no-c-format
-msgid "In most cases, Hibernate is able to properly determine which dialect to use. See <xref linkend=\"portability-dialectresolver\" /> for more information."
+msgid "In most cases, Hibernate is able to properly determine which dialect to use. See <xref linkend=\"portability-dialectresolver\"/> for more information."
msgstr ""
#. Tag: para
+#: tutorial.xml:389
#, no-c-format
msgid "Hibernate's automatic session management for persistence contexts is particularly useful in this context. The <literal>hbm2ddl.auto</literal> option turns on automatic generation of database schemas directly into the database. This can also be turned off by removing the configuration option, or redirected to a file with the help of the <literal>SchemaExport</literal> Ant task. Finally, add the mapping file(s) for persistent classes to the configuration."
msgstr ""
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
msgid "Save this file as <filename>hibernate.cfg.xml</filename> into the <filename>src/main/resources</filename> directory."
msgstr ""
#. Tag: title
+#: tutorial.xml:406
#, no-c-format
msgid "Building with Maven"
msgstr ""
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
msgid "We will now build the tutorial with Maven. You will need to have Maven installed; it is available from the <ulink url=\"http://maven.apache.org/download.html\">Maven download page</ulink>. Maven will read the <filename>/pom.xml</filename> file we created earlier and know how to perform some basic project tasks. First, lets run the <literal>compile</literal> goal to make sure we can compile everything so far:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+ "<![CDATA[[hibernateTutorial]$ mvn compile\n"
+ "[INFO] Scanning for projects...\n"
+ "[INFO] ------------------------------------------------------------------------\n"
+ "[INFO] Building First Hibernate Tutorial\n"
+ "[INFO] task-segment: [compile]\n"
+ "[INFO] ------------------------------------------------------------------------\n"
+ "[INFO] [resources:resources]\n"
+ "[INFO] Using default encoding to copy filtered resources.\n"
+ "[INFO] [compiler:compile]\n"
+ "[INFO] Compiling 1 source file to /home/steve/projects/sandbox/hibernateTutorial/target/classes\n"
+ "[INFO] ------------------------------------------------------------------------\n"
+ "[INFO] BUILD SUCCESSFUL\n"
+ "[INFO] ------------------------------------------------------------------------\n"
+ "[INFO] Total time: 2 seconds\n"
+ "[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+ "[INFO] Final Memory: 5M/547M\n"
+ "[INFO] ------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr ""
#. Tag: para
+#: tutorial.xml:425
#, no-c-format
msgid "It is time to load and store some <literal>Event</literal> objects, but first you have to complete the setup with some infrastructure code. You have to startup Hibernate by building a global <interfacename>org.hibernate.SessionFactory</interfacename> object and storing it somewhere for easy access in application code. A <interfacename>org.hibernate.SessionFactory</interfacename> is used to obtain <interfacename>org.hibernate.Session</interfacename> instances. A <interfacename>org.hibernate.Session</interfacename> represents a single-threaded unit of work. The <interfacename>org.hibernate.SessionFactory</interfacename> is a thread-safe global object that is instantiated once."
msgstr ""
#. Tag: para
+#: tutorial.xml:439
#, no-c-format
msgid "We will create a <literal>HibernateUtil</literal> helper class that takes care of startup and makes accessing the <interfacename>org.hibernate.SessionFactory</interfacename> more convenient."
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:445
+#, no-c-format
+msgid ""
+ "<![CDATA[package org.hibernate.tutorial.util;\n"
+ "\n"
+ "import org.hibernate.SessionFactory;\n"
+ "import org.hibernate.cfg.Configuration;\n"
+ "\n"
+ "public class HibernateUtil {\n"
+ "\n"
+ " private static final SessionFactory sessionFactory = buildSessionFactory();\n"
+ "\n"
+ " private static SessionFactory buildSessionFactory() {\n"
+ " try {\n"
+ " // Create the SessionFactory from hibernate.cfg.xml\n"
+ " return new Configuration().configure().buildSessionFactory();\n"
+ " }\n"
+ " catch (Throwable ex) {\n"
+ " // Make sure you log the exception, as it might be swallowed\n"
+ " System.err.println(\"Initial SessionFactory creation failed.\" + ex);\n"
+ " throw new ExceptionInInitializerError(ex);\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " public static SessionFactory getSessionFactory() {\n"
+ " return sessionFactory;\n"
+ " }\n"
+ "\n"
+ "}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
msgid "Save this code as <filename>src/main/java/org/hibernate/tutorial/util/HibernateUtil.java</filename>"
msgstr ""
#. Tag: para
+#: tutorial.xml:452
#, no-c-format
msgid "This class not only produces the global <interfacename>org.hibernate.SessionFactory</interfacename> reference in its static initializer; it also hides the fact that it uses a static singleton. We might just as well have looked up the <interfacename>org.hibernate.SessionFactory</interfacename> reference from JNDI in an application server or any other location for that matter."
msgstr ""
#. Tag: para
+#: tutorial.xml:461
#, no-c-format
msgid "If you give the <interfacename>org.hibernate.SessionFactory</interfacename> a name in your configuration, Hibernate will try to bind it to JNDI under that name after it has been built. Another, better option is to use a JMX deployment and let the JMX-capable container instantiate and bind a <literal>HibernateService</literal> to JNDI. Such advanced options are discussed later."
msgstr ""
#. Tag: para
+#: tutorial.xml:470
#, no-c-format
msgid "You now need to configure a logging system. Hibernate uses commons logging and provides two choices: Log4j and JDK 1.4 logging. Most developers prefer Log4j: copy <literal>log4j.properties</literal> from the Hibernate distribution in the <literal>etc/</literal> directory to your <literal>src</literal> directory, next to <literal>hibernate.cfg.xml</literal>. If you prefer to have more verbose output than that provided in the example configuration, you can change the settings. By default, only the Hibernate startup message is shown on stdout."
msgstr ""
#. Tag: para
+#: tutorial.xml:480
#, no-c-format
msgid "The tutorial infrastructure is complete and you are now ready to do some real work with Hibernate."
msgstr ""
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr ""
#. Tag: para
+#: tutorial.xml:490
#, no-c-format
-msgid "We are now ready to start doing some real worjk with Hibernate. Let's start by writing an <literal>EventManager</literal> class with a <literal>main()</literal> method:"
+msgid "We are now ready to start doing some real work with Hibernate. Let's start by writing an <literal>EventManager</literal> class with a <literal>main()</literal> method:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:496
+#, no-c-format
+msgid ""
+ "<![CDATA[package org.hibernate.tutorial;\n"
+ "\n"
+ "import org.hibernate.Session;\n"
+ "\n"
+ "import java.util.*;\n"
+ "\n"
+ "import org.hibernate.tutorial.domain.Event;\n"
+ "import org.hibernate.tutorial.util.HibernateUtil;\n"
+ "\n"
+ "public class EventManager {\n"
+ "\n"
+ " public static void main(String[] args) {\n"
+ " EventManager mgr = new EventManager();\n"
+ "\n"
+ " if (args[0].equals(\"store\")) {\n"
+ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+ " }\n"
+ "\n"
+ " HibernateUtil.getSessionFactory().close();\n"
+ " }\n"
+ "\n"
+ " private void createAndStoreEvent(String title, Date theDate) {\n"
+ " Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n"
+ " session.beginTransaction();\n"
+ "\n"
+ " Event theEvent = new Event();\n"
+ " theEvent.setTitle(title);\n"
+ " theEvent.setDate(theDate);\n"
+ " session.save(theEvent);\n"
+ "\n"
+ " session.getTransaction().commit();\n"
+ " }\n"
+ "\n"
+ "}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:498
#, no-c-format
msgid "In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</literal> object and handed it over to Hibernate. At that point, Hibernate takes care of the SQL and executes an <literal>INSERT</literal> on the database."
msgstr ""
#. Tag: para
+#: tutorial.xml:505
#, no-c-format
-msgid "A <interface>org.hibernate.Session</interface> is designed to represent a single unit of work (a single atmoic piece of work to be performed). For now we will keep things simple and assume a one-to-one granularity between a Hibernate <interface>org.hibernate.Session</interface> and a database transaction. To shield our code from the actual underlying transaction system we use the Hibernate <interfacename>org.hibernate.Transaction</interfacename> API. In this particular case we are using JDBC-based transactional semantics, but it could also run with JTA."
+msgid "A <interface>org.hibernate.Session</interface> is designed to represent a single unit of work (a single atomic piece of work to be performed). For now we will keep things simple and assume a one-to-one granularity between a Hibernate <interface>org.hibernate.Session</interface> and a database transaction. To shield our code from the actual underlying transaction system we use the Hibernate <interfacename>org.hibernate.Transaction</interfacename> API. In this particular case we are using JDBC-based transactional semantics, but it could also run with JTA."
msgstr ""
#. Tag: para
+#: tutorial.xml:518
#, no-c-format
msgid "What does <literal>sessionFactory.getCurrentSession()</literal> do? First, you can call it as many times and anywhere you like once you get hold of your <interfacename>org.hibernate.SessionFactory</interfacename>. The <literal>getCurrentSession()</literal> method always returns the \"current\" unit of work. Remember that we switched the configuration option for this mechanism to \"thread\" in our <filename>src/main/resources/hibernate.cfg.xml</filename>? Due to that setting, the context of a current unit of work is bound to the current Java thread that executes the application."
msgstr ""
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
msgid "Hibernate offers three methods of current session tracking. The \"thread\" based method is not intended for production use; it is merely useful for prototyping and tutorials such as this one. Current session tracking is discussed in more detail later on."
msgstr ""
#. Tag: para
+#: tutorial.xml:541
#, no-c-format
msgid "A <interface>org.hibernate.Session</interface> begins when the first call to <literal>getCurrentSession()</literal> is made for the current thread. It is then bound by Hibernate to the current thread. When the transaction ends, either through commit or rollback, Hibernate automatically unbinds the <interface>org.hibernate.Session</interface> from the thread and closes it for you. If you call <literal>getCurrentSession()</literal> again, you get a new <interface>org.hibernate.Session</interface> and can start a new unit of work."
msgstr ""
#. Tag: para
+#: tutorial.xml:554
#, no-c-format
msgid "Related to the unit of work scope, should the Hibernate <interface>org.hibernate.Session</interface> be used to execute one or several database operations? The above example uses one <interface>org.hibernate.Session</interface> for one operation. However this is pure coincidence; the example is just not complex enough to show any other approach. The scope of a Hibernate <interface>org.hibernate.Session</interface> is flexible but you should never design your application to use a new Hibernate <interface>org.hibernate.Session</interface> for <emphasis>every</emphasis> database operation. Even though it is used in the following examples, consider <emphasis>session-per-operation</emphasis> an anti-pattern. A real web application is shown later in the tutorial which will help illustrate this."
msgstr ""
#. Tag: para
+#: tutorial.xml:571
#, no-c-format
-msgid "See <xref linkend=\"transactions\" /> for more information about transaction handling and demarcation. The previous example also skipped any error handling and rollback."
+msgid "See <xref linkend=\"transactions\"/> for more information about transaction handling and demarcation. The previous example also skipped any error handling and rollback."
msgstr ""
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
msgid "To run this, we will make use of the Maven exec plugin to call our class with the necessary classpath setup: <command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"store\"</command>"
msgstr ""
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
msgstr ""
#. Tag: para
+#: tutorial.xml:589
#, no-c-format
msgid "You should see Hibernate starting up and, depending on your configuration, lots of log output. Towards the end, the following line will be displayed:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:594
+#, no-c-format
+msgid "<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values (?, ?, ?)]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:596
#, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr ""
#. Tag: para
+#: tutorial.xml:600
#, no-c-format
msgid "To list stored events an option is added to the main method:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:604
+#, no-c-format
+msgid ""
+ "<![CDATA[ if (args[0].equals(\"store\")) {\n"
+ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+ " }\n"
+ " else if (args[0].equals(\"list\")) {\n"
+ " List events = mgr.listEvents();\n"
+ " for (int i = 0; i < events.size(); i++) {\n"
+ " Event theEvent = (Event) events.get(i);\n"
+ " System.out.println(\n"
+ " \"Event: \" + theEvent.getTitle() + \" Time: \" + theEvent.getDate()\n"
+ " );\n"
+ " }\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:606
#, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:610
+#, no-c-format
+msgid ""
+ "<![CDATA[ private List listEvents() {\n"
+ " Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n"
+ " session.beginTransaction();\n"
+ " List result = session.createQuery(\"from Event\").list();\n"
+ " session.getTransaction().commit();\n"
+ " return result;\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:612
#, no-c-format
-msgid "Here, we are using a Hibernate Query Language (HQL) query to load all existing <literal>Event</literal> objects from the database. Hibernate will generate the appropriate SQL, send it to the database and populate <literal>Event</literal> objects with the data. You can create more complex queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
+msgid "Here, we are using a Hibernate Query Language (HQL) query to load all existing <literal>Event</literal> objects from the database. Hibernate will generate the appropriate SQL, send it to the database and populate <literal>Event</literal> objects with the data. You can create more complex queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
msgstr ""
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
msgid "Now we can call our new functionality, again using the Maven exec plugin: <command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"list\"</command>"
msgstr ""
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr ""
#. Tag: para
+#: tutorial.xml:632
#, no-c-format
msgid "So far we have mapped a single persistent entity class to a table in isolation. Let's expand on that a bit and add some class associations. We will add people to the application and store a list of events in which they participate."
msgstr ""
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr ""
#. Tag: para
+#: tutorial.xml:642
#, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:646
+#, no-c-format
+msgid ""
+ "<![CDATA[package org.hibernate.tutorial.domain;\n"
+ "\n"
+ "public class Person {\n"
+ "\n"
+ " private Long id;\n"
+ " private int age;\n"
+ " private String firstname;\n"
+ " private String lastname;\n"
+ "\n"
+ " public Person() {}\n"
+ "\n"
+ " // Accessor methods for all properties, private setter for 'id'\n"
+ "\n"
+ "}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
msgid "Save this to a file named <filename>src/main/java/org/hibernate/tutorial/domain/Person.java</filename>"
msgstr ""
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
msgid "Next, create the new mapping file as <filename>src/main/resources/org/hibernate/tutorial/domain/Person.hbm.xml</filename>"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:658
+#, no-c-format
+msgid ""
+ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+ "\n"
+ " <class name=\"Person\" table=\"PERSON\">\n"
+ " <id name=\"id\" column=\"PERSON_ID\">\n"
+ " <generator class=\"native\"/>\n"
+ " </id>\n"
+ " <property name=\"age\"/>\n"
+ " <property name=\"firstname\"/>\n"
+ " <property name=\"lastname\"/>\n"
+ " </class>\n"
+ "\n"
+ "</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:664
+#, no-c-format
+msgid ""
+ "<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+ "<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:666
#, no-c-format
msgid "Create an association between these two entities. Persons can participate in events, and events have participants. The design questions you have to deal with are: directionality, multiplicity, and collection behavior."
msgstr ""
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr ""
#. Tag: para
+#: tutorial.xml:678
#, no-c-format
msgid "By adding a collection of events to the <literal>Person</literal> class, you can easily navigate to the events for a particular person, without executing an explicit query - by calling <literal>Person#getEvents</literal>. Multi-valued associations are represented in Hibernate by one of the Java Collection Framework contracts; here we choose a <interfacename>java.util.Set</interfacename> because the collection will not contain duplicate elements and the ordering is not relevant to our examples:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:689
+#, no-c-format
+msgid ""
+ "<![CDATA[public class Person {\n"
+ "\n"
+ " private Set events = new HashSet();\n"
+ "\n"
+ " public Set getEvents() {\n"
+ " return events;\n"
+ " }\n"
+ "\n"
+ " public void setEvents(Set events) {\n"
+ " this.events = events;\n"
+ " }\n"
+ "}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:691
#, no-c-format
msgid "Before mapping this association, let's consider the other side. We could just keep this unidirectional or create another collection on the <literal>Event</literal>, if we wanted to be able to navigate it from both directions. This is not necessary, from a functional perspective. You can always execute an explicit query to retrieve the participants for a particular event. This is a design choice left to you, but what is clear from this discussion is the multiplicity of the association: \"many\" valued on both sides is called a <emphasis>many-to-many</emphasis> association. Hence, we use Hibernate's many-to-many mapping:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:704
+#, no-c-format
+msgid ""
+ "<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+ " <id name=\"id\" column=\"PERSON_ID\">\n"
+ " <generator class=\"native\"/>\n"
+ " </id>\n"
+ " <property name=\"age\"/>\n"
+ " <property name=\"firstname\"/>\n"
+ " <property name=\"lastname\"/>\n"
+ "\n"
+ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
+ " <key column=\"PERSON_ID\"/>\n"
+ " <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+ " </set>\n"
+ "\n"
+ "</class>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:706
#, no-c-format
msgid "Hibernate supports a broad range of collection mappings, a <literal>set</literal> being most common. For a many-to-many association, or <emphasis>n:m</emphasis> entity relationship, an association table is required. Each row in this table represents a link between a person and an event. The table name is decalred using the <literal>table</literal> attribute of the <literal>set</literal> element. The identifier column name in the association, for the person side, is defined with the <literal>key</literal> element, the column name for the event's side with the <literal>column</literal> attribute of the <literal>many-to-many</literal>. You also have to tell Hibernate the class of the objects in your collection (the class on the other side of the collection of references)."
msgstr ""
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:726
+#, no-c-format
+msgid ""
+ "<![CDATA[\n"
+ " _____________ __________________\n"
+ " | | | | _____________\n"
+ " | EVENTS | | PERSON_EVENT | | |\n"
+ " |_____________| |__________________| | PERSON |\n"
+ " | | | | |_____________|\n"
+ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+ " | TITLE | |__________________| | AGE |\n"
+ " |_____________| | FIRSTNAME |\n"
+ " | LASTNAME |\n"
+ " |_____________|\n"
+ " ]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr ""
#. Tag: para
+#: tutorial.xml:733
#, no-c-format
msgid "Now we will bring some people and events together in a new method in <literal>EventManager</literal>:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:737
+#, no-c-format
+msgid ""
+ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+ " Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n"
+ " session.beginTransaction();\n"
+ "\n"
+ " Person aPerson = (Person) session.load(Person.class, personId);\n"
+ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
+ " aPerson.getEvents().add(anEvent);\n"
+ "\n"
+ " session.getTransaction().commit();\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:739
#, no-c-format
msgid "After loading a <literal>Person</literal> and an <literal>Event</literal>, simply modify the collection using the normal collection methods. There is no explicit call to <literal>update()</literal> or <literal>save()</literal>; Hibernate automatically detects that the collection has been modified and needs to be updated. This is called <emphasis>automatic dirty checking</emphasis>. You can also try it by modifying the name or the date property of any of your objects. As long as they are in <emphasis>persistent</emphasis> state, that is, bound to a particular Hibernate <interfacename>org.hibernate.Session</interfacename>, Hibernate monitors any changes and executes SQL in a write-behind fashion. The process of synchronizing the memory state with the database, usually only at the end of a unit of work, is called <emphasis>flushing</emphasis>. In our code, the unit of work ends with a commit, or rollback, of the database transaction."
msgstr ""
#. Tag: para
+#: tutorial.xml:758
#, no-c-format
msgid "You can load person and event in different units of work. Or you can modify an object outside of a <interfacename>org.hibernate.Session</interfacename>, when it is not in persistent state (if it was persistent before, this state is called <emphasis>detached</emphasis>). You can even modify a collection when it is detached:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:767
+#, no-c-format
+msgid ""
+ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+ " Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n"
+ " session.beginTransaction();\n"
+ "\n"
+ " Person aPerson = (Person) session\n"
+ " .createQuery(\"select p from Person p left join fetch p.events where p.id = :pid\")\n"
+ " .setParameter(\"pid\", personId)\n"
+ " .uniqueResult(); // Eager fetch the collection so we can use it detached\n"
+ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
+ "\n"
+ " session.getTransaction().commit();\n"
+ "\n"
+ " // End of first unit of work\n"
+ "\n"
+ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) is detached\n"
+ "\n"
+ " // Begin second unit of work\n"
+ "\n"
+ " Session session2 = HibernateUtil.getSessionFactory().getCurrentSession();\n"
+ " session2.beginTransaction();\n"
+ " session2.update(aPerson); // Reattachment of aPerson\n"
+ "\n"
+ " session2.getTransaction().commit();\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:769
#, no-c-format
msgid "The call to <literal>update</literal> makes a detached object persistent again by binding it to a new unit of work, so any modifications you made to it while detached can be saved to the database. This includes any modifications (additions/deletions) you made to a collection of that entity object."
msgstr ""
#. Tag: para
+#: tutorial.xml:778
#, no-c-format
msgid "This is not much use in our example, but it is an important concept you can incorporate into your own application. Complete this exercise by adding a new action to the main method of the <literal>EventManager</literal> and call it from the command line. If you need the identifiers of a person and an event - the <literal>save()</literal> method returns it (you might have to modify some of the previous methods to return that identifier):"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:786
+#, no-c-format
+msgid ""
+ "<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+ " mgr.addPersonToEvent(personId, eventId);\n"
+ " System.out.println(\"Added person \" + personId + \" to event \" + eventId);\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:788
#, no-c-format
msgid "This is an example of an association between two equally important classes : two entities. As mentioned earlier, there are other classes and types in a typical model, usually \"less important\". Some you have already seen, like an <literal>int</literal> or a <classname>java.lang.String</classname>. We call these classes <emphasis>value types</emphasis>, and their instances <emphasis>depend</emphasis> on a particular entity. Instances of these types do not have their own identity, nor are they shared between entities. Two persons do not reference the same <literal>firstname</literal> object, even if they have the same first name. Value types cannot only be found in the JDK , but you can also write dependent classes yourself such as an <literal>Address</literal> or <literal>MonetaryAmount</literal> class. In fact, in a Hibernate application all JDK classes are considered value types."
msgstr ""
#. Tag: para
+#: tutorial.xml:806
#, no-c-format
msgid "You can also design a collection of value types. This is conceptually different from a collection of references to other entities, but looks almost the same in Java."
msgstr ""
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr ""
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
msgid "Let's add a collection of email addresses to the <literal>Person</literal> entity. This will be represented as a <interfacename>java.util.Set</interfacename> of <classname>java.lang.String</classname> instances:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:823
+#, no-c-format
+msgid ""
+ "<![CDATA[ private Set emailAddresses = new HashSet();\n"
+ "\n"
+ " public Set getEmailAddresses() {\n"
+ " return emailAddresses;\n"
+ " }\n"
+ "\n"
+ " public void setEmailAddresses(Set emailAddresses) {\n"
+ " this.emailAddresses = emailAddresses;\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:825
#, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:829
+#, no-c-format
+msgid ""
+ "<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+ " <key column=\"PERSON_ID\"/>\n"
+ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+ " </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:831
#, no-c-format
msgid "The difference compared with the earlier mapping is the use of the <literal>element</literal> part which tells Hibernate that the collection does not contain references to another entity, but is rather a collection whose elements are values types, here specifically of type <literal>string</literal>. The lowercase name tells you it is a Hibernate mapping type/converter. Again the <literal>table</literal> attribute of the <literal>set</literal> element determines the table name for the collection. The <literal>key</literal> element defines the foreign-key column name in the collection table. The <literal>column</literal> attribute in the <literal>element</literal> element defines the column name where the email address values will actually be stored."
msgstr ""
#. Tag: para
+#: tutorial.xml:847
#, no-c-format
msgid "Here is the updated schema:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:851
+#, no-c-format
+msgid ""
+ "<![CDATA[\n"
+ " _____________ __________________\n"
+ " | | | | _____________\n"
+ " | EVENTS | | PERSON_EVENT | | | ___________________\n"
+ " |_____________| |__________________| | PERSON | | |\n"
+ " | | | | |_____________| | PERSON_EMAIL_ADDR |\n"
+ " | *EVENT_ID | <--> | *EVENT_ID | | | |___________________|\n"
+ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | *PERSON_ID |\n"
+ " | TITLE | |__________________| | AGE | | *EMAIL_ADDR |\n"
+ " |_____________| | FIRSTNAME | |___________________|\n"
+ " | LASTNAME |\n"
+ " |_____________|\n"
+ " ]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:853
#, no-c-format
msgid "You can see that the primary key of the collection table is in fact a composite key that uses both columns. This also implies that there cannot be duplicate email addresses per person, which is exactly the semantics we need for a set in Java."
msgstr ""
#. Tag: para
+#: tutorial.xml:859
#, no-c-format
msgid "You can now try to add elements to this collection, just like we did before by linking persons and events. It is the same code in Java:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:864
+#, no-c-format
+msgid ""
+ "<![CDATA[ private void addEmailToPerson(Long personId, String emailAddress) {\n"
+ " Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n"
+ " session.beginTransaction();\n"
+ "\n"
+ " Person aPerson = (Person) session.load(Person.class, personId);\n"
+ " // adding to the emailAddress collection might trigger a lazy load of the collection\n"
+ " aPerson.getEmailAddresses().add(emailAddress);\n"
+ "\n"
+ " session.getTransaction().commit();\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:866
#, no-c-format
msgid "This time we did not use a <emphasis>fetch</emphasis> query to initialize the collection. Monitor the SQL log and try to optimize this with an eager fetch."
msgstr ""
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr ""
#. Tag: para
+#: tutorial.xml:877
#, no-c-format
msgid "Next you will map a bi-directional association. You will make the association between person and event work from both sides in Java. The database schema does not change, so you will still have many-to-many multiplicity."
msgstr ""
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
msgid "A relational database is more flexible than a network programming language, in that it does not need a navigation direction; data can be viewed and retrieved in any possible way."
msgstr ""
#. Tag: para
+#: tutorial.xml:893
#, no-c-format
msgid "First, add a collection of participants to the <literal>Event</literal> class:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:898
+#, no-c-format
+msgid ""
+ "<![CDATA[ private Set participants = new HashSet();\n"
+ "\n"
+ " public Set getParticipants() {\n"
+ " return participants;\n"
+ " }\n"
+ "\n"
+ " public void setParticipants(Set participants) {\n"
+ " this.participants = participants;\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:900
#, no-c-format
msgid "Now map this side of the association in <literal>Event.hbm.xml</literal>."
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:904
+#, no-c-format
+msgid ""
+ "<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true\">\n"
+ " <key column=\"EVENT_ID\"/>\n"
+ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+ " </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:906
#, no-c-format
msgid "These are normal <literal>set</literal> mappings in both mapping documents. Notice that the column names in <literal>key</literal> and <literal>many-to-many</literal> swap in both mapping documents. The most important addition here is the <literal>inverse=\"true\"</literal> attribute in the <literal>set</literal> element of the <literal>Event</literal>'s collection mapping."
msgstr ""
#. Tag: para
+#: tutorial.xml:914
#, no-c-format
msgid "What this means is that Hibernate should take the other side, the <literal>Person</literal> class, when it needs to find out information about the link between the two. This will be a lot easier to understand once you see how the bi-directional link between our two entities is created."
msgstr ""
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr ""
#. Tag: para
+#: tutorial.xml:925
#, no-c-format
msgid "First, keep in mind that Hibernate does not affect normal Java semantics. How did we create a link between a <literal>Person</literal> and an <literal>Event</literal> in the unidirectional example? You add an instance of <literal>Event</literal> to the collection of event references, of an instance of <literal>Person</literal>. If you want to make this link bi-directional, you have to do the same on the other side by adding a <literal>Person</literal> reference to the collection in an <literal>Event</literal>. This process of \"setting the link on both sides\" is absolutely necessary with bi-directional links."
msgstr ""
#. Tag: para
+#: tutorial.xml:935
#, no-c-format
msgid "Many developers program defensively and create link management methods to correctly set both sides (for example, in <literal>Person</literal>):"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:940
+#, no-c-format
+msgid ""
+ "<![CDATA[ protected Set getEvents() {\n"
+ " return events;\n"
+ " }\n"
+ "\n"
+ " protected void setEvents(Set events) {\n"
+ " this.events = events;\n"
+ " }\n"
+ "\n"
+ " public void addToEvent(Event event) {\n"
+ " this.getEvents().add(event);\n"
+ " event.getParticipants().add(this);\n"
+ " }\n"
+ "\n"
+ " public void removeFromEvent(Event event) {\n"
+ " this.getEvents().remove(event);\n"
+ " event.getParticipants().remove(this);\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:942
#, no-c-format
msgid "The get and set methods for the collection are now protected. This allows classes in the same package and subclasses to still access the methods, but prevents everybody else from altering the collections directly. Repeat the steps for the collection on the other side."
msgstr ""
#. Tag: para
+#: tutorial.xml:949
#, no-c-format
msgid "What about the <literal>inverse</literal> mapping attribute? For you, and for Java, a bi-directional link is simply a matter of setting the references on both sides correctly. Hibernate, however, does not have enough information to correctly arrange SQL <literal>INSERT</literal> and <literal>UPDATE</literal> statements (to avoid constraint violations). Making one side of the association <literal>inverse</literal> tells Hibernate to consider it a <emphasis>mirror</emphasis> of the other side. That is all that is necessary for Hibernate to resolve any issues that arise when transforming a directional navigation model to a SQL database schema. The rules are straightforward: all bi-directional associations need one side as <literal>inverse</literal>. In a one-to-many association it has to be the many-side, and in many-to-many association you can select either side."
msgstr ""
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr ""
#. Tag: para
+#: tutorial.xml:967
#, no-c-format
msgid "A Hibernate web application uses <literal>Session</literal> and <literal>Transaction</literal> almost like a standalone application. However, some common patterns are useful. You can now write an <literal>EventManagerServlet</literal>. This servlet can list all events stored in the database, and it provides an HTML form to enter new events."
msgstr ""
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr ""
#. Tag: para
+#: tutorial.xml:977
#, no-c-format
msgid "First we need create our basic processing servlet. Since our servlet only handles HTTP <literal>GET</literal> requests, we will only implement the <literal>doGet()</literal> method:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:983
+#, no-c-format
+msgid ""
+ "<![CDATA[package org.hibernate.tutorial.web;\n"
+ "\n"
+ "// Imports\n"
+ "\n"
+ "public class EventManagerServlet extends HttpServlet {\n"
+ "\n"
+ " protected void doGet(\n"
+ " HttpServletRequest request,\n"
+ " HttpServletResponse response) throws ServletException, IOException {\n"
+ "\n"
+ " SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy\" );\n"
+ "\n"
+ " try {\n"
+ " // Begin unit of work\n"
+ " HibernateUtil.getSessionFactory().getCurrentSession().beginTransaction();\n"
+ "\n"
+ " // Process request and render page...\n"
+ "\n"
+ " // End unit of work\n"
+ " HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().commit();\n"
+ " }\n"
+ " catch (Exception ex) {\n"
+ " HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();\n"
+ " if ( ServletException.class.isInstance( ex ) ) {\n"
+ " throw ( ServletException ) ex;\n"
+ " }\n"
+ " else {\n"
+ " throw new ServletException( ex );\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ "\n"
+ "}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
msgid "Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/EventManagerServlet.java</filename>"
msgstr ""
#. Tag: para
+#: tutorial.xml:990
#, no-c-format
msgid "The pattern applied here is called <emphasis>session-per-request</emphasis>. When a request hits the servlet, a new Hibernate <literal>Session</literal> is opened through the first call to <literal>getCurrentSession()</literal> on the <literal>SessionFactory</literal>. A database transaction is then started. All data access occurs inside a transaction irrespective of whether the data is read or written. Do not use the auto-commit mode in applications."
msgstr ""
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
msgid "Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> for every database operation. Use one Hibernate <literal>Session</literal> that is scoped to the whole request. Use <literal>getCurrentSession()</literal>, so that it is automatically bound to the current Java thread."
msgstr ""
#. Tag: para
+#: tutorial.xml:1006
#, no-c-format
msgid "Next, the possible actions of the request are processed and the response HTML is rendered. We will get to that part soon."
msgstr ""
#. Tag: para
+#: tutorial.xml:1011
#, no-c-format
msgid "Finally, the unit of work ends when processing and rendering are complete. If any problems occurred during processing or rendering, an exception will be thrown and the database transaction rolled back. This completes the <literal>session-per-request</literal> pattern. Instead of the transaction demarcation code in every servlet, you could also write a servlet filter. See the Hibernate website and Wiki for more information about this pattern called <emphasis>Open Session in View</emphasis>. You will need it as soon as you consider rendering your view in JSP, not in a servlet."
msgstr ""
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr ""
#. Tag: para
+#: tutorial.xml:1027
#, no-c-format
msgid "Now you can implement the processing of the request and the rendering of the page."
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, no-c-format
+msgid ""
+ "<![CDATA[ // Write HTML header\n"
+ " PrintWriter out = response.getWriter();\n"
+ " out.println(\"<html><head><title>Event Manager</title></head><body>\");\n"
+ "\n"
+ " // Handle actions\n"
+ " if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+ "\n"
+ " String eventTitle = request.getParameter(\"eventTitle\");\n"
+ " String eventDate = request.getParameter(\"eventDate\");\n"
+ "\n"
+ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+ " out.println(\"<b><i>Please enter event title and date.</i></b>\");\n"
+ " }\n"
+ " else {\n"
+ " createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
+ " out.println(\"<b><i>Added event.</i></b>\");\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " // Print page\n"
+ " printEventForm(out);\n"
+ " listEvents(out, dateFormatter);\n"
+ "\n"
+ " // Write HTML footer\n"
+ " out.println(\"</body></html>\");\n"
+ " out.flush();\n"
+ " out.close();]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1033
#, no-c-format
msgid "This coding style, with a mix of Java and HTML, would not scale in a more complex application—keep in mind that we are only illustrating basic Hibernate concepts in this tutorial. The code prints an HTML header and a footer. Inside this page, an HTML form for event entry and a list of all events in the database are printed. The first method is trivial and only outputs HTML:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, no-c-format
+msgid ""
+ "<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+ " out.println(\"<h2>Add new event:</h2>\");\n"
+ " out.println(\"<form>\");\n"
+ " out.println(\"Title: <input name='eventTitle' length='50'/><br/>\");\n"
+ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' length='10'/><br/>\");\n"
+ " out.println(\"<input type='submit' name='action' value='store'/>\");\n"
+ " out.println(\"</form>\");\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
msgid "The <literal>listEvents()</literal> method uses the Hibernate <literal>Session</literal> bound to the current thread to execute a query:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, no-c-format
+msgid ""
+ "<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) {\n"
+ "\n"
+ " List result = HibernateUtil.getSessionFactory()\n"
+ " .getCurrentSession().createCriteria(Event.class).list();\n"
+ " if (result.size() > 0) {\n"
+ " out.println(\"<h2>Events in database:</h2>\");\n"
+ " out.println(\"<table border='1'>\");\n"
+ " out.println(\"<tr>\");\n"
+ " out.println(\"<th>Event title</th>\");\n"
+ " out.println(\"<th>Event date</th>\");\n"
+ " out.println(\"</tr>\");\n"
+ " Iterator it = result.iterator();\n"
+ " while (it.hasNext()) {\n"
+ " Event event = (Event) it.next();\n"
+ " out.println(\"<tr>\");\n"
+ " out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+ " out.println(\"<td>\" + dateFormatter.format(event.getDate()) + \"</td>\");\n"
+ " out.println(\"</tr>\");\n"
+ " }\n"
+ " out.println(\"</table>\");\n"
+ " }\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
msgid "Finally, the <literal>store</literal> action is dispatched to the <literal>createAndStoreEvent()</literal> method, which also uses the <literal>Session</literal> of the current thread:"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, no-c-format
+msgid ""
+ "<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) {\n"
+ " Event theEvent = new Event();\n"
+ " theEvent.setTitle(title);\n"
+ " theEvent.setDate(theDate);\n"
+ "\n"
+ " HibernateUtil.getSessionFactory()\n"
+ " .getCurrentSession().save(theEvent);\n"
+ " }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1060
#, no-c-format
msgid "The servlet is now complete. A request to the servlet will be processed in a single <literal>Session</literal> and <literal>Transaction</literal>. As earlier in the standalone application, Hibernate can automatically bind these objects to the current thread of execution. This gives you the freedom to layer your code and access the <literal>SessionFactory</literal> in any way you like. Usually you would use a more sophisticated design and move the data access code into data access objects (the DAO pattern). See the Hibernate Wiki for more examples."
msgstr ""
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr ""
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
msgid "To deploy this application for testing we must create a Web ARchive (WAR). First we must define the WAR descriptor as <filename>src/main/webapp/WEB-INF/web.xml</filename>"
msgstr ""
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, no-c-format
+msgid ""
+ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<web-app version=\"2.4\"\n"
+ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
+ "\n"
+ " <servlet>\n"
+ " <servlet-name>Event Manager</servlet-name>\n"
+ " <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</servlet-class>\n"
+ " </servlet>\n"
+ "\n"
+ " <servlet-mapping>\n"
+ " <servlet-name>Event Manager</servlet-name>\n"
+ " <url-pattern>/eventmanager</url-pattern>\n"
+ " </servlet-mapping>\n"
+ "</web-app>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1084
#, no-c-format
msgid "To build and deploy call <literal>mvn package</literal> in your project directory and copy the <filename>hibernate-tutorial.war</filename> file into your Tomcat <filename>webapps</filename> directory."
msgstr ""
#. Tag: para
+#: tutorial.xml:1091
#, no-c-format
-msgid "If you do not have Tomcat installed, download it from <ulink url=\"http://tomcat.apache.org/\" /> and follow the installation instructions. Our application requires no changes to the standard Tomcat configuration."
+msgid "If you do not have Tomcat installed, download it from <ulink url=\"http://tomcat.apache.org/\"></ulink> and follow the installation instructions. Our application requires no changes to the standard Tomcat configuration."
msgstr ""
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
msgid "Once deployed and Tomcat is running, access the application at <literal>http://localhost:8080/hibernate-tutorial/eventmanager</literal>. Make sure you watch the Tomcat log to see Hibernate initialize when the first request hits your servlet (the static initializer in <literal>HibernateUtil</literal> is called) and to get the detailed output if any exceptions occurs."
msgstr ""
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr ""
#. Tag: para
+#: tutorial.xml:1114
#, no-c-format
msgid "This tutorial covered the basics of writing a simple standalone Hibernate application and a small web application. More tutorials are available from the Hibernate <ulink url=\"http://hibernate.org\">website</ulink>."
msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/author_group.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/author_group.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/author_group.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: author_group\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-04T04:51:21\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-19 15:45+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -15,138 +15,296 @@
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
-msgstr "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
-msgstr "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
-msgstr "Max"
+msgid ""
+"<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</"
+"surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
-msgstr "Emmanuel"
+msgid ""
+"<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
-msgstr "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
-msgstr "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
-msgstr "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
-msgstr "Vincent"
+msgid "Graphic Design"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
-msgstr "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
-msgstr "Michael"
+msgid ""
+"<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> "
+"<email>kreimer at bbs.frc.utn.edu.ar</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
-msgstr "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
-msgstr "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
-msgstr "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
-msgstr "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
-msgstr "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
-msgstr "Francisco"
+msgid ""
+"<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></"
+"othercredit>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
-msgstr "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
-msgstr "Luiz Carlos"
+msgid ""
+"<firstname>Alvaro</firstname> <surname>Netto</surname> "
+"<email>alvaronetto at cetip.com.br</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
-msgstr "Marcel"
+msgid ""
+"<firstname>Anderson</firstname> <surname>Braulio</surname> "
+"<email>andersonbraulio at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
-msgstr "Paulo"
+msgid ""
+"<firstname>Daniel Vieira</firstname> <surname>Costa</surname> "
+"<email>danielvc at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
-msgstr "Pablo L."
+msgid ""
+"<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco."
+"gamarra at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
-msgstr "Renato"
+msgid ""
+"<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
-msgstr "Rogério"
+msgid ""
+"<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> "
+"<email>luizcarlos_rodrigues at yahoo.com.br</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
-msgstr "Wanderson"
+msgid ""
+"<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel."
+"castelo at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
-msgstr "Cao"
+msgid ""
+"<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail."
+"com</email>"
+msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
-msgstr "RedSaga"
+msgid ""
+"<firstname>Pablo L.</firstname> <surname>de Miranda</surname> "
+"<email>pablolmiranda at gmail.com</email>"
+msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
-msgstr "Time de Tradução"
+msgid ""
+"<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail."
+"com</email>"
+msgstr ""
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid ""
+"<firstname>Rogério</firstname> <surname>Araújo</surname> "
+"<email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid ""
+"<firstname>Wanderson</firstname> <surname>Siqueira</surname> "
+"<email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid ""
+"<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> "
+"<orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</"
+"contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
+
+#~ msgid "Gavin"
+#~ msgstr "Gavin"
+
+#~ msgid "Christian"
+#~ msgstr "Christian"
+
+#~ msgid "Max"
+#~ msgstr "Max"
+
+#~ msgid "Emmanuel"
+#~ msgstr "Emmanuel"
+
+#~ msgid "Steve"
+#~ msgstr "Steve"
+
+#~ msgid "James"
+#~ msgstr "James"
+
+#~ msgid "Cheyenne"
+#~ msgstr "Cheyenne"
+
+#~ msgid "Vincent"
+#~ msgstr "Vincent"
+
+#~ msgid "Sebastien"
+#~ msgstr "Sebastien"
+
+#~ msgid "Michael"
+#~ msgstr "Michael"
+
+#~ msgid "Baptiste"
+#~ msgstr "Baptiste"
+
+#~ msgid "Anthony"
+#~ msgstr "Anthony"
+
+#~ msgid "Alvaro"
+#~ msgstr "Alvaro"
+
+#~ msgid "Anderson"
+#~ msgstr "Anderson"
+
+#~ msgid "Daniel Vieira"
+#~ msgstr "Daniel Vieira"
+
+#~ msgid "Francisco"
+#~ msgstr "Francisco"
+
+#~ msgid "Gamarra"
+#~ msgstr "Gamarra"
+
+#~ msgid "Luiz Carlos"
+#~ msgstr "Luiz Carlos"
+
+#~ msgid "Marcel"
+#~ msgstr "Marcel"
+
+#~ msgid "Paulo"
+#~ msgstr "Paulo"
+
+#~ msgid "Pablo L."
+#~ msgstr "Pablo L."
+
+#~ msgid "Renato"
+#~ msgstr "Renato"
+
+#~ msgid "Rogério"
+#~ msgstr "Rogério"
+
+#~ msgid "Wanderson"
+#~ msgstr "Wanderson"
+
+#~ msgid "Cao"
+#~ msgstr "Cao"
+
+#~ msgid "RedSaga"
+#~ msgstr "RedSaga"
+
+#~ msgid "Translation Lead"
+#~ msgstr "Time de Tradução"
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/basic_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/basic_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/basic_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: basic_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-18 10:20+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,23 +118,144 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "Mapeamento O/R Básico"
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "Declaração de mapeamento"
#. Tag: para
+#: basic_mapping.xml:36
#, no-c-format
+msgid "Object/relational mappings can be defined in three approaches:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:41
+#, no-c-format
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:46
+#, no-c-format
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
msgid ""
-"Object/relational mappings are usually defined in an XML document. The "
-"mapping document is designed to be readable and hand-editable. The mapping "
-"language is Java-centric, meaning that mappings are constructed around "
-"persistent class declarations and not table declarations."
+"Annotations are split in two categories, the logical mapping annotations "
+"(describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid ""
+"JPA annotations are in the <literal>javax.persistence.*</literal> package. "
+"Hibernate specific extensions are in <literal>org.hibernate.annotations.*</"
+"literal>. You favorite IDE can auto-complete annotations and their "
+"attributes for you (even without a specific \"JPA\" plugin, since JPA "
+"annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
+#, fuzzy, no-c-format
+msgid "Here is an example of mapping"
+msgstr "Vamos iniciar com um exemplo de mapeamento:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"@Entity \n"
+"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
+"discriminatorType=CHAR)\n"
+"public class Cat {\n"
+" \n"
+" @Id @GeneratedValue\n"
+" public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public BigDecimal getWeight() { return weight; }\n"
+" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+" private BigDecimal weight;\n"
+"\n"
+" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+" public Date getBirthdate() { return birthdate; }\n"
+" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+" private Date birthdate;\n"
+"\n"
+" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+" @NotNull @Column(updatable=false)\n"
+" public ColorType getColor() { return color; }\n"
+" public void setColor(ColorType color) { this.color = color; }\n"
+" private ColorType color;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public String getSex() { return sex; }\n"
+" public void setSex(String sex) { this.sex = sex; }\n"
+" private String sex;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public Integer getLitterId() { return litterId; }\n"
+" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+" private Integer litterId;\n"
+"\n"
+" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+" public Cat getMother() { return mother; }\n"
+" public void setMother(Cat mother) { this.mother = mother; }\n"
+" private Cat mother;\n"
+"\n"
+" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+" public Set<Cat> getKittens() { return kittens; }\n"
+" public void setKittens(Set<Cat> kittens) { this.kittens = "
+"kittens; }\n"
+" private Set<Cat> kittens = new HashSet<Cat>();\n"
+"}\n"
+"\n"
+"@Entity @DiscriminatorValue(\"D\")\n"
+"public class DomesticCat extends Cat {\n"
+"\n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name }\n"
+" private String name;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Dog { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:73
+#, fuzzy, no-c-format
+msgid ""
+"The legacy hbm.xml approach uses an XML schema designed to be readable and "
+"hand-editable. The mapping language is Java-centric, meaning that mappings "
+"are constructed around persistent class declarations and not table "
+"declarations."
+msgstr ""
"O mapeamento de objeto/relacional é geralmente definido em um documento XML. "
"O documento de mapeamento é criado para ser de leitura e editável "
"manualmente. A linguagem do mapeamento é Java-centric, ou seja, os "
@@ -142,6 +263,7 @@
"não de declarações de tabelas. "
#. Tag: para
+#: basic_mapping.xml:78
#, no-c-format
msgid ""
"Please note that even though many Hibernate users choose to write the XML by "
@@ -153,19 +275,93 @@
"mapeamento, incluindo o XDoclet Middlegen e AndroMDA."
#. Tag: para
+#: basic_mapping.xml:82
#, no-c-format
msgid "Here is an example mapping:"
msgstr "Vamos iniciar com um exemplo de mapeamento:"
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:84
#, no-c-format
msgid ""
-"We will now discuss the content of the mapping document. We will only "
-"describe, however, the document elements and attributes that are used by "
-"Hibernate at runtime. The mapping document also contains some extra optional "
-"attributes and elements that affect the database schemas exported by the "
-"schema export tool (for example, the <literal> not-null</literal> attribute)."
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:86
+#, fuzzy, no-c-format
+msgid ""
+"We will now discuss the concepts of the mapping documents (both annotations "
+"and XML). We will only describe, however, the document elements and "
+"attributes that are used by Hibernate at runtime. The mapping document also "
+"contains some extra optional attributes and elements that affect the "
+"database schemas exported by the schema export tool (for example, the "
+"<literal> not-null</literal> attribute)."
+msgstr ""
"Discutiremos agora o conteúdo deste documento de mapeamento. Iremos apenas "
"descrever os elementos do documento e funções que são utilizadas pelo "
"Hibernate em tempo de execução. O documento de mapeamento também contém "
@@ -174,232 +370,429 @@
"esquemas. (Por exemplo, o atributo <literal>not-null</literal>). "
#. Tag: title
+#: basic_mapping.xml:94
+#, fuzzy, no-c-format
+msgid "Entity"
+msgstr "Solucionador de Entidade"
+
+#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "Doctype"
-msgstr "Doctype"
+msgid ""
+"An entity is a regular Java object (aka POJO) which will be persisted by "
+"Hibernate."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:99
#, no-c-format
msgid ""
-"All XML mappings should declare the doctype shown. The actual DTD can be "
-"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
-"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
-"will always look for the DTD in its classpath first. If you experience "
-"lookups of the DTD using an Internet connection, check the DTD declaration "
-"against the contents of your classpath."
+"To mark an object as an entity in annotations, use the <classname>@Entity</"
+"classname> annotation."
msgstr ""
-"Todos os mapeamentos de XML devem declarar o doctype exibido. O DTD atual "
-"pode ser encontrado na URL abaixo, no diretório <literal>hibernate-x.x.x/src/"
-"org/ hibernate </literal> ou no <literal>hibernate3.jar</literal>. O "
-"Hibernate sempre irá procurar pelo DTD inicialmente no seu classpath. Se "
-"você tentar localizar o DTD usando uma conexão de internet, compare a "
-"declaração do seu DTD com o conteúdo do seu classpath."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:102
#, no-c-format
-msgid "EntityResolver"
-msgstr "Solucionador de Entidade"
+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
+#: basic_mapping.xml:104
#, no-c-format
msgid ""
-"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
-"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
-"implementation with the SAXReader it uses to read in the xml files. This "
-"custom <literal>EntityResolver</literal> recognizes two different systemId "
-"namespaces:"
+"That's pretty much it, the rest is optional. There are however any options "
+"to tweak your entity mapping, let's explore them."
msgstr ""
-"O Hibernate irá primeiro tentar solucionar os DTDs em seus classpath. Isto é "
-"feito, registrando uma implementação <literal>org.xml.sax.EntityResolver</"
-"literal> personalizada com o SAXReader que ele utiliza para ler os arquivos "
-"xml. Este <literal>EntityResolver</literal> personalizado, reconhece dois "
-"nomes de espaço de sistemas Id diferentes:"
#. Tag: para
+#: basic_mapping.xml:107
#, no-c-format
msgid ""
-"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
-"encounters a systemId starting with <literal>http://hibernate.sourceforge."
-"net/</literal>. The resolver attempts to resolve these entities via the "
-"classloader which loaded the Hibernate classes."
+"<classname>@Table</classname> lets you define the table the entity will be "
+"persisted into. If undefined, the table name is the unqualified class name "
+"of the entity. You can also optionally define the catalog, the schema as "
+"well as unique constraints on the table."
msgstr ""
-"Um <literal>hibernate namespace</literal> é reconhecido quando um "
-"solucionador encontra um systema Id iniciando com <literal>http://hibernate."
-"sourceforge.net/</literal>. O solucionador tenta solucionar estas entidades "
-"através do carregador de classe que carregou as classes do Hibernate. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:112
#, no-c-format
msgid ""
-"a <literal>user namespace</literal> is recognized whenever the resolver "
-"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
-"The resolver will attempt to resolve these entities via (1) the current "
-"thread context classloader and (2) the classloader which loaded the "
-"Hibernate classes."
+"@Entity\n"
+"@Table(name=\"TBL_FLIGHT\", \n"
+" schema=\"AIR_COMMAND\", \n"
+" uniqueConstraints=\n"
+" @UniqueConstraint(\n"
+" name=\"flight_number\", \n"
+" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+"public class Flight implements Serializable {\n"
+" @Column(name=\"comp_prefix\")\n"
+" public String getCompagnyPrefix() { return companyPrefix; }\n"
+"\n"
+" @Column(name=\"flight_number\")\n"
+" public String getNumber() { return number; }\n"
+"}"
msgstr ""
-"Um <literal>user namespace</literal> é reconhecido quando um solucionador "
-"encontra um sistema Id, utilizando um protocolo URL de <literal>classpath://"
-"</literal>. O solucionador tentará solucionar estas entidades através do "
-"carregador de classe do contexto de thread atual (1) e o carregador de "
-"classe (2) que carregou as classes do Hibernate. "
#. Tag: para
+#: basic_mapping.xml:114
#, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
-msgstr "Um exemplo de utilização do espaço de nome do usuário:"
+msgid ""
+"The constraint name is optional (generated if left undefined). The column "
+"names composing the constraint correspond to the column names as defined "
+"before the Hibernate <classname>NamingStrategy</classname> is applied."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:119
#, no-c-format
msgid ""
-"Where <literal>types.xml</literal> is a resource in the <literal>your."
-"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
-"custom\">typedef</link>."
+"<literal>@Entity.name</literal> lets you define the shortcut name of the "
+"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
+"class name of the class."
msgstr ""
-"Onde <literal>types.xml</literal> é um recurso no pacote <literal>your."
-"domain</literal> e contém um <link linkend=\"mapping-types-"
-"custom\">typedef</link> "
-"personalizado."
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:123
#, no-c-format
-msgid "Hibernate-mapping"
-msgstr "Mapeamento do Hibernate"
+msgid ""
+"Hibernate goes beyond the JPA specification and provide additional "
+"configurations. Some of them are hosted on <classname>@org.hibernate."
+"annotations.Entity</classname>:"
+msgstr ""
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:129
+#, fuzzy, no-c-format
msgid ""
-"This element has several optional attributes. The <literal>schema</literal> "
-"and <literal>catalog</literal> attributes specify that tables referred to in "
-"this mapping belong to the named schema and/or catalog. If they are "
-"specified, tablenames will be qualified by the given schema and catalog "
-"names. If they are missing, tablenames will be unqualified. The "
-"<literal>default-cascade</literal> attribute specifies what cascade style "
-"should be assumed for properties and collections that do not specify a "
-"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
-"literal> attribute allows you to use unqualified class names in the query "
-"language."
+"<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> "
+"(defaults to false): specifies that <literal>INSERT</literal> / "
+"<literal>UPDATE</literal> SQL should be generated at runtime and contain "
+"only the columns whose values are not null. The <literal>dynamic-update</"
+"literal> and <literal>dynamic-insert</literal> settings are not inherited by "
+"subclasses. Although these settings can increase performance in some cases, "
+"they can actually decrease performance in others."
msgstr ""
-"Este elemento possui diversos atributos opcionais. Os atributos "
-"<literal>schema</literal> e <literal>catalog</literal> especificam que "
-"tabelas referenciadas neste mapeamento pertencem ao esquema e/ou ao catálogo "
-"nomeado. Se especificados, os nomes das tabelas serão qualificados no "
-"esquema ou catálogo dado. Se não, os nomes das tabelas não serão "
-"qualificados. O atributo <literal>default-cascade</literal> especifica qual "
-"estilo de cascata será considerado pelas propriedades e coleções que não "
-"especificarem uma função <literal>cascade</literal>. A função <literal>auto-"
-"import</literal> nos deixa utilizar nomes de classes não qualificados na "
-"linguagem de consulta, por padrão."
+"Observe que as configurações <literal>dynamic-update</literal> e "
+"<literal>dynamic-insert</literal> não são herdadas pelas subclasses e assim "
+"podem também ser especificadas em elementos <literal><subclass></"
+"literal> ou <literal><joined-subclass></literal>. Estas configurações "
+"podem incrementar o desempenho em alguns casos, mas podem realmente diminuir "
+"o desempenho em outras. "
#. Tag: para
+#: basic_mapping.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"<literal>selectBeforeUpdate</literal> (defaults to false): specifies that "
+"Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</"
+"literal> unless it is certain that an object is actually modified. Only when "
+"a transient object has been associated with a new session using "
+"<literal>update()</literal>, will Hibernate perform an extra SQL "
+"<literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is "
+"actually required. Use of <literal>select-before-update</literal> will "
+"usually decrease performance. It is useful to prevent a database update "
+"trigger being called unnecessarily if you reattach a graph of detached "
+"instances to a <literal>Session</literal>."
+msgstr ""
+"<literal>select-before-update</literal> (opcional, valor padrão "
+"<literal>false</literal>): Especifica que o Hibernate <emphasis>nunca</"
+"emphasis> deve executar um SQL de <literal>UPDATE</literal> a não ser que "
+"seja certo que um objeto está atualmente modificado. Em certos casos (na "
+"verdade, apenas quando um objeto transiente foi associado a uma nova sessão "
+"utilizando <literal>update()</literal>), isto significa que o Hibernate irá "
+"executar uma instrução SQL de <literal>SELECT</literal> adicional para "
+"determinar se um <literal>UPDATE</literal> é necessário nesse momento."
+
+#. Tag: para
+#: basic_mapping.xml:154
+#, fuzzy, no-c-format
+msgid ""
+"<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): "
+"determines whether implicit or explicit query polymorphisms is used. "
+"<emphasis>Implicit</emphasis> polymorphisms means that instances of the "
+"class will be returned by a query that names any superclass or implemented "
+"interface or class, and that instances of any subclass of the class will be "
+"returned by a query that names the class itself. <emphasis>Explicit</"
+"emphasis> polymorphisms means that class instances will be returned only by "
+"queries that explicitly name that class. Queries that name the class will "
+"return only instances of subclasses mapped. For most purposes, the default "
+"<literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit "
+"polymorphisms is useful when two different classes are mapped to the same "
+"table This allows a \"lightweight\" class that contains a subset of the "
+"table columns."
+msgstr ""
+"Polimorfismo <emphasis>implícito</emphasis> significa que instâncias de uma "
+"classe serão retornadas por uma consulta que dá nome a qualquer superclasse "
+"ou interface e classe implementada, além das instâncias de qualquer "
+"subclasse da classe serão retornadas por uma consulta que nomeia a classe "
+"por si. Polimorfismo <emphasis>explícito</emphasis> significa que instâncias "
+"da classe serão retornadas apenas por consultas que explicitamente nomeiam a "
+"classe e que as consultas que nomeiam as classes irão retornar apenas "
+"instâncias de subclasses mapeadas dentro da declaração <literal><class>"
+"</literal> como uma <literal><subclass></literal> ou <literal><"
+"joined-subclass></literal>. Para a maioria dos casos, o valor padrão "
+"<literal>polymorphism=\"implicit\"</literal>, é apropriado. Polimorfismo "
+"explicito é útil quando duas classes distintas estão mapeadas para a mesma "
+"tabela. Isso aceita uma classe \"peso leve\" que contém um subconjunto de "
+"colunas da tabela. "
+
+#. Tag: para
+#: basic_mapping.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"<literal>persister</literal>: specifies a custom <literal>ClassPersister</"
+"literal>. The <literal>persister</literal> attribute lets you customize the "
+"persistence strategy used for the class. You can, for example, specify your "
+"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
+"or you can even provide a completely new implementation of the interface "
+"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
+"for example, persistence via stored procedure calls, serialization to flat "
+"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
+"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgstr ""
+"O atributo <literal>persister</literal> deixa você customizar a estratégia "
+"de persistência utilizada para a classe. Você pode, por exemplo, especificar "
+"sua própria subclasse do <literal>org.hibernate.persister.EntityPersister</"
+"literal> ou você pode criar uma implementação completamente nova da "
+"interface <literal>org.hibernate.persister.ClassPersister</literal> que "
+"implementa a persistência através de, por exemplo, chamadas a procedimentos "
+"armazenados, serialização de arquivos planos ou LDAP. Veja <literal>org."
+"hibernate.test.CustomPersister</literal> para um exemplo simples de "
+"\"persistência\" para uma <literal>Hashtable</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): "
+"determines the optimistic locking strategy. If you enable "
+"<literal>dynamicUpdate</literal>, you will have a choice of optimistic "
+"locking strategies:"
+msgstr ""
+"Se você ativar <literal>dynamic-update</literal>, você terá de escolher a "
+"estratégia de bloqueio otimista:"
+
+#. Tag: para
+#: basic_mapping.xml:192
#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
-msgstr "<literal>schema</literal> (opcional): O nome do esquema do banco de dados. "
+msgid "<literal>version</literal>: check the version/timestamp columns"
+msgstr "<literal>version</literal>: verifica as colunas de versão/timestamp"
#. Tag: para
+#: basic_mapping.xml:197
#, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
-msgstr "<literal>catalog</literal> (opcional): O nome do catálogo do banco de dados. "
+msgid "<literal>all</literal>: check all columns"
+msgstr "<literal>all</literal>: verifica todas as colunas"
#. Tag: para
+#: basic_mapping.xml:201
#, no-c-format
msgid ""
-"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
-"literal>): a default cascade style."
+"<literal>dirty</literal>: check the changed columns, allowing some "
+"concurrent updates"
msgstr ""
-"<literal>default-cascade</literal> (opcional – o padrão é <literal>none</"
-"literal>): Um estilo cascata padrão."
+"<literal>dirty</literal>: verifica as colunas modificadas, permitindo "
+"algumas atualizações concorrentes"
#. Tag: para
+#: basic_mapping.xml:206
#, no-c-format
+msgid "<literal>none</literal>: do not use optimistic locking"
+msgstr "<literal>none</literal>: não utiliza o bloqueio otimista"
+
+#. Tag: para
+#: basic_mapping.xml:211
+#, no-c-format
msgid ""
-"<literal>default-access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing all properties. "
-"It can be a custom implementation of <literal>PropertyAccessor</literal>."
+"It is <emphasis>strongly</emphasis> recommended that you use version/"
+"timestamp columns for optimistic locking with Hibernate. This strategy "
+"optimizes performance and correctly handles modifications made to detached "
+"instances (i.e. when <literal>Session.merge()</literal> is used)."
msgstr ""
-"<literal>default-access</literal> (opcional – o padrão é <literal>property</"
-"literal>): A estratégia que o Hibernate deve utilizar para acessar todas as "
-"propridades. Pode ser uma implementação personalizada de "
-"<literal>PropertyAccessor</literal>."
+"Nós <emphasis>realmente</emphasis> recomendamos que você utilize as colunas "
+"de versão/timestamp para o bloqueio otimista com o Hibernate. Esta é a "
+"melhor estratégia em relação ao desempenho e é a única estratégia que trata "
+"corretamente as modificações efetuadas em instâncias desconectadas (por "
+"exemplo, quando <literal>Session.merge()</literal> é utilizado)."
#. Tag: para
+#: basic_mapping.xml:220
#, no-c-format
msgid ""
-"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
-"literal>): the default value for unspecified <literal>lazy</literal> "
-"attributes of class and collection mappings."
+"Be sure to import <classname>@javax.persistence.Entity</classname> to mark a "
+"class as an entity. It's a common mistake to import <classname>@org."
+"hibernate.annotations.Entity</classname> by accident."
msgstr ""
-"<literal>default-lazy</literal> (opcional - o padrão é <literal>true</"
-"literal>): O valor padrão para atributos <literal>lazy</literal> não "
-"especificados da classe e dos mapeamentos de coleções."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:227
+#, fuzzy, no-c-format
msgid ""
-"<literal>auto-import</literal> (optional - defaults to <literal>true</"
-"literal>): specifies whether we can use unqualified class names of classes "
-"in this mapping in the query language."
+"Some entities are not mutable. They cannot be updated or deleted by the "
+"application. This allows Hibernate to make some minor performance "
+"optimizations.. Use the <classname>@Immutable</classname> annotation."
msgstr ""
-"<literal>auto-import</literal> (opcional - o padrão é <literal>true</"
-"literal>): Especifica se podemos usar nomes de classes não qualificados, das "
-"classes deste mapeamento, na linguagem de consulta."
+"Classes imutáveis, <literal>mutable=\"false\"</literal>, não podem ser "
+"modificadas ou excluídas pela aplicação. Isso permite que o Hibernate "
+"aperfeiçoe o desempenho. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:232
+#, fuzzy, no-c-format
msgid ""
-"<literal>package</literal> (optional): specifies a package prefix to use for "
-"unqualified class names in the mapping document."
+"You can also alter how Hibernate deals with lazy initialization for this "
+"class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false "
+"to disable lazy fetching (not recommended). You can also specify an "
+"interface to use for lazy initializing proxies (defaults to the class "
+"itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. "
+"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
+"the named interface. The persistent object will load when a method of the "
+"proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
-"<literal>package</literal> (opcional): Especifica um prefixo do pacote a ser "
-"considerado para nomes de classes não qualificadas no documento de "
-"mapeamento. "
+"A função opcional <literal>proxy</literal> habilita a inicialização lazy das "
+"instâncias persistentes da classe. O Hibernate irá retornar CGLIB proxies "
+"como implementado na interface nomeada. O objeto persistente atual será "
+"carregado quando um método do proxy for invocado. Veja \"Inicialização de "
+"Coleções e Proxies\" abaixo. "
#. Tag: para
+#: basic_mapping.xml:243
#, no-c-format
msgid ""
-"If you have two persistent classes with the same unqualified name, you "
-"should set <literal>auto-import=\"false\"</literal>. An exception will "
-"result if you attempt to assign two classes to the same \"imported\" name."
+"<classname>@BatchSize</classname> specifies a \"batch size\" for fetching "
+"instances of this class by identifier. Not yet loaded instances are loaded "
+"batch-size at a time (default 1)."
msgstr ""
-"Se você tem duas classes persistentes com o mesmo nome (não qualificadas), "
-"você deve ajustar <literal>auto-import=\"false\"</literal>. Caso você tentar "
-"ajustar duas classes para o mesmo nome \"importado\", isto resultará numa "
-"exceção."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:247
+#, fuzzy, no-c-format
msgid ""
-"The <literal>hibernate-mapping</literal> element allows you to nest several "
-"persistent <literal><class></literal> mappings, as shown above. It is, "
-"however, good practice (and expected by some tools) to map only a single "
-"persistent class, or a single class hierarchy, in one mapping file and name "
-"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
-"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
-"<literal>Animal.hbm.xml</literal>."
+"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
+"objects of this class. Use <classname>@Where</classname> for that."
msgstr ""
-"Observe que o elemento <literal>hibernate-mapping</literal> permite que você "
-"aninhe diversos mapeamentos de <literal><class></literal> "
-"persistentes, como mostrado abaixo. Entretanto, é uma boa prática (e "
-"esperado por algumas ferramentas) o mapeamento de apenas uma classe "
-"persistente simples (ou uma hierarquia de classes simples) em um arquivo de "
-"mapeamento e nomeá-la após a superclasse persistente, por exemplo: "
-"<literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal>, ou se "
-"estiver usando herança, <literal>Animal.hbm.xml</literal>. "
+"<literal>where</literal> (opicional): Especifica um comando SQL "
+"<literal>WHERE</literal> arbitrário para ser usado quando da recuperação de "
+"objetos desta classe."
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:251
+#, fuzzy, no-c-format
+msgid ""
+"In the same vein, <classname>@Check</classname> lets you define an SQL "
+"expression used to generate a multi-row <emphasis>check</emphasis> "
+"constraint for automatic schema generation."
+msgstr ""
+"<literal>check</literal> (opcional): Uma expressão SQL utilizada para gerar "
+"uma restrição de <emphasis>verificação</emphasis> de múltiplas linhas para a "
+"geração automática do esquema. "
+
+#. Tag: para
+#: basic_mapping.xml:255
+#, fuzzy, no-c-format
+msgid ""
+"There is no difference between a view and a base table for a Hibernate "
+"mapping. This is transparent at the database level, although some DBMS do "
+"not support views properly, especially with updates. Sometimes you want to "
+"use a view, but you cannot create one in the database (i.e. with a legacy "
+"schema). In this case, you can map an immutable and read-only entity to a "
+"given SQL subselect expression using <classname>@org.hibernate.annotations."
+"Subselect</classname>:"
+msgstr ""
+"Não há diferença entre uma visão e uma tabela para o mapeamento do "
+"Hibernate, e como esperado isto é transparente no nível do banco de dados, "
+"mesmo que alguns bancos de dados não suportam visões apropriadamente, "
+"especialmente com atualizações. Algumas vezes, você quer utilizar uma visão, "
+"mas não pode criá-la no banco de dados (por exemplo, com um esquema legado). "
+"Neste caso, você pode mapear uma entidade imutável e de somente leitura, "
+"para uma dada expressão de subseleção SQL: "
+
+#. Tag: programlisting
+#: basic_mapping.xml:263
#, no-c-format
-msgid "Class"
-msgstr "Classe"
+msgid ""
+"@Entity\n"
+"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+" + \"from item \"\n"
+" + \"join bid on bid.item_id = item.id \"\n"
+" + \"group by item.name\")\n"
+"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+"public class Summary {\n"
+" @Id\n"
+" public String getId() { return id; }\n"
+" ...\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:265
#, no-c-format
msgid ""
-"You can declare a persistent class using the <literal>class</literal> "
-"element. For example:"
+"Declare the tables to synchronize this entity with, ensuring that auto-flush "
+"happens correctly and that queries against the derived entity do not return "
+"stale data. The <literal><subselect></literal> is available both as an "
+"attribute and a nested mapping element."
msgstr ""
+"Declare as tabelas para sincronizar com esta entidade, garantindo que a auto-"
+"liberação ocorra corretamente, e que as consultas para esta entidade "
+"derivada não retornem dados desatualizados. O <literal><subselect></"
+"literal> está disponível tanto como um atributo como um elemento mapeado "
+"aninhado."
+
+#. Tag: para
+#: basic_mapping.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"We will now explore the same options using the hbm.xml structure. You can "
+"declare a persistent class using the <literal>class</literal> element. For "
+"example:"
+msgstr ""
"Você pode declarar uma classe persistente utilizando o elemento "
"<literal>class</literal>. Por exemplo:"
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, no-c-format
+msgid ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:323
#, no-c-format
msgid ""
"<literal>name</literal> (optional): the fully qualified Java class name of "
@@ -411,6 +804,7 @@
"assume-se que o mapeamento é para entidades não-POJO. "
#. Tag: para
+#: basic_mapping.xml:330
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to the unqualified class "
@@ -420,6 +814,7 @@
"qualificadas): O nome da sua tabela do banco de dados."
#. Tag: para
+#: basic_mapping.xml:335
#, no-c-format
msgid ""
"<literal>discriminator-value</literal> (optional - defaults to the class "
@@ -433,6 +828,7 @@
"<literal>not null</literal>. "
#. Tag: para
+#: basic_mapping.xml:343
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -442,6 +838,7 @@
"literal>): Especifica quais instâncias da classe são (ou não) mutáveis."
#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): overrides the schema name specified by "
@@ -451,6 +848,7 @@
"especificado pelo elemento raíz <literal><hibernate-mapping></literal>."
#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
#, no-c-format
msgid ""
"<literal>catalog</literal> (optional): overrides the catalog name specified "
@@ -460,6 +858,7 @@
"especificado pelo elemento raíz <literal><hibernate-mapping></literal>."
#. Tag: para
+#: basic_mapping.xml:361
#, no-c-format
msgid ""
"<literal>proxy</literal> (optional): specifies an interface to use for lazy "
@@ -470,6 +869,7 @@
"da própria classe. "
#. Tag: para
+#: basic_mapping.xml:367
#, no-c-format
msgid ""
"<literal>dynamic-update</literal> (optional - defaults to <literal>false</"
@@ -482,6 +882,7 @@
"alterados. "
#. Tag: para
+#: basic_mapping.xml:374
#, no-c-format
msgid ""
"<literal>dynamic-insert</literal> (optional - defaults to <literal>false</"
@@ -494,6 +895,7 @@
"nulos. "
#. Tag: para
+#: basic_mapping.xml:381
#, no-c-format
msgid ""
"<literal>select-before-update</literal> (optional - defaults to "
@@ -514,10 +916,11 @@
"determinar se um <literal>UPDATE</literal> é necessário nesse momento."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:393
+#, fuzzy, no-c-format
msgid ""
-"<literal>polymorphism</literal> (optional - defaults to <literal>implicit</"
-"literal>): determines whether implicit or explicit query polymorphism is "
+"<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</"
+"literal>): determines whether implicit or explicit query polymorphisms is "
"used."
msgstr ""
"<literal>polymorphism</literal> (opcional, padrão para <literal>implicit</"
@@ -525,6 +928,7 @@
"ou explicitamente. "
#. Tag: para
+#: basic_mapping.xml:399
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -536,6 +940,7 @@
"objetos desta classe."
#. Tag: para
+#: basic_mapping.xml:405
#, no-c-format
msgid ""
"<literal>persister</literal> (optional): specifies a custom "
@@ -545,6 +950,7 @@
"<literal>ClassPersister</literal> customizada."
#. Tag: para
+#: basic_mapping.xml:410
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): "
@@ -556,6 +962,7 @@
"classe pela identificação."
#. Tag: para
+#: basic_mapping.xml:416
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>version</"
@@ -565,6 +972,7 @@
"literal>): Determina a estratégia de bloqueio."
#. Tag: para
+#: basic_mapping.xml:422
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional): lazy fetching can be disabled by setting "
@@ -574,14 +982,15 @@
"completamente desabilitada, ajustando <literal>lazy=\"false\"</literal>."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:427
+#, fuzzy, no-c-format
msgid ""
"<literal>entity-name</literal> (optional - defaults to the class name): "
"Hibernate3 allows a class to be mapped multiple times, potentially to "
"different tables. It also allows entity mappings that are represented by "
"Maps or XML at the Java level. In these cases, you should provide an "
"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
-"classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
+"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
"<literal>entity-name</literal> (opcional - padrão para o nome da classe): O "
"Hibernate3 permite uma classe ser mapeada múltiplas vezes, potencialmente "
@@ -592,6 +1001,7 @@
"para maiores informações."
#. Tag: para
+#: basic_mapping.xml:437
#, no-c-format
msgid ""
"<literal>check</literal> (optional): an SQL expression used to generate a "
@@ -603,6 +1013,7 @@
"geração automática do esquema. "
#. Tag: para
+#: basic_mapping.xml:443
#, no-c-format
msgid ""
"<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. "
@@ -619,6 +1030,7 @@
"uma determinada tuple armazenada. "
#. Tag: para
+#: basic_mapping.xml:452
#, no-c-format
msgid ""
"<literal>subselect</literal> (optional): maps an immutable and read-only "
@@ -631,6 +1043,7 @@
"informações. "
#. Tag: para
+#: basic_mapping.xml:459
#, no-c-format
msgid ""
"<literal>abstract</literal> (optional): is used to mark abstract "
@@ -640,6 +1053,7 @@
"abstratas em hierarquias <literal><union-subclass></literal>. "
#. Tag: para
+#: basic_mapping.xml:466
#, no-c-format
msgid ""
"It is acceptable for the named persistent class to be an interface. You can "
@@ -656,306 +1070,1229 @@
"Foo$Bar</literal>. "
#. Tag: para
+#: basic_mapping.xml:472
#, no-c-format
+msgid "Here is how to do a virtual view (subselect) in XML:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:474
+#, no-c-format
msgid ""
-"Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated "
-"or deleted by the application. This allows Hibernate to make some minor "
-"performance optimizations."
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"Classes imutáveis, <literal>mutable=\"false\"</literal>, não podem ser "
-"modificadas ou excluídas pela aplicação. Isso permite que o Hibernate "
-"aperfeiçoe o desempenho. "
#. Tag: para
+#: basic_mapping.xml:476
#, no-c-format
msgid ""
-"The optional <literal>proxy</literal> attribute enables lazy initialization "
-"of persistent instances of the class. Hibernate will initially return CGLIB "
-"proxies that implement the named interface. The persistent object will load "
-"when a method of the proxy is invoked. See \"Initializing collections and "
-"proxies\" below."
+"The <literal><subselect></literal> is available both as an attribute "
+"and a nested mapping element."
msgstr ""
-"A função opcional <literal>proxy</literal> habilita a inicialização lazy das "
-"instâncias persistentes da classe. O Hibernate irá retornar CGLIB proxies "
-"como implementado na interface nomeada. O objeto persistente atual será "
-"carregado quando um método do proxy for invocado. Veja \"Inicialização de "
-"Coleções e Proxies\" abaixo. "
+#. Tag: title
+#: basic_mapping.xml:481
+#, fuzzy, no-c-format
+msgid "Identifiers"
+msgstr "Identificadores atribuídos"
+
#. Tag: para
+#: basic_mapping.xml:483
+#, fuzzy, no-c-format
+msgid ""
+"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
+"the database table. Most classes will also have a JavaBeans-style property "
+"holding the unique identifier of an instance."
+msgstr ""
+"Classes mapeadas <emphasis>devem</emphasis> declarar a coluna de chave "
+"primária da tabela do banco de dados. Muitas classes irão também ter uma "
+"propriedade ao estilo Java-Beans declarando o identificador único de uma "
+"instância. O elemento <literal><id></literal> define o mapeamento "
+"desta propriedade para a chave primária."
+
+#. Tag: para
+#: basic_mapping.xml:488
#, no-c-format
+msgid "Mark the identifier property with <classname>@Id</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
msgid ""
-"<emphasis>Implicit</emphasis> polymorphism means that instances of the class "
-"will be returned by a query that names any superclass or implemented "
-"interface or class, and that instances of any subclass of the class will be "
-"returned by a query that names the class itself. <emphasis>Explicit</"
-"emphasis> polymorphism means that class instances will be returned only by "
-"queries that explicitly name that class. Queries that name the class will "
-"return only instances of subclasses mapped inside this <literal><class>"
-"</literal> declaration as a <literal><subclass></literal> or "
-"<literal><joined-subclass></literal>. For most purposes, the default "
-"<literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit "
-"polymorphism is useful when two different classes are mapped to the same "
-"table This allows a \"lightweight\" class that contains a subset of the "
-"table columns."
+"@Entity\n"
+"public class Person {\n"
+" @Id Integer getId() { ... }\n"
+" ...\n"
+"}"
msgstr ""
-"Polimorfismo <emphasis>implícito</emphasis> significa que instâncias de uma "
-"classe serão retornadas por uma consulta que dá nome a qualquer superclasse "
-"ou interface e classe implementada, além das instâncias de qualquer "
-"subclasse da classe serão retornadas por uma consulta que nomeia a classe "
-"por si. Polimorfismo <emphasis>explícito</emphasis> significa que instâncias "
-"da classe serão retornadas apenas por consultas que explicitamente nomeiam a "
-"classe e que as consultas que nomeiam as classes irão retornar apenas "
-"instâncias de subclasses mapeadas dentro da declaração <literal><class>"
-"</literal> como uma <literal><subclass></literal> ou <literal><"
-"joined-subclass></literal>. Para a maioria dos casos, o valor padrão "
-"<literal>polymorphism=\"implicit\"</literal>, é apropriado. Polimorfismo "
-"explicito é útil quando duas classes distintas estão mapeadas para a mesma "
-"tabela. Isso aceita uma classe \"peso leve\" que contém um subconjunto de "
-"colunas da tabela. "
#. Tag: para
+#: basic_mapping.xml:493
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><id></literal> element which defines the "
+"mapping from that property to the primary key column."
+msgstr ""
+"Observe o uso da tag <literal><column></literal> para mapear uma "
+"propriedade para colunas múltiplas."
+
+#. Tag: programlisting
+#: basic_mapping.xml:509
#, no-c-format
msgid ""
-"The <literal>persister</literal> attribute lets you customize the "
-"persistence strategy used for the class. You can, for example, specify your "
-"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
-"or you can even provide a completely new implementation of the interface "
-"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
-"for example, persistence via stored procedure calls, serialization to flat "
-"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
-"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
msgstr ""
-"O atributo <literal>persister</literal> deixa você customizar a estratégia "
-"de persistência utilizada para a classe. Você pode, por exemplo, especificar "
-"sua própria subclasse do <literal>org.hibernate.persister.EntityPersister</"
-"literal> ou você pode criar uma implementação completamente nova da "
-"interface <literal>org.hibernate.persister.ClassPersister</literal> que "
-"implementa a persistência através de, por exemplo, chamadas a procedimentos "
-"armazenados, serialização de arquivos planos ou LDAP. Veja <literal>org."
-"hibernate.test.CustomPersister</literal> para um exemplo simples de "
-"\"persistência\" para uma <literal>Hashtable</literal>."
#. Tag: para
+#: basic_mapping.xml:513
#, no-c-format
msgid ""
-"The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> "
-"settings are not inherited by subclasses, so they can also be specified on "
-"the <literal><subclass></literal> or <literal><joined-subclass></"
-"literal> elements. Although these settings can increase performance in some "
-"cases, they can actually decrease performance in others."
+"<literal>name</literal> (optional): the name of the identifier property."
msgstr ""
-"Observe que as configurações <literal>dynamic-update</literal> e "
-"<literal>dynamic-insert</literal> não são herdadas pelas subclasses e assim "
-"podem também ser especificadas em elementos <literal><subclass></"
-"literal> ou <literal><joined-subclass></literal>. Estas configurações "
-"podem incrementar o desempenho em alguns casos, mas podem realmente diminuir "
-"o desempenho em outras. "
+"<literal>name</literal> (opcional): O nome da propriedade do identificador."
#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
#, no-c-format
msgid ""
-"Use of <literal>select-before-update</literal> will usually decrease "
-"performance. It is useful to prevent a database update trigger being called "
-"unnecessarily if you reattach a graph of detached instances to a "
-"<literal>Session</literal>."
+"<literal>type</literal> (optional): a name that indicates the Hibernate type."
msgstr ""
-"O uso de <literal>select-before-update</literal> geralmente irá diminuir o "
-"desempenho. Ela é muito útil para prevenir que um trigger de atualização no "
-"banco de dados seja ativado desnecessariamente, se você reconectar um nó de "
-"uma instância desconectada em uma <literal>Session</literal>."
+"<literal>type</literal> (opcional): um nome que indica o tipo de Hibernate."
#. Tag: para
+#: basic_mapping.xml:523
#, no-c-format
msgid ""
-"If you enable <literal>dynamic-update</literal>, you will have a choice of "
-"optimistic locking strategies:"
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the primary key column."
msgstr ""
-"Se você ativar <literal>dynamic-update</literal>, você terá de escolher a "
-"estratégia de bloqueio otimista:"
+"<literal>column</literal> (opcional – padrão para o nome da propridade): O "
+"nome coluna chave primária."
#. Tag: para
+#: basic_mapping.xml:528
#, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
-msgstr "<literal>version</literal>: verifica as colunas de versão/timestamp"
+msgid ""
+"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
+"value): an identifier property value that indicates an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session."
+msgstr ""
+"<literal>unsaved-value</literal> (opcional - padrão para um valor \"sensível"
+"\"): O valor da propriedade de identificação que indica que a instância foi "
+"novamente instanciada (unsaved), diferenciando de instâncias desconectadas "
+"que foram salvas ou carregadas em uma sessão anterior. "
#. Tag: para
+#: basic_mapping.xml:536
#, no-c-format
-msgid "<literal>all</literal>: check all columns"
-msgstr "<literal>all</literal>: verifica todas as colunas"
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing the property "
+"value."
+msgstr ""
+"<literal>access</literal> (opcional - padrão para <literal>property</"
+"literal>): A estratégia que o Hiberante deve utilizar para acessar o valor "
+"da propriedade."
#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
msgid ""
-"<literal>dirty</literal>: check the changed columns, allowing some "
-"concurrent updates"
+"If the <literal>name</literal> attribute is missing, it is assumed that the "
+"class has no identifier property."
msgstr ""
-"<literal>dirty</literal>: verifica as colunas modificadas, permitindo "
-"algumas atualizações concorrentes"
+"Se a função <literal>name</literal> não for declarada, considera-se que a "
+"classe não tem a propriedade de identificação."
#. Tag: para
+#: basic_mapping.xml:546
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>unsaved-value</literal> attribute is almost never needed in "
+"Hibernate3 and indeed has no corresponding element in annotations."
+msgstr ""
+"A função <literal>unsaved-value</literal> não é mais necessária no Hibernate "
+"3."
+
+#. Tag: para
+#: basic_mapping.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"You can also declare the identifier as a composite identifier. This allows "
+"access to legacy data with composite keys. Its use is strongly discouraged "
+"for anything else."
+msgstr ""
+"Há uma declaração alternativa <literal><composite-id></literal> que "
+"permite o acesso à dados legados com chaves compostas. Nós realmente "
+"desencorajamos o uso deste para qualquer outra função."
+
+#. Tag: title
+#: basic_mapping.xml:555
+#, fuzzy, no-c-format
+msgid "Composite identifier"
+msgstr "Identificadores atribuídos"
+
+#. Tag: para
+#: basic_mapping.xml:557
#, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
-msgstr "<literal>none</literal>: não utiliza o bloqueio otimista"
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:562
#, no-c-format
msgid ""
-"It is <emphasis>strongly</emphasis> recommended that you use version/"
-"timestamp columns for optimistic locking with Hibernate. This strategy "
-"optimizes performance and correctly handles modifications made to detached "
-"instances (i.e. when <literal>Session.merge()</literal> is used)."
+"use a component type to represent the identifier and map it as a property in "
+"the entity: you then annotated the property as <classname>@EmbeddedId</"
+"classname>. The component type has to be <classname>Serializable</classname>."
msgstr ""
-"Nós <emphasis>realmente</emphasis> recomendamos que você utilize as colunas "
-"de versão/timestamp para o bloqueio otimista com o Hibernate. Esta é a "
-"melhor estratégia em relação ao desempenho e é a única estratégia que trata "
-"corretamente as modificações efetuadas em instâncias desconectadas (por "
-"exemplo, quando <literal>Session.merge()</literal> é utilizado)."
#. Tag: para
+#: basic_mapping.xml:569
#, no-c-format
msgid ""
-"There is no difference between a view and a base table for a Hibernate "
-"mapping. This is transparent at the database level, although some DBMS do "
-"not support views properly, especially with updates. Sometimes you want to "
-"use a view, but you cannot create one in the database (i.e. with a legacy "
-"schema). In this case, you can map an immutable and read-only entity to a "
-"given SQL subselect expression:"
+"map multiple properties as <classname>@Id</classname> properties: the "
+"identifier type is then the entity class itself and needs to be "
+"<classname>Serializable</classname>. This approach is unfortunately not "
+"standard and only supported by Hibernate."
msgstr ""
-"Não há diferença entre uma visão e uma tabela para o mapeamento do "
-"Hibernate, e como esperado isto é transparente no nível do banco de dados, "
-"mesmo que alguns bancos de dados não suportam visões apropriadamente, "
-"especialmente com atualizações. Algumas vezes, você quer utilizar uma visão, "
-"mas não pode criá-la no banco de dados (por exemplo, com um esquema legado). "
-"Neste caso, você pode mapear uma entidade imutável e de somente leitura, "
-"para uma dada expressão de subseleção SQL: "
#. Tag: para
+#: basic_mapping.xml:577
#, no-c-format
msgid ""
-"Declare the tables to synchronize this entity with, ensuring that auto-flush "
-"happens correctly and that queries against the derived entity do not return "
-"stale data. The <literal><subselect></literal> is available both as an "
-"attribute and a nested mapping element."
+"map multiple properties as <classname>@Id</classname> properties and declare "
+"an external class to be the identifier type. This class, which needs to be "
+"<classname>Serializable</classname>, is declared on the entity via the "
+"<classname>@IdClass</classname> annotation. The identifier type must contain "
+"the same properties as the identifier properties of the entity: each "
+"property name must be the same, its type must be the same as well if the "
+"entity property is of a basic type, its type must be the type of the primary "
+"key of the associated entity if the entity property is an association "
+"(either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</"
+"classname>)."
msgstr ""
-"Declare as tabelas para sincronizar com esta entidade, garantindo que a auto-"
-"liberação ocorra corretamente, e que as consultas para esta entidade "
-"derivada não retornem dados desatualizados. O <literal><subselect></"
-"literal> está disponível tanto como um atributo como um elemento mapeado "
-"aninhado."
+#. Tag: para
+#: basic_mapping.xml:592
+#, no-c-format
+msgid ""
+"As you can see the last case is far from obvious. It has been inherited from "
+"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
+"to use it (for simplicity sake)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:596
+#, no-c-format
+msgid "Let's explore all three cases using examples."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:599
#, no-c-format
-msgid "id"
-msgstr "id"
+msgid "id as a property using a component type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:601
#, no-c-format
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
msgid ""
-"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
-"the database table. Most classes will also have a JavaBeans-style property "
-"holding the unique identifier of an instance. The <literal><id></"
-"literal> element defines the mapping from that property to the primary key "
-"column."
+"@Entity\n"
+"class User {\n"
+" @EmbeddedId\n"
+" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
+"\")\n"
+" UserId id;\n"
+"\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
msgstr ""
-"Classes mapeadas <emphasis>devem</emphasis> declarar a coluna de chave "
-"primária da tabela do banco de dados. Muitas classes irão também ter uma "
-"propriedade ao estilo Java-Beans declarando o identificador único de uma "
-"instância. O elemento <literal><id></literal> define o mapeamento "
-"desta propriedade para a chave primária."
#. Tag: para
+#: basic_mapping.xml:606
#, no-c-format
-msgid "<literal>name</literal> (optional): the name of the identifier property."
-msgstr "<literal>name</literal> (opcional): O nome da propriedade do identificador."
+msgid ""
+"You can notice that the <classname>UserId</classname> class is serializable. "
+"To override the column mapping, use <classname>@AttributeOverride</"
+"classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:610
#, no-c-format
-msgid "<literal>type</literal> (optional): a name that indicates the Hibernate type."
-msgstr "<literal>type</literal> (opcional): um nome que indica o tipo de Hibernate."
+msgid ""
+"An embedded id can itself contains the primary key of an associated entity."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"\n"
+" @MapsId(\"userId\")\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" @OneToOne User user;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" UserId userId;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:615
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to the property name): the "
-"name of the primary key column."
+"In the embedded id object, the association is represented as the identifier "
+"of the associated entity. But you can link its value to a regular "
+"association in the entity via the <classname>@MapsId</classname> annotation. "
+"The <classname>@MapsId</classname> value correspond to the property name of "
+"the embedded id object containing the associated entity's identifier. In the "
+"database, it means that the <literal>Customer.user</literal> and the "
+"<literal>CustomerId.userId</literal> properties share the same underlying "
+"column (<literal>user_fk</literal> in this case)."
msgstr ""
-"<literal>column</literal> (opcional – padrão para o nome da propridade): O "
-"nome coluna chave primária."
#. Tag: para
+#: basic_mapping.xml:627
#, no-c-format
msgid ""
-"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
-"value): an identifier property value that indicates an instance is newly "
-"instantiated (unsaved), distinguishing it from detached instances that were "
-"saved or loaded in a previous session."
+"The component type used as identifier must implement <methodname>equals()</"
+"methodname> and <methodname>hashCode()</methodname>."
msgstr ""
-"<literal>unsaved-value</literal> (opcional - padrão para um valor \"sensível"
-"\"): O valor da propriedade de identificação que indica que a instância foi "
-"novamente instanciada (unsaved), diferenciando de instâncias desconectadas "
-"que foram salvas ou carregadas em uma sessão anterior. "
#. Tag: para
+#: basic_mapping.xml:632
#, no-c-format
msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate should use for accessing the property "
-"value."
+"In practice, your code only sets the <literal>Customer.user</literal> "
+"property and the user id value is copied by Hibernate into the "
+"<literal>CustomerId.userId</literal> property."
msgstr ""
-"<literal>access</literal> (opcional - padrão para <literal>property</"
-"literal>): A estratégia que o Hiberante deve utilizar para acessar o valor "
-"da propriedade."
#. Tag: para
+#: basic_mapping.xml:638
#, no-c-format
msgid ""
-"If the <literal>name</literal> attribute is missing, it is assumed that the "
-"class has no identifier property."
+"The id value can be copied as late as flush time, don't rely on it until "
+"after flush time."
msgstr ""
-"Se a função <literal>name</literal> não for declarada, considera-se que a "
-"classe não tem a propriedade de identificação."
#. Tag: para
+#: basic_mapping.xml:642
#, no-c-format
msgid ""
-"The <literal>unsaved-value</literal> attribute is almost never needed in "
-"Hibernate3."
+"While not supported in JPA, Hibernate lets you place your association "
+"directly in the embedded id component (instead of having to use the "
+"<classname>@MapsId</classname> annotation)."
msgstr ""
-"A função <literal>unsaved-value</literal> não é mais necessária no Hibernate "
-"3."
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:648
#, no-c-format
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:651
+#, no-c-format
msgid ""
-"There is an alternative <literal><composite-id></literal> declaration "
-"that allows access to legacy data with composite keys. Its use is strongly "
-"discouraged for anything else."
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" node=\"element-name|.\">\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
msgstr ""
-"Há uma declaração alternativa <literal><composite-id></literal> que "
-"permite o acesso à dados legados com chaves compostas. Nós realmente "
-"desencorajamos o uso deste para qualquer outra função."
+#. Tag: para
+#: basic_mapping.xml:653
+#, no-c-format
+msgid "First a simple example:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
+msgid ""
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:657
+#, no-c-format
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"\n"
+" <many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" </many-to-one>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:662
+#, no-c-format
+msgid "Notice a few things in the previous example:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:666
+#, no-c-format
+msgid ""
+"the order of the properties (and column) matters. It must be the same "
+"between the association and the primary key of the associated entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:672
+#, no-c-format
+msgid ""
+"the many to one uses the same columns as the primary key and thus must be "
+"marked as read only (<literal>insertable</literal> and <literal>updatable</"
+"literal> to false)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:679
+#, no-c-format
+msgid ""
+"unlike with <classname>@MapsId</classname>, the id value of the associated "
+"entity is not transparently copied, check the <literal>foreign</literal> id "
+"generator for more information."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:686
+#, no-c-format
+msgid ""
+"The last example shows how to map association directly in the embedded id "
+"component."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:691
+#, no-c-format
+msgid ""
+"This is the recommended approach to map composite identifier. The following "
+"options should not be considered unless some constraint are present."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:697
#, no-c-format
-msgid "Generator"
-msgstr "Gerador"
+msgid "Multiple id properties without identifier type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:699
#, no-c-format
msgid ""
-"The optional <literal><generator></literal> child element names a Java "
-"class used to generate unique identifiers for instances of the persistent "
-"class. If any parameters are required to configure or initialize the "
-"generator instance, they are passed using the <literal><param></"
-"literal> element."
+"Another, arguably more natural, approach is to place <classname>@Id</"
+"classname> on multiple properties of your entity. This approach is only "
+"supported by Hibernate (not JPA compliant) but does not require an extra "
+"embeddable component."
msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:706
+#, no-c-format
+msgid ""
+"In this case <classname>Customer</classname> is its own identifier "
+"representation: it must implement <classname>Serializable</classname> and "
+"must implement <methodname>equals()</methodname> and <methodname>hashCode()</"
+"methodname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:712
+#, no-c-format
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id>\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:718
+#, no-c-format
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:721
+#, no-c-format
+msgid ""
+"<classname>@IdClass</classname> on an entity points to the class (component) "
+"representing the identifier of the class. The properties marked "
+"<classname>@Id</classname> on the entity must have their corresponding "
+"property on the <classname>@IdClass</classname>. The return type of search "
+"twin property must be either identical for basic properties or must "
+"correspond to the identifier class of the associated entity for an "
+"association."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:730
+#, no-c-format
+msgid ""
+"This approach is inherited from the EJB 2 days and we recommend against its "
+"use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" UserId user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:737
+#, no-c-format
+msgid ""
+"<classname>Customer</classname> and <classname>CustomerId</classname> do "
+"have the same properties <literal>customerNumber</literal> as well as "
+"<literal>user</literal>. <classname>CustomerId</classname> must be "
+"<classname>Serializable</classname> and implement <classname>equals()</"
+"classname> and <classname>hashCode()</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:745
+#, no-c-format
+msgid ""
+"While not JPA standard, Hibernate let's you declare the vanilla associated "
+"property in the <classname>@IdClass</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:751
+#, no-c-format
+msgid ""
+"This feature is of limited interest though as you are likely to have chosen "
+"the <classname>@IdClass</classname> approach to stay JPA compliant or you "
+"have a quite twisted mind."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:762
+#, fuzzy, no-c-format
+msgid "Identifier generator"
+msgstr "Aprimoração dos geradores de identificador"
+
+#. Tag: para
+#: basic_mapping.xml:764
+#, no-c-format
+msgid ""
+"Hibernate can generate and populate identifier values for you automatically. "
+"This is the recommended approach over \"business\" or \"natural\" id "
+"(especially composite ids)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:768
+#, no-c-format
+msgid ""
+"Hibernate offers various generation strategies, let's explore the most "
+"common ones first that happens to be standardized by JPA:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:774
+#, fuzzy, no-c-format
+msgid ""
+"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
+msgstr ""
+"suporta colunas de identidade em DB2, MySQL, Servidor MS SQL, Sybase e "
+"HypersonicSQL. O identificador retornado é do tipo <literal>long</literal>, "
+"<literal>short</literal> ou <literal>int</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo "
+"algorithm to efficiently generate identifiers of type <literal>long</"
+"literal>, <literal>short</literal> or <literal>int</literal>, given a named "
+"database sequence."
+msgstr ""
+"utiliza um algoritmo hi/lo para gerar de forma eficiente identificadores do "
+"tipo <literal>long</literal>, <literal>short</literal> ou <literal>int</"
+"literal>, a partir de uma seqüência de banco de dados fornecida."
+
+#. Tag: para
+#: basic_mapping.xml:788
+#, fuzzy, no-c-format
+msgid ""
+"TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in "
+"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
+"type <literal>long</literal>, <literal>short</literal> or <literal>int</"
+"literal>, given a table and column as a source of hi values. The hi/lo "
+"algorithm generates identifiers that are unique only for a particular "
+"database."
+msgstr ""
+"utiliza um algoritmo hi/lo para gerar de forma eficiente identificadores do "
+"tipo <literal>long</literal>, <literal>short</literal> ou <literal>int</"
+"literal>, a partir de uma tabela e coluna fornecida (por padrão "
+"<literal>hibernate_unique_key</literal> e <literal>next_hi</literal>) como "
+"fonte para os valores hi. O algoritmo hi/lo gera identificadores que são "
+"únicos apenas para um banco de dados específico."
+
+#. Tag: para
+#: basic_mapping.xml:798
+#, fuzzy, no-c-format
+msgid ""
+"AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or "
+"<literal>TABLE</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"seleciona entre <literal>identity</literal>, <literal>sequence</literal>ou "
+"<literal>hilo</literal> dependendo das capacidades do banco de dados "
+"utilizado."
+
+#. Tag: para
+#: basic_mapping.xml:805
+#, no-c-format
+msgid ""
+"We recommend all new projects to use the new enhanced identifier generators. "
+"They are deactivated by default for entities using annotations but can be "
+"activated using <code>hibernate.id.new_generator_mappings=true</code>. These "
+"new generators are more efficient and closer to the JPA 2 specification "
+"semantic."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:812
+#, no-c-format
+msgid ""
+"However they are not backward compatible with existing Hibernate based "
+"application (if a sequence or a table is used for id generation). See "
+"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
+"to activate them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:818
+#, no-c-format
+msgid ""
+"To mark an id property as generated, use the <classname>@GeneratedValue</"
+"classname> annotation. You can specify the strategy used (default to "
+"<literal>AUTO</literal>) by setting <literal>strategy</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue\n"
+" Integer getId() { ... };\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Invoice {\n"
+" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+" Integer getId() { ... };\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid ""
+"<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional "
+"configurations that you can set using <classname>@SequenceGenerator</"
+"classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
+#, fuzzy, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr "<literal>name</literal>: O nome da propriedade. "
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> / <literal>sequenceName</literal>: name of the "
+"table or the sequence (defaulting respectively to "
+"<literal>hibernate_sequences</literal> and <literal>hibernate_sequence</"
+"literal>)"
+msgstr ""
+"<literal>sequence_name</literal> (opcional - valor padrão "
+"<literal>hibernate_sequence</literal>) o nome da seqüência ou tabela a ser "
+"usada."
+
+#. Tag: para
+#: basic_mapping.xml:843
+#, fuzzy, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, fuzzy, no-c-format
+msgid ""
+"<literal>initialValue</literal>: the value from which the id is to start "
+"generating"
+msgstr "<literal>table</literal>: O nome da tabela associada. "
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid ""
+"<literal>allocationSize</literal>: the amount to increment by when "
+"allocating id numbers from the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid ""
+"In addition, the <classname>TABLE</classname> strategy also let you "
+"customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
+#, fuzzy, no-c-format
+msgid ""
+"<literal>pkColumnName</literal>: the column name containing the entity "
+"identifier"
+msgstr "<literal>name</literal>: O nome da propriedade. "
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, fuzzy, no-c-format
+msgid ""
+"<literal>valueColumnName</literal>: the column name containing the "
+"identifier value"
+msgstr ""
+"<literal>name</literal> (opcional): O nome da propriedade do identificador."
+
+#. Tag: para
+#: basic_mapping.xml:873
+#, fuzzy, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr "<literal>id-type</literal>: o tipo identificador."
+
+#. Tag: para
+#: basic_mapping.xml:878
+#, no-c-format
+msgid ""
+"<literal>uniqueConstraints</literal>: any potential column constraint on the "
+"table containing the ids"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:883
+#, no-c-format
+msgid ""
+"To link a table or sequence generator definition with an actual generated "
+"property, use the same name in both the definition <literal>name</literal> "
+"and the generator value <literal>generator</literal> as shown below."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+"@Id \n"
+"@GeneratedValue(\n"
+" strategy=GenerationType.SEQUENCE, \n"
+" generator=\"SEQ_GEN\")\n"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:890
+#, no-c-format
+msgid ""
+"The scope of a generator definition 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 in "
+"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
+"\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+"@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"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:898
+#, no-c-format
+msgid ""
+"If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used "
+"to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</"
+"literal> are application level generators."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:904
+#, no-c-format
+msgid ""
+"Package level definition is not supported by the JPA specification. However, "
+"you can use the <literal>@GenericGenerator</literal> at the package level "
+"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:910
+#, no-c-format
+msgid ""
+"These are the four standard JPA generators. Hibernate goes beyond that and "
+"provide additional generators or additional options as we will see below. "
+"You can also write your own custom identifier generator by implementing "
+"<classname>org.hibernate.id.IdentifierGenerator</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:916
+#, no-c-format
+msgid ""
+"To define a custom generator, use the <classname>@GenericGenerator</"
+"classname> annotation (and its plural counter part "
+"<classname>@GenericGenerators</classname>) that describes the class of the "
+"identifier generator or its short cut name (as described below) and a list "
+"of key/value parameters. When using <classname>@GenericGenerator</classname> "
+"and assigning it via <classname>@GeneratedValue.generator</classname>, the "
+"<classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+"@GenericGenerator(\n"
+" name=\"trigger-generated\", \n"
+" strategy = \"select\",\n"
+" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+")\n"
+"public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, fuzzy, no-c-format
+msgid ""
+"The hbm.xml approach uses the optional <literal><generator></literal> "
+"child element inside <literal><id></literal>. If any parameters are "
+"required to configure or initialize the generator instance, they are passed "
+"using the <literal><param></literal> element."
+msgstr ""
"O elemento filho opcional <literal><generator></literal> nomeia uma "
"classe Java usada para gerar identificadores únicos para instâncias de uma "
"classe persistente. Se algum parâmetro é requerido para configurar ou "
"inicializar a instância geradora, eles são passados utilizando o elemento "
"<literal><param></literal>."
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:937
+#, no-c-format
+msgid "Various additional generators"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:939
#, no-c-format
msgid ""
"All generators implement the interface <literal>org.hibernate.id."
@@ -971,12 +2308,14 @@
"internamente. Há nomes de atalhos para estes geradores internos, conforme "
"segue abaixo: "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:946
#, no-c-format
-msgid "<literal>increment</literal>"
-msgstr "<literal>increment</literal>"
+msgid "increment"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
msgid ""
"generates identifiers of type <literal>long</literal>, <literal>short</"
@@ -989,12 +2328,14 @@
"processo está inserindo dados na mesma tabela. <emphasis>Não utilize em "
"ambientes de cluster.</emphasis>"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:958
#, no-c-format
-msgid "<literal>identity</literal>"
-msgstr "<literal>identity</literal>"
+msgid "identity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
msgid ""
"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
@@ -1005,12 +2346,14 @@
"HypersonicSQL. O identificador retornado é do tipo <literal>long</literal>, "
"<literal>short</literal> ou <literal>int</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:969
#, no-c-format
-msgid "<literal>sequence</literal>"
-msgstr "<literal>sequence</literal>"
+msgid "sequence"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
msgid ""
"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
@@ -1021,12 +2364,14 @@
"gerador no Interbase. O identificador de retorno é do tipo <literal> long</"
"literal>, <literal>short</literal> ou <literal>int</literal>."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:980
#, no-c-format
-msgid "<literal>hilo</literal>"
-msgstr "<literal>hilo</literal>"
+msgid "hilo"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -1043,12 +2388,14 @@
"fonte para os valores hi. O algoritmo hi/lo gera identificadores que são "
"únicos apenas para um banco de dados específico."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:996
#, no-c-format
-msgid "<literal>seqhilo</literal>"
-msgstr "<literal>seqhilo</literal>"
+msgid "seqhilo"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
@@ -1059,38 +2406,122 @@
"tipo <literal>long</literal>, <literal>short</literal> ou <literal>int</"
"literal>, a partir de uma seqüência de banco de dados fornecida."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
+#, fuzzy, no-c-format
+msgid "uuid"
+msgstr "id"
+
+#. Tag: para
+#: basic_mapping.xml:1010
#, no-c-format
-msgid "<literal>uuid</literal>"
-msgstr "<literal>uuid</literal>"
+msgid ""
+"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
+"represented as a string of 32 hexidecimal digits. Users can also configure "
+"it to use a separator (config parameter \"separator\") which separates the "
+"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
+"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
+"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
+"discussed below."
+msgstr ""
+#. Tag: literal
+#: basic_mapping.xml:1023
+#, no-c-format
+msgid "uuid2"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
msgid ""
-"uses a 128-bit UUID algorithm to generate identifiers of type string that "
-"are unique within a network (the IP address is used). The UUID is encoded as "
-"a string of 32 hexadecimal digits in length."
+"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
+"\"version\" (the RFC term) generated depends on the pluggable \"generation "
+"strategy\" used (see below). Capable of generating values as <classname>java."
+"util.UUID</classname>, <classname>java.lang.String</classname> or as a byte "
+"array of length 16 (<literal>byte[16]</literal>). The \"generation strategy"
+"\" is defined by the interface <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
+"configuration parameters for defining which generation strategy to use:"
msgstr ""
-"utiliza um algorítimo UUID de 128-bits para gerar identificadores do tipo "
-"string, únicos em uma rede (o endereço IP é utilizado). O UUID é codificado "
-"como um string de dígitos hexadecimais de tamanho 32."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1038
#, no-c-format
-msgid "<literal>guid</literal>"
-msgstr "<literal>guid</literal>"
+msgid "uuid_gen_strategy_class"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1041
#, no-c-format
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1047
+#, no-c-format
+msgid "uuid_gen_strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1050
+#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the "
+"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
+"<methodname>randomUUID</methodname> method of <classname>java.util.UUID</"
+"classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - "
+"generates \"version 1\" UUID values, using IP address since mac address not "
+"available. If you need mac address to be used, consider leveraging one of "
+"the existing third party UUID generators which sniff out mac address and "
+"integrating it via the <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
+"time of this writing include <ulink url=\"http://johannburkard.de/software/"
+"uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url="
+"\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/"
+"sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, fuzzy, no-c-format
+msgid "guid"
+msgstr "id"
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
-msgstr "utiliza um string GUID gerado pelo banco de dados no Servidor MS SQL e MySQL."
+msgstr ""
+"utiliza um string GUID gerado pelo banco de dados no Servidor MS SQL e MySQL."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1094
#, no-c-format
-msgid "<literal>native</literal>"
-msgstr "<literal>native</literal>"
+msgid "native"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1097
#, no-c-format
msgid ""
"selects <literal>identity</literal>, <literal>sequence</literal> or "
@@ -1101,12 +2532,14 @@
"<literal>hilo</literal> dependendo das capacidades do banco de dados "
"utilizado."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1105
#, no-c-format
-msgid "<literal>assigned</literal>"
-msgstr "<literal>assigned</literal>"
+msgid "assigned"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1108
#, no-c-format
msgid ""
"lets the application assign an identifier to the object before <literal>save"
@@ -1117,12 +2550,14 @@
"<literal>save()</literal> seja chamado. Esta é a estratégia padrão caso "
"nenhum elemento <literal><generator></literal> seja especificado. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1117
#, no-c-format
-msgid "<literal>select</literal>"
-msgstr "<literal>select</literal>"
+msgid "select"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1120
#, no-c-format
msgid ""
"retrieves a primary key, assigned by a database trigger, by selecting the "
@@ -1132,12 +2567,14 @@
"selecionando uma linha pela chave única e recuperando o valor da chave "
"primária."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1127
#, no-c-format
-msgid "<literal>foreign</literal>"
-msgstr "<literal>foreign</literal>"
+msgid "foreign"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1130
#, no-c-format
msgid ""
"uses the identifier of another associated object. It is usually used in "
@@ -1148,12 +2585,14 @@
"em conjunto com uma associação de chave primária do tipo <literal><one-to-"
"one></literal>."
-#. Tag: term
-#, no-c-format
-msgid "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1138
+#, fuzzy, no-c-format
+msgid "sequence-identity"
msgstr "<literal>sequence-identity</literal>"
#. Tag: para
+#: basic_mapping.xml:1141
#, no-c-format
msgid ""
"a specialized sequence generation strategy that utilizes a database sequence "
@@ -1172,11 +2611,13 @@
"a um bug nos drivers da Oracle. "
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "Algoritmo Hi/lo"
#. Tag: para
+#: basic_mapping.xml:1157
#, no-c-format
msgid ""
"The <literal>hilo</literal> and <literal>seqhilo</literal> generators "
@@ -1192,7 +2633,33 @@
"\"hi\" disponível. A segunda utiliza uma seqüência do estilo Oracle (quando "
"suportado)."
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1167
#, no-c-format
msgid ""
"Unfortunately, you cannot use <literal>hilo</literal> when supplying your "
@@ -1209,11 +2676,13 @@
"literal>. "
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "Algoritmo UUID"
#. Tag: para
+#: basic_mapping.xml:1177
#, no-c-format
msgid ""
"The UUID contains: IP address, startup time of the JVM that is accurate to a "
@@ -1227,11 +2696,13 @@
"código Java, portanto este é o melhor que pode ser feito sem utilizar JNI."
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "Colunas de identidade e seqüências"
#. Tag: para
+#: basic_mapping.xml:1187
#, no-c-format
msgid ""
"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
@@ -1247,7 +2718,30 @@
"no estilo <literal>sequence</literal>. As duas estratégias requerem duas "
"consultas SQL para inserir um novo objeto. "
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1199
#, no-c-format
msgid ""
"For cross-platform development, the <literal>native</literal> strategy will, "
@@ -1261,20 +2755,22 @@
"capacidades do banco de dados utilizado."
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "Identificadores atribuídos"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1209
+#, fuzzy, no-c-format
msgid ""
"If you want the application to assign identifiers, as opposed to having "
"Hibernate generate them, you can use the <literal>assigned</literal> "
"generator. This special generator uses the identifier value already assigned "
"to the object's identifier property. The generator is used when the primary "
"key is a natural key instead of a surrogate key. This is the default "
-"behavior if you do not specify a <literal><generator></literal> "
-"element."
+"behavior if you do not specify <classname>@GeneratedValue</classname> nor "
+"<literal><generator></literal> elements."
msgstr ""
"Se você quiser que a aplicação especifique os identificadores, em vez do "
"Hibernate gerá-los, você deve utilizar o gerador <literal>assigned</"
@@ -1285,6 +2781,7 @@
"elemento <literal><generator></literal>. "
#. Tag: para
+#: basic_mapping.xml:1218
#, no-c-format
msgid ""
"The <literal>assigned</literal> generator makes Hibernate use "
@@ -1300,16 +2797,32 @@
"de timestamp, ou que você definia <literal>Interceptor.isUnsaved()</literal>."
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "Chaves primárias geradas por triggers"
#. Tag: para
+#: basic_mapping.xml:1228
#, no-c-format
-msgid "Hibernate does not generate DDL with triggers. It is for legacy schemas only."
+msgid ""
+"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
msgstr "O Hibernate não gera DDL com triggers, apenas para sistemas legados."
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1233
#, no-c-format
msgid ""
"In the above example, there is a unique valued property named "
@@ -1323,11 +2836,91 @@
"valor é gerado por um trigger."
#. Tag: title
+#: basic_mapping.xml:1241
#, no-c-format
+msgid "Identity copy (foreign generator)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1243
+#, no-c-format
+msgid ""
+"Finally, you can ask Hibernate to copy the identifier from another "
+"associated entity. In the Hibernate jargon, it is known as a foreign "
+"generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumn(name = \"person_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1250
+#, fuzzy, no-c-format
+msgid "Or alternatively"
+msgstr "Alternativas de Metadados"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id Integer id;\n"
+"\n"
+" @MapsId @OneToOne\n"
+" @JoinColumn(name = \"patient_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Person {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1254
+#, no-c-format
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, no-c-format
+msgid ""
+"<class name=\"MedicalHistory\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">patient</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
+">\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, no-c-format
msgid "Enhanced identifier generators"
msgstr "Aprimoração dos geradores de identificador"
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
msgid ""
"Starting with release 3.2.3, there are 2 new generators which represent a re-"
@@ -1348,6 +2941,7 @@
"incluídos nas liberações atuais e podem ser referenciados pelo FQN."
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
msgid ""
"The first of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1385,6 +2979,7 @@
"possui um número de parâmetros de configuração: "
#. Tag: para
+#: basic_mapping.xml:1291
#, no-c-format
msgid ""
"<literal>sequence_name</literal> (optional, defaults to "
@@ -1396,6 +2991,7 @@
"usada."
#. Tag: para
+#: basic_mapping.xml:1297
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional, defaults to <literal>1</"
@@ -1409,6 +3005,7 @@
"nomeada \"STARTS WITH\"."
#. Tag: para
+#: basic_mapping.xml:1304
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1422,6 +3019,7 @@
"cláusula tipicamente nomeada \"INCREMENT BY\"."
#. Tag: para
+#: basic_mapping.xml:1312
#, no-c-format
msgid ""
"<literal>force_table_use</literal> (optional - defaults to <literal>false</"
@@ -1433,6 +3031,7 @@
"mesmo que o dialeto possa suportar a seqüência?"
#. Tag: para
+#: basic_mapping.xml:1319
#, no-c-format
msgid ""
"<literal>value_column</literal> (optional - defaults to <literal>next_val</"
@@ -1444,17 +3043,17 @@
"coluna onde na tabela que é usado para manter o valor."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1326
+#, fuzzy, no-c-format
msgid ""
"<literal>optimizer</literal> (optional - defaults to <literal>none</"
-"literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" /"
-">"
+"literal>): See"
msgstr ""
-"<literal>optimizer</literal> (opcional – padrão para <literal>none</"
-"literal>): Veja <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
-"\" />"
+"<literal>cascade</literal> (opcional – valor padrão <literal>none</"
+"literal>): o estilo cascata."
#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
msgid ""
"The second of these new generators is <literal>org.hibernate.id.enhanced."
@@ -1480,6 +3079,7 @@
"configuração."
#. Tag: para
+#: basic_mapping.xml:1345
#, no-c-format
msgid ""
"<literal>table_name</literal> (optional - defaults to "
@@ -1489,6 +3089,7 @@
"<literal>hibernate_sequences</literal>): O nome da tabela a ser usado."
#. Tag: para
+#: basic_mapping.xml:1351
#, no-c-format
msgid ""
"<literal>value_column_name</literal> (optional - defaults to "
@@ -1500,6 +3101,7 @@
"manter o valor."
#. Tag: para
+#: basic_mapping.xml:1357
#, no-c-format
msgid ""
"<literal>segment_column_name</literal> (optional - defaults to "
@@ -1513,6 +3115,7 @@
"valor de incremento a ser usado."
#. Tag: para
+#: basic_mapping.xml:1365
#, no-c-format
msgid ""
"<literal>segment_value</literal> (optional - defaults to <literal>default</"
@@ -1524,6 +3127,7 @@
"obter os valores de incremento para este gerador."
#. Tag: para
+#: basic_mapping.xml:1372
#, no-c-format
msgid ""
"<literal>segment_value_length</literal> (optional - defaults to "
@@ -1535,6 +3139,7 @@
"coluna para criar esta coluna de chave de segmento."
#. Tag: para
+#: basic_mapping.xml:1378
#, no-c-format
msgid ""
"<literal>initial_value</literal> (optional - defaults to <literal>1</"
@@ -1544,6 +3149,7 @@
"literal>): O valor inicial a ser restaurado a partir da tabela."
#. Tag: para
+#: basic_mapping.xml:1384
#, no-c-format
msgid ""
"<literal>increment_size</literal> (optional - defaults to <literal>1</"
@@ -1554,28 +3160,31 @@
"diferir-se."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1390
+#, fuzzy, no-c-format
msgid ""
-"<literal>optimizer</literal> (optional - defaults to <literal></literal>): "
-"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
+"<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): "
+"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
"<literal>optimizer</literal> (opcional – padrão para <literal></literal>): "
"Consulte <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
#. Tag: title
+#: basic_mapping.xml:1397
#, no-c-format
msgid "Identifier generator optimization"
msgstr "Otimização do Gerador de Identificação"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1399
+#, fuzzy, no-c-format
msgid ""
"For identifier generators that store values in the database, it is "
"inefficient for them to hit the database on each and every call to generate "
"a new identifier value. Instead, you can group a bunch of them in memory and "
"only hit the database when you have exhausted your in-memory value group. "
"This is the role of the pluggable optimizers. Currently only the two "
-"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> "
+"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
"support this operation."
msgstr ""
"Para os geradores de identificação que armazenam valores no banco de dados, "
@@ -1587,6 +3196,7 @@
"linkend=\"mapping-declaration-id-enhanced\"/>)"
#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
msgid ""
"<literal>none</literal> (generally this is the default if no optimizer was "
@@ -1598,6 +3208,7 @@
"banco de dados para cada e toda solicitação."
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
msgid ""
"<literal>hilo</literal>: applies a hi/lo algorithm around the database "
@@ -1615,6 +3226,7 @@
"valor em memória para definir um grupo \"hi value\"."
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
msgid ""
"<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this "
@@ -1633,306 +3245,202 @@
"partir do banco de dados."
#. Tag: title
-#, no-c-format
-msgid "composite-id"
-msgstr "Composição-id"
+#: basic_mapping.xml:1441
+#, fuzzy, no-c-format
+msgid "Partial identifier generation"
+msgstr "Aprimoração dos geradores de identificador"
#. Tag: para
+#: basic_mapping.xml:1443
#, no-c-format
msgid ""
-"A table with a composite key can be mapped with multiple properties of the "
-"class as identifier properties. The <literal><composite-id></literal> "
-"element accepts <literal><key-property></literal> property mappings "
-"and <literal><key-many-to-one></literal> mappings as child elements."
+"Hibernate supports the automatic generation of some of the identifier "
+"properties. Simply use the <classname>@GeneratedValue</classname> annotation "
+"on one or several id properties."
msgstr ""
-"Uma tabela com uma chave composta, pode ser mapeada com múltiplas "
-"propriedades da classe como propriedades de identificação. O elemento "
-"<literal><composite-id></literal> aceita o mapeamento da propriedade "
-"<literal><key-property></literal> e mapeamentos <literal><key-many-"
-"to-one></literal>como elementos filhos."
#. Tag: para
+#: basic_mapping.xml:1449
#, no-c-format
msgid ""
-"The persistent class <emphasis>must</emphasis> override <literal>equals()</"
-"literal> and <literal>hashCode()</literal> to implement composite identifier "
-"equality. It must also implement <literal>Serializable</literal>."
+"The Hibernate team has always felt such a construct as fundamentally wrong. "
+"Try hard to fix your data model before using this feature."
msgstr ""
-"A classe persistente <emphasis>precisa</emphasis> substituir <literal>equals"
-"()</literal> e <literal>hashCode()</literal> para implementar "
-"identificadores compostos igualmente. E precisa também implementar "
-"<literal>Serializable</literal>."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1454
#, no-c-format
msgid ""
-"Unfortunately, this approach means that a persistent object is its own "
-"identifier. There is no convenient \"handle\" other than the object itself. "
-"You must instantiate an instance of the persistent class itself and populate "
-"its identifier properties before you can <literal>load()</literal> the "
-"persistent state associated with a composite key. We call this approach an "
-"<emphasis>embedded</emphasis> composite identifier, and discourage it for "
-"serious applications."
+"@Entity\n"
+"public class CustomerInventory implements Serializable {\n"
+" @Id\n"
+" @TableGenerator(name = \"inventory\",\n"
+" table = \"U_SEQUENCES\",\n"
+" pkColumnName = \"S_ID\",\n"
+" valueColumnName = \"S_NEXTNUM\",\n"
+" pkColumnValue = \"inventory\",\n"
+" allocationSize = 1000)\n"
+" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
+"\")\n"
+" Integer id;\n"
+"\n"
+"\n"
+" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+" Customer customer;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @Id\n"
+" private int id;\n"
+"}"
msgstr ""
-"Infelizmente, esta solução para um identificador composto significa que um "
-"objeto persistente é seu próprio identificador. Não há outro \"handle\" "
-"conveniente a não ser o próprio objeto. Você mesmo precisa instanciar uma "
-"instância de outra classe persistente e preencher suas propriedades de "
-"identificação antes que você possa dar um <literal>load()</literal> para o "
-"estado persistente associado com uma chave composta. Nós chamamos esta "
-"solução de identificador composto <emphasis>incorporado</emphasis> e não "
-"aconselhamos para aplicações sérias."
#. Tag: para
+#: basic_mapping.xml:1456
#, no-c-format
msgid ""
-"A second approach is what we call a <emphasis>mapped</emphasis> composite "
-"identifier, where the identifier properties named inside the <literal><"
-"composite-id></literal> element are duplicated on both the persistent "
-"class and a separate identifier class."
+"You can also generate properties inside an <classname>@EmbeddedId</"
+"classname> class."
msgstr ""
-"Uma segunda solução seria chamar de identificador composto <emphasis>mapped</"
-"emphasis> quando a propriedades de identificação nomeadas dentro do elemento "
-"<literal><composite-id></literal> estão duplicadas tanto na classe "
-"persistente como em uma classe de identificação separada."
-#. Tag: para
+#. Tag: title
+#: basic_mapping.xml:1462
#, no-c-format
-msgid ""
-"In this example, both the composite identifier class, <literal>MedicareId</"
-"literal>, and the entity class itself have properties named "
-"<literal>medicareNumber</literal> and <literal>dependent</literal>. The "
-"identifier class must override <literal>equals()</literal> and "
-"<literal>hashCode()</literal> and implement <literal>Serializable</literal>. "
-"The main disadvantage of this approach is code duplication."
+msgid "Optimistic locking properties (optional)"
msgstr ""
-"No exemplo, ambas as classes de identificadores compostas, "
-"<literal>MedicareId</literal>, e a própria classe entidade possuem "
-"propriedades nomeadas <literal>medicareNumber</literal> e "
-"<literal>dependent</literal>. A classe identificadora precisa sobrepor "
-"<literal>equals()</literal> e <literal>hashCode()</literal> e implementar "
-"<literal>Serializable</literal>. A desvantagem desta solução é óbvia: "
-"duplicação de código."
#. Tag: para
+#: basic_mapping.xml:1464
#, no-c-format
-msgid "The following attributes are used to specify a mapped composite identifier:"
-msgstr ""
-"As seguintes funções são utilizadas para especificar o mapeamento de um "
-"identificador composto:"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>mapped</literal> (optional - defaults to <literal>false</literal>): "
-"indicates that a mapped composite identifier is used, and that the contained "
-"property mappings refer to both the entity class and the composite "
-"identifier class."
+"When using long transactions or conversations that span several database "
+"transactions, it is useful to store versioning data to ensure that if the "
+"same entity is updated by two conversations, the last to commit changes will "
+"be informed and not override the other conversation's work. It guarantees "
+"some isolation while still allowing for good scalability and works "
+"particularly well in read-often write-sometimes situations."
msgstr ""
-"<literal>mapped</literal> (opcional, <literal>false</literal> por padrão): "
-"Indica que um identificar composto mapeado é usado, e que as propriedades de "
-"mapeamento contidas refere-se tanto à classe entidade quanto à classe de "
-"identificação composta."
#. Tag: para
+#: basic_mapping.xml:1472
#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - but required for a mapped composite "
-"identifier): the class used as a composite identifier."
+msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
-"<literal>class</literal> (opcional, mas requerida para um identificador "
-"composto mapeado): A classe usada como um identificador composto. "
#. Tag: para
+#: basic_mapping.xml:1475
#, no-c-format
msgid ""
-"We will describe a third, even more convenient approach, where the composite "
-"identifier is implemented as a component class in <xref linkend=\"components-"
-"compositeid\" />. The attributes described below apply only to this "
-"alternative approach:"
+"A version or timestamp property should never be null for a detached "
+"instance. Hibernate will detect any instance with a null version or "
+"timestamp as transient, irrespective of what other <literal>unsaved-value</"
+"literal> strategies are specified. <emphasis>Declaring a nullable version or "
+"timestamp property is an easy way to avoid problems with transitive "
+"reattachment in Hibernate. It is especially useful for people using assigned "
+"identifiers or composite keys</emphasis>."
msgstr ""
-"Descreveremos uma abordagem terciária e até mais conveniente, onde o "
-"identificador da composição é implementado como uma classe componente na "
-"<xref linkend=\"components-compositeid\"/>. Os atributos descritos abaixo "
-"aplicam-se apenas para esta abordagem: "
+"A versão ou timestamp de uma propriedade nunca deve ser nula para uma "
+"instância desconectada, assim o Hibernate irá identificar qualquer instância "
+"com uma versão nula ou timestamp como transiente, não importando qual outra "
+"estratégia <literal>unsaved-value</literal> tenha sido especificada. "
+"<emphasis>A declaração de uma versão nula ou a propriedade timestamp é um "
+"caminho fácil para tratar problemas com reconexões transitivas no Hibernate, "
+"especialmente úteis para pessoas utilizando identificadores atribuídos ou "
+"chaves compostas</emphasis>."
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>name</literal> (optional - required for this approach): a property "
-"of component type that holds the composite identifier. Please see chapter 9 "
-"for more information."
-msgstr ""
-"<literal>name</literal> (opcional, requerida para esta abordagem): Uma "
-"propriedade do tipo componente que armazena o identificador composto. Para "
-"maiores informações, por favor consulte o capítulo 9."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>access</literal> (optional - defaults to <literal>property</"
-"literal>): the strategy Hibernate uses for accessing the property value."
-msgstr ""
-"<literal>access</literal> (opcional - padrão para <literal>property</"
-"literal>): A estratégia que o Hiberante deve utilizar para acessar o valor "
-"da propriedade."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the component class used as a composite "
-"identifier. Please see the next section for more information."
-msgstr ""
-"<literal>class</literal> (opcional - valor padrão para o tipo de propriedade "
-"determinando por reflexão): A classe componente utilizada como um "
-"identificador composto. Por favor consulte a próxima seção para maiores "
-"informações."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The third approach, an <emphasis>identifier component</emphasis>, is "
-"recommended for almost all applications."
-msgstr ""
-"Esta terceira abordagem, um <emphasis>componente identificador</emphasis>, é "
-"a que nós recomendamos para a maioria das aplicações. "
-
#. Tag: title
+#: basic_mapping.xml:1485
#, no-c-format
-msgid "Discriminator"
-msgstr "Discriminador "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The <literal><discriminator></literal> element is required for "
-"polymorphic persistence using the table-per-class-hierarchy mapping "
-"strategy. It declares a discriminator column of the table. The discriminator "
-"column contains marker values that tell the persistence layer what subclass "
-"to instantiate for a particular row. A restricted set of types can be used: "
-"<literal>string</literal>, <literal>character</literal>, <literal>integer</"
-"literal>, <literal>byte</literal>, <literal>short</literal>, "
-"<literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</"
-"literal>."
+msgid "Version number"
msgstr ""
-"O elemento <literal><discriminator></literal> é necessário para "
-"persistência polimórfica utilizando a estratégia de mapeamento de tabela-por-"
-"classe-hierárquica e declara uma coluna discriminadora da tabela. A coluna "
-"discriminadora contém valores de marcação que informam à camada de "
-"persistência qual subclasse instanciar para uma linha em específico. Um "
-"restrito conjunto de tipos que podem ser utilizados: <literal>string</"
-"literal>, <literal>character</literal>, <literal>integer</literal>, "
-"<literal>byte</literal>, <literal>short</literal>, <literal>boolean</"
-"literal>, <literal>yes_no</literal>, <literal>true_false</literal>."
#. Tag: para
+#: basic_mapping.xml:1487
#, no-c-format
msgid ""
-"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
-"the name of the discriminator column."
+"You can add optimistic locking capability to an entity using the "
+"<literal>@Version</literal> annotation:"
msgstr ""
-"<literal>column</literal> (opcional - padrão para <literal>class</literal>): "
-"O nome da coluna discriminadora."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1490
#, no-c-format
msgid ""
-"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
-"a name that indicates the Hibernate type"
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
msgstr ""
-"<literal>type</literal> (opcional - padrão para <literal>string</literal>): "
-"O nome que indica o tipo Hibernate."
#. Tag: para
+#: basic_mapping.xml:1492
#, no-c-format
msgid ""
-"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
-"\"forces\" Hibernate to specify the allowed discriminator values, even when "
-"retrieving all instances of the root class."
+"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 ""
-"<literal>force</literal> (opcional - valor padrão <literal>false</literal>): "
-"\"Força\" o Hibernate a especificar valores discriminadores permitidos mesmo "
-"quando recuperando todas as instâncias da classe raíz. "
#. Tag: para
+#: basic_mapping.xml:1497
#, no-c-format
msgid ""
-"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
-"set this to <literal>false</literal> if your discriminator column is also "
-"part of a mapped composite identifier. It tells Hibernate not to include the "
-"column in SQL <literal>INSERTs</literal>."
+"The version column may be a numeric. Hibernate supports any kind of type "
+"provided that you define and implement the appropriate "
+"<classname>UserVersionType</classname>."
msgstr ""
-"<literal>insert</literal> (opcional - valor padrão para <literal>true</"
-"literal>) Ajuste para <literal>false</literal> se sua coluna discriminadora "
-"também fizer parte do identificador composto mapeado. (Isto informa ao "
-"Hibernate para não incluir a coluna em comandos SQL <literal>INSERT</"
-"literal>s)."
#. Tag: para
+#: basic_mapping.xml:1501
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
-"executed when a type has to be evaluated. It allows content-based "
-"discrimination."
+"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>LockModeType."
+"OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType."
+"PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
-"<literal>formula</literal> (opcional): Uma expressão SQL arbitrária que é "
-"executada quando um tipo tem que ser avaliado. Permite discriminação baseada "
-"em conteúdo. "
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
msgid ""
-"Actual values of the discriminator column are specified by the "
-"<literal>discriminator-value</literal> attribute of the <literal><"
-"class></literal> and <literal><subclass></literal> elements."
+"If the version number is generated by the database (via a trigger for "
+"example), make sure to use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"Valores atuais de uma coluna discriminada são especificados pela função "
-"<literal>discriminator-value</literal> da <literal><class></literal> e "
-"elementos da <literal><subclass></literal>."
#. Tag: para
+#: basic_mapping.xml:1511
#, no-c-format
-msgid ""
-"The <literal>force</literal> attribute is only useful if the table contains "
-"rows with \"extra\" discriminator values that are not mapped to a persistent "
-"class. This will not usually be the case."
+msgid "To declare a version property in hbm.xml, use:"
msgstr ""
-"O atributo <literal>force</literal> é útil (apenas) em tabelas contendo "
-"linhas com valores discriminadores \"extras\" que não estão mapeados para "
-"uma classe persistente. Este não é geralmente o caso."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:1530
#, no-c-format
msgid ""
-"The <literal>formula</literal> attribute allows you to declare an arbitrary "
-"SQL expression that will be used to evaluate the type of a row. For example:"
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
msgstr ""
-"Usando o atributo <literal>formula</literal> você pode declarar uma "
-"expressão SQL arbitrária que será utilizada para avaliar o tipo de uma "
-"linha. Por exemplo:"
-#. Tag: title
-#, no-c-format
-msgid "Version (optional)"
-msgstr "Versão (opcional) "
-
#. Tag: para
+#: basic_mapping.xml:1534
#, no-c-format
msgid ""
-"The <literal><version></literal> element is optional and indicates "
-"that the table contains versioned data. This is particularly useful if you "
-"plan to use <emphasis>long transactions</emphasis>. See below for more "
-"information:"
-msgstr ""
-"O elemento <literal><version></literal> é opcional e indica que a "
-"tabela possui dados versionados. Isto é particularmente útil se você planeja "
-"utilizar <emphasis>transações longas</emphasis>. Veja abaixo maiores "
-"informações: "
-
-#. Tag: para
-#, no-c-format
-msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of the column holding the version number."
msgstr ""
@@ -1940,11 +3448,14 @@
"name): O nome da coluna mantendo o número da versão."
#. Tag: para
+#: basic_mapping.xml:1540
#, no-c-format
-msgid "<literal>name</literal>: the name of a property of the persistent class."
+msgid ""
+"<literal>name</literal>: the name of a property of the persistent class."
msgstr "<literal>name</literal>: O nome da propriedade da classe persistente. "
#. Tag: para
+#: basic_mapping.xml:1545
#, no-c-format
msgid ""
"<literal>type</literal> (optional - defaults to <literal>integer</literal>): "
@@ -1954,6 +3465,7 @@
"O tipo do número da versão."
#. Tag: para
+#: basic_mapping.xml:1551
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -1964,6 +3476,7 @@
"da propriedade."
#. Tag: para
+#: basic_mapping.xml:1557
#, no-c-format
msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</"
@@ -1980,6 +3493,7 @@
"propriedade de identificação deve ser utilizado). "
#. Tag: para
+#: basic_mapping.xml:1567
#, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -1990,10 +3504,10 @@
"<literal>generated</literal> (opcional - valor padrão <literal>never</"
"literal>): Especifica que este valor de propriedade da versão é na verdade "
"gerado pelo banco de dados. Veja o <link linkend=\"mapping-generated"
-"\">generated properties</link> "
-"para maiores informações. "
+"\">generated properties</link> para maiores informações. "
#. Tag: para
+#: basic_mapping.xml:1575
#, no-c-format
msgid ""
"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
@@ -2006,59 +3520,82 @@
"do SQL. Pode ser configurado como <literal>false</literal> se a coluna do "
"banco de dados estiver definida com um valor padrão de <literal>0</literal>."
+#. Tag: title
+#: basic_mapping.xml:1586
+#, fuzzy, no-c-format
+msgid "Timestamp"
+msgstr "Timestamp (opcional) "
+
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:1588
+#, fuzzy, no-c-format
msgid ""
-"Version numbers can be of Hibernate type <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> or <literal>calendar</literal>."
+"Alternatively, you can use a timestamp. Timestamps are a less safe "
+"implementation of optimistic locking. However, sometimes the application "
+"might use the timestamps in other ways."
msgstr ""
-"Números de versão podem ser dos tipos Hibernate <literal>long</literal>, "
-"<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
-"literal> ou <literal>calendar</literal>. "
+"O elemento opcional <literal><timestamp></literal> indica que uma "
+"tabela contém dados em timestamp. Isso tem por objetivo dar uma alternativa "
+"para versionamento. Timestamps são por natureza uma implementação menos "
+"segura do bloqueio otimista. Entretanto, algumas vezes a aplicação pode usar "
+"timestamps em outros caminhos. "
#. Tag: para
+#: basic_mapping.xml:1592
#, no-c-format
msgid ""
-"A version or timestamp property should never be null for a detached "
-"instance. Hibernate will detect any instance with a null version or "
-"timestamp as transient, irrespective of what other <literal>unsaved-value</"
-"literal> strategies are specified. <emphasis>Declaring a nullable version or "
-"timestamp property is an easy way to avoid problems with transitive "
-"reattachment in Hibernate. It is especially useful for people using assigned "
-"identifiers or composite keys</emphasis>."
+"Simply mark a property of type <classname>Date</classname> or "
+"<classname>Calendar</classname> as <classname>@Version</classname>."
msgstr ""
-"A versão ou timestamp de uma propriedade nunca deve ser nula para uma "
-"instância desconectada, assim o Hibernate irá identificar qualquer instância "
-"com uma versão nula ou timestamp como transiente, não importando qual outra "
-"estratégia <literal>unsaved-value</literal> tenha sido especificada. "
-"<emphasis>A declaração de uma versão nula ou a propriedade timestamp é um "
-"caminho fácil para tratar problemas com reconexões transitivas no Hibernate, "
-"especialmente úteis para pessoas utilizando identificadores atribuídos ou "
-"chaves compostas</emphasis>."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:1596
#, no-c-format
-msgid "Timestamp (optional)"
-msgstr "Timestamp (opcional) "
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" public Date getLastUpdate() { ... }\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1598
#, no-c-format
msgid ""
-"The optional <literal><timestamp></literal> element indicates that the "
-"table contains timestamped data. This provides an alternative to versioning. "
-"Timestamps are a less safe implementation of optimistic locking. However, "
-"sometimes the application might use the timestamps in other ways."
+"Like version numbers, the timestamp can be generated by the database instead "
+"of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
msgstr ""
-"O elemento opcional <literal><timestamp></literal> indica que uma "
-"tabela contém dados em timestamp. Isso tem por objetivo dar uma alternativa "
-"para versionamento. Timestamps são por natureza uma implementação menos "
-"segura do bloqueio otimista. Entretanto, algumas vezes a aplicação pode usar "
-"timestamps em outros caminhos. "
#. Tag: para
+#: basic_mapping.xml:1602
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr ""
+"Por exemplo, se temos o seguinte mapeamento de <literal><properties></"
+"literal>:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
#, no-c-format
msgid ""
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1624
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
"name of a column holding the timestamp."
msgstr ""
@@ -2066,6 +3603,7 @@
"nome da coluna que mantém o timestamp."
#. Tag: para
+#: basic_mapping.xml:1630
#, no-c-format
msgid ""
"<literal>name</literal>: the name of a JavaBeans style property of Java type "
@@ -2077,8 +3615,21 @@
"persistente."
#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380
+#: basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
#, no-c-format
msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the property value."
+msgstr ""
+"<literal>access</literal> (opcional - padrão para <literal>property</"
+"literal>): A estratégia que o Hiberante deve utilizar para acessar o valor "
+"da propriedade."
+
+#. Tag: para
+#: basic_mapping.xml:1642
+#, no-c-format
+msgid ""
"<literal>unsaved-value</literal> (optional - defaults to <literal>null</"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
@@ -2093,6 +3644,7 @@
"identificação deve ser utilizado."
#. Tag: para
+#: basic_mapping.xml:1652
#, no-c-format
msgid ""
"<literal>source</literal> (optional - defaults to <literal>vm</literal>): "
@@ -2115,6 +3667,7 @@
"por exemplo)."
#. Tag: para
+#: basic_mapping.xml:1665
#, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2124,16 +3677,17 @@
msgstr ""
"<literal>generated</literal> (opcional - padrão para <literal>never</"
"literal>): Especifica que o valor da propriedade timestamp é gerado pelo "
-"banco de dados. Veja a discussão do <link linkend=\"mapping-"
-"generated\">generated properties</link> "
-"para maiores informações. "
+"banco de dados. Veja a discussão do <link linkend=\"mapping-generated"
+"\">generated properties</link> para maiores informações. "
#. Tag: title
+#: basic_mapping.xml:1675
#, no-c-format
msgid "Note"
msgstr "Nota"
#. Tag: para
+#: basic_mapping.xml:1677
#, no-c-format
msgid ""
"<literal><Timestamp></literal> is equivalent to <literal><version "
@@ -2147,20 +3701,830 @@
"type=\"dbtimestamp\"></literal>."
#. Tag: title
+#: basic_mapping.xml:1686
#, no-c-format
msgid "Property"
msgstr "Propriedade "
#. Tag: para
+#: basic_mapping.xml:1688
#, no-c-format
msgid ""
+"You need to decide which property needs to be made persistent in a given "
+"entity. This differs slightly between the annotation driven metadata and the "
+"hbm.xml files."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1693
+#, no-c-format
+msgid "Property mapping with annotations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1695
+#, no-c-format
+msgid ""
+"In the annotations world, every non static non transient property (field or "
+"method depending on the access type) of an entity 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."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1702
+#, no-c-format
+msgid ""
+"The <literal>@Basic</literal> annotation allows you to declare the fetching "
+"strategy for a property. If set to <literal>LAZY</literal>, specifies that "
+"this property should be fetched lazily when the instance variable is first "
+"accessed. It requires build-time bytecode instrumentation, if your classes "
+"are not instrumented, property level lazy loading is silently ignored. The "
+"default is <literal>EAGER</literal>. You can also mark a property as not "
+"optional thanks to the <classname>@Basic.optional</classname> attribute. "
+"This will ensure that the underlying column are not nullable (if possible). "
+"Note that a better approach is to use the <classname>@NotNull</classname> "
+"annotation of the Bean Validation specification."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1715
+#, no-c-format
+msgid "Let's look at a few examples:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+"@Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property \n"
+"\n"
+"@Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1719
+#, 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 Hibernate. <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). The recommended alternative is to "
+"use the projection capability of JP-QL (Java Persistence Query Language) or "
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1732
+#, no-c-format
+msgid ""
+"JPA support property mapping of all basic types supported by Hibernate (all "
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> "
+"annotation as shown in the <literal>note</literal> property example."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1742
+#, no-c-format
+msgid ""
+"In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
+#, 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 <classname>Serializable</classname> type "
+"will be persisted in a Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
+#, 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
+#: basic_mapping.xml:1768
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1770
+#, no-c-format
+msgid ""
+"You can also manually specify a type using the <literal>@org.hibernate."
+"annotations.Type</literal> and some parameters if needed. <classname>@Type."
+"type</classname> could be:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
+#, no-c-format
+msgid ""
+"The name of a Hibernate basic type: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgstr ""
+"O nome de um tipo básico de Hibernate: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal>, etc. "
+
+#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
+#, no-c-format
+msgid ""
+"The name of a Java class with a default basic type: <literal>int, float, "
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal> etc."
+msgstr ""
+"O nome da classe Java com um tipo básico padrão: <literal>int, float, char, "
+"java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal>, etc."
+
+#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
+#, no-c-format
+msgid "The name of a serializable Java class."
+msgstr "O nome da classe Java serializável"
+
+#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
+#, no-c-format
+msgid ""
+"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
+"literal> etc."
+msgstr ""
+"O nome da classe de um tipo customizado: <literal>com.illflow.type."
+"MyCustomType</literal>, etc."
+
+#. Tag: para
+#: basic_mapping.xml:1798
+#, fuzzy, no-c-format
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4."
+msgstr ""
+"Se você não especificar um tipo, o Hibernate irá utilizar reflexão sobre a "
+"propriedade nomeada para ter uma idéia do tipo de Hibernate correto. O "
+"Hibernate tentará interpretar o nome da classe retornada, usando as regras "
+"2, 3 e 4 nesta ordem. Em certos casos, você ainda precisará do atributo "
+"<literal>type</literal>. Por exemplo, para distinguir entre "
+"<literal>Hibernate.DATE</literal> e <literal>Hibernate.TIMESTAMP</literal>, "
+"ou para especificar um tipo customizado."
+
+#. Tag: para
+#: basic_mapping.xml:1803
+#, no-c-format
+msgid ""
+"<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when "
+"defined at the class level). If the type is used on a single entity, you can "
+"place the definition on the entity itself. Otherwise, it is recommended to "
+"place the definition at the package level. In the example below, when "
+"Hibernate encounters a property of class <literal>PhoneNumer</literal>, it "
+"delegates the persistence strategy to the custom mapping type "
+"<literal>PhoneNumberType</literal>. However, properties belonging to other "
+"classes, too, can delegate their persistence strategy to "
+"<literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</"
+"literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1819
+#, 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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+"@TypeDef(\n"
+" name = \"phoneNumber\",\n"
+" defaultForType = PhoneNumber.class,\n"
+" typeClass = PhoneNumberType.class\n"
+")\n"
+"\n"
+"@Entity\n"
+"public class ContactDetails {\n"
+" [...]\n"
+" private PhoneNumber localPhoneNumber;\n"
+" @Type(type=\"phoneNumber\")\n"
+" private OverseasPhoneNumber overseasPhoneNumber;\n"
+" [...]\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1826
+#, no-c-format
+msgid ""
+"The following example shows the usage of the <literal>parameters</literal> "
+"attribute to customize the TypeDef."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
+#, 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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+"@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
+#: basic_mapping.xml:1840
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1842
+#, no-c-format
+msgid ""
+"By default the access type of a class hierarchy is defined by the position "
+"of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> "
+"annotations. If these annotations are on a field, then only fields are "
+"considered for persistence and the state is accessed via the field. If there "
+"annotations are on a getter, then only the getters are considered for "
+"persistence and the state is accessed via the getter/setter. That works well "
+"in practice and is the recommended approach."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1850
+#, no-c-format
+msgid ""
+"The placement of annotations within a class hierarchy has to be consistent "
+"(either field or on property) to be able to determine the default access "
+"type. It is recommended to stick to one single annotation placement strategy "
+"throughout your whole application."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1857
+#, no-c-format
+msgid "However in some situations, you need to:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1861
+#, no-c-format
+msgid "force the access type of the entity hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1865
+#, no-c-format
+msgid "override the access type of a specific entity in the class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1870
+#, no-c-format
+msgid "override the access type of an embeddable type"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid ""
+"The best use case is an embeddable class used by several entities that might "
+"not use the same access type. In this case it is better to force the access "
+"type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid ""
+"To force the access type on a given class, use the <classname>@Access</"
+"classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" @Embedded private Address address;\n"
+" public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class User {\n"
+" private Long id;\n"
+" @Id public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" private Address address;\n"
+" @Embedded public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"@Access(AcessType.PROPERTY)\n"
+"public class Address {\n"
+" private String street1;\n"
+" public String getStreet1() { return street1; }\n"
+" public void setStreet1() { this.street1 = street1; }\n"
+"\n"
+" private hashCode; //not persistent\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid ""
+"You can also override the access type of a single property while keeping the "
+"other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+" @Transient private String userId;\n"
+" @Transient private String orderId;\n"
+"\n"
+" @Access(AccessType.PROPERTY)\n"
+" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid ""
+"In this example, the default access type is <classname>FIELD</classname> "
+"except for the <literal>orderNumber</literal> property. Note that the "
+"corresponding field, if any must be marked as <classname>@Transient</"
+"classname> or <code>transient</code>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1896
+#, no-c-format
+msgid "@org.hibernate.annotations.AccessType"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1898
+#, no-c-format
+msgid ""
+"The annotation <classname>@org.hibernate.annotations.AccessType</classname> "
+"should be considered deprecated for FIELD and PROPERTY access. It is still "
+"useful however if you need to use a custom access type."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1907
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1909
+#, 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
+#: basic_mapping.xml:1914
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "<literal>assigned</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "<literal>string</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "<literal>hilo</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, fuzzy, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the property "
+"name)"
+msgstr ""
+"<literal>name</literal> (opcional): O nome da propriedade do identificador."
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal> (opcional): Habilita a geração de DDL de uma única "
+"restrição para as colunas. Da mesma forma, permita que isto seja o alvo de "
+"uma <literal>property-ref</literal>. "
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, fuzzy, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable (default "
+"true)."
+msgstr ""
+"<literal>name</literal> (opcional): O nome da propriedade do identificador."
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column will be "
+"part of the insert statement (default true)"
+msgstr ""
+"<literal>name</literal> (opcional): O nome da propriedade do identificador."
+
+#. Tag: para
+#: basic_mapping.xml:2008
+#, fuzzy, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will be "
+"part of the update statement (default true)"
+msgstr ""
+"<literal>catalog</literal> (opcional): O nome do catálogo do banco de dados. "
+
+#. Tag: para
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL "
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default "
+"primary table)"
+msgstr ""
+"<literal>catalog</literal> (opcional): O nome do catálogo do banco de dados. "
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional): column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional): column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional): column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>Serializable</"
+"classname>, it is mapped as <classname>@Basic</classname> in a column "
+"holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>java.sql.Clob</"
+"classname> or <classname>java.sql.Blob</classname>, it is mapped as "
+"<classname>@Lob</classname> with the appropriate <classname>LobType</"
+"classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, no-c-format
+msgid ""
"The <literal><property></literal> element declares a persistent "
"JavaBean style property of the class."
msgstr ""
"O elemento <literal><property></literal> declara uma propriedade de "
"estilo JavaBean de uma classe."
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, no-c-format
+msgid ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2129
#, no-c-format
msgid ""
"<literal>name</literal>: the name of the property, with an initial lowercase "
@@ -2170,6 +4534,7 @@
"minúscula."
#. Tag: para
+#: basic_mapping.xml:2134
#, no-c-format
msgid ""
"<literal>column</literal> (optional - defaults to the property name): the "
@@ -2181,6 +4546,7 @@
"pelo(s) elemento(s) <literal><column></literal> aninhados."
#. Tag: para
+#: basic_mapping.xml:2146
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2198,6 +4564,7 @@
"coluna(s) ou por uma disparo ou outra aplicação."
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2209,6 +4576,7 @@
"não possuem uma coluna de mapeamento para elas."
#. Tag: para
+#: basic_mapping.xml:2169
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
@@ -2221,6 +4589,7 @@
"instrumentação bytecode em tempo de criação."
#. Tag: para
+#: basic_mapping.xml:2176
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2232,6 +4601,7 @@
"uma <literal>property-ref</literal>. "
#. Tag: para
+#: basic_mapping.xml:2183
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2241,6 +4611,7 @@
"restrição de nulidade para as colunas. "
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2254,6 +4625,7 @@
"deve ocorrer quando esta propriedade está suja."
#. Tag: para
+#: basic_mapping.xml:2196
#, no-c-format
msgid ""
"<literal>generated</literal> (optional - defaults to <literal>never</"
@@ -2264,51 +4636,18 @@
"<literal>generated</literal> (opcional - padrão para <literal>never</"
"literal>): Especifica que o valor da propriedade é na verdade gerado pelo "
"banco de dados. Veja a discussão do <link linkend=\"mapping-generated"
-"\">generated properties</link> "
-"para maiores informações. "
+"\">generated properties</link> para maiores informações. "
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr "<emphasis>typename</emphasis> pode ser:"
#. Tag: para
+#: basic_mapping.xml:2230
#, no-c-format
msgid ""
-"The name of a Hibernate basic type: <literal>integer, string, character, "
-"date, timestamp, float, binary, serializable, object, blob</literal> etc."
-msgstr ""
-"O nome de um tipo básico de Hibernate: <literal>integer, string, character, "
-"date, timestamp, float, binary, serializable, object, blob</literal>, etc. "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The name of a Java class with a default basic type: <literal>int, float, "
-"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
-"literal> etc."
-msgstr ""
-"O nome da classe Java com um tipo básico padrão: <literal>int, float, char, "
-"java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
-"literal>, etc."
-
-#. Tag: para
-#, no-c-format
-msgid "The name of a serializable Java class."
-msgstr "O nome da classe Java serializável"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
-"literal> etc."
-msgstr ""
-"O nome da classe de um tipo customizado: <literal>com.illflow.type."
-"MyCustomType</literal>, etc."
-
-#. Tag: para
-#, no-c-format
-msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
@@ -2326,6 +4665,7 @@
"ou para especificar um tipo customizado."
#. Tag: para
+#: basic_mapping.xml:2239
#, no-c-format
msgid ""
"The <literal>access</literal> attribute allows you to control how Hibernate "
@@ -2346,6 +4686,7 @@
"literal>."
#. Tag: para
+#: basic_mapping.xml:2248
#, no-c-format
msgid ""
"A powerful feature is derived properties. These properties are by definition "
@@ -2359,7 +4700,20 @@
"SQL, que traduz para cláusula <literal>SELECT</literal> de uma subconsulta "
"da consulta SQL que carrega a instância: "
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, no-c-format
+msgid ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2256
#, no-c-format
msgid ""
"You can reference the entity table by not declaring an alias on a particular "
@@ -2374,31 +4728,1813 @@
"se você não gostar de usar o atributo. "
#. Tag: title
+#: basic_mapping.xml:2265
#, no-c-format
-msgid "Many-to-one"
-msgstr "Muitos-para-um "
+msgid "Embedded objects (aka components)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2267
+#, fuzzy, no-c-format
+msgid ""
+"Embeddable objects (or components) are objects whose properties are mapped "
+"to the same table as the owning entity's table. Components can, in turn, "
+"declare their own properties, components or collections"
+msgstr ""
+"O elemento <literal><component></literal> mapeia propriedades de um "
+"objeto filho para colunas da tabela de uma classe pai. Os componentes podem, "
+"um após o outro, declarar suas próprias propriedades, componentes ou "
+"coleções. Veja \"Components\" abaixo:"
+
+#. Tag: para
+#: basic_mapping.xml:2272
#, no-c-format
msgid ""
-"An ordinary association to another persistent class is declared using a "
-"<literal>many-to-one</literal> element. The relational model is a many-to-"
-"one association; a foreign key in one table is referencing the primary key "
-"column(s) of the target table."
+"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 ""
-"Uma associação ordinária para outra classe persistente é declarada usando o "
-"elemento <literal>many-to-one</literal>. O modelo relacional é uma "
-"associação muitos para um: uma chave exterior de uma tabela referenciando as "
-"colunas da chave primária da tabela destino."
+#. Tag: programlisting
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
#, no-c-format
+msgid ""
+"An embeddable object inherits the access type of its owning entity (note "
+"that you can override that using the <literal>@Access</literal> annotation)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2290
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded "
+"objects of embedded objects is through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2305
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column = @Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
+"(name=\"nat_Iso2\") ),\n"
+" @AttributeOverride(name=\"nationality.name\", column = @Column"
+"(name=\"nat_CountryName\") )\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2307
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports something that is not explicitly supported by "
+"the JPA 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
+#: basic_mapping.xml:2313
+#, no-c-format
+msgid ""
+"You can also use association annotations in an embeddable object (ie "
+"<literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, "
+"<classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To "
+"override the association columns you can use <literal>@AssociationOverride</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2319
+#, 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 as several embedded objects "
+"would share the same set of columns. In plain JPA, you need to override at "
+"least one set of columns. Hibernate, however, allows you to enhance the "
+"default naming mechanism through the <classname>NamingStrategy</classname> "
+"interface. You can write a strategy that prevent name clashing in such a "
+"situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an "
+"example of this."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2329
+#, no-c-format
+msgid ""
+"If a property of the embedded object points back to the owning entity, "
+"annotate it with the <classname>@Parent</classname> annotation. Hibernate "
+"will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
+#, no-c-format
+msgid ""
+"<component\n"
+" name=\"propertyName\"\n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
+#, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr "<literal>name</literal>: O nome da propriedade. "
#. Tag: para
+#: basic_mapping.xml:2364
#, no-c-format
msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the component (child) class."
+msgstr ""
+"<literal>class</literal> (opcional – padrão para o tipo de propriedade "
+"determinada por reflection): O nome da classe (filha) do componente."
+
+#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
+#, no-c-format
+msgid ""
+"<literal>insert</literal>: do the mapped columns appear in SQL "
+"<literal>INSERTs</literal>?"
+msgstr ""
+"<literal>insert</literal>: As colunas mapeadas aparecem nos SQL de "
+"<literal>INSERTs</literal>? "
+
+#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
+#, no-c-format
+msgid ""
+"<literal>update</literal>: do the mapped columns appear in SQL "
+"<literal>UPDATEs</literal>?"
+msgstr ""
+"<literal>update</literal>: As colunas mapeadas aparecem nos SQL de "
+"<literal>UPDATEs</literal>? "
+
+#. Tag: para
+#: basic_mapping.xml:2386
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this component should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal> (opcional - padrão para <literal>false</literal>): "
+"Especifica que este componente deve ter uma busca lazy quando a função for "
+"acessada pela primeira vez. Isto requer instrumentação bytecode de tempo de "
+"construção."
+
+#. Tag: para
+#: basic_mapping.xml:2393
+#, no-c-format
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this component either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal> (opcional – padrão para <literal>true</"
+"literal>): Especifica que atualizações para este componente requerem ou não "
+"aquisição de um bloqueio otimista. Em outras palavras, determina se uma "
+"versão de incremento deve ocorrer quando esta propriedade estiver suja."
+
+#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that a unique constraint exists upon all mapped columns of the "
+"component."
+msgstr ""
+"<literal>unique</literal> (opcional – valor padrão <literal>false</"
+"literal>): Especifica que existe uma unique restrição em todas as colunas "
+"mapeadas do componente. "
+
+#. Tag: para
+#: basic_mapping.xml:2408
+#, no-c-format
+msgid ""
+"The child <literal><property></literal> tags map properties of the "
+"child class to table columns."
+msgstr ""
+"A tag filha <literal><property></literal> acrescenta a propriedade de "
+"mapeamento da classe filha para colunas de uma tabela."
+
+#. Tag: para
+#: basic_mapping.xml:2411
+#, no-c-format
+msgid ""
+"The <literal><component></literal> element allows a <literal><"
+"parent></literal> subelement that maps a property of the component class "
+"as a reference back to the containing entity."
+msgstr ""
+"O elemento <literal><component></literal> permite um sub-elemento "
+"<literal><parent></literal> mapeie uma propriedade da classe do "
+"componente como uma referencia de volta para a entidade que o contém."
+
+#. Tag: para
+#: basic_mapping.xml:2415
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><dynamic-component></literal> element allows a "
+"<literal>Map</literal> to be mapped as a component, where the property names "
+"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
+"more information. This feature is not supported in annotations."
+msgstr ""
+"O elemento <literal><dynamic-component></literal> permite que um "
+"<literal>Map</literal> possa ser mapeado como um componente onde os nomes "
+"das propriedades referem-se para as chaves no mapa. Consulte <xref linkend="
+"\"components-dynamic\"/> para maiores informações."
+
+#. Tag: title
+#: basic_mapping.xml:2423
+#, no-c-format
+msgid "Inheritance strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2425
+#, no-c-format
+msgid ""
+"Java is a language supporting polymorphism: a class can inherit from "
+"another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2431
+#, no-c-format
+msgid ""
+"Single table per class hierarchy strategy: a single table hosts all the "
+"instances of a class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2436
+#, no-c-format
+msgid ""
+"Joined subclass strategy: one table per class and subclass is present and "
+"each table persist the properties specific to a given subclass. The state of "
+"the entity is then stored in its corresponding class table and all its "
+"superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2443
+#, no-c-format
+msgid ""
+"Table per class strategy: one table per concrete class and subclass is "
+"present and each table persist the properties of the class and its "
+"superclasses. The state of the entity is then stored entirely in the "
+"dedicated table for its class."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2453
+#, no-c-format
+msgid ""
+"With this approach the properties of all the subclasses in a given mapped "
+"class hierarchy are stored in a single table."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2456
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass declares its own persistent properties and subclasses. Version "
+"and id properties are assumed to be inherited from the root class. Each "
+"subclass in a hierarchy must define a unique discriminator value. If this is "
+"not specified, the fully qualified Java class name is used."
+msgstr ""
+"Cada subclasse deve declarar suas próprias propriedades persistentes e "
+"subclasses. As propriedades <literal><version></literal> e "
+"<literal><id></literal> são configuradas para serem herdadas da classe "
+"raíz. Cada subclasse numa hierarquia deve definir um único "
+"<literal>discriminator-value</literal>. Se nenhum for especificado, será "
+"usado o nome da classe Java completamente qualificado."
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: basic_mapping.xml:2464
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
+"<literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+"Finalmente, a persistência polimórfica requer a declaração de cada subclasse "
+"da classe raíz de persistência. Para a estratégia de mapeamento tabela-por-"
+"hierarquia-de-classe, deve-se utilizar a declaração <literal><subclass>"
+"</literal>. Por exemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, no-c-format
+msgid ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
+#, no-c-format
+msgid ""
+"<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr ""
+"<literal>name</literal>: O nome de classe completamente qualificada da "
+"subclasse. "
+
+#. Tag: para
+#: basic_mapping.xml:2488
+#, no-c-format
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses."
+msgstr ""
+"<literal>discriminator-value</literal> (opcional – padrão para o nome da "
+"classe): Um valor que distingue subclasses individuais."
+
+#. Tag: para
+#: basic_mapping.xml:2494
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface used for "
+"lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (opcional): Especifica a classe ou interface que "
+"usará os proxies de inicialização lazy."
+
+#. Tag: para
+#: basic_mapping.xml:2499
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (opcional, padrão para <literal>true</literal>): "
+"Configurar <literal>lazy=\"false\"</literal> desabilitará o uso de "
+"inicialização lazy."
+
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, fuzzy, no-c-format
+msgid ""
+"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
+">."
+msgstr ""
+"Para informações sobre mapeamento de heranças. Consulte o <xref linkend="
+"\"inheritance\" />."
+
+#. Tag: title
+#: basic_mapping.xml:2511
+#, no-c-format
+msgid "Discriminator"
+msgstr "Discriminador "
+
+#. Tag: para
+#: basic_mapping.xml:2513
+#, fuzzy, no-c-format
+msgid ""
+"Discriminators are required for polymorphic persistence using the table-per-"
+"class-hierarchy mapping strategy. It declares a discriminator column of the "
+"table. The discriminator column contains marker values that tell the "
+"persistence layer what subclass to instantiate for a particular row. A "
+"restricted set of types can be used: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+"O elemento <literal><discriminator></literal> é necessário para "
+"persistência polimórfica utilizando a estratégia de mapeamento de tabela-por-"
+"classe-hierárquica e declara uma coluna discriminadora da tabela. A coluna "
+"discriminadora contém valores de marcação que informam à camada de "
+"persistência qual subclasse instanciar para uma linha em específico. Um "
+"restrito conjunto de tipos que podem ser utilizados: <literal>string</"
+"literal>, <literal>character</literal>, <literal>integer</literal>, "
+"<literal>byte</literal>, <literal>short</literal>, <literal>boolean</"
+"literal>, <literal>yes_no</literal>, <literal>true_false</literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2523
+#, no-c-format
+msgid ""
+"Use the <classname>@DiscriminatorColumn</classname> to define the "
+"discriminator column as well as the discriminator type. Alternatively, you "
+"can also use <classname>@DiscriminatorFormula</classname> to express in SQL "
+"what would be in a virtual discriminator column. This is particularly handy "
+"when the discriminator value can be extracted from one or more columns of "
+"the table. Both <classname>@DiscriminatorColumn</classname> and "
+"<classname>@DiscriminatorFormula</classname> are to be set on the root "
+"entity (once per persisted hierarchy)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2534
+#, no-c-format
+msgid ""
+"Finally, use <classname>@DiscriminatorValue</classname> on each class of the "
+"hierarchy to specify the value stored in the discriminator column for a "
+"given entity. If you do not set <classname>@DiscriminatorValue</classname> "
+"on a class, the fully qualified class name is used."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2542
+#, no-c-format
+msgid ""
+"In hbm.xml, the <literal><discriminator></literal> element is used to "
+"define the discriminator column or formula:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, no-c-format
+msgid ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2563
+#, no-c-format
+msgid ""
+"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
+"the name of the discriminator column."
+msgstr ""
+"<literal>column</literal> (opcional - padrão para <literal>class</literal>): "
+"O nome da coluna discriminadora."
+
+#. Tag: para
+#: basic_mapping.xml:2569
+#, no-c-format
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
+"a name that indicates the Hibernate type"
+msgstr ""
+"<literal>type</literal> (opcional - padrão para <literal>string</literal>): "
+"O nome que indica o tipo Hibernate."
+
+#. Tag: para
+#: basic_mapping.xml:2575
+#, no-c-format
+msgid ""
+"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
+"\"forces\" Hibernate to specify the allowed discriminator values, even when "
+"retrieving all instances of the root class."
+msgstr ""
+"<literal>force</literal> (opcional - valor padrão <literal>false</literal>): "
+"\"Força\" o Hibernate a especificar valores discriminadores permitidos mesmo "
+"quando recuperando todas as instâncias da classe raíz. "
+
+#. Tag: para
+#: basic_mapping.xml:2582
+#, no-c-format
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"set this to <literal>false</literal> if your discriminator column is also "
+"part of a mapped composite identifier. It tells Hibernate not to include the "
+"column in SQL <literal>INSERTs</literal>."
+msgstr ""
+"<literal>insert</literal> (opcional - valor padrão para <literal>true</"
+"literal>) Ajuste para <literal>false</literal> se sua coluna discriminadora "
+"também fizer parte do identificador composto mapeado. (Isto informa ao "
+"Hibernate para não incluir a coluna em comandos SQL <literal>INSERT</"
+"literal>s)."
+
+#. Tag: para
+#: basic_mapping.xml:2590
+#, no-c-format
+msgid ""
+"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
+"executed when a type has to be evaluated. It allows content-based "
+"discrimination."
+msgstr ""
+"<literal>formula</literal> (opcional): Uma expressão SQL arbitrária que é "
+"executada quando um tipo tem que ser avaliado. Permite discriminação baseada "
+"em conteúdo. "
+
+#. Tag: para
+#: basic_mapping.xml:2597
+#, no-c-format
+msgid ""
+"Actual values of the discriminator column are specified by the "
+"<literal>discriminator-value</literal> attribute of the <literal><"
+"class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+"Valores atuais de uma coluna discriminada são especificados pela função "
+"<literal>discriminator-value</literal> da <literal><class></literal> e "
+"elementos da <literal><subclass></literal>."
+
+#. Tag: para
+#: basic_mapping.xml:2602
+#, no-c-format
+msgid ""
+"The <literal>force</literal> attribute is only useful if the table contains "
+"rows with \"extra\" discriminator values that are not mapped to a persistent "
+"class. This will not usually be the case."
+msgstr ""
+"O atributo <literal>force</literal> é útil (apenas) em tabelas contendo "
+"linhas com valores discriminadores \"extras\" que não estão mapeados para "
+"uma classe persistente. Este não é geralmente o caso."
+
+#. Tag: para
+#: basic_mapping.xml:2607
+#, no-c-format
+msgid ""
+"The <literal>formula</literal> attribute allows you to declare an arbitrary "
+"SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+"Usando o atributo <literal>formula</literal> você pode declarar uma "
+"expressão SQL arbitrária que será utilizada para avaliar o tipo de uma "
+"linha. Por exemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, no-c-format
+msgid ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, fuzzy, no-c-format
+msgid "Joined subclass strategy"
+msgstr "Subclasses Unidas "
+
+#. Tag: para
+#: basic_mapping.xml:2618
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass can also be mapped to its own table. This is called the table-"
+"per-subclass mapping strategy. An inherited state is retrieved by joining "
+"with the table of the superclass. A discriminator column is not required for "
+"this mapping strategy. Each subclass must, however, declare a table column "
+"holding the object identifier. The primary key of this table is also a "
+"foreign key to the superclass table and described by the "
+"<classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></"
+"literal> element."
+msgstr ""
+"Alternativamente, cada subclasse pode ser mapeada para sua própria tabela. "
+"Isto é chamado estratégia de mapeamento de tabela-por-subclasse. O estado "
+"herdado é devolvido por associação com a tabela da superclasse. Nós usamos o "
+"elemento <literal><joined-subclass></literal>. Por exemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
+#, no-c-format
+msgid ""
+"@Entity @Table(name=\"CATS\")\n"
+"@Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Cat implements Serializable { \n"
+" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+" String getId() { return id; }\n"
+"\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+"public class DomesticCat extends Cat { \n"
+" public String getName() { return name; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2631
+#, no-c-format
+msgid ""
+"The table name still defaults to the non qualified class name. Also if "
+"<classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / "
+"foreign key columns are assumed to have the same names as the primary key "
+"columns of the primary table of the superclass."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2638
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><joined-subclass></literal> element. For "
+"example:"
+msgstr ""
+"Você pode declarar uma classe persistente utilizando o elemento "
+"<literal>class</literal>. Por exemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, no-c-format
+msgid ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
+#, no-c-format
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr "<literal>table</literal>: O nome da tabela da subclasse. "
+
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface to use "
+"for lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal> (opcional): Especifica a classe ou interface que "
+"usará os proxies de inicialização lazy. "
+
+#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal> (opcional, padrão para <literal>true</literal>): "
+"Configurar <literal>lazy=\"false\"</literal> desabilitará o uso de "
+"inicialização lazy."
+
+#. Tag: para
+#: basic_mapping.xml:2679
+#, no-c-format
+msgid ""
+"Use the <literal><key></literal> element to declare the primary key / "
+"foreign key column. The mapping at the start of the chapter would then be re-"
+"written as:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2692
+#, fuzzy, no-c-format
+msgid ""
+"A third option is to map only the concrete classes of an inheritance "
+"hierarchy to tables. This is called the table-per-concrete-class strategy. "
+"Each table defines all persistent states of the class, including the "
+"inherited state. In Hibernate, it is not necessary to explicitly map such "
+"inheritance hierarchies. You can map each class as a separate entity root. "
+"However, if you wish use polymorphic associations (e.g. an association to "
+"the superclass of your hierarchy), you need to use the union subclass "
+"mapping."
+msgstr ""
+"Uma terceira opção é mapear apenas as classes concretas de uma hierarquia de "
+"heranças para tabelas. Isto é chamado estratégia table-per-concrete-class. "
+"Cada tabela define todos os estados persistentes da classe, incluindo "
+"estados herdados. No Hibernate, não é absolutamente necessário mapear "
+"explicitamente como hierarquia de heranças. Você pode simplesmente mapear "
+"cada classe com uma declaração <literal><class></literal> separada. "
+"Porém, se você deseja usar associações polimórficas (por exemplo: uma "
+"associação para a superclasse de sua hierarquia), você precisa usar o "
+"mapeamento <literal><union-subclass></literal>. Por exemplo:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2703
+#, no-c-format
+msgid "Or in hbm.xml:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, no-c-format
+msgid ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid ""
+"No discriminator column or key column is required for this mapping strategy."
+msgstr ""
+"A coluna discriminatória não é requerida para esta estratégia de mapeamento."
+
+#. Tag: title
+#: basic_mapping.xml:2751
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2753
+#, 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>@MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
+#, 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
+#: basic_mapping.xml:2768
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as <literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2773
+#, no-c-format
+msgid ""
+"The default access type (field or methods) is used, unless you use the "
+"<literal>@Access</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2778
+#, 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
+#: basic_mapping.xml:2786
+#, 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
+#: basic_mapping.xml:2792
+#, 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
+#: basic_mapping.xml:2797
+#, 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
+#: basic_mapping.xml:2801
+#, 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( \n"
+" name=\"propulsion\", \n"
+" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+")\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2803
+#, 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
+#: basic_mapping.xml:2809
+#, 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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid ""
+"In hbm.xml, simply map the properties of the superclass in the <literal><"
+"class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2821
+#, no-c-format
+msgid "Mapping one entity to several tables"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2823
+#, no-c-format
+msgid ""
+"While not recommended for a fresh schema, some legacy databases force your "
+"to map a single entity on several tables."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2826
+#, no-c-format
+msgid ""
+"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>@JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2834
+#, 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
+#: basic_mapping.xml:2844
+#, no-c-format
+msgid ""
+"There is also additional tuning accessible via the <classname>@org.hibernate."
+"annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, fuzzy, 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 <classname>SELECT</classname> 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>(opcional – valor padrão <literal>join</literal>): "
+"Se ajustado para <literal>join</literal>, o padrão, o Hibernate irá usar uma "
+"união interna para restaurar um <literal>join</literal> definido por uma "
+"classe ou suas subclasses e uma união externa para um <literal>join</"
+"literal> definido por uma subclasse. Se ajustado para <literal>select</"
+"literal>, então o Hibernate irá usar uma seleção seqüencial para um "
+"<literal><join></literal> definida numa subclasse, que será emitido "
+"apenas se uma linha representar uma instância da subclasse. Uniões internas "
+"ainda serão utilizadas para restaurar um <literal><join></literal> "
+"definido pela classe e suas superclasses. "
+
+#. Tag: para
+#: basic_mapping.xml:2862
+#, fuzzy, 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> (opcional – padrão para <literal>false</"
+"literal>): Se habilitado, o Hibernate não tentará inserir ou atualizar as "
+"propriedades definidas por esta união."
+
+#. Tag: para
+#: basic_mapping.xml:2868
+#, fuzzy, 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> (opcional – padrão para <literal>false</"
+"literal>): Se habilitado, o Hibernate irá inserir uma linha apenas se as "
+"propriedades, definidas por esta junção, não forem nulas. Isto irá sempre "
+"usar uma união externa para recuperar as propriedades."
+
+#. Tag: para
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid ""
+"Make sure to use the secondary table name in the <methodname>appliesto</"
+"methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTable(name=\"Cat1\")\n"
+"@org.hibernate.annotations.Table(\n"
+" appliesTo=\"Cat1\",\n"
+" fetch=FetchMode.SELECT,\n"
+" optional=true)\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
+msgstr ""
+"Por exemplo, se temos o seguinte mapeamento de <literal><properties></"
+"literal>:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, no-c-format
+msgid ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+"\n"
+" <key ... />\n"
+"\n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2907
+#, no-c-format
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr "<literal>table</literal>: O nome da tabela associada. "
+
+#. Tag: para
+#: basic_mapping.xml:2924
+#, no-c-format
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
+"if set to <literal>join</literal>, the default, Hibernate will use an inner "
+"join to retrieve a <literal><join></literal> defined by a class or its "
+"superclasses. It will use an outer join for a <literal><join></"
+"literal> defined by a subclass. If set to <literal>select</literal> then "
+"Hibernate will use a sequential select for a <literal><join></literal> "
+"defined on a subclass. This will be issued only if a row represents an "
+"instance of the subclass. Inner joins will still be used to retrieve a "
+"<literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+"<literal>fetch</literal>(opcional – valor padrão <literal>join</literal>): "
+"Se ajustado para <literal>join</literal>, o padrão, o Hibernate irá usar uma "
+"união interna para restaurar um <literal>join</literal> definido por uma "
+"classe ou suas subclasses e uma união externa para um <literal>join</"
+"literal> definido por uma subclasse. Se ajustado para <literal>select</"
+"literal>, então o Hibernate irá usar uma seleção seqüencial para um "
+"<literal><join></literal> definida numa subclasse, que será emitido "
+"apenas se uma linha representar uma instância da subclasse. Uniões internas "
+"ainda serão utilizadas para restaurar um <literal><join></literal> "
+"definido pela classe e suas superclasses. "
+
+#. Tag: para
+#: basic_mapping.xml:2939
+#, no-c-format
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will not insert or update the properties "
+"defined by this join."
+msgstr ""
+"<literal>inverse</literal> (opcional – padrão para <literal>false</"
+"literal>): Se habilitado, o Hibernate não tentará inserir ou atualizar as "
+"propriedades definidas por esta união."
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, no-c-format
+msgid ""
+"<literal>optional</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will insert a row only if the properties "
+"defined by this join are non-null. It will always use an outer join to "
+"retrieve the properties."
+msgstr ""
+"<literal>optional</literal> (opcional – padrão para <literal>false</"
+"literal>): Se habilitado, o Hibernate irá inserir uma linha apenas se as "
+"propriedades, definidas por esta junção, não forem nulas. Isto irá sempre "
+"usar uma união externa para recuperar as propriedades."
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, no-c-format
+msgid ""
+"For example, address information for a person can be mapped to a separate "
+"table while preserving value type semantics for all properties:"
+msgstr ""
+"Por exemplo, a informação de endereço para uma pessoa pode ser mapeada para "
+"uma tabela separada, enquanto preservando o valor da semântica de tipos para "
+"todas as propriedades:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, no-c-format
+msgid ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, no-c-format
+msgid ""
+"This feature is often only useful for legacy data models. We recommend fewer "
+"tables than classes and a fine-grained domain model. However, it is useful "
+"for switching between inheritance mapping strategies in a single hierarchy, "
+"as explained later."
+msgstr ""
+"Esta característica é útil apenas para modelos de dados legados. Nós "
+"recomendamos menos tabelas do que classes e um modelo de domínio fine-"
+"grained. Porém, é útil para ficar trocando entre estratégias de mapeamento "
+"de herança numa hierarquia simples, como explicaremos mais a frente."
+
+#. Tag: title
+#: basic_mapping.xml:2967
+#, no-c-format
+msgid "Mapping one to one and one to many associations"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2969
+#, no-c-format
+msgid ""
+"To link one entity to an other, you need to map the association property as "
+"a to one association. In the relational model, you can either use a foreign "
+"key or an association table, or (a bit less common) share the same primary "
+"key value between the two entities."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2974
+#, no-c-format
+msgid ""
+"To mark an association, use either <classname>@ManyToOne</classname> or "
+"<classname>@OnetoOne</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2978
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
+#, no-c-format
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than nothing will propagate certain operations to the "
+"associated object. The meaningful values are divided into three categories."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2992
+#, no-c-format
+msgid ""
+"basic operations, which include: <literal>persist, merge, delete, save-"
+"update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2998
+#, fuzzy, no-c-format
+msgid ""
+"special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+"Note como as associações são agora especificadas utilizando o "
+"<literal>entity-name</literal> ao invés da <literal>class</literal>. "
+
+#. Tag: para
+#: basic_mapping.xml:3003
+#, no-c-format
+msgid ""
+"comma-separated combinations of operation names: <literal>cascade=\"persist,"
+"merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. "
+"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
+"that single valued many-to-one associations do not support orphan delete."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3012
+#, no-c-format
+msgid ""
+"By default, single point associations are eagerly fetched in JPA 2. You can "
+"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
+"LAZY) </classname>in which case Hibernate will proxy the association and "
+"load it when the state of the associated entity is reached. You can force "
+"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</"
+"classname>. In this case, the property is fetched lazily when the instance "
+"variable is first accessed. This requires build-time bytecode "
+"instrumentation. lazy=\"false\" specifies that the association will always "
+"be eagerly fetched."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid ""
+"With the default JPA options, single-ended associations are loaded with a "
+"subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used "
+"for <literal>EAGER</literal> associations. You can however adjust the "
+"fetching strategy, ie how data is fetched by using <literal>@Fetch</"
+"literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a "
+"select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, fuzzy, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr "Associações de chave exterior exclusiva"
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, fuzzy, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+"Uma associação um-pra-um para outra classe persistente é declarada usando um "
+"elemento <literal>one-to-one </literal>."
+
+#. Tag: para
+#: basic_mapping.xml:3041
+#, no-c-format
+msgid ""
+"<classname>@ManyToOne</classname> if several entities can point to the the "
+"target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3046
+#, no-c-format
+msgid ""
+"<classname>@OneToOne</classname> if only a single entity can point to the "
+"the target entity"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3051
+#, no-c-format
+msgid ""
+"and a foreign key in one table is referencing the primary key column(s) of "
+"the target table."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3056
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default value"
+"(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"targetEntity=CompanyImpl.class )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3066
+#, no-c-format
+msgid ""
+"You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing "
+"the target entity table (through <literal>@JoinTable.inverseJoinColumns</"
+"literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3077
+#, no-c-format
+msgid ""
+"You can use a SQL fragment to simulate a physical join column using the "
+"<classname>@JoinColumnOrFormula</classname> / "
+"<classname>@JoinColumnOrformulas</classname> annotations (just like you can "
+"use a SQL fragment to simulate a property column via the "
+"<classname>@Formula</classname> annotation)."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" @ManyToOne\n"
+" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+" public Person getOwner() {\n"
+" return person;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid ""
+"You can mark an association as mandatory by using the "
+"<literal>optional=false</literal> attribute. We recommend to use Bean "
+"Validation's <classname>@NotNull</classname> annotation as a better "
+"alternative however. As a consequence, the foreign key column(s) will be "
+"marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid ""
+"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. 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."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3100
+#, no-c-format
+msgid "@NotFound annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when "
+"a given entity is deleted. In this case Hibernate generates a cascade delete "
+"constraint at the database level."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name using "
+"<literal>@ForeignKey</literal>."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:3120
+#, fuzzy, no-c-format
+msgid "@ForeignKey annotation"
+msgstr "Associações de chave exterior exclusiva"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @ForeignKey(name=\"FK_PARENT\")\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3125
+#, no-c-format
+msgid ""
+"Sometimes, you want to link one entity to an other not by the target entity "
+"primary key but by a different unique key. You can achieve that by "
+"referencing the unique key column(s) in <methodname>@JoinColumn."
+"referenceColumnName</methodname>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Person {\n"
+" @Id Integer personNumber;\n"
+" String firstName;\n"
+" @Column(name=\"I\")\n"
+" String initial;\n"
+" String lastName;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Home {\n"
+" @ManyToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+" })\n"
+" Person owner\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3132
+#, no-c-format
+msgid ""
+"This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3135
+#, no-c-format
+msgid ""
+"In hbm.xml, mapping an association is similar. The main difference is that a "
+"<classname>@OneToOne</classname> is mapped as <literal><many-to-one "
+"unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, no-c-format
+msgid ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
+#, no-c-format
+msgid ""
"<literal>column</literal> (optional): the name of the foreign key column. "
"This can also be specified by nested <literal><column></literal> "
"element(s)."
@@ -2408,6 +6544,7 @@
"<literal><column></literal>. "
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, no-c-format
msgid ""
"<literal>class</literal> (optional - defaults to the property type "
@@ -2417,6 +6554,7 @@
"determinado pela reflexão): O nome da classe associada."
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional): specifies which operations should be "
@@ -2426,6 +6564,7 @@
"cascateada do objeto pai para o objeto associado. "
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional - defaults to <literal>select</literal>): "
@@ -2436,6 +6575,7 @@
"seleção."
#. Tag: para
+#: basic_mapping.xml:3209
#, no-c-format
msgid ""
"<literal>update, insert</literal> (optional - defaults to <literal>true</"
@@ -2454,6 +6594,7 @@
"outra aplicação. "
#. Tag: para
+#: basic_mapping.xml:3219
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2465,6 +6606,7 @@
"especificada, a chave primária da classe associada será utilizada. "
#. Tag: para
+#: basic_mapping.xml:3232
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): enables the DDL generation of a unique "
@@ -2478,6 +6620,7 @@
"associação efetivamente um para um. "
#. Tag: para
+#: basic_mapping.xml:3240
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): enables the DDL generation of a "
@@ -2487,6 +6630,7 @@
"restrição de nulidade para as colunas de chaves exteriores."
#. Tag: para
+#: basic_mapping.xml:3254
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2505,6 +6649,7 @@
"procurada."
#. Tag: para
+#: basic_mapping.xml:3264
#, no-c-format
msgid ""
"<literal>not-found</literal> (optional - defaults to <literal>exception</"
@@ -2518,6 +6663,7 @@
"linha faltante como uma associação nula."
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, no-c-format
msgid ""
"<literal>entity-name</literal> (optional): the entity name of the associated "
@@ -2527,6 +6673,7 @@
"associada. "
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): an SQL expression that defines the "
@@ -2536,7 +6683,8 @@
"para uma chave exterior <emphasis>computed</emphasis>."
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3284
+#, fuzzy, no-c-format
msgid ""
"Setting a value of the <literal>cascade</literal> attribute to any "
"meaningful value other than <literal>none</literal> will propagate certain "
@@ -2546,7 +6694,7 @@
"second, special values: <literal>delete-orphan</literal>; and third,"
"<literal>all</literal> comma-separated combinations of operation names: "
"<literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,"
-"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> "
+"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> "
"for a full explanation. Note that single valued, many-to-one and one-to-one, "
"associations do not support orphan delete."
msgstr ""
@@ -2564,13 +6712,23 @@
"delete órfão: "
#. Tag: para
+#: basic_mapping.xml:3298
#, no-c-format
-msgid "Here is an example of a typical <literal>many-to-one</literal> declaration:"
+msgid ""
+"Here is an example of a typical <literal>many-to-one</literal> declaration:"
msgstr ""
"Segue abaixo uma amostra de uma típica declaração <literal>many-to-one</"
"literal>:"
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, no-c-format
+msgid ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3303
#, no-c-format
msgid ""
"The <literal>property-ref</literal> attribute should only be used for "
@@ -2589,17 +6747,36 @@
"atributo <literal>unique</literal> controla a geração de DDL do Hibernate "
"com a ferramenta SchemaExport."
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, no-c-format
+msgid ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3313
#, no-c-format
msgid "Then the mapping for <literal>OrderItem</literal> might use:"
msgstr "Então o mapeamento para <literal>OrderItem</literal> poderia usar:"
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, no-c-format
+msgid ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3318
#, no-c-format
msgid "This is not encouraged, however."
msgstr "No entanto, isto não é recomendável."
#. Tag: para
+#: basic_mapping.xml:3320
#, no-c-format
msgid ""
"If the referenced unique key comprises multiple properties of the associated "
@@ -2611,6 +6788,7 @@
"elemento chamado <literal><properties></literal>"
#. Tag: para
+#: basic_mapping.xml:3324
#, no-c-format
msgid ""
"If the referenced unique key is the property of a component, you can specify "
@@ -2619,23 +6797,100 @@
"Se a chave exclusiva referenciada é a propriedade de um componente, você "
"pode especificar um caminho para a propriedade:"
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, no-c-format
+msgid ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3331
#, no-c-format
-msgid "One-to-one"
-msgstr "Um-para-um "
+msgid "Sharing the primary key with the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3333
#, no-c-format
msgid ""
-"A one-to-one association to another persistent class is declared using a "
-"<literal>one-to-one</literal> element."
+"The second approach is to ensure an entity and its associated entity share "
+"the same primary key. In this case the primary key column is also a foreign "
+"key and there is no extra column. These associations are always one to one."
msgstr ""
-"Uma associação um-pra-um para outra classe persistente é declarada usando um "
-"elemento <literal>one-to-one </literal>."
+#. Tag: title
+#: basic_mapping.xml:3339
+#, fuzzy, no-c-format
+msgid "One to One association"
+msgstr "Associações de chave exterior exclusiva"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @MapsId\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"} \n"
+"\n"
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
msgid ""
+"Many people got confused by these primary key based one to one associations. "
+"They can only be lazily loaded if Hibernate knows that the other side of the "
+"association is always present. To indicate to Hibernate that it is the case, "
+"use <classname>@OneToOne(optional=false)</classname>."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3352
+#, no-c-format
+msgid "In hbm.xml, use the following mapping."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3377
+#, no-c-format
+msgid ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3397
+#, no-c-format
+msgid ""
"<literal>constrained</literal> (optional): specifies that a foreign key "
"constraint on the primary key of the mapped table and references the table "
"of the associated class. This option affects the order in which <literal>save"
@@ -2650,6 +6905,7 @@
"pode sofrer o proxie. Isto também é usado pela ferramenta schema export. "
#. Tag: para
+#: basic_mapping.xml:3413
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): the name of a property of the "
@@ -2661,6 +6917,7 @@
"especificada, a chave primária da classe associada é utilizada. "
#. Tag: para
+#: basic_mapping.xml:3426
#, no-c-format
msgid ""
"<literal>formula</literal> (optional): almost all one-to-one associations "
@@ -2676,6 +6933,7 @@
"onetooneformula</literal> para exemplo. "
#. Tag: para
+#: basic_mapping.xml:3435
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
@@ -2698,22 +6956,8 @@
"realizar uma busca antecipada na associação</emphasis>."
#. Tag: para
+#: basic_mapping.xml:3454
#, no-c-format
-msgid "There are two varieties of one-to-one associations:"
-msgstr "Existem duas variedades de associações um-pra-um: "
-
-#. Tag: para
-#, no-c-format
-msgid "primary key associations"
-msgstr "Associações de chave primária"
-
-#. Tag: para
-#, no-c-format
-msgid "unique foreign key associations"
-msgstr "Associações de chave exterior exclusiva"
-
-#. Tag: para
-#, no-c-format
msgid ""
"Primary key associations do not need an extra table column. If two rows are "
"related by the association, then the two table rows share the same primary "
@@ -2727,6 +6971,7 @@
"deve ter certeza que foram atribuídos com o mesmo valor identificador."
#. Tag: para
+#: basic_mapping.xml:3460
#, no-c-format
msgid ""
"For a primary key association, add the following mappings to "
@@ -2735,7 +6980,21 @@
"Para uma associação de chave primária, adicione os seguintes mapeamentos em "
"<literal>Employee</literal> e <literal>Person</literal>, respectivamente:"
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, no-c-format
+msgid ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3468
#, no-c-format
msgid ""
"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
@@ -2746,7 +7005,25 @@
"tabelas PERSON e EMPLOYEE são iguais. Nós usamos uma estratégia especial de "
"geração de identificador do Hibernate chamada <literal>foreign</literal>:"
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, no-c-format
+msgid ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3474
#, no-c-format
msgid ""
"A newly saved instance of <literal>Person</literal> is assigned the same "
@@ -2758,41 +7035,23 @@
"referenciada com a propriedade <literal>employee</literal> daquela "
"<literal>Person</literal>."
-#. Tag: para
-#, no-c-format
-msgid ""
-"Alternatively, a foreign key with a unique constraint, from "
-"<literal>Employee</literal> to <literal>Person</literal>, can be expressed "
-"as:"
-msgstr ""
-"Alternativamente, uma chave exterior com uma restrição única, de "
-"<literal>Employee</literal> para <literal>Person</literal>, pode ser "
-"expressada como:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"This association can be made bidirectional by adding the following to the "
-"<literal>Person</literal> mapping:"
-msgstr ""
-"Esta associação pode ser feita de forma bi-direcional adicionando o seguinte "
-"no mapeamento de <literal>Person</literal>:"
-
#. Tag: title
+#: basic_mapping.xml:3482
#, no-c-format
msgid "Natural-id"
msgstr "Id Natural"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3484
+#, fuzzy, no-c-format
msgid ""
"Although we recommend the use of surrogate keys as primary keys, you should "
"try to identify natural keys for all entities. A natural key is a property "
"or combination of properties that is unique and non-null. It is also "
-"immutable. Map the properties of the natural key inside the <literal><"
-"natural-id></literal> element. Hibernate will generate the necessary "
-"unique key and nullability constraints and, as a result, your mapping will "
-"be more self-documenting."
+"immutable. Map the properties of the natural key as <classname>@NaturalId</"
+"classname> or map them inside the <literal><natural-id></literal> "
+"element. Hibernate will generate the necessary unique key and nullability "
+"constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
"Embora recomendemos o uso das chaves substitutas como chaves primárias, você "
"deve ainda identificar chaves naturais para todas as entidades. Uma chave "
@@ -2802,9 +7061,57 @@
"exclusiva necessária e as restrições de anulabilidade, e seu mapeamento será "
"apropriadamente auto documentado."
+#. Tag: programlisting
+#: basic_mapping.xml:3493
+#, 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
+#: basic_mapping.xml:3495
#, no-c-format
+msgid "Or in XML,"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3497
+#, no-c-format
msgid ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3499
+#, no-c-format
+msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
"<literal>hashCode()</literal> to compare the natural key properties of the "
"entity."
@@ -2814,6 +7121,7 @@
"natural da entidade. "
#. Tag: para
+#: basic_mapping.xml:3503
#, no-c-format
msgid ""
"This mapping is not intended for use with entities that have natural primary "
@@ -2823,6 +7131,7 @@
"primárias."
#. Tag: para
+#: basic_mapping.xml:3508
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>false</"
@@ -2834,125 +7143,204 @@
"(constante)."
#. Tag: title
-#, no-c-format
-msgid "Component and dynamic-component"
-msgstr "Componente e componente dinâmico"
+#: basic_mapping.xml:3516
+#, fuzzy, no-c-format
+msgid "<title>Any</title>"
+msgstr "<literal>binary</literal>"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3518
+#, fuzzy, no-c-format
msgid ""
-"The <literal><component></literal> element maps properties of a child "
-"object to columns of the table of a parent class. Components can, in turn, "
-"declare their own properties, components or collections. See the \"Component"
-"\" examples below:"
+"There is one more type of property mapping. The <classname>@Any</classname> "
+"mapping defines a polymorphic association to classes from multiple tables. "
+"This type of mapping requires more than one column. The first column "
+"contains the type of the associated entity. The remaining columns contain "
+"the identifier. It is impossible to specify a foreign key constraint for "
+"this kind of association. This is not the usual way of mapping polymorphic "
+"associations and you should use this only in special cases. For example, for "
+"audit logs, user session data, etc."
msgstr ""
-"O elemento <literal><component></literal> mapeia propriedades de um "
-"objeto filho para colunas da tabela de uma classe pai. Os componentes podem, "
-"um após o outro, declarar suas próprias propriedades, componentes ou "
-"coleções. Veja \"Components\" abaixo:"
+"Existe mais um tipo de propriedade de mapeamento. O elemento de mapeamento "
+"<literal><any></literal> define uma associação polimórfica para "
+"classes de múltiplas tabelas. Este tipo de mapeamento sempre requer mais de "
+"uma coluna. A primeira coluna possui o tipo da entidade associada. A outra "
+"coluna restante possui o identificador. É impossível especificar uma "
+"restrição de chave exterior para este tipo de associação, portanto isto "
+"certamente não é visto como um caminho usual para associações (polimórficas) "
+"de mapeamento. Você deve usar este mapeamento apenas em casos muito "
+"especiais. Por exemplo: audit logs, dados de sessão do usuário, etc. "
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3528
+#, fuzzy, no-c-format
msgid ""
-"<literal>class</literal> (optional - defaults to the property type "
-"determined by reflection): the name of the component (child) class."
+"The <classname>@Any</classname> 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. The <literal>metaType</"
+"literal> attribute allows the application to specify a custom type that maps "
+"database column values to persistent classes that have identifier properties "
+"of the type specified by <literal>idType</literal>. You must specify the "
+"mapping from values of the <literal>metaType</literal> to class names."
msgstr ""
-"<literal>class</literal> (opcional – padrão para o tipo de propriedade "
-"determinada por reflection): O nome da classe (filha) do componente."
+"A função <literal>meta-type</literal> permite que a aplicação especifique um "
+"tipo adaptado que mapeia valores de colunas de banco de dados para classes "
+"persistentes que possuem propriedades identificadoras do tipo especificado "
+"através do <literal>id-type</literal>. Você deve especificar o mapeamento de "
+"valores do meta-type para nome de classes. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3538
#, no-c-format
msgid ""
-"<literal>insert</literal>: do the mapped columns appear in SQL "
-"<literal>INSERTs</literal>?"
+"@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 ""
-"<literal>insert</literal>: As colunas mapeadas aparecem nos SQL de "
-"<literal>INSERTs</literal>? "
#. Tag: para
+#: basic_mapping.xml:3540
#, no-c-format
msgid ""
-"<literal>update</literal>: do the mapped columns appear in SQL "
-"<literal>UPDATEs</literal>?"
+"Note that <classname>@AnyDef</classname> can be mutualized and reused. It is "
+"recommended to place it as a package metadata in this case."
msgstr ""
-"<literal>update</literal>: As colunas mapeadas aparecem nos SQL de "
-"<literal>UPDATEs</literal>? "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3544
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that this component should be fetched lazily when the instance "
-"variable is first accessed. It requires build-time bytecode instrumentation."
+"//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 ""
-"<literal>lazy</literal> (opcional - padrão para <literal>false</literal>): "
-"Especifica que este componente deve ter uma busca lazy quando a função for "
-"acessada pela primeira vez. Isto requer instrumentação bytecode de tempo de "
-"construção."
#. Tag: para
+#: basic_mapping.xml:3546
#, no-c-format
+msgid "The hbm.xml equivalent is:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3548
+#, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this component either do or do not "
-"require acquisition of the optimistic lock. It determines if a version "
-"increment should occur when this property is dirty."
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
msgstr ""
-"<literal>optimistic-lock</literal> (opcional – padrão para <literal>true</"
-"literal>): Especifica que atualizações para este componente requerem ou não "
-"aquisição de um bloqueio otimista. Em outras palavras, determina se uma "
-"versão de incremento deve ocorrer quando esta propriedade estiver suja."
#. Tag: para
+#: basic_mapping.xml:3551
#, no-c-format
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3570
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
-"specifies that a unique constraint exists upon all mapped columns of the "
-"component."
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
msgstr ""
-"<literal>unique</literal> (opcional – valor padrão <literal>false</"
-"literal>): Especifica que existe uma unique restrição em todas as colunas "
-"mapeadas do componente. "
#. Tag: para
+#: basic_mapping.xml:3574
#, no-c-format
+msgid "<literal>name</literal>: the property name."
+msgstr "<literal>name</literal>: o nome da propriedade."
+
+#. Tag: para
+#: basic_mapping.xml:3578
+#, no-c-format
+msgid "<literal>id-type</literal>: the identifier type."
+msgstr "<literal>id-type</literal>: o tipo identificador."
+
+#. Tag: para
+#: basic_mapping.xml:3582
+#, no-c-format
msgid ""
-"The child <literal><property></literal> tags map properties of the "
-"child class to table columns."
+"<literal>meta-type</literal> (optional - defaults to <literal>string</"
+"literal>): any type that is allowed for a discriminator mapping."
msgstr ""
-"A tag filha <literal><property></literal> acrescenta a propriedade de "
-"mapeamento da classe filha para colunas de uma tabela."
+"<literal>meta-type</literal> (opcional – padrão para <literal>string</"
+"literal>): Qualquer tipo que é permitido para um mapeamento discriminador."
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
msgid ""
-"The <literal><component></literal> element allows a <literal><"
-"parent></literal> subelement that maps a property of the component class "
-"as a reference back to the containing entity."
+"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
+"the cascade style."
msgstr ""
-"O elemento <literal><component></literal> permite um sub-elemento "
-"<literal><parent></literal> mapeie uma propriedade da classe do "
-"componente como uma referencia de volta para a entidade que o contém."
+"<literal>cascade</literal> (opcional – valor padrão <literal>none</"
+"literal>): o estilo cascata."
#. Tag: para
+#: basic_mapping.xml:3599
#, no-c-format
msgid ""
-"The <literal><dynamic-component></literal> element allows a "
-"<literal>Map</literal> to be mapped as a component, where the property names "
-"refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for "
-"more information."
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property either do or do not "
+"require acquisition of the optimistic lock. It defines whether a version "
+"increment should occur if this property is dirty."
msgstr ""
-"O elemento <literal><dynamic-component></literal> permite que um "
-"<literal>Map</literal> possa ser mapeado como um componente onde os nomes "
-"das propriedades referem-se para as chaves no mapa. Consulte <xref linkend="
-"\"components-dynamic\"/> para maiores informações."
+"<literal>optimistic-lock</literal> (opcional - valor padrão<literal>true</"
+"literal>): Especifica que as atualizações para esta propriedade requerem ou "
+"não aquisição da bloqueio otimista. Em outras palavras, define se uma versão "
+"de incremento deve ocorrer se esta propriedade for suja."
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
msgid "Properties"
msgstr "Propriedades"
#. Tag: para
+#: basic_mapping.xml:3612
#, no-c-format
msgid ""
"The <literal><properties></literal> element allows the definition of a "
@@ -2968,7 +7356,26 @@
"conveninente para definir uma restrição única de múltiplas colunas. Por "
"exemplo:"
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, no-c-format
+msgid ""
+"<properties\n"
+" name=\"logicalName\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3636
#, no-c-format
msgid ""
"<literal>name</literal>: the logical name of the grouping. It is "
@@ -2978,6 +7385,7 @@
"emphasis> é o nome atual de propriedade."
#. Tag: para
+#: basic_mapping.xml:3651
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -2991,6 +7399,7 @@
"versão de incremento deve ocorrer quando estas propriedades estiverem sujas."
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
msgid ""
"For example, if we have the following <literal><properties></literal> "
@@ -2999,7 +7408,25 @@
"Por exemplo, se temos o seguinte mapeamento de <literal><properties></"
"literal>:"
+#. Tag: programlisting
+#: basic_mapping.xml:3669
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+"\n"
+" ...\n"
+" <properties name=\"name\"\n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3671
#, no-c-format
msgid ""
"You might have some legacy data association that refers to this unique key "
@@ -3009,9 +7436,31 @@
"exclusiva da tabela <literal>Person</literal>, ao invés de se referirem a "
"chave primária:"
+#. Tag: programlisting
+#: basic_mapping.xml:3675
+#, no-c-format
+msgid ""
+"<many-to-one name=\"owner\"\n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3678
#, no-c-format
msgid ""
+"When using annotations as a mapping strategy, such construct is not "
+"necessary as the binding between a column and its related column on the "
+"associated table is done directly"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3685
+#, no-c-format
+msgid ""
"The use of this outside the context of mapping legacy data is not "
"recommended."
msgstr ""
@@ -3019,271 +7468,285 @@
"mapeamento de dados legados."
#. Tag: title
+#: basic_mapping.xml:3690
#, no-c-format
-msgid "Subclass"
-msgstr "Subclass"
+msgid "Some hbm.xml specificities"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3692
#, no-c-format
msgid ""
-"Polymorphic persistence requires the declaration of each subclass of the "
-"root persistent class. For the table-per-class-hierarchy mapping strategy, "
-"the <literal><subclass></literal> declaration is used. For example:"
+"The hbm.xml structure has some specificities naturally not present when "
+"using annotations, let's describe them briefly."
msgstr ""
-"Finalmente, a persistência polimórfica requer a declaração de cada subclasse "
-"da classe raíz de persistência. Para a estratégia de mapeamento tabela-por-"
-"hierarquia-de-classe, deve-se utilizar a declaração <literal><subclass>"
-"</literal>. Por exemplo:"
+#. Tag: title
+#: basic_mapping.xml:3696
+#, no-c-format
+msgid "Doctype"
+msgstr "Doctype"
+
#. Tag: para
+#: basic_mapping.xml:3698
#, no-c-format
-msgid "<literal>name</literal>: the fully qualified class name of the subclass."
+msgid ""
+"All XML mappings should declare the doctype shown. The actual DTD can be "
+"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
+"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
+"will always look for the DTD in its classpath first. If you experience "
+"lookups of the DTD using an Internet connection, check the DTD declaration "
+"against the contents of your classpath."
msgstr ""
-"<literal>name</literal>: O nome de classe completamente qualificada da "
-"subclasse. "
+"Todos os mapeamentos de XML devem declarar o doctype exibido. O DTD atual "
+"pode ser encontrado na URL abaixo, no diretório <literal>hibernate-x.x.x/src/"
+"org/ hibernate </literal> ou no <literal>hibernate3.jar</literal>. O "
+"Hibernate sempre irá procurar pelo DTD inicialmente no seu classpath. Se "
+"você tentar localizar o DTD usando uma conexão de internet, compare a "
+"declaração do seu DTD com o conteúdo do seu classpath."
+#. Tag: title
+#: basic_mapping.xml:3707
+#, no-c-format
+msgid "EntityResolver"
+msgstr "Solucionador de Entidade"
+
#. Tag: para
+#: basic_mapping.xml:3709
#, no-c-format
msgid ""
-"<literal>discriminator-value</literal> (optional - defaults to the class "
-"name): a value that distinguishes individual subclasses."
+"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
+"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
+"implementation with the SAXReader it uses to read in the xml files. This "
+"custom <literal>EntityResolver</literal> recognizes two different systemId "
+"namespaces:"
msgstr ""
-"<literal>discriminator-value</literal> (opcional – padrão para o nome da "
-"classe): Um valor que distingue subclasses individuais."
+"O Hibernate irá primeiro tentar solucionar os DTDs em seus classpath. Isto é "
+"feito, registrando uma implementação <literal>org.xml.sax.EntityResolver</"
+"literal> personalizada com o SAXReader que ele utiliza para ler os arquivos "
+"xml. Este <literal>EntityResolver</literal> personalizado, reconhece dois "
+"nomes de espaço de sistemas Id diferentes:"
#. Tag: para
+#: basic_mapping.xml:3718
#, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface used for "
-"lazy initializing proxies."
+"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
+"encounters a systemId starting with <literal>http://hibernate.sourceforge."
+"net/</literal>. The resolver attempts to resolve these entities via the "
+"classloader which loaded the Hibernate classes."
msgstr ""
-"<literal>proxy</literal> (opcional): Especifica a classe ou interface que "
-"usará os proxies de inicialização lazy."
+"Um <literal>hibernate namespace</literal> é reconhecido quando um "
+"solucionador encontra um systema Id iniciando com <literal>http://hibernate."
+"sourceforge.net/</literal>. O solucionador tenta solucionar estas entidades "
+"através do carregador de classe que carregou as classes do Hibernate. "
#. Tag: para
+#: basic_mapping.xml:3726
#, no-c-format
msgid ""
-"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+"a <literal>user namespace</literal> is recognized whenever the resolver "
+"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
+"The resolver will attempt to resolve these entities via (1) the current "
+"thread context classloader and (2) the classloader which loaded the "
+"Hibernate classes."
msgstr ""
-"<literal>lazy</literal> (opcional, padrão para <literal>true</literal>): "
-"Configurar <literal>lazy=\"false\"</literal> desabilitará o uso de "
-"inicialização lazy."
+"Um <literal>user namespace</literal> é reconhecido quando um solucionador "
+"encontra um sistema Id, utilizando um protocolo URL de <literal>classpath://"
+"</literal>. O solucionador tentará solucionar estas entidades através do "
+"carregador de classe do contexto de thread atual (1) e o carregador de "
+"classe (2) que carregou as classes do Hibernate. "
#. Tag: para
+#: basic_mapping.xml:3735
#, no-c-format
+msgid "The following is an example of utilizing user namespacing:"
+msgstr "Um exemplo de utilização do espaço de nome do usuário:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3738
+#, no-c-format
msgid ""
-"Each subclass declares its own persistent properties and subclasses. "
-"<literal><version></literal> and <literal><id></literal> "
-"properties are assumed to be inherited from the root class. Each subclass in "
-"a hierarchy must define a unique <literal>discriminator-value</literal>. If "
-"this is not specified, the fully qualified Java class name is used."
+"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
msgstr ""
-"Cada subclasse deve declarar suas próprias propriedades persistentes e "
-"subclasses. As propriedades <literal><version></literal> e "
-"<literal><id></literal> são configuradas para serem herdadas da classe "
-"raíz. Cada subclasse numa hierarquia deve definir um único "
-"<literal>discriminator-value</literal>. Se nenhum for especificado, será "
-"usado o nome da classe Java completamente qualificado."
#. Tag: para
+#: basic_mapping.xml:3740
#, no-c-format
msgid ""
-"For information about inheritance mappings see <xref linkend=\"inheritance"
-"\" />."
+"Where <literal>types.xml</literal> is a resource in the <literal>your."
+"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
+"custom\">typedef</link>."
msgstr ""
-"Para informações sobre mapeamento de heranças. Consulte o <xref linkend="
-"\"inheritance\" />."
+"Onde <literal>types.xml</literal> é um recurso no pacote <literal>your."
+"domain</literal> e contém um <link linkend=\"mapping-types-custom\">typedef</"
+"link> personalizado."
#. Tag: title
+#: basic_mapping.xml:3747
#, no-c-format
-msgid "Joined-subclass"
-msgstr "Subclasses Unidas "
+msgid "Hibernate-mapping"
+msgstr "Mapeamento do Hibernate"
#. Tag: para
+#: basic_mapping.xml:3749
#, no-c-format
msgid ""
-"Each subclass can also be mapped to its own table. This is called the table-"
-"per-subclass mapping strategy. An inherited state is retrieved by joining "
-"with the table of the superclass. To do this you use the <literal><joined-"
-"subclass></literal> element. For example:"
+"This element has several optional attributes. The <literal>schema</literal> "
+"and <literal>catalog</literal> attributes specify that tables referred to in "
+"this mapping belong to the named schema and/or catalog. If they are "
+"specified, tablenames will be qualified by the given schema and catalog "
+"names. If they are missing, tablenames will be unqualified. The "
+"<literal>default-cascade</literal> attribute specifies what cascade style "
+"should be assumed for properties and collections that do not specify a "
+"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
+"literal> attribute allows you to use unqualified class names in the query "
+"language."
msgstr ""
-"Alternativamente, cada subclasse pode ser mapeada para sua própria tabela. "
-"Isto é chamado estratégia de mapeamento de tabela-por-subclasse. O estado "
-"herdado é devolvido por associação com a tabela da superclasse. Nós usamos o "
-"elemento <literal><joined-subclass></literal>. Por exemplo:"
+"Este elemento possui diversos atributos opcionais. Os atributos "
+"<literal>schema</literal> e <literal>catalog</literal> especificam que "
+"tabelas referenciadas neste mapeamento pertencem ao esquema e/ou ao catálogo "
+"nomeado. Se especificados, os nomes das tabelas serão qualificados no "
+"esquema ou catálogo dado. Se não, os nomes das tabelas não serão "
+"qualificados. O atributo <literal>default-cascade</literal> especifica qual "
+"estilo de cascata será considerado pelas propriedades e coleções que não "
+"especificarem uma função <literal>cascade</literal>. A função <literal>auto-"
+"import</literal> nos deixa utilizar nomes de classes não qualificados na "
+"linguagem de consulta, por padrão."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3778
#, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
-msgstr "<literal>table</literal>: O nome da tabela da subclasse. "
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>proxy</literal> (optional): specifies a class or interface to use "
-"for lazy initializing proxies."
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
msgstr ""
-"<literal>proxy</literal> (opcional): Especifica a classe ou interface que "
-"usará os proxies de inicialização lazy. "
#. Tag: para
+#: basic_mapping.xml:3782
#, no-c-format
-msgid ""
-"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
-"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgid "<literal>schema</literal> (optional): the name of a database schema."
msgstr ""
-"<literal>lazy</literal> (opcional, padrão para <literal>true</literal>): "
-"Configurar <literal>lazy=\"false\"</literal> desabilitará o uso de "
-"inicialização lazy."
+"<literal>schema</literal> (opcional): O nome do esquema do banco de dados. "
#. Tag: para
+#: basic_mapping.xml:3787
#, no-c-format
-msgid ""
-"A discriminator column is not required for this mapping strategy. Each "
-"subclass must, however, declare a table column holding the object identifier "
-"using the <literal><key></literal> element. The mapping at the start "
-"of the chapter would then be re-written as:"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
msgstr ""
-"A coluna discriminadora não é requerida para esta estratégia de mapeamento. "
-"Cada subclasse deve declarar uma coluna de tabela com o identificador do "
-"objeto usando o elemento <literal><key></literal>. O mapeamento no "
-"início do capítulo poderia ser re-escrito assim: "
+"<literal>catalog</literal> (opcional): O nome do catálogo do banco de dados. "
-#. Tag: title
-#, no-c-format
-msgid "Union-subclass"
-msgstr "Subclasse de União"
-
#. Tag: para
+#: basic_mapping.xml:3792
#, no-c-format
msgid ""
-"A third option is to map only the concrete classes of an inheritance "
-"hierarchy to tables. This is called the table-per-concrete-class strategy. "
-"Each table defines all persistent states of the class, including the "
-"inherited state. In Hibernate, it is not necessary to explicitly map such "
-"inheritance hierarchies. You can map each class with a separate <literal><"
-"class></literal> declaration. However, if you wish use polymorphic "
-"associations (e.g. an association to the superclass of your hierarchy), you "
-"need to use the <literal><union-subclass></literal> mapping. For "
-"example:"
+"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
+"literal>): a default cascade style."
msgstr ""
-"Uma terceira opção é mapear apenas as classes concretas de uma hierarquia de "
-"heranças para tabelas. Isto é chamado estratégia table-per-concrete-class. "
-"Cada tabela define todos os estados persistentes da classe, incluindo "
-"estados herdados. No Hibernate, não é absolutamente necessário mapear "
-"explicitamente como hierarquia de heranças. Você pode simplesmente mapear "
-"cada classe com uma declaração <literal><class></literal> separada. "
-"Porém, se você deseja usar associações polimórficas (por exemplo: uma "
-"associação para a superclasse de sua hierarquia), você precisa usar o "
-"mapeamento <literal><union-subclass></literal>. Por exemplo:"
+"<literal>default-cascade</literal> (opcional – o padrão é <literal>none</"
+"literal>): Um estilo cascata padrão."
#. Tag: para
+#: basic_mapping.xml:3797
#, no-c-format
-msgid "No discriminator column or key column is required for this mapping strategy."
-msgstr "A coluna discriminatória não é requerida para esta estratégia de mapeamento."
-
-#. Tag: title
-#, no-c-format
-msgid "Join"
-msgstr "União "
-
-#. Tag: para
-#, no-c-format
msgid ""
-"Using the <literal><join></literal> element, it is possible to map "
-"properties of one class to several tables that have a one-to-one "
-"relationship. For example:"
+"<literal>default-access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing all properties. "
+"It can be a custom implementation of <literal>PropertyAccessor</literal>."
msgstr ""
-"Usando o elemento <literal><join></literal>>, é possível mapear "
-"propriedades de uma classe para várias tabelas que possuem uma relação um "
-"por um. Por exemplo:"
+"<literal>default-access</literal> (opcional – o padrão é <literal>property</"
+"literal>): A estratégia que o Hibernate deve utilizar para acessar todas as "
+"propridades. Pode ser uma implementação personalizada de "
+"<literal>PropertyAccessor</literal>."
#. Tag: para
+#: basic_mapping.xml:3804
#, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
-msgstr "<literal>table</literal>: O nome da tabela associada. "
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"if set to <literal>join</literal>, the default, Hibernate will use an inner "
-"join to retrieve a <literal><join></literal> defined by a class or its "
-"superclasses. It will use an outer join for a <literal><join></"
-"literal> defined by a subclass. If set to <literal>select</literal> then "
-"Hibernate will use a sequential select for a <literal><join></literal> "
-"defined on a subclass. This will be issued only if a row represents an "
-"instance of the subclass. Inner joins will still be used to retrieve a "
-"<literal><join></literal> defined by the class and its superclasses."
+"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
+"literal>): the default value for unspecified <literal>lazy</literal> "
+"attributes of class and collection mappings."
msgstr ""
-"<literal>fetch</literal>(opcional – valor padrão <literal>join</literal>): "
-"Se ajustado para <literal>join</literal>, o padrão, o Hibernate irá usar uma "
-"união interna para restaurar um <literal>join</literal> definido por uma "
-"classe ou suas subclasses e uma união externa para um <literal>join</"
-"literal> definido por uma subclasse. Se ajustado para <literal>select</"
-"literal>, então o Hibernate irá usar uma seleção seqüencial para um "
-"<literal><join></literal> definida numa subclasse, que será emitido "
-"apenas se uma linha representar uma instância da subclasse. Uniões internas "
-"ainda serão utilizadas para restaurar um <literal><join></literal> "
-"definido pela classe e suas superclasses. "
+"<literal>default-lazy</literal> (opcional - o padrão é <literal>true</"
+"literal>): O valor padrão para atributos <literal>lazy</literal> não "
+"especificados da classe e dos mapeamentos de coleções."
#. Tag: para
+#: basic_mapping.xml:3811
#, no-c-format
msgid ""
-"<literal>inverse</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will not insert or update the properties "
-"defined by this join."
+"<literal>auto-import</literal> (optional - defaults to <literal>true</"
+"literal>): specifies whether we can use unqualified class names of classes "
+"in this mapping in the query language."
msgstr ""
-"<literal>inverse</literal> (opcional – padrão para <literal>false</"
-"literal>): Se habilitado, o Hibernate não tentará inserir ou atualizar as "
-"propriedades definidas por esta união."
+"<literal>auto-import</literal> (opcional - o padrão é <literal>true</"
+"literal>): Especifica se podemos usar nomes de classes não qualificados, das "
+"classes deste mapeamento, na linguagem de consulta."
#. Tag: para
+#: basic_mapping.xml:3818
#, no-c-format
msgid ""
-"<literal>optional</literal> (optional - defaults to <literal>false</"
-"literal>): if enabled, Hibernate will insert a row only if the properties "
-"defined by this join are non-null. It will always use an outer join to "
-"retrieve the properties."
+"<literal>package</literal> (optional): specifies a package prefix to use for "
+"unqualified class names in the mapping document."
msgstr ""
-"<literal>optional</literal> (opcional – padrão para <literal>false</"
-"literal>): Se habilitado, o Hibernate irá inserir uma linha apenas se as "
-"propriedades, definidas por esta junção, não forem nulas. Isto irá sempre "
-"usar uma união externa para recuperar as propriedades."
+"<literal>package</literal> (opcional): Especifica um prefixo do pacote a ser "
+"considerado para nomes de classes não qualificadas no documento de "
+"mapeamento. "
#. Tag: para
+#: basic_mapping.xml:3825
#, no-c-format
msgid ""
-"For example, address information for a person can be mapped to a separate "
-"table while preserving value type semantics for all properties:"
+"If you have two persistent classes with the same unqualified name, you "
+"should set <literal>auto-import=\"false\"</literal>. An exception will "
+"result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
-"Por exemplo, a informação de endereço para uma pessoa pode ser mapeada para "
-"uma tabela separada, enquanto preservando o valor da semântica de tipos para "
-"todas as propriedades:"
+"Se você tem duas classes persistentes com o mesmo nome (não qualificadas), "
+"você deve ajustar <literal>auto-import=\"false\"</literal>. Caso você tentar "
+"ajustar duas classes para o mesmo nome \"importado\", isto resultará numa "
+"exceção."
#. Tag: para
+#: basic_mapping.xml:3830
#, no-c-format
msgid ""
-"This feature is often only useful for legacy data models. We recommend fewer "
-"tables than classes and a fine-grained domain model. However, it is useful "
-"for switching between inheritance mapping strategies in a single hierarchy, "
-"as explained later."
+"The <literal>hibernate-mapping</literal> element allows you to nest several "
+"persistent <literal><class></literal> mappings, as shown above. It is, "
+"however, good practice (and expected by some tools) to map only a single "
+"persistent class, or a single class hierarchy, in one mapping file and name "
+"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
+"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
+"<literal>Animal.hbm.xml</literal>."
msgstr ""
-"Esta característica é útil apenas para modelos de dados legados. Nós "
-"recomendamos menos tabelas do que classes e um modelo de domínio fine-"
-"grained. Porém, é útil para ficar trocando entre estratégias de mapeamento "
-"de herança numa hierarquia simples, como explicaremos mais a frente."
+"Observe que o elemento <literal>hibernate-mapping</literal> permite que você "
+"aninhe diversos mapeamentos de <literal><class></literal> "
+"persistentes, como mostrado abaixo. Entretanto, é uma boa prática (e "
+"esperado por algumas ferramentas) o mapeamento de apenas uma classe "
+"persistente simples (ou uma hierarquia de classes simples) em um arquivo de "
+"mapeamento e nomeá-la após a superclasse persistente, por exemplo: "
+"<literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal>, ou se "
+"estiver usando herança, <literal>Animal.hbm.xml</literal>. "
#. Tag: title
+#: basic_mapping.xml:3841
#, no-c-format
-msgid "Key"
-msgstr "Key"
+msgid "<title>Key</title>"
+msgstr ""
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:3843
+#, fuzzy, no-c-format
msgid ""
-"The <literal><key></literal> element has featured a few times within "
+"The <literal><key></literal> element is featured a few times within "
"this guide. It appears anywhere the parent mapping element defines a join to "
"a new table that references the primary key of the original table. It also "
"defines the foreign key in the joined table:"
@@ -3293,7 +7756,22 @@
"junção para a nova tabela, e define a chave exterior para a tabela "
"associada. Ele também referencia a chave primária da tabela original:"
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, no-c-format
+msgid ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3874
#, no-c-format
msgid ""
"<literal>on-delete</literal> (optional - defaults to <literal>noaction</"
@@ -3305,6 +7783,7 @@
"está habilitada para o deletar cascade."
#. Tag: para
+#: basic_mapping.xml:3880
#, no-c-format
msgid ""
"<literal>property-ref</literal> (optional): specifies that the foreign key "
@@ -3316,6 +7795,7 @@
"os dados legados."
#. Tag: para
+#: basic_mapping.xml:3886
#, no-c-format
msgid ""
"<literal>not-null</literal> (optional): specifies that the foreign key "
@@ -3327,6 +7807,7 @@
"a chave exterior também fizer parte da chave primária."
#. Tag: para
+#: basic_mapping.xml:3892
#, no-c-format
msgid ""
"<literal>update</literal> (optional): specifies that the foreign key should "
@@ -3338,6 +7819,7 @@
"exterior também fizer parte da chave primária."
#. Tag: para
+#: basic_mapping.xml:3898
#, no-c-format
msgid ""
"<literal>unique</literal> (optional): specifies that the foreign key should "
@@ -3349,6 +7831,7 @@
"exterior também fizer parte da chave primária."
#. Tag: para
+#: basic_mapping.xml:3905
#, no-c-format
msgid ""
"For systems where delete performance is important, we recommend that all "
@@ -3366,6 +7849,7 @@
"da estratégia usual de bloqueio otimista do Hibernate para dados versionados."
#. Tag: para
+#: basic_mapping.xml:3913
#, no-c-format
msgid ""
"The <literal>not-null</literal> and <literal>update</literal> attributes are "
@@ -3381,54 +7865,13 @@
"<literal><key not-null=\"true\"></literal>."
#. Tag: title
+#: basic_mapping.xml:3922
#, no-c-format
-msgid "Column and formula elements"
-msgstr "Elementos coluna e fórmula "
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Mapping elements which accept a <literal>column</literal> attribute will "
-"alternatively accept a <literal><column></literal> subelement. "
-"Likewise, <literal><formula></literal> is an alternative to the "
-"<literal>formula</literal> attribute. For example:"
-msgstr ""
-"Qualquer elemento de mapeamento que aceita uma função <literal>column</"
-"literal> irá aceitar alternativamente um sub-elemento <literal><column>"
-"</literal>. Da mesma forma, <literal><formula></literal> é uma "
-"alternativa para a função <literal>formula</literal>."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Most of the attributes on <literal>column</literal> provide a means of "
-"tailoring the DDL during automatic schema generation. The <literal>read</"
-"literal> and <literal>write</literal> attributes allow you to specify custom "
-"SQL that Hibernate will use to access the column's value. For more on this, "
-"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
-"read and write expressions</link>."
-msgstr ""
-"A maioria das funções no <literal>column</literal> fornecem um significado de junção do DDL durante a geração automática do esquema. As funções <literal>read</"
-"literal> e <literal>write</literal> permitem que você especifique o SQL personalizado, do qual o Hibernate usará para acessar o valor da coluna. Consulte a discussão da <link linkend=\"mapping-column-read-and-write\">column "
-"read and write expressions</link> para maiores informações."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The <literal>column</literal> and <literal>formula</literal> elements can "
-"even be combined within the same property or association mapping to express, "
-"for example, exotic join conditions."
-msgstr ""
-"Os elementos <literal>column</literal> e <literal>formula</literal> podem até "
-"ser combinados dentro da mesma propriedade ou associação mapeando para "
-"expressar, por exemplo, condições de associações exóticas."
-
-#. Tag: title
-#, no-c-format
msgid "Import"
msgstr "Importar "
#. Tag: para
+#: basic_mapping.xml:3924
#, no-c-format
msgid ""
"If your application has two persistent classes with the same name, and you "
@@ -3443,14 +7886,33 @@
"preferência contando com <literal>auto-import=\"true\"</literal>. Você pode "
"até importar classes e interfaces que não estão explicitamente mapeadas:"
+#. Tag: programlisting
+#: basic_mapping.xml:3930
+#, no-c-format
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3939
+#, no-c-format
+msgid ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3943
#, no-c-format
-msgid "<literal>class</literal>: the fully qualified class name of any Java class."
+msgid ""
+"<literal>class</literal>: the fully qualified class name of any Java class."
msgstr ""
"<literal>class</literal>: O nome qualificado do pacote de qualquer classe "
"Java."
#. Tag: para
+#: basic_mapping.xml:3948
#, no-c-format
msgid ""
"<literal>rename</literal> (optional - defaults to the unqualified class "
@@ -3459,100 +7921,114 @@
"<literal>rename</literal> (opcional – padrão para o nome da classe não "
"qualificada): Um nome que pode ser usado numa linguagem de consulta."
+#. Tag: para
+#: basic_mapping.xml:3956
+#, no-c-format
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3962
#, no-c-format
-msgid "Any"
-msgstr "Any"
+msgid "Column and formula elements"
+msgstr "Elementos coluna e fórmula "
#. Tag: para
+#: basic_mapping.xml:3964
#, no-c-format
msgid ""
-"There is one more type of property mapping. The <literal><any></"
-"literal> mapping element defines a polymorphic association to classes from "
-"multiple tables. This type of mapping requires more than one column. The "
-"first column contains the type of the associated entity. The remaining "
-"columns contain the identifier. It is impossible to specify a foreign key "
-"constraint for this kind of association. This is not the usual way of "
-"mapping polymorphic associations and you should use this only in special "
-"cases. For example, for audit logs, user session data, etc."
+"Mapping elements which accept a <literal>column</literal> attribute will "
+"alternatively accept a <literal><column></literal> subelement. "
+"Likewise, <literal><formula></literal> is an alternative to the "
+"<literal>formula</literal> attribute. For example:"
msgstr ""
-"Existe mais um tipo de propriedade de mapeamento. O elemento de mapeamento "
-"<literal><any></literal> define uma associação polimórfica para "
-"classes de múltiplas tabelas. Este tipo de mapeamento sempre requer mais de "
-"uma coluna. A primeira coluna possui o tipo da entidade associada. A outra "
-"coluna restante possui o identificador. É impossível especificar uma "
-"restrição de chave exterior para este tipo de associação, portanto isto "
-"certamente não é visto como um caminho usual para associações (polimórficas) "
-"de mapeamento. Você deve usar este mapeamento apenas em casos muito "
-"especiais. Por exemplo: audit logs, dados de sessão do usuário, etc. "
+"Qualquer elemento de mapeamento que aceita uma função <literal>column</"
+"literal> irá aceitar alternativamente um sub-elemento <literal><column>"
+"</literal>. Da mesma forma, <literal><formula></literal> é uma "
+"alternativa para a função <literal>formula</literal>."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3970
#, no-c-format
msgid ""
-"The <literal>meta-type</literal> attribute allows the application to specify "
-"a custom type that maps database column values to persistent classes that "
-"have identifier properties of the type specified by <literal>id-type</"
-"literal>. You must specify the mapping from values of the meta-type to class "
-"names."
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"\n"
+" read=\"SQL expression\"\n"
+" write=\"SQL expression\"/>"
msgstr ""
-"A função <literal>meta-type</literal> permite que a aplicação especifique um "
-"tipo adaptado que mapeia valores de colunas de banco de dados para classes "
-"persistentes que possuem propriedades identificadoras do tipo especificado "
-"através do <literal>id-type</literal>. Você deve especificar o mapeamento de "
-"valores do meta-type para nome de classes. "
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3972
#, no-c-format
-msgid "<literal>name</literal>: the property name."
-msgstr "<literal>name</literal>: o nome da propriedade."
+msgid "<formula>SQL expression</formula>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "<literal>id-type</literal>: the identifier type."
-msgstr "<literal>id-type</literal>: o tipo identificador."
-
-#. Tag: para
-#, no-c-format
msgid ""
-"<literal>meta-type</literal> (optional - defaults to <literal>string</"
-"literal>): any type that is allowed for a discriminator mapping."
+"Most of the attributes on <literal>column</literal> provide a means of "
+"tailoring the DDL during automatic schema generation. The <literal>read</"
+"literal> and <literal>write</literal> attributes allow you to specify custom "
+"SQL that Hibernate will use to access the column's value. For more on this, "
+"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
+"read and write expressions</link>."
msgstr ""
-"<literal>meta-type</literal> (opcional – padrão para <literal>string</"
-"literal>): Qualquer tipo que é permitido para um mapeamento discriminador."
+"A maioria das funções no <literal>column</literal> fornecem um significado "
+"de junção do DDL durante a geração automática do esquema. As funções "
+"<literal>read</literal> e <literal>write</literal> permitem que você "
+"especifique o SQL personalizado, do qual o Hibernate usará para acessar o "
+"valor da coluna. Consulte a discussão da <link linkend=\"mapping-column-read-"
+"and-write\">column read and write expressions</link> para maiores "
+"informações."
#. Tag: para
+#: basic_mapping.xml:3982
#, no-c-format
msgid ""
-"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
-"the cascade style."
+"The <literal>column</literal> and <literal>formula</literal> elements can "
+"even be combined within the same property or association mapping to express, "
+"for example, exotic join conditions."
msgstr ""
-"<literal>cascade</literal> (opcional – valor padrão <literal>none</"
-"literal>): o estilo cascata."
+"Os elementos <literal>column</literal> e <literal>formula</literal> podem "
+"até ser combinados dentro da mesma propriedade ou associação mapeando para "
+"expressar, por exemplo, condições de associações exóticas."
-#. Tag: para
+#. Tag: programlisting
+#: basic_mapping.xml:3986
#, no-c-format
msgid ""
-"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
-"literal>): specifies that updates to this property either do or do not "
-"require acquisition of the optimistic lock. It defines whether a version "
-"increment should occur if this property is dirty."
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
msgstr ""
-"<literal>optimistic-lock</literal> (opcional - valor padrão<literal>true</"
-"literal>): Especifica que as atualizações para esta propriedade requerem ou "
-"não aquisição da bloqueio otimista. Em outras palavras, define se uma versão "
-"de incremento deve ocorrer se esta propriedade for suja."
#. Tag: title
+#: basic_mapping.xml:3992
#, no-c-format
msgid "Hibernate types"
msgstr "Tipos do Hibernate "
#. Tag: title
+#: basic_mapping.xml:3995
#, no-c-format
msgid "Entities and values"
msgstr "Entidades e valores"
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
msgid ""
"In relation to the persistence service, Java language-level objects are "
@@ -3562,6 +8038,7 @@
"relação ao serviço de persistência:"
#. Tag: para
+#: basic_mapping.xml:4000
#, no-c-format
msgid ""
"An <emphasis>entity</emphasis> exists independently of any other objects "
@@ -3586,6 +8063,7 @@
"podem ser versionados."
#. Tag: para
+#: basic_mapping.xml:4010
#, no-c-format
msgid ""
"An entity's persistent state consists of references to other entities and "
@@ -3609,6 +8087,7 @@
"assim eles não podem ser comuns para duas entidades ou coleções."
#. Tag: para
+#: basic_mapping.xml:4020
#, no-c-format
msgid ""
"Until now, we have been using the term \"persistent class\" to refer to "
@@ -3638,11 +8117,13 @@
"de valor."
#. Tag: para
+#: basic_mapping.xml:4033
#, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
msgstr "Iremos rever ambos os conceitos durante todo o guia de referência."
#. Tag: para
+#: basic_mapping.xml:4036
#, no-c-format
msgid ""
"The challenge is to map the Java type system, and the developers' definition "
@@ -3669,6 +8150,7 @@
"estratégia de conversão adaptada, como você."
#. Tag: para
+#: basic_mapping.xml:4049
#, no-c-format
msgid ""
"With the exception of collections, all built-in Hibernate types support null "
@@ -3678,11 +8160,13 @@
"nulas com a exceção das coleções."
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
msgid "Basic value types"
msgstr "Valores de tipos básicos"
#. Tag: para
+#: basic_mapping.xml:4056
#, no-c-format
msgid ""
"The built-in <emphasis>basic mapping types</emphasis> can be roughly "
@@ -3691,16 +8175,18 @@
"Os <emphasis>tipos de mapeamento básicos</emphasis> fazem parte da "
"categorização do seguinte:"
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4059
+#, fuzzy, no-c-format
msgid ""
-"<literal>integer, long, short, float, double, character, byte, boolean, "
-"yes_no, true_false</literal>"
+"integer, long, short, float, double, character, byte, boolean, yes_no, "
+"true_false"
msgstr ""
"<literal>integer, long, short, float, double, character, byte, boolean, "
"yes_no, true_false</literal>"
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
msgid ""
"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
@@ -3713,12 +8199,14 @@
"yes_no</literal> são todas codificações alternativas para um "
"<literal>boolean</literal> ou <literal>java.lang.Boolean</literal> do Java."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4073
#, no-c-format
-msgid "<literal>string</literal>"
-msgstr "<literal>string</literal>"
+msgid "string"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</"
@@ -3727,12 +8215,14 @@
"Um tipo de mapeamento de <literal>java.lang.String</literal> para "
"<literal>VARCHAR</literal> (ou <literal>VARCHAR2</literal> no Oracle)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4083
+#, fuzzy, no-c-format
+msgid "date, time, timestamp"
msgstr "<literal>date, time, timestamp</literal>"
#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Date</literal> and its subclasses to "
@@ -3743,12 +8233,14 @@
"para os tipos SQL <literal>DATE</literal>, <literal>TIME</literal> e "
"<literal>TIMESTAMP</literal> (ou equivalente)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4094
+#, fuzzy, no-c-format
+msgid "calendar, calendar_date"
msgstr "<literal>calendar, calendar_date</literal>"
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Calendar</literal> to SQL types "
@@ -3757,12 +8249,14 @@
"Tipo de mapeamento de <literal>java.util.Calendar</literal> para os tipos "
"SQL <literal>TIMESTAMP</literal> e <literal>DATE</literal> (ou equivalente)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4104
+#, fuzzy, no-c-format
+msgid "big_decimal, big_integer"
msgstr "<literal>big_decimal, big_integer</literal>"
#. Tag: para
+#: basic_mapping.xml:4107
#, no-c-format
msgid ""
"Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java."
@@ -3773,12 +8267,14 @@
"<literal>java.math.BigInteger</literal> para <literal>NUMERIC</literal> (ou "
"<literal>NUMBER</literal> no Oracle)."
-#. Tag: term
-#, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4115
+#, fuzzy, no-c-format
+msgid "locale, timezone, currency"
msgstr "<literal>locale, timezone, currency</literal>"
#. Tag: para
+#: basic_mapping.xml:4118
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Locale</literal>, <literal>java.util."
@@ -3795,12 +8291,14 @@
"mapeados para seus códigos ISO. Instâncias de <literal>TimeZone</literal> "
"são mapeados para seu <literal>ID</literal>."
-#. Tag: term
-#, no-c-format
-msgid "<literal>class</literal>"
-msgstr "<literal>class</literal>"
+#. Tag: literal
+#: basic_mapping.xml:4131
+#, fuzzy, no-c-format
+msgid "class"
+msgstr "Classe"
#. Tag: para
+#: basic_mapping.xml:4134
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</"
@@ -3811,22 +8309,26 @@
"<literal>VARCHAR</literal> (ou <literal>VARCHAR2</literal> no Oracle). Uma "
"<literal>Class</literal> é mapeada pelo seu nome qualificado (completo)."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4142
#, no-c-format
-msgid "<literal>binary</literal>"
-msgstr "<literal>binary</literal>"
+msgid "binary"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4145
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr "Mapeia matrizes de bytes para um tipo binário de SQL apropriado."
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4150
#, no-c-format
-msgid "<literal>text</literal>"
-msgstr "<literal>text</literal>"
+msgid "text"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4153
#, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</"
@@ -3835,12 +8337,14 @@
"Mapeia strings de Java longos para um tipo SQL <literal>CLOB</literal> ou "
"<literal>TEXT</literal>. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4159
#, no-c-format
-msgid "<literal>serializable</literal>"
-msgstr "<literal>serializable</literal>"
+msgid "serializable"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4162
#, no-c-format
msgid ""
"Maps serializable Java types to an appropriate SQL binary type. You can also "
@@ -3852,12 +8356,14 @@
"o nome da classe ou interface Java serializável que não é padrão para um "
"tipo básico. "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:4171
#, no-c-format
-msgid "<literal>clob, blob</literal>"
-msgstr "<literal>clob, blob</literal>"
+msgid "clob, blob"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4174
#, no-c-format
msgid ""
"Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and "
@@ -3871,16 +8377,18 @@
"reusado fora de uma transação. Além disso, o suporte de driver é imcompleto "
"e inconsistente."
-#. Tag: term
-#, no-c-format
+#. Tag: literal
+#: basic_mapping.xml:4184
+#, fuzzy, no-c-format
msgid ""
-"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
-"imm_serializable, imm_binary</literal>"
+"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary"
msgstr ""
"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary</literal>"
#. Tag: para
+#: basic_mapping.xml:4188
#, no-c-format
msgid ""
"Type mappings for what are considered mutable Java types. This is where "
@@ -3900,6 +8408,7 @@
"aplicação deve atribuir um novo objeto (nonidentical) à propriedade."
#. Tag: para
+#: basic_mapping.xml:4200
#, no-c-format
msgid ""
"Unique identifiers of entities and collections can be of any basic type "
@@ -3913,6 +8422,7 @@
"Leia abaixo para maiores informações."
#. Tag: para
+#: basic_mapping.xml:4205
#, no-c-format
msgid ""
"The basic value types have corresponding <literal>Type</literal> constants "
@@ -3926,11 +8436,13 @@
"<literal>string</literal>."
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
msgid "Custom value types"
msgstr "Tipos de valores personalizados"
#. Tag: para
+#: basic_mapping.xml:4214
#, no-c-format
msgid ""
"It is relatively easy for developers to create their own value types. For "
@@ -3955,6 +8467,7 @@
"<literal>SURNAME</literal>. "
#. Tag: para
+#: basic_mapping.xml:4225
#, no-c-format
msgid ""
"To implement a custom type, implement either <literal>org.hibernate."
@@ -3969,7 +8482,19 @@
"<literal>org.hibernate.test.DoubleStringType</literal> para outras "
"funcionalidades. "
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, no-c-format
+msgid ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4234
#, no-c-format
msgid ""
"Notice the use of <literal><column></literal> tags to map a property "
@@ -3979,6 +8504,7 @@
"propriedade para colunas múltiplas."
#. Tag: para
+#: basic_mapping.xml:4237
#, no-c-format
msgid ""
"The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</"
@@ -3992,6 +8518,7 @@
"especializados."
#. Tag: para
+#: basic_mapping.xml:4243
#, no-c-format
msgid ""
"You can even supply parameters to a <literal>UserType</literal> in the "
@@ -4006,7 +8533,19 @@
"literal>. Para fornecer parâmetros a seu tipo personalizado, você pode usar "
"o elemento <literal><type></literal> em seus arquivos de mapeamento. "
+#. Tag: programlisting
+#: basic_mapping.xml:4250
+#, no-c-format
+msgid ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4252
#, no-c-format
msgid ""
"The <literal>UserType</literal> can now retrieve the value for the parameter "
@@ -4018,6 +8557,7 @@
"passado a ele."
#. Tag: para
+#: basic_mapping.xml:4256
#, no-c-format
msgid ""
"If you regularly use a certain <literal>UserType</literal>, it is useful to "
@@ -4032,7 +8572,24 @@
"tipo personalizado, e pode também conter uma lista de valores de parâmetro "
"padrão se o tipo for parametrizado."
+#. Tag: programlisting
+#: basic_mapping.xml:4262
+#, no-c-format
+msgid ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:4264
+#, no-c-format
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4266
#, no-c-format
msgid ""
"It is also possible to override the parameters supplied in a typedef on a "
@@ -4043,6 +8600,7 @@
"mapeamento da propriedade."
#. Tag: para
+#: basic_mapping.xml:4270
#, no-c-format
msgid ""
"Even though Hibernate's rich range of built-in types and support for "
@@ -4065,11 +8623,13 @@
"contra mudanças possíveis na forma de representação de valores monetários. "
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
msgid "Mapping a class more than once"
msgstr "Mapeando uma classe mais de uma vez"
#. Tag: para
+#: basic_mapping.xml:4285
#, no-c-format
msgid ""
"It is possible to provide more than one mapping for a particular persistent "
@@ -4087,7 +8647,31 @@
"com objetos persistentes, quando escrever consultas, ou ao mapear "
"associações para a entidade nomeada. "
+#. Tag: programlisting
+#: basic_mapping.xml:4293
+#, no-c-format
+msgid ""
+"<class name=\"Contract\" table=\"Contracts\"\n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\"\n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\"\n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\"\n"
+" column=\"currentContractId\"\n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4295
#, no-c-format
msgid ""
"Associations are now specified using <literal>entity-name</literal> instead "
@@ -4096,12 +8680,20 @@
"Note como as associações são agora especificadas utilizando o "
"<literal>entity-name</literal> ao invés da <literal>class</literal>. "
+#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
+#, no-c-format
+msgid "This feature is not supported in Annotations"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
msgid "SQL quoted identifiers"
msgstr "Identificadores quotados do SQL"
#. Tag: para
+#: basic_mapping.xml:4306
#, no-c-format
msgid ""
"You can force Hibernate to quote an identifier in the generated SQL by "
@@ -4116,100 +8708,32 @@
"<literal>Dialect</literal>. Geralmente são quotas dúplas, mas parênteses "
"para o Servidor SQL e backticks para MeuSQL."
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:4312
#, no-c-format
-msgid "Metadata alternatives"
-msgstr "Alternativas de Metadados"
-
-#. Tag: para
-#, no-c-format
msgid ""
-"XML does not suit all users so there are some alternative ways to define O/R "
-"mapping metadata in Hibernate."
+"@Entity @Table(name=\"`Line Item`\")\n"
+"class LineItem {\n"
+" @id @Column(name=\"`Item Id`\") Integer id;\n"
+" @Column(name=\"`Item #`\") int itemNumber\n"
+"}\n"
+"\n"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
msgstr ""
-"O XML não é para todos, e portanto existem algumas formas alternativas de "
-"defiinir o metadado de mapeamento no Hibernate. "
#. Tag: title
+#: basic_mapping.xml:4316
#, no-c-format
-msgid "Using XDoclet markup"
-msgstr "Usando a marcação XDoclet."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Many Hibernate users prefer to embed mapping information directly in "
-"sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover "
-"this approach in this reference guide since it is considered part of "
-"XDoclet. However, we include the following example of the <literal>Cat</"
-"literal> class with XDoclet mappings:"
-msgstr ""
-"Muitos usuários do Hibernate preferem encubar a informação de mapeamento "
-"diretamente no código de fonte utilizando o XDoclet <literal>@hibernate."
-"tags</literal>. Nós não falaremos sobre esta abordagem neste documento, uma "
-"vez que é estritamente considerado parte de um XDoclet. No entanto, "
-"incluímos os seguintes exemplos da classe <literal>Cat</literal> com os "
-"mapeamentos de XDoclet:"
-
-#. Tag: para
-#, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr ""
-"Veja o web site do Hibernate para maiores detalhes sobre um XDoclet e "
-"Hibernate. "
-
-#. Tag: title
-#, no-c-format
-msgid "Using JDK 5.0 Annotations"
-msgstr "Usando as anotações JDK 5.0"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"JDK 5.0 introduced XDoclet-style annotations at the language level that are "
-"type-safe and checked at compile time. This mechanism is more powerful than "
-"XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, "
-"for example, supports auto-completion and syntax highlighting of JDK 5.0 "
-"annotations. The new revision of the EJB specification (JSR-220) uses JDK "
-"5.0 annotations as the primary metadata mechanism for entity beans. "
-"Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the "
-"persistence API). Support for mapping metadata is available via the "
-"<emphasis>Hibernate Annotations</emphasis> package as a separate download. "
-"Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
-msgstr ""
-"O JDK 5.0 introduziu as anotações estilo XDoclet em nível de linguagem, tipo "
-"seguro e checado em tempo de compilação. Este mecanismo é mais potente do "
-"que as anotações XDoclet e melhor suportado pelas ferramentas e IDEs. O "
-"IntelliJ IDEA por exemplo, suporta a auto complexão e destaque da sintaxe "
-"das anotações JDK 5.0. A nova revisão da especificação EJB (JSR-220) usa as "
-"anotações JDK 5.0 como mecanismos de metadados para beans de entidade. O "
-"Hibernate3 implementa o <literal>EntityManager</literal> do JSR-220 (o API "
-"de persistência). O suporte para mapear metadados está disponível através do "
-"pacote <emphasis>Anotações do Hibernate</emphasis>, como um download "
-"separado. Ambos os EJB3 (JSR-220) e o metadado Hibernate3 são suportados. "
-
-#. Tag: para
-#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
-msgstr "Este é um exemplo de uma classe POJO anotado como um bean de entidade EJB:"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Support for JDK 5.0 Annotations (and JSR-220) is currently under "
-"development. Please refer to the Hibernate Annotations module for more "
-"details."
-msgstr ""
-"Note que o suporte para Anotações JDK 5.0 (e JSR-220) ainda está em "
-"construção. Consulte o módulo de Anotações do Hibernate para maiores "
-"detalhes. "
-
-#. Tag: title
-#, no-c-format
msgid "Generated properties"
msgstr "Propriedades geradas "
#. Tag: para
+#: basic_mapping.xml:4318
#, no-c-format
msgid ""
"Generated properties are properties that have their values generated by the "
@@ -4230,6 +8754,7 @@
"para recuperar os valores gerados."
#. Tag: para
+#: basic_mapping.xml:4327
#, no-c-format
msgid ""
"Properties marked as generated must additionally be non-insertable and non-"
@@ -4239,11 +8764,13 @@
"can be marked as generated."
msgstr ""
"As propriedades marcadas como geradas devem ser não-inseríveis e não-"
-"atualizáveis. Somente <link linkend=\"mapping-declaration-version\">versions</"
-"link>, <link linkend=\"mapping-declaration-timestamp\">timestamps</link>, "
-"e <link linkend=\"mapping-declaration-property\">simple properties</link> podem ser marcadas como geradas."
+"atualizáveis. Somente <link linkend=\"mapping-declaration-version"
+"\">versions</link>, <link linkend=\"mapping-declaration-timestamp"
+"\">timestamps</link>, e <link linkend=\"mapping-declaration-property"
+"\">simple properties</link> podem ser marcadas como geradas."
#. Tag: para
+#: basic_mapping.xml:4334
#, no-c-format
msgid ""
"<literal>never</literal> (the default): the given property value is not "
@@ -4253,6 +8780,7 @@
"dado não é gerado dentro do banco de dados. "
#. Tag: para
+#: basic_mapping.xml:4337
#, no-c-format
msgid ""
"<literal>insert</literal>: the given property value is generated on insert, "
@@ -4265,12 +8793,13 @@
"<literal>insert</literal>: informa que o valor de propriedade dado é gerado "
"ao inserir, mas não é novamente gerado nas próximas atualizações. "
"Propriedades do tipo data criada, se encaixam nesta categoria. Note que "
-"embora as propriedades <link linkend=\"mapping-declaration-"
-"version\">version</link> e <link linkend=\"mapping-declaration-timestamp"
-"\">timestamp</link> podem ser marcadas como "
-"geradas, esta opção não está disponível."
+"embora as propriedades <link linkend=\"mapping-declaration-version"
+"\">version</link> e <link linkend=\"mapping-declaration-timestamp"
+"\">timestamp</link> podem ser marcadas como geradas, esta opção não está "
+"disponível."
#. Tag: para
+#: basic_mapping.xml:4344
#, no-c-format
msgid ""
"<literal>always</literal>: the property value is generated both on insert "
@@ -4279,60 +8808,96 @@
"<literal>always</literal> - informa que o valor da propriedade é gerado "
"tanto ao inserir quanto ao atualizar. "
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr "Coluna de expressöes de gravação e leitura"
#. Tag: para
-#, no-c-format
+#: basic_mapping.xml:4354
+#, fuzzy, no-c-format
msgid ""
"Hibernate allows you to customize the SQL it uses to read and write the "
"values of columns mapped to <link linkend=\"mapping-declaration-property"
"\">simple properties</link>. For example, if your database provides a set of "
"data encryption functions, you can invoke them for individual columns like "
-"this: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"this:"
msgstr ""
-"O Hibernate permite você personalizar o SQL utilizado para ler e gravar os valores da coluna mapeada ao <link linkend=\"mapping-declaration-property"
-"\">simple properties</link>. Por exemplo, caso o seu banco de dados fornecer um conjunto de funçöes encriptonados de dados, você poderá invocá-las para colunas individuais como: <programlisting role=\"XML\"><property name=\"creditCardNumber"
-"\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" "
-"write=\"encrypt(?)\"/> </property></programlisting>"
+"O Hibernate permite você personalizar o SQL utilizado para ler e gravar os "
+"valores da coluna mapeada ao <link linkend=\"mapping-declaration-property"
+"\">simple properties</link>. Por exemplo, caso o seu banco de dados fornecer "
+"um conjunto de funçöes encriptonados de dados, você poderá invocá-las para "
+"colunas individuais como: <programlisting role=\"XML\"><property name="
+"\"creditCardNumber\"> <column name=\"credit_card_num\" read=\"decrypt"
+"(credit_card_num)\" write=\"encrypt(?)\"/> </property></"
+"programlisting>"
+#. Tag: programlisting
+#: basic_mapping.xml:4359
+#, no-c-format
+msgid ""
+"<property name=\"creditCardNumber\">\n"
+" <column \n"
+" name=\"credit_card_num\"\n"
+" read=\"decrypt(credit_card_num)\"\n"
+" write=\"encrypt(?)\"/>\n"
+"</property>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
msgid ""
"Hibernate applies the custom expressions automatically whenever the property "
"is referenced in a query. This functionality is similar to a derived-"
"property <literal>formula</literal> with two differences:"
-msgstr "O Hibernate aplica automaticamente as expressöes personalizadas a todo instante que a propriedade é referenciada numa consulta. Esta funcionalidade é parecida a uma <literal>formula</literal> de propriedade-derivada com duas diferenças:"
+msgstr ""
+"O Hibernate aplica automaticamente as expressöes personalizadas a todo "
+"instante que a propriedade é referenciada numa consulta. Esta funcionalidade "
+"é parecida a uma <literal>formula</literal> de propriedade-derivada com duas "
+"diferenças:"
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
msgid ""
"The property is backed by one or more columns that are exported as part of "
"automatic schema generation."
-msgstr "Esta propriedade é suportada por uma ou mais colunas que são exportadas como parte da geração do esquema automático."
+msgstr ""
+"Esta propriedade é suportada por uma ou mais colunas que são exportadas como "
+"parte da geração do esquema automático."
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr "Esta propriedade é de gravação-leitura, e não de leitura apenas."
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
msgid ""
"The <literal>write</literal> expression, if specified, must contain exactly "
"one '?' placeholder for the value."
-msgstr "Caso a expressão <literal>write</literal>seja especificada, deverá conter um '?' para o valor."
+msgstr ""
+"Caso a expressão <literal>write</literal>seja especificada, deverá conter um "
+"'?' para o valor."
#. Tag: title
+#: basic_mapping.xml:4384
#, no-c-format
msgid "Auxiliary database objects"
msgstr "Objetos de Banco de Dados Auxiliares "
#. Tag: para
+#: basic_mapping.xml:4386
#, no-c-format
msgid ""
"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
@@ -4354,6 +8919,7 @@
"módulos essenciais para definir objetos de banco de dados auxiliares:"
#. Tag: para
+#: basic_mapping.xml:4396
#, no-c-format
msgid ""
"The first mode is to explicitly list the CREATE and DROP commands in the "
@@ -4362,7 +8928,21 @@
"O primeiro módulo é para listar explicitamente os comandos CREATE e DROP no "
"arquivo de mapeamento: "
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4401
#, no-c-format
msgid ""
"The second mode is to supply a custom class that constructs the CREATE and "
@@ -4373,7 +8953,20 @@
"os comandos CREATE e DROP. Esta classe padrão deve implementar a interface "
"<literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal>. "
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:4408
#, no-c-format
msgid ""
"Additionally, these database objects can be optionally scoped so that they "
@@ -4382,3 +8975,394 @@
"Além disso, estes objetos de banco de dados podem ter um escopo opcional que "
"só será aplicado quando certos dialetos forem utilizados. "
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
+">\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#~ msgid ""
+#~ "Use of <literal>select-before-update</literal> will usually decrease "
+#~ "performance. It is useful to prevent a database update trigger being "
+#~ "called unnecessarily if you reattach a graph of detached instances to a "
+#~ "<literal>Session</literal>."
+#~ msgstr ""
+#~ "O uso de <literal>select-before-update</literal> geralmente irá diminuir "
+#~ "o desempenho. Ela é muito útil para prevenir que um trigger de "
+#~ "atualização no banco de dados seja ativado desnecessariamente, se você "
+#~ "reconectar um nó de uma instância desconectada em uma <literal>Session</"
+#~ "literal>."
+
+#~ msgid "Generator"
+#~ msgstr "Gerador"
+
+#~ msgid "<literal>increment</literal>"
+#~ msgstr "<literal>increment</literal>"
+
+#~ msgid "<literal>identity</literal>"
+#~ msgstr "<literal>identity</literal>"
+
+#~ msgid "<literal>sequence</literal>"
+#~ msgstr "<literal>sequence</literal>"
+
+#~ msgid "<literal>seqhilo</literal>"
+#~ msgstr "<literal>seqhilo</literal>"
+
+#~ msgid "<literal>uuid</literal>"
+#~ msgstr "<literal>uuid</literal>"
+
+#~ msgid ""
+#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
+#~ "are unique within a network (the IP address is used). The UUID is encoded "
+#~ "as a string of 32 hexadecimal digits in length."
+#~ msgstr ""
+#~ "utiliza um algorítimo UUID de 128-bits para gerar identificadores do tipo "
+#~ "string, únicos em uma rede (o endereço IP é utilizado). O UUID é "
+#~ "codificado como um string de dígitos hexadecimais de tamanho 32."
+
+#~ msgid "<literal>guid</literal>"
+#~ msgstr "<literal>guid</literal>"
+
+#~ msgid "<literal>native</literal>"
+#~ msgstr "<literal>native</literal>"
+
+#~ msgid "<literal>select</literal>"
+#~ msgstr "<literal>select</literal>"
+
+#~ msgid "<literal>foreign</literal>"
+#~ msgstr "<literal>foreign</literal>"
+
+#~ msgid ""
+#~ "<literal>optimizer</literal> (optional - defaults to <literal>none</"
+#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
+#~ msgstr ""
+#~ "<literal>optimizer</literal> (opcional – padrão para <literal>none</"
+#~ "literal>): Veja <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
+
+#~ msgid "composite-id"
+#~ msgstr "Composição-id"
+
+#~ msgid ""
+#~ "A table with a composite key can be mapped with multiple properties of "
+#~ "the class as identifier properties. The <literal><composite-id></"
+#~ "literal> element accepts <literal><key-property></literal> property "
+#~ "mappings and <literal><key-many-to-one></literal> mappings as child "
+#~ "elements."
+#~ msgstr ""
+#~ "Uma tabela com uma chave composta, pode ser mapeada com múltiplas "
+#~ "propriedades da classe como propriedades de identificação. O elemento "
+#~ "<literal><composite-id></literal> aceita o mapeamento da "
+#~ "propriedade <literal><key-property></literal> e mapeamentos "
+#~ "<literal><key-many-to-one></literal>como elementos filhos."
+
+#~ msgid ""
+#~ "The persistent class <emphasis>must</emphasis> override <literal>equals()"
+#~ "</literal> and <literal>hashCode()</literal> to implement composite "
+#~ "identifier equality. It must also implement <literal>Serializable</"
+#~ "literal>."
+#~ msgstr ""
+#~ "A classe persistente <emphasis>precisa</emphasis> substituir "
+#~ "<literal>equals()</literal> e <literal>hashCode()</literal> para "
+#~ "implementar identificadores compostos igualmente. E precisa também "
+#~ "implementar <literal>Serializable</literal>."
+
+#~ msgid ""
+#~ "Unfortunately, this approach means that a persistent object is its own "
+#~ "identifier. There is no convenient \"handle\" other than the object "
+#~ "itself. You must instantiate an instance of the persistent class itself "
+#~ "and populate its identifier properties before you can <literal>load()</"
+#~ "literal> the persistent state associated with a composite key. We call "
+#~ "this approach an <emphasis>embedded</emphasis> composite identifier, and "
+#~ "discourage it for serious applications."
+#~ msgstr ""
+#~ "Infelizmente, esta solução para um identificador composto significa que "
+#~ "um objeto persistente é seu próprio identificador. Não há outro \"handle"
+#~ "\" conveniente a não ser o próprio objeto. Você mesmo precisa instanciar "
+#~ "uma instância de outra classe persistente e preencher suas propriedades "
+#~ "de identificação antes que você possa dar um <literal>load()</literal> "
+#~ "para o estado persistente associado com uma chave composta. Nós chamamos "
+#~ "esta solução de identificador composto <emphasis>incorporado</emphasis> e "
+#~ "não aconselhamos para aplicações sérias."
+
+#~ msgid ""
+#~ "A second approach is what we call a <emphasis>mapped</emphasis> composite "
+#~ "identifier, where the identifier properties named inside the <literal><"
+#~ "composite-id></literal> element are duplicated on both the persistent "
+#~ "class and a separate identifier class."
+#~ msgstr ""
+#~ "Uma segunda solução seria chamar de identificador composto "
+#~ "<emphasis>mapped</emphasis> quando a propriedades de identificação "
+#~ "nomeadas dentro do elemento <literal><composite-id></literal> estão "
+#~ "duplicadas tanto na classe persistente como em uma classe de "
+#~ "identificação separada."
+
+#~ msgid ""
+#~ "In this example, both the composite identifier class, "
+#~ "<literal>MedicareId</literal>, and the entity class itself have "
+#~ "properties named <literal>medicareNumber</literal> and "
+#~ "<literal>dependent</literal>. The identifier class must override "
+#~ "<literal>equals()</literal> and <literal>hashCode()</literal> and "
+#~ "implement <literal>Serializable</literal>. The main disadvantage of this "
+#~ "approach is code duplication."
+#~ msgstr ""
+#~ "No exemplo, ambas as classes de identificadores compostas, "
+#~ "<literal>MedicareId</literal>, e a própria classe entidade possuem "
+#~ "propriedades nomeadas <literal>medicareNumber</literal> e "
+#~ "<literal>dependent</literal>. A classe identificadora precisa sobrepor "
+#~ "<literal>equals()</literal> e <literal>hashCode()</literal> e implementar "
+#~ "<literal>Serializable</literal>. A desvantagem desta solução é óbvia: "
+#~ "duplicação de código."
+
+#~ msgid ""
+#~ "The following attributes are used to specify a mapped composite "
+#~ "identifier:"
+#~ msgstr ""
+#~ "As seguintes funções são utilizadas para especificar o mapeamento de um "
+#~ "identificador composto:"
+
+#~ msgid ""
+#~ "<literal>mapped</literal> (optional - defaults to <literal>false</"
+#~ "literal>): indicates that a mapped composite identifier is used, and that "
+#~ "the contained property mappings refer to both the entity class and the "
+#~ "composite identifier class."
+#~ msgstr ""
+#~ "<literal>mapped</literal> (opcional, <literal>false</literal> por "
+#~ "padrão): Indica que um identificar composto mapeado é usado, e que as "
+#~ "propriedades de mapeamento contidas refere-se tanto à classe entidade "
+#~ "quanto à classe de identificação composta."
+
+#~ msgid ""
+#~ "<literal>class</literal> (optional - but required for a mapped composite "
+#~ "identifier): the class used as a composite identifier."
+#~ msgstr ""
+#~ "<literal>class</literal> (opcional, mas requerida para um identificador "
+#~ "composto mapeado): A classe usada como um identificador composto. "
+
+#~ msgid ""
+#~ "We will describe a third, even more convenient approach, where the "
+#~ "composite identifier is implemented as a component class in <xref linkend="
+#~ "\"components-compositeid\" />. The attributes described below apply only "
+#~ "to this alternative approach:"
+#~ msgstr ""
+#~ "Descreveremos uma abordagem terciária e até mais conveniente, onde o "
+#~ "identificador da composição é implementado como uma classe componente na "
+#~ "<xref linkend=\"components-compositeid\"/>. Os atributos descritos abaixo "
+#~ "aplicam-se apenas para esta abordagem: "
+
+#~ msgid ""
+#~ "<literal>name</literal> (optional - required for this approach): a "
+#~ "property of component type that holds the composite identifier. Please "
+#~ "see chapter 9 for more information."
+#~ msgstr ""
+#~ "<literal>name</literal> (opcional, requerida para esta abordagem): Uma "
+#~ "propriedade do tipo componente que armazena o identificador composto. "
+#~ "Para maiores informações, por favor consulte o capítulo 9."
+
+#~ msgid ""
+#~ "<literal>class</literal> (optional - defaults to the property type "
+#~ "determined by reflection): the component class used as a composite "
+#~ "identifier. Please see the next section for more information."
+#~ msgstr ""
+#~ "<literal>class</literal> (opcional - valor padrão para o tipo de "
+#~ "propriedade determinando por reflexão): A classe componente utilizada "
+#~ "como um identificador composto. Por favor consulte a próxima seção para "
+#~ "maiores informações."
+
+#~ msgid ""
+#~ "The third approach, an <emphasis>identifier component</emphasis>, is "
+#~ "recommended for almost all applications."
+#~ msgstr ""
+#~ "Esta terceira abordagem, um <emphasis>componente identificador</"
+#~ "emphasis>, é a que nós recomendamos para a maioria das aplicações. "
+
+#~ msgid "Version (optional)"
+#~ msgstr "Versão (opcional) "
+
+#~ msgid ""
+#~ "The <literal><version></literal> element is optional and indicates "
+#~ "that the table contains versioned data. This is particularly useful if "
+#~ "you plan to use <emphasis>long transactions</emphasis>. See below for "
+#~ "more information:"
+#~ msgstr ""
+#~ "O elemento <literal><version></literal> é opcional e indica que a "
+#~ "tabela possui dados versionados. Isto é particularmente útil se você "
+#~ "planeja utilizar <emphasis>transações longas</emphasis>. Veja abaixo "
+#~ "maiores informações: "
+
+#~ msgid ""
+#~ "Version numbers can be of Hibernate type <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> or <literal>calendar</literal>."
+#~ msgstr ""
+#~ "Números de versão podem ser dos tipos Hibernate <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> ou <literal>calendar</literal>. "
+
+#~ msgid "Many-to-one"
+#~ msgstr "Muitos-para-um "
+
+#~ msgid ""
+#~ "An ordinary association to another persistent class is declared using a "
+#~ "<literal>many-to-one</literal> element. The relational model is a many-to-"
+#~ "one association; a foreign key in one table is referencing the primary "
+#~ "key column(s) of the target table."
+#~ msgstr ""
+#~ "Uma associação ordinária para outra classe persistente é declarada usando "
+#~ "o elemento <literal>many-to-one</literal>. O modelo relacional é uma "
+#~ "associação muitos para um: uma chave exterior de uma tabela referenciando "
+#~ "as colunas da chave primária da tabela destino."
+
+#~ msgid "One-to-one"
+#~ msgstr "Um-para-um "
+
+#~ msgid "There are two varieties of one-to-one associations:"
+#~ msgstr "Existem duas variedades de associações um-pra-um: "
+
+#~ msgid "primary key associations"
+#~ msgstr "Associações de chave primária"
+
+#~ msgid ""
+#~ "Alternatively, a foreign key with a unique constraint, from "
+#~ "<literal>Employee</literal> to <literal>Person</literal>, can be "
+#~ "expressed as:"
+#~ msgstr ""
+#~ "Alternativamente, uma chave exterior com uma restrição única, de "
+#~ "<literal>Employee</literal> para <literal>Person</literal>, pode ser "
+#~ "expressada como:"
+
+#~ msgid ""
+#~ "This association can be made bidirectional by adding the following to the "
+#~ "<literal>Person</literal> mapping:"
+#~ msgstr ""
+#~ "Esta associação pode ser feita de forma bi-direcional adicionando o "
+#~ "seguinte no mapeamento de <literal>Person</literal>:"
+
+#~ msgid "Component and dynamic-component"
+#~ msgstr "Componente e componente dinâmico"
+
+#~ msgid "Subclass"
+#~ msgstr "Subclass"
+
+#~ msgid ""
+#~ "A discriminator column is not required for this mapping strategy. Each "
+#~ "subclass must, however, declare a table column holding the object "
+#~ "identifier using the <literal><key></literal> element. The mapping "
+#~ "at the start of the chapter would then be re-written as:"
+#~ msgstr ""
+#~ "A coluna discriminadora não é requerida para esta estratégia de "
+#~ "mapeamento. Cada subclasse deve declarar uma coluna de tabela com o "
+#~ "identificador do objeto usando o elemento <literal><key></literal>. "
+#~ "O mapeamento no início do capítulo poderia ser re-escrito assim: "
+
+#~ msgid "Union-subclass"
+#~ msgstr "Subclasse de União"
+
+#~ msgid "Join"
+#~ msgstr "União "
+
+#~ msgid ""
+#~ "Using the <literal><join></literal> element, it is possible to map "
+#~ "properties of one class to several tables that have a one-to-one "
+#~ "relationship. For example:"
+#~ msgstr ""
+#~ "Usando o elemento <literal><join></literal>>, é possível mapear "
+#~ "propriedades de uma classe para várias tabelas que possuem uma relação um "
+#~ "por um. Por exemplo:"
+
+#~ msgid "Key"
+#~ msgstr "Key"
+
+#~ msgid "Any"
+#~ msgstr "Any"
+
+#~ msgid "<literal>class</literal>"
+#~ msgstr "<literal>class</literal>"
+
+#~ msgid "<literal>text</literal>"
+#~ msgstr "<literal>text</literal>"
+
+#~ msgid "<literal>clob, blob</literal>"
+#~ msgstr "<literal>clob, blob</literal>"
+
+#~ msgid ""
+#~ "XML does not suit all users so there are some alternative ways to define "
+#~ "O/R mapping metadata in Hibernate."
+#~ msgstr ""
+#~ "O XML não é para todos, e portanto existem algumas formas alternativas de "
+#~ "defiinir o metadado de mapeamento no Hibernate. "
+
+#~ msgid "Using XDoclet markup"
+#~ msgstr "Usando a marcação XDoclet."
+
+#~ msgid ""
+#~ "Many Hibernate users prefer to embed mapping information directly in "
+#~ "sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not "
+#~ "cover this approach in this reference guide since it is considered part "
+#~ "of XDoclet. However, we include the following example of the "
+#~ "<literal>Cat</literal> class with XDoclet mappings:"
+#~ msgstr ""
+#~ "Muitos usuários do Hibernate preferem encubar a informação de mapeamento "
+#~ "diretamente no código de fonte utilizando o XDoclet <literal>@hibernate."
+#~ "tags</literal>. Nós não falaremos sobre esta abordagem neste documento, "
+#~ "uma vez que é estritamente considerado parte de um XDoclet. No entanto, "
+#~ "incluímos os seguintes exemplos da classe <literal>Cat</literal> com os "
+#~ "mapeamentos de XDoclet:"
+
+#~ msgid ""
+#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
+#~ msgstr ""
+#~ "Veja o web site do Hibernate para maiores detalhes sobre um XDoclet e "
+#~ "Hibernate. "
+
+#~ msgid "Using JDK 5.0 Annotations"
+#~ msgstr "Usando as anotações JDK 5.0"
+
+#~ msgid ""
+#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
+#~ "are type-safe and checked at compile time. This mechanism is more "
+#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
+#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
+#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
+#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
+#~ "mechanism for entity beans. Hibernate3 implements the "
+#~ "<literal>EntityManager</literal> of JSR-220 (the persistence API). "
+#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
+#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
+#~ "220) and Hibernate3 metadata is supported."
+#~ msgstr ""
+#~ "O JDK 5.0 introduziu as anotações estilo XDoclet em nível de linguagem, "
+#~ "tipo seguro e checado em tempo de compilação. Este mecanismo é mais "
+#~ "potente do que as anotações XDoclet e melhor suportado pelas ferramentas "
+#~ "e IDEs. O IntelliJ IDEA por exemplo, suporta a auto complexão e destaque "
+#~ "da sintaxe das anotações JDK 5.0. A nova revisão da especificação EJB "
+#~ "(JSR-220) usa as anotações JDK 5.0 como mecanismos de metadados para "
+#~ "beans de entidade. O Hibernate3 implementa o <literal>EntityManager</"
+#~ "literal> do JSR-220 (o API de persistência). O suporte para mapear "
+#~ "metadados está disponível através do pacote <emphasis>Anotações do "
+#~ "Hibernate</emphasis>, como um download separado. Ambos os EJB3 (JSR-220) "
+#~ "e o metadado Hibernate3 são suportados. "
+
+#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+#~ msgstr ""
+#~ "Este é um exemplo de uma classe POJO anotado como um bean de entidade EJB:"
+
+#~ msgid ""
+#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
+#~ "development. Please refer to the Hibernate Annotations module for more "
+#~ "details."
+#~ msgstr ""
+#~ "Note que o suporte para Anotações JDK 5.0 (e JSR-220) ainda está em "
+#~ "construção. Consulte o módulo de Anotações do Hibernate para maiores "
+#~ "detalhes. "
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/collection_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/collection_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/collection_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: collection_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 16:00+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,33 +118,52 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: collection_mapping.xml:31
#, no-c-format
msgid "Collection mapping"
msgstr "Mapeamento de coleção "
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr "Coleções persistentes"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:36
+#, fuzzy, no-c-format
msgid ""
-"Hibernate requires that persistent collection-valued fields be declared as "
-"an interface type. For example:"
+"Naturally Hibernate also allows to persist collections. These persistent "
+"collections can contain almost any other Hibernate type, including: basic "
+"types, custom types, components and references to other entities. The "
+"distinction between value and reference semantics is in this context very "
+"important. An object in a collection might be handled with \"value\" "
+"semantics (its life cycle fully depends on the collection owner), or it "
+"might be a reference to another entity with its own life cycle. In the "
+"latter case, only the \"link\" between the two objects is considered to be a "
+"state held by the collection."
msgstr ""
-"O Hibernate requer que os campos de coleções de valor persistente sejam "
-"declarados como um tipo de interface. Por exemplo:"
+"As coleções podem conter quase qualquer outro tipo de Hibernate, incluindo "
+"todos os tipos básicos, tipos padronizados, e é claro, referências a outras "
+"entidades. Isto é uma distinção importante: um objeto em uma coleção pode "
+"ser manipulada com as semânticas \"valor\" (seu ciclo de vida depende "
+"totalmente do proprietário da coleção), ou ele pode ser uma referência à "
+"outra entidade, com seu próprio ciclo de vida. No último caso, somente o "
+"\"link\" entre os dois objetos é considerado como estado seguro pela "
+"coleção. "
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:46
+#, fuzzy, no-c-format
msgid ""
-"The actual interface might be <literal>java.util.Set</literal>, "
+"As a requirement persistent collection-valued fields must be declared as an "
+"interface type (see <xref linkend=\"example.collection.mapping.annotations\"/"
+">). The actual interface might be <literal>java.util.Set</literal>, "
"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
"<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, "
"<literal>java.util.SortedMap</literal> or anything you like (\"anything you "
"like\" means you will have to write an implementation of <literal>org."
-"hibernate.usertype.UserCollectionType</literal>.)"
+"hibernate.usertype.UserCollectionType</literal>)."
msgstr ""
"A interface atual pode ser <literal>java.util.Set</literal>, <literal>java."
"util.Collection</literal>, <literal>java.util.List</literal>, <literal>java."
@@ -154,15 +173,17 @@
"UserCollectionType</literal>.)"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:57
+#, fuzzy, no-c-format
msgid ""
-"Notice how the instance variable was initialized with an instance of "
-"<literal>HashSet</literal>. This is the best way to initialize collection "
+"Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the "
+"instance variable <literal>parts</literal> was initialized with an instance "
+"of <literal>HashSet</literal>. This is the best way to initialize collection "
"valued properties of newly instantiated (non-persistent) instances. When you "
-"make the instance persistent, by calling <literal>persist()</literal> for "
-"example, Hibernate will actually replace the <literal>HashSet</literal> with "
-"an instance of Hibernate's own implementation of <literal>Set</literal>. Be "
-"aware of the following errors:"
+"make the instance persistent, by calling <literal>persist()</literal>, "
+"Hibernate will actually replace the <literal>HashSet</literal> with an "
+"instance of Hibernate's own implementation of <literal>Set</literal>. Be "
+"aware of the following error:"
msgstr ""
"Observe como inicializamos a variável da instância com uma instância de "
"<literal>HashSet</literal>. Esta é a melhor maneira de inicializar "
@@ -172,7 +193,30 @@
"<literal>HashSet</literal> por uma instância da própria implementação do "
"Hibernate do <literal>Set</literal>. Cuidado com erros como este:"
+#. Tag: title
+#: collection_mapping.xml:68
+#, no-c-format
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:73
#, no-c-format
msgid ""
"The persistent collections injected by Hibernate behave like "
@@ -186,6 +230,7 @@
"dependendo do tipo de interface."
#. Tag: para
+#: collection_mapping.xml:78
#, no-c-format
msgid ""
"Collections instances have the usual behavior of value types. They are "
@@ -208,67 +253,347 @@
"coleção nula e uma coleção vazia. "
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:89
+#, fuzzy, no-c-format
msgid ""
"Use persistent collections the same way you use ordinary Java collections. "
-"However, please ensure you understand the semantics of bidirectional "
-"associations (these are discussed later)."
+"However, ensure you understand the semantics of bidirectional associations "
+"(see <xref linkend=\"collections-bidirectional\"/>)."
msgstr ""
"Use as coleções persistentes da mesma forma que usa coleções Java comuns. No "
"entanto, somente tenha a certeza de entender as semânticas de associações "
"bidirecionais (as quais serão discutidas mais tarde)."
#. Tag: title
+#: collection_mapping.xml:97
+#, fuzzy, no-c-format
+msgid "How to map collections"
+msgstr "Coleções escolhidas"
+
+#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "Collection mappings"
-msgstr "Mapeamento de coleção"
+msgid ""
+"Using annotations you can map <classname>Collection</classname>s, "
+"<classname>List</classname>s, <classname>Map</classname>s and "
+"<classname>Set</classname>s of associated entities using @OneToMany and "
+"@ManyToMany. For collections of a basic or embeddable type use "
+"@ElementCollection. In the simplest case a collection mapping looks like "
+"this:"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinColumn(name=\"PART_ID\")\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:112
#, no-c-format
msgid ""
-"There are quite a range of mappings that can be generated for collections "
-"that cover many common relational models. We suggest you experiment with the "
-"schema generation tool so that you understand how various mapping "
-"declarations translate to database tables."
+"Product describes a unidirectional relationship with Part using the join "
+"column PART_ID. In this unidirectional one to many scenario you can also use "
+"a join table as seen in <xref linkend=\"example-one-to-many-with-join-table"
+"\"/>."
msgstr ""
-"Existem diversas variedades de mapeamento que podem ser gerados para as "
-"coleções, cobrindo muitos modelos relacionais comuns. Sugerimos que você "
-"faça o teste com a ferramenta de geração do esquema para obter uma idéia de "
-"como diversas declarações de mapeamento traduzem as tabelas de banco de "
-"dados. "
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"PRODUCT_PARTS\",\n"
+" joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+" )\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:124
#, no-c-format
msgid ""
-"The Hibernate mapping element used for mapping a collection depends upon the "
-"type of interface. For example, a <literal><set></literal> element is "
-"used for mapping properties of type <literal>Set</literal>."
+"Without describing any physical mapping (no <classname>@JoinColumn</"
+"classname> or <classname>@JoinTable</classname>), a unidirectional one to "
+"many with join table is used. The table name is the concatenation of the "
+"owner table name, _, and the other side table name. The foreign key name(s) "
+"referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:135
+#, fuzzy, no-c-format
+msgid ""
+"Lets have a look now how collections are mapped using Hibernate mapping "
+"files. In this case the first step is to chose the right mapping element. It "
+"depends on the type of interface. For example, a <literal><set></"
+"literal> element is used for mapping properties of type <literal>Set</"
+"literal>."
+msgstr ""
"O elemento do mapeamento do Hibernate, usado para mapear uma coleção, "
"depende do tipo de interface. Por exemplo, um elemento <literal><set></"
"literal> é usado para mapear propriedades do tipo <literal>Set</literal>. "
+#. Tag: title
+#: collection_mapping.xml:142
+#, no-c-format
+msgid "Mapping a Set using <set>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, no-c-format
+msgid ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:147
+#, fuzzy, no-c-format
+msgid ""
+"In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many "
+"association</emphasis> links the <literal>Product</literal> and "
+"<literal>Part</literal> entities. This association requires the existence of "
+"a foreign key column and possibly an index column to the <literal>Part</"
+"literal> table. This mapping loses certain semantics of normal Java "
+"collections:"
+msgstr ""
+"Uma associação a partir do <literal>Produto</literal> até a <literal>Parte</"
+"literal> requer a existência de uma coluna de chave exterior e possivelmente "
+"uma coluna de índice para a tabela <literal>Part</literal> Uma tag "
+"<literal><one-to-many></literal> indica que esta é uma associação um "
+"para muitos."
+
+#. Tag: para
+#: collection_mapping.xml:156
#, no-c-format
msgid ""
-"Apart from <literal><set></literal>, there is also <literal><"
-"list></literal>, <literal><map></literal>, <literal><bag></"
-"literal>, <literal><array></literal> and <literal><primitive-"
-"array></literal> mapping elements. The <literal><map></literal> "
-"element is representative:"
+"An instance of the contained entity class cannot belong to more than one "
+"instance of the collection."
msgstr ""
+"Uma instância de classes entidades contidas, podem não pertencer à mais de "
+"uma instância da coleção. "
+
+#. Tag: para
+#: collection_mapping.xml:161
+#, no-c-format
+msgid ""
+"An instance of the contained entity class cannot appear at more than one "
+"value of the collection index."
+msgstr ""
+"Uma instância da classe de entidade contida pode não aparecer em mais de um "
+"valor do índice da coleção. "
+
+#. Tag: para
+#: collection_mapping.xml:166
+#, no-c-format
+msgid ""
+"Looking closer at the used <literal><one-to-many></literal> tag we see "
+"that it has the following options."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, no-c-format
+msgid ""
+"<one-to-many\n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:185
+#, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr "<literal>class</literal> (requerido): O nome da classe associada. "
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, no-c-format
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how cached identifiers that reference missing rows will "
+"be handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal> (opcional - padrão para <literal>exception</"
+"literal>): Especifica como os identificadores em cache que referenciam as "
+"linhas faltantes serão tratadas: <literal>ignore</literal> tratará a linha "
+"faltante como uma associação nula. "
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class, as an alternative to <literal>class</literal>."
+msgstr ""
+"<literal>entity-name</literal> (opcional): O nome da entidade da classe "
+"associada, como uma alternativa para a <literal>class</literal>. "
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, no-c-format
+msgid ""
+"The <literal><one-to-many></literal> element does not need to declare "
+"any columns. Nor is it necessary to specify the <literal>table</literal> "
+"name anywhere."
+msgstr ""
+"Note que o elemento <literal><one-to-many></literal> não precisa "
+"declarar qualquer coluna. Nem é necessário especificar o nome da "
+"<literal>table</literal> em qualquer lugar. "
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, fuzzy, no-c-format
+msgid ""
+"If the foreign key column of a <literal><one-to-many></literal> "
+"association is declared <literal>NOT NULL</literal>, you must declare the "
+"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
+"or <emphasis>use a bidirectional association</emphasis> with the collection "
+"mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend="
+"\"collections-bidirectional\"/>."
+msgstr ""
+"Se a coluna da chave exterior de uma associação <literal><one-to-many>"
+"</literal> for declarada como <literal>NOT NULL</literal>, você deve "
+"declarar a <literal><key></literal> mapeando <literal>not-null=\"true"
+"\"</literal> ou <emphasis>use uma associação bidirecional</emphasis> com o "
+"mapeamento da coleção marcado como <literal>inverse=\"true\"</literal>. Veja "
+"a discussão das associações bidirecionais mais tarde neste mesmo capítulo."
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, fuzzy, no-c-format
+msgid ""
+"Apart from the <literal><set> </literal>tag as shown in <xref linkend="
+"\"example.collections.set\"/>, there is also <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> and <literal><primitive-array></"
+"literal> mapping elements. The <literal><map></literal> element is "
+"representative:"
+msgstr ""
"Além do <literal><set></literal>, existe também os elementos de "
"mapeamento <literal><list></literal>, <literal><map></literal>, "
"<literal><bag></literal>, <literal><array></literal> and "
"<literal><primitive-array></literal>. O elemento <literal><map></"
"literal> é de representação:"
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, no-c-format
+msgid ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:266
#, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr "<literal>name</literal>: o nome da propriedade da coleção"
#. Tag: para
+#: collection_mapping.xml:270
#, no-c-format
msgid ""
"<literal>table</literal> (optional - defaults to property name): the name of "
@@ -278,6 +603,7 @@
"nome da tabela de coleção. Isto não é usado para associações um-para-muitos."
#. Tag: para
+#: collection_mapping.xml:276
#, no-c-format
msgid ""
"<literal>schema</literal> (optional): the name of a table schema to override "
@@ -287,6 +613,7 @@
"sobrescrever o esquema declarado no elemento raíz."
#. Tag: para
+#: collection_mapping.xml:281
#, no-c-format
msgid ""
"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
@@ -302,6 +629,7 @@
"para coleções bem grandes)."
#. Tag: para
+#: collection_mapping.xml:290
#, no-c-format
msgid ""
"<literal>inverse</literal> (optional - defaults to <literal>false</"
@@ -313,6 +641,7 @@
"bidirecional."
#. Tag: para
+#: collection_mapping.xml:296
#, no-c-format
msgid ""
"<literal>cascade</literal> (optional - defaults to <literal>none</literal>): "
@@ -322,6 +651,7 @@
"habilita operações para cascata para entidades filho."
#. Tag: para
+#: collection_mapping.xml:302
#, no-c-format
msgid ""
"<literal>sort</literal> (optional): specifies a sorted collection with "
@@ -331,12 +661,13 @@
"ordem de escolha<literal>natural</literal> ou uma dada classe comparatória."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:308
+#, fuzzy, no-c-format
msgid ""
-"<literal>order-by</literal> (optional, JDK1.4 only): specifies a table "
-"column or columns that define the iteration order of the <literal>Map</"
-"literal>, <literal>Set</literal> or bag, together with an optional "
-"<literal>asc</literal> or <literal>desc</literal>."
+"<literal>order-by</literal> (optional): specifies a table column or columns "
+"that define the iteration order of the <literal>Map</literal>, <literal>Set</"
+"literal> or bag, together with an optional <literal>asc</literal> or "
+"<literal>desc</literal>."
msgstr ""
"<literal>order-by</literal> (opcional, somente JDK1.4): especifica uma "
"coluna da tabela (ou colunas) que define a ordem de iteração do "
@@ -344,6 +675,7 @@
"<literal>asc</literal> ou <literal>desc</literal> opcional."
#. Tag: para
+#: collection_mapping.xml:316
#, no-c-format
msgid ""
"<literal>where</literal> (optional): specifies an arbitrary SQL "
@@ -356,6 +688,7 @@
"Isto é útil se a coleção tiver somente um subconjunto dos dados disponíveis."
#. Tag: para
+#: collection_mapping.xml:324
#, no-c-format
msgid ""
"<literal>fetch</literal> (optional, defaults to <literal>select</literal>): "
@@ -367,6 +700,7 @@
"por subseleção sequencial."
#. Tag: para
+#: collection_mapping.xml:331
#, no-c-format
msgid ""
"<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): "
@@ -377,6 +711,7 @@
"coleção."
#. Tag: para
+#: collection_mapping.xml:337
#, no-c-format
msgid ""
"<literal>access</literal> (optional - defaults to <literal>property</"
@@ -388,6 +723,7 @@
"valor de propriedade. "
#. Tag: para
+#: collection_mapping.xml:343
#, no-c-format
msgid ""
"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
@@ -401,6 +737,7 @@
"sempre bom desabilitar esta configuração."
#. Tag: para
+#: collection_mapping.xml:351
#, no-c-format
msgid ""
"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
@@ -413,19 +750,31 @@
"nunca mudam. Isto permite uma otimização mínima do desempenho em alguns "
"casos."
+#. Tag: para
+#: collection_mapping.xml:360
+#, no-c-format
+msgid ""
+"After exploring the basic mapping of collections in the preceding paragraphs "
+"we will now focus details like physical mapping considerations, indexed "
+"collections and collections of value types."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr "Chaves Externas de Coleção"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:367
+#, fuzzy, no-c-format
msgid ""
-"Collection instances are distinguished in the database by the foreign key of "
-"the entity that owns the collection. This foreign key is referred to as the "
-"<emphasis>collection key column</emphasis>, or columns, of the collection "
-"table. The collection key column is mapped by the <literal><key></"
-"literal> element."
+"On the database level collection instances are distinguished by the foreign "
+"key of the entity that owns the collection. This foreign key is referred to "
+"as the <emphasis>collection key column</emphasis>, or columns, of the "
+"collection table. The collection key column is mapped by the "
+"<literal>@JoinColumn</literal> annotation respectively the <literal><"
+"key></literal> XML element."
msgstr ""
"Instâncias de coleção são distinguidas no banco de dados pela chave exterior "
"da entidade que possui a coleção. Esta chave exterior é referida como a "
@@ -434,177 +783,301 @@
"key></literal>."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:374
+#, fuzzy, no-c-format
msgid ""
"There can be a nullability constraint on the foreign key column. For most "
"collections, this is implied. For unidirectional one-to-many associations, "
-"the foreign key column is nullable by default, so you may need to specify "
-"<literal>not-null=\"true\"</literal>."
+"the foreign key column is nullable by default, so you may need to specify"
msgstr ""
"Pode existir uma restrição de nulabilidade na coluna da chave exterior. Para "
"a maioria das coleções, isto está implícito. Para associações unidirecionais "
"um-para-muitos, a coluna de chave estrangeira é anulável por padrão, "
"portanto você pode precisar especificar <literal>not-null=\"true\"</literal>."
+#. Tag: programlisting
+#: collection_mapping.xml:379
+#, no-c-format
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:381
#, no-c-format
-msgid "The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
-msgstr "A restrição da chave exterior pode usar <literal>ON DELETE CASCADE</literal>."
+msgid "<para>or</para>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:383
+#, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:385
+#, fuzzy, no-c-format
+msgid ""
+"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In "
+"XML this can be expressed via:"
+msgstr ""
+"A restrição da chave exterior pode usar <literal>ON DELETE CASCADE</literal>."
+
+#. Tag: programlisting
+#: collection_mapping.xml:388
#, no-c-format
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:390
+#, no-c-format
msgid ""
-"See the previous chapter for a full definition of the <literal><key></"
-"literal> element."
+"In annotations the Hibernate specific annotation @OnDelete has to be used."
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:393
+#, no-c-format
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:395
+#, fuzzy, no-c-format
+msgid ""
+"See <xref lang=\"\" linkend=\"section.key\"/> for more information about the "
+"<literal><key></literal> element."
+msgstr ""
"Veja nos capítulos anteriores para uma completa definição do "
"elemento<literal><key></literal>."
#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
-msgid "Collection elements"
-msgstr "Elementos de coleção"
+msgid "Indexed collections"
+msgstr "Coleções indexadas"
#. Tag: para
+#: collection_mapping.xml:402
#, no-c-format
msgid ""
-"Collections can contain almost any other Hibernate type, including: basic "
-"types, custom types, components and references to other entities. This is an "
-"important distinction. An object in a collection might be handled with "
-"\"value\" semantics (its life cycle fully depends on the collection owner), "
-"or it might be a reference to another entity with its own life cycle. In the "
-"latter case, only the \"link\" between the two objects is considered to be a "
-"state held by the collection."
+"In the following paragraphs we have a closer at the indexed collections "
+"<classname>List</classname> and <classname>Map</classname> how the their "
+"index can be mapped in Hibernate."
msgstr ""
-"As coleções podem conter quase qualquer outro tipo de Hibernate, incluindo "
-"todos os tipos básicos, tipos padronizados, e é claro, referências a outras "
-"entidades. Isto é uma distinção importante: um objeto em uma coleção pode "
-"ser manipulada com as semânticas \"valor\" (seu ciclo de vida depende "
-"totalmente do proprietário da coleção), ou ele pode ser uma referência à "
-"outra entidade, com seu próprio ciclo de vida. No último caso, somente o "
-"\"link\" entre os dois objetos é considerado como estado seguro pela "
-"coleção. "
+#. Tag: title
+#: collection_mapping.xml:407
+#, no-c-format
+msgid "Lists"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
+msgid "Lists can be mapped in two different ways:"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:413
+#, no-c-format
+msgid "as ordered lists, where the order is not materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:418
+#, no-c-format
+msgid "as indexed lists, where the order is materialized in the database"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:423
+#, no-c-format
msgid ""
-"The contained type is referred to as the <emphasis>collection element type</"
-"emphasis>. Collection elements are mapped by <literal><element></"
-"literal> or <literal><composite-element></literal>, or in the case of "
-"entity references, with <literal><one-to-many></literal> or "
-"<literal><many-to-many></literal>. The first two map elements with "
-"value semantics, the next two are used to map entity associations."
+"To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> "
+"to your property. This annotation takes as parameter a list of comma "
+"separated properties (of the target entity) and orders the collection "
+"accordingly (eg <code>firstname asc, age desc</code>), if the string is "
+"empty, the collection will be ordered by the primary key of the target "
+"entity."
msgstr ""
-"O tipo contido é referido como <emphasis>tipo de elemento de coleção</"
-"emphasis>. Os elementos de coleção são mapeados pelo <literal><element>"
-"</literal> ou <literal><composite-element></literal>,ou no caso de "
-"referências de entidade, com <literal><one-to-many></literal> "
-"ou<literal><many-to-many></literal>. Os primeiros dois, mapeiam "
-"elementos com semânticas de valor, os dois outros são usados para mapear "
-"associações de entidade."
#. Tag: title
+#: collection_mapping.xml:432
#, no-c-format
-msgid "Indexed collections"
-msgstr "Coleções indexadas"
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:434
#, no-c-format
msgid ""
-"All collection mappings, except those with set and bag semantics, need an "
-"<emphasis>index column</emphasis> in the collection table. An index column "
-"is a column that maps to an array index, or <literal>List</literal> index, "
-"or <literal>Map</literal> key. The index of a <literal>Map</literal> may be "
-"of any basic type, mapped with <literal><map-key></literal>. It can be "
-"an entity reference mapped with <literal><map-key-many-to-many></"
-"literal>, or it can be a composite type mapped with <literal><composite-"
-"map-key></literal>. The index of an array or list is always of type "
-"<literal>integer</literal> and is mapped using the <literal><list-"
-"index></literal> element. The mapped column contains sequential integers "
-"that are numbered from zero by default."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderBy(\"number\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"Todos os mapeamentos de coleção, exceto aqueles com semânticas de conjunto e "
-"bag, precisam de uma <emphasis>coluna índice</emphasis> na tabela de "
-"coleção, uma coluna que mapeia para um índice matriz ou índice "
-"<literal>List</literal> ou chave de <literal>Map</literal>. O índice de um "
-"<literal>Map</literal> pode ser de qualquer tipo, mapeado com <literal><"
-"map-key></literal>, pode ser uma referência de entidade mapeada com "
-"<literal><map-key-many-to-many></literal>, ou pode ser um tipo "
-"composto, mapeado com <literal><composite-map-key></literal>. O índice "
-"de uma matriz ou lista é sempre do tipo <literal>integer</literal> e é "
-"mapeado usando o elemento <literal><list-index></literal>. As colunas "
-"mapeadas contém inteiros sequenciais, dos quais são numerados a partir do "
-"zero, por padrão. "
#. Tag: para
+#: collection_mapping.xml:437
#, no-c-format
msgid ""
-"<literal>column_name</literal> (required): the name of the column holding "
-"the collection index values."
+"To store the index value in a dedicated column, use the <classname>@javax."
+"persistence.OrderColumn</classname> annotation on your property. This "
+"annotations describes the column name and attributes of the column keeping "
+"the index value. This column is hosted on the table containing the "
+"association foreign key. If the column name is not specified, the default is "
+"the name of the referencing property, followed by underscore, followed by "
+"<literal>ORDER</literal> (in the following example, it would be "
+"<literal>orders_ORDER</literal>)."
msgstr ""
-"<literal>column_name</literal> (requerido): O nome da coluna que mantém os "
-"valores do índice da coleção."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:448
#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
msgid ""
-"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
-"value of the index column that corresponds to the first element of the list "
-"or array."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderColumn(name=\"orders_index\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|--------------| |----------|\n"
+"| Order | | Customer |\n"
+"|--------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"| orders_order |\n"
+"|--------------|"
msgstr ""
-"<literal>base</literal> (opcional - padrão para <literal>0</literal>): o "
-"valor da coluna de índice que corresponde ao primeiro elemento da lista ou "
-"matriz."
#. Tag: para
+#: collection_mapping.xml:455
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection index values."
+"We recommend you to convert <classname>the legacy @org.hibernate.annotations."
+"IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless "
+"you are making use of the base property. The <literal>base</literal> "
+"property lets you define the index value of the first element (aka as base "
+"index). The usual value is <literal>0</literal> or <literal>1</literal>. The "
+"default is 0 like in Java."
msgstr ""
-"<literal>column</literal>(opcional): o nome da coluna que mnatém os valores "
-"do índice de coleção."
#. Tag: para
+#: collection_mapping.xml:464
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
-"key of the map."
+"Looking again at the Hibernate mapping file equivalent, the index of an "
+"array or list is always of type <literal>integer</literal> and is mapped "
+"using the <literal><list-index></literal> element. The mapped column "
+"contains sequential integers that are numbered from zero by default."
msgstr ""
-"<literal>formula</literal> (opcional): Uma fórmula SQL usada para avaliar a "
-"chave ou o mapa."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:471
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
-msgstr "<literal>type</literal> (requerido): o tipo de chaves de mapa."
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:481
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the foreign key column for "
-"the collection index values."
+"<list-index\n"
+" column=\"column_name\"\n"
+" base=\"0|1|...\"/>"
msgstr ""
-"<literal>column</literal> (opcional): o nome de uma coluna de chave exterior "
-"para os valores do índice de coleção."
#. Tag: para
+#: collection_mapping.xml:485
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
-"foreign key of the map key."
+"<literal>column_name</literal> (required): the name of the column holding "
+"the collection index values."
msgstr ""
-"<literal>formula</literal> (opcional): uma fórmula SQ usada para avaliar a "
-"chave exterior da chave do mapa."
+"<literal>column_name</literal> (requerido): O nome da coluna que mantém os "
+"valores do índice da coleção."
#. Tag: para
+#: collection_mapping.xml:490
#, no-c-format
-msgid "<literal>class</literal> (required): the entity class used as the map key."
+msgid ""
+"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
+"value of the index column that corresponds to the first element of the list "
+"or array."
msgstr ""
-"<literal>class</literal> (requerido): a classe da entidade usada como chave "
-"do mapa."
+"<literal>base</literal> (opcional - padrão para <literal>0</literal>): o "
+"valor da coluna de índice que corresponde ao primeiro elemento da lista ou "
+"matriz."
#. Tag: para
+#: collection_mapping.xml:498
#, no-c-format
msgid ""
"If your table does not have an index column, and you still wish to use "
@@ -620,309 +1093,589 @@
"escolhida de forma opcional ou ordenada. "
#. Tag: title
+#: collection_mapping.xml:506
#, no-c-format
-msgid "Collections of values and many-to-many associations"
-msgstr "Coleções de valores e associações muitos-para-muitos"
+msgid "Maps"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:508
#, no-c-format
msgid ""
-"Any collection of values or many-to-many associations requires a dedicated "
-"<emphasis>collection table</emphasis> with a foreign key column or columns, "
-"<emphasis>collection element column</emphasis> or columns, and possibly an "
-"index column or columns."
+"The question with <classname>Map</classname>s is where the key value is "
+"stored. There are everal options. Maps can borrow their keys from one of the "
+"associated entity properties or have dedicated columns to store an explicit "
+"key."
msgstr ""
-"Quaisquer valores de coleção ou associação muitos-para-muitos requerem uma "
-"<emphasis>tabela de coleção</emphasis> dedicada, com uma coluna de chave "
-"exterior ou colunas, <emphasis>collection element column</emphasis> ou "
-"colunas e possivelmente uma coluna de índice ou colunas."
#. Tag: para
+#: collection_mapping.xml:513
#, no-c-format
msgid ""
-"For a collection of values use the <literal><element></literal> tag. "
-"For example:"
+"To use one of the target entity property as a key of the map, use "
+"<literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</"
+"literal> is a property name in the target entity. When using "
+"<literal>@MapKey</literal> without the name attribuate, 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, "
+"because the map key 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."
msgstr ""
-"Para uma coleção com valores, utilizamos a tag <literal><element></"
-"literal>. Por exemplo:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:525
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the column holding the "
-"collection element values."
+"Use of target entity property as map key via <classname>@MapKey</classname>"
msgstr ""
-"<literal>column</literal> (opcional): o nome da coluna que mantém os valores "
-"do elemento da coleção."
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:528
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @MapKey(name=\"number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> order) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
msgstr ""
-"<literal>formula</literal> (opcional): uma fórmula usada para avaliar o "
-"elemento."
#. Tag: para
+#: collection_mapping.xml:531
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
-msgstr "<literal>type</literal> (requerido): o tipo do elemento de coleção."
+msgid ""
+"Alternatively the map key is mapped to a dedicated column or columns. In "
+"order to customize the mapping use one of the following annotations:"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:537
#, no-c-format
msgid ""
-"A <emphasis>many-to-many association</emphasis> is specified using the "
-"<literal><many-to-many></literal> element."
+"@<classname>MapKeyColumn</classname> if the map key is a basic type. If you "
+"don't specify the column name, the name of the property followed by "
+"underscore followed by <literal>KEY</literal> is used (for example "
+"<literal>orders_KEY</literal>)."
msgstr ""
-"A <emphasis>associação muitos-para-muitos</emphasis> é especificada usando o "
-"elemento <literal><many-to-many></literal>. "
#. Tag: para
+#: collection_mapping.xml:544
#, no-c-format
msgid ""
-"<literal>column</literal> (optional): the name of the element foreign key "
-"column."
+"<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</"
+"classname> if the map key type is respectively an enum or a <classname>Date</"
+"classname>."
msgstr ""
-"<literal>column</literal> (opcional): o nome da coluna da chave exterior do "
-"elemento."
#. Tag: para
+#: collection_mapping.xml:550
#, no-c-format
msgid ""
-"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
-"element foreign key value."
+"<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</"
+"classname> if the map key type is another entity."
msgstr ""
-"<literal>formula</literal> (opcional): uma fórmula SQL usada para avaliar o "
-"valor da chave exterior do elemento."
#. Tag: para
+#: collection_mapping.xml:555
#, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
-msgstr "<literal>class</literal> (requerido): O nome da classe associada. "
+msgid ""
+"<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</"
+"classname> when the map key is a embeddable object. Use <literal>key.</"
+"literal> as a prefix for your embeddable object property names."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:562
#, no-c-format
msgid ""
-"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
-"enables outer-join or sequential select fetching for this association. This "
-"is a special case; for full eager fetching in a single <literal>SELECT</"
-"literal> of an entity and its many-to-many relationships to other entities, "
-"you would enable <literal>join</literal> fetching,not only of the collection "
-"itself, but also with this attribute on the <literal><many-to-many></"
-"literal> nested element."
+"You can also use <classname>@MapKeyClass</classname> to define the type of "
+"the key if you don't use generics."
msgstr ""
-"<literal>fetch</literal> (opcional - padrão para <literal>join</literal>): "
-"ativa a busca de seleção seqüencial ou união exterior para esta associação. "
-"Isto é um caso especial; para uma busca completa num <literal>SELECT</"
-"literal> único de uma entidade e suas relações muitos-para-muitos com outras "
-"entidades, você deverá ativar a busca <literal>join</literal>, não apenas a "
-"própria coleção, mas também este atributo no elemento aninhado <literal><"
-"many-to-many></literal>."
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:566
#, no-c-format
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
msgid ""
-"<literal>unique</literal> (optional): enables the DDL generation of a unique "
-"constraint for the foreign-key column. This makes the association "
-"multiplicity effectively one-to-many."
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+" @MapKeyColumn(name=\"orders_number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> orders) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------| |---------------|\n"
+"| Order | | Customer | | Cust_Order |\n"
+"|-------------| |----------| |---------------|\n"
+"| id | | id | | customer_id |\n"
+"| number | |----------| | order_id |\n"
+"| customer_id | | orders_number |\n"
+"|-------------| |---------------|"
msgstr ""
-"<literal>unique</literal> (opcional): ativa a geração DDl de uma restrição "
-"única para a coluna de chave exterior. Isto realiza efetivamente a "
-"multiplicidade da associação um-para-muitos."
#. Tag: para
+#: collection_mapping.xml:573
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how foreign keys that reference missing rows will be "
-"handled: <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</"
+"classname> to the new standard approach described above"
msgstr ""
-"<literal>not-found</literal> (opcional - padrão para <literal>exception</"
-"literal>): especifica como os identificadores em cache que referenciam as "
-"linhas faltantes serão tratadas: <literal>ignore</literal> tratará a linha "
-"faltante como uma associação nula. "
#. Tag: para
+#: collection_mapping.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files there exists equivalent concepts to the "
+"descibed annotations. You have to use <literal><map-key></literal>, "
+"<literal><map-key-many-to-many></literal> and <literal><composite-"
+"map-key></literal>. <literal><map-key></literal> is used for any "
+"basic type, <literal><map-key-many-to-many></literal> for an entity "
+"reference and <literal><composite-map-key></literal> for a composite "
+"type."
+msgstr ""
+"Além do <literal><set></literal>, existe também os elementos de "
+"mapeamento <literal><list></literal>, <literal><map></literal>, "
+"<literal><bag></literal>, <literal><array></literal> and "
+"<literal><primitive-array></literal>. O elemento <literal><map></"
+"literal> é de representação:"
+
+#. Tag: title
+#: collection_mapping.xml:590
#, no-c-format
+msgid "map-key xml mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
msgid ""
-"<literal>entity-name</literal> (optional): the entity name of the associated "
-"class, as an alternative to <literal>class</literal>."
+"<map-key\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"type_name\"\n"
+" node=\"@attribute-name\"\n"
+" length=\"N\"/>"
msgstr ""
-"<literal>entity-name</literal> (opcional): O nome da entidade da classe "
-"associada, como uma alternativa para a <literal>class</literal>. "
#. Tag: para
+#: collection_mapping.xml:605
#, no-c-format
msgid ""
-"<literal>property-ref</literal> (optional): the name of a property of the "
-"associated class that is joined to this foreign key. If not specified, the "
-"primary key of the associated class is used."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection index values."
msgstr ""
-"<literal>property-ref</literal> (opcional): o nome de uma propriedade de "
-"classe associada que é unida a esta chave exterior. caso não especificada, a "
-"chave primária da classe associada será usada."
+"<literal>column</literal>(opcional): o nome da coluna que mnatém os valores "
+"do índice de coleção."
#. Tag: para
+#: collection_mapping.xml:610
#, no-c-format
-msgid "Here are some examples."
-msgstr "Segue abaixo alguns exemplos."
+msgid ""
+"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
+"key of the map."
+msgstr ""
+"<literal>formula</literal> (opcional): Uma fórmula SQL usada para avaliar a "
+"chave ou o mapa."
#. Tag: para
+#: collection_mapping.xml:615
#, no-c-format
-msgid "A set of strings:"
-msgstr "Um conjunto de strings:"
+msgid "<literal>type</literal> (required): the type of the map keys."
+msgstr "<literal>type</literal> (requerido): o tipo de chaves de mapa."
+#. Tag: title
+#: collection_mapping.xml:623
+#, fuzzy, no-c-format
+msgid "map-key-many-to-many"
+msgstr "Muitos-para-muitos"
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
+#, no-c-format
+msgid ""
+"<map-key-many-to-many\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" class=\"ClassName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:638
#, no-c-format
msgid ""
-"A bag containing integers with an iteration order determined by the "
-"<literal>order-by</literal> attribute:"
+"<literal>column</literal> (optional): the name of the foreign key column for "
+"the collection index values."
msgstr ""
-"Uma bag contendo inteiros com uma ordem de iteração determinada pelo "
-"atributo <literal>order-by</literal>):"
+"<literal>column</literal> (opcional): o nome de uma coluna de chave exterior "
+"para os valores do índice de coleção."
#. Tag: para
+#: collection_mapping.xml:643
#, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
-msgstr "Uma matriz de entidades, neste caso, uma associação muitos-para-muitos: "
+msgid ""
+"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
+"foreign key of the map key."
+msgstr ""
+"<literal>formula</literal> (opcional): uma fórmula SQ usada para avaliar a "
+"chave exterior da chave do mapa."
#. Tag: para
+#: collection_mapping.xml:648
#, no-c-format
-msgid "A map from string indices to dates:"
-msgstr "Um mapa desde índices de strigs até datas:"
+msgid ""
+"<literal>class</literal> (required): the entity class used as the map key."
+msgstr ""
+"<literal>class</literal> (requerido): a classe da entidade usada como chave "
+"do mapa."
+#. Tag: title
+#: collection_mapping.xml:658
+#, fuzzy, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr "Coleções de valores e associações muitos-para-muitos"
+
#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
-msgstr "Uma lista de componentes (isto será discutido no próximo capítulo):"
+msgid ""
+"In some situations you don't need to associate two entities but simply "
+"create a collection of basic types or embeddable objects. Use the "
+"<classname>@ElementCollection</classname> for this case."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:665
#, no-c-format
-msgid "One-to-many associations"
-msgstr "Associações um-para-muitos"
+msgid ""
+"Collection of basic types mapped via <classname>@ElementCollection</"
+"classname>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @Column(name=\"nickname\")\n"
+" public Set<String> getNicknames() { ... } \n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:671
#, no-c-format
msgid ""
-"A <emphasis>one-to-many association</emphasis> links the tables of two "
-"classes via a foreign key with no intervening collection table. This mapping "
-"loses certain semantics of normal Java collections:"
+"The collection table holding the collection data is set using the "
+"<classname>@CollectionTable</classname> annotation. If omitted the "
+"collection table name defaults to the concatenation of the name of the "
+"containing entity and the name of the collection attribute, separated by an "
+"underscore. In our example, it would be <literal>User_nicknames</literal>."
msgstr ""
-"Uma <emphasis>associação um para muitos</emphasis> liga as tabelas das duas "
-"classes através de uma chave exterior, sem a intervenção da tabela de "
-"coleção. Este mapeamento perde um pouco da semântica das coleções normais do "
-"Java: "
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot belong to more than one "
-"instance of the collection."
+"The column holding the basic type is set using the <classname>@Column</"
+"classname> annotation. If omitted, the column name defaults to the property "
+"name: in our example, it would be <literal>nicknames</literal>."
msgstr ""
-"Uma instância de classes entidades contidas, podem não pertencer à mais de "
-"uma instância da coleção. "
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
msgid ""
-"An instance of the contained entity class cannot appear at more than one "
-"value of the collection index."
+"But you are not limited to basic types, the collection type can be any "
+"embeddable object. To override the columns of the embeddable object in the "
+"collection table, use the <classname>@AttributeOverride</classname> "
+"annotation."
msgstr ""
-"Uma instância da classe de entidade contida pode não aparecer em mais de um "
-"valor do índice da coleção. "
+#. Tag: title
+#: collection_mapping.xml:689
+#, no-c-format
+msgid "@ElementCollection for embeddable objects"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:691
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street"
+"\"))\n"
+" })\n"
+" public Set<Address> getAddresses() { ... } \n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" public String getStreet1() {...}\n"
+" [...]\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:694
#, no-c-format
+msgid "Such an embeddable object cannot contains a collection itself."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:698
+#, no-c-format
msgid ""
-"An association from <literal>Product</literal> to <literal>Part</literal> "
-"requires the existence of a foreign key column and possibly an index column "
-"to the <literal>Part</literal> table. A <literal><one-to-many></"
-"literal> tag indicates that this is a one-to-many association."
+"in <classname>@AttributeOverride</classname>, you must use the "
+"<literal>value.</literal> prefix to override properties of the embeddable "
+"object used in the map value and the <literal>key.</literal> prefix to "
+"override properties of the embeddable object used in the map key."
msgstr ""
-"Uma associação a partir do <literal>Produto</literal> até a <literal>Parte</"
-"literal> requer a existência de uma coluna de chave exterior e possivelmente "
-"uma coluna de índice para a tabela <literal>Part</literal> Uma tag "
-"<literal><one-to-many></literal> indica que esta é uma associação um "
-"para muitos."
+#. Tag: programlisting
+#: collection_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" @ElementCollection\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"key.street1\", column=@Column(name="
+"\"fld_street\")),\n"
+" @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note"
+"\"))\n"
+" })\n"
+" public Map<Address,Rating> getFavHomes() { ... }"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:708
#, no-c-format
msgid ""
-"<literal>not-found</literal> (optional - defaults to <literal>exception</"
-"literal>): specifies how cached identifiers that reference missing rows will "
-"be handled. <literal>ignore</literal> will treat a missing row as a null "
-"association."
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"CollectionOfElements</classname> to the new <classname>@ElementCollection</"
+"classname> annotation."
msgstr ""
-"<literal>not-found</literal> (opcional - padrão para <literal>exception</"
-"literal>): Especifica como os identificadores em cache que referenciam as "
-"linhas faltantes serão tratadas: <literal>ignore</literal> tratará a linha "
-"faltante como uma associação nula. "
#. Tag: para
+#: collection_mapping.xml:714
+#, fuzzy, no-c-format
+msgid ""
+"Using the mapping file approach a collection of values is mapped using the "
+"<literal><element></literal> tag. For example:"
+msgstr ""
+"Para uma coleção com valores, utilizamos a tag <literal><element></"
+"literal>. Por exemplo:"
+
+#. Tag: title
+#: collection_mapping.xml:718
#, no-c-format
+msgid "<element> tag for collection values using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
msgid ""
-"The <literal><one-to-many></literal> element does not need to declare "
-"any columns. Nor is it necessary to specify the <literal>table</literal> "
-"name anywhere."
+"<element\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"typename\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
msgstr ""
-"Note que o elemento <literal><one-to-many></literal> não precisa "
-"declarar qualquer coluna. Nem é necessário especificar o nome da "
-"<literal>table</literal> em qualquer lugar. "
#. Tag: para
+#: collection_mapping.xml:734
#, no-c-format
msgid ""
-"If the foreign key column of a <literal><one-to-many></literal> "
-"association is declared <literal>NOT NULL</literal>, you must declare the "
-"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
-"or <emphasis>use a bidirectional association</emphasis> with the collection "
-"mapping marked <literal>inverse=\"true\"</literal>. See the discussion of "
-"bidirectional associations later in this chapter for more information."
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection element values."
msgstr ""
-"Se a coluna da chave exterior de uma associação <literal><one-to-many>"
-"</literal> for declarada como <literal>NOT NULL</literal>, você deve "
-"declarar a <literal><key></literal> mapeando <literal>not-null=\"true"
-"\"</literal> ou <emphasis>use uma associação bidirecional</emphasis> com o "
-"mapeamento da coleção marcado como <literal>inverse=\"true\"</literal>. Veja "
-"a discussão das associações bidirecionais mais tarde neste mesmo capítulo."
+"<literal>column</literal> (opcional): o nome da coluna que mantém os valores "
+"do elemento da coleção."
#. Tag: para
+#: collection_mapping.xml:739
#, no-c-format
msgid ""
-"The following example shows a map of <literal>Part</literal> entities by "
-"name, where <literal>partName</literal> is a persistent property of "
-"<literal>Part</literal>. Notice the use of a formula-based index:"
+"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
+"element."
msgstr ""
-"Este exemplo demonstra um mapa das entidades <literal>Part</literal> por "
-"nome, onde <literal>partName</literal> é uma propriedade persistente de "
-"<literal>Part</literal>. Note que o uso de um índice baseado em fórmula:"
+"<literal>formula</literal> (opcional): uma fórmula usada para avaliar o "
+"elemento."
+#. Tag: para
+#: collection_mapping.xml:744
+#, no-c-format
+msgid "<literal>type</literal> (required): the type of the collection element."
+msgstr "<literal>type</literal> (requerido): o tipo do elemento de coleção."
+
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr "Mapeamentos de coleção avançados."
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr "Coleções escolhidas"
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
msgid ""
"Hibernate supports collections implementing <literal>java.util.SortedMap</"
-"literal> and <literal>java.util.SortedSet</literal>. You must specify a "
-"comparator in the mapping file:"
+"literal> and <literal>java.util.SortedSet</literal>. With annotations you "
+"declare a sort comparator using <literal>@Sort</literal>. You chose between "
+"the comparator types unsorted, natural or custom. If you want to use your "
+"own comparator implementation, you'll also have to specify 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 ""
-"O Hibernate suporta a implementação de coleções <literal>java.util."
-"SortedMap</literal> e <literal>java.util.SortedSet</literal>. Você deve "
-"especificar um comparador no arquivo de mapeamento:"
+#. Tag: title
+#: collection_mapping.xml:770
+#, fuzzy, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr "Coleções escolhidas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+"@JoinColumn(name=\"CUST_ID\")\n"
+"@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+"public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
msgid ""
+"Using Hibernate mapping files you specify a comparator in the mapping file "
+"with <literal><sort></literal>:"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:779
+#, fuzzy, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr "Coleções escolhidas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, no-c-format
+msgid ""
+"<set name=\"aliases\"\n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:784
+#, no-c-format
+msgid ""
"Allowed values of the <literal>sort</literal> attribute are "
"<literal>unsorted</literal>, <literal>natural</literal> and the name of a "
"class implementing <literal>java.util.Comparator</literal>."
@@ -932,6 +1685,7 @@
"<literal>java.util.Comparator</literal>."
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
msgid ""
"Sorted collections actually behave like <literal>java.util.TreeSet</literal> "
@@ -941,14 +1695,15 @@
"TreeSet</literal> ou <literal>java.util.TreeMap</literal>."
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:794
+#, fuzzy, no-c-format
msgid ""
"If you want the database itself to order the collection elements, use the "
"<literal>order-by</literal> attribute of <literal>set</literal>, "
"<literal>bag</literal> or <literal>map</literal> mappings. This solution is "
-"only available under JDK 1.4 or higher and is implemented using "
-"<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This "
-"performs the ordering in the SQL query and not in the memory."
+"implemented using <literal>LinkedHashSet</literal> or "
+"<literal>LinkedHashMap</literal> and performs the ordering in the SQL query "
+"and not in the memory."
msgstr ""
"Se você quiser que o próprio banco de dados ordene os elementos da coleção "
"use a função <literal>order-by</literal> do <literal>set</literal>, "
@@ -958,11 +1713,36 @@
"literal>). Este desempenha a ordenação na consulta SQL, não em memória."
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, no-c-format
+msgid ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr "Nota"
#. Tag: para
+#: collection_mapping.xml:810
#, no-c-format
msgid ""
"The value of the <literal>order-by</literal> attribute is an SQL ordering, "
@@ -972,6 +1752,7 @@
"não uma ordenação."
#. Tag: para
+#: collection_mapping.xml:814
#, no-c-format
msgid ""
"Associations can even be sorted by arbitrary criteria at runtime using a "
@@ -981,11 +1762,27 @@
"tempo de espera usando uma coleção <literal>filter()</literal>:"
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, no-c-format
+msgid ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr "Associações Bidirecionais"
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
msgid ""
"A <emphasis>bidirectional association</emphasis> allows navigation from both "
@@ -997,49 +1794,404 @@
"são suportados: "
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr "Um-para-muitos"
#. Tag: para
+#: collection_mapping.xml:834
#, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr "conjunto ou bag de valor em um dos lados, valor único do outro "
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr "Muitos-para-muitos"
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr "Conjunto ou bag com valor em ambos os lados"
#. Tag: para
+#: collection_mapping.xml:848
#, no-c-format
msgid ""
-"You can specify a bidirectional many-to-many association by mapping two many-"
-"to-many associations to the same database table and declaring one end as "
-"<emphasis>inverse</emphasis>. You cannot select an indexed collection."
+"Often there exists a many to one association which is the owner side of a "
+"bidirectional relationship. The corresponding one to many association is in "
+"this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:854
+#, no-c-format
+msgid "Bidirectional one to many with many to one side as association owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:860
+#, no-c-format
+msgid ""
+"<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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:865
+#, no-c-format
+msgid ""
+"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 not optimized and will produce additional UPDATE "
+"statements."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:872
+#, fuzzy, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr "Associações bidirecionais com coleções indexadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:878
+#, fuzzy, no-c-format
+msgid ""
+"How does the mappping of a bidirectional mapping look like in Hibernate "
+"mapping xml? There you define a bidirectional one-to-many association by "
+"mapping a one-to-many association to the same table column(s) as a many-to-"
+"one association and declaring the many-valued end <literal>inverse=\"true\"</"
+"literal>."
+msgstr ""
+"Você pode definir uma associação bidirecional um para muitos através de uma "
+"associação um-para-muitos indicando as mesmas colunas da tabela que à "
+"associação muitos-para-um e declarando a propriedade <literal>inverse=\"true"
+"\"</literal>."
+
+#. Tag: title
+#: collection_mapping.xml:885
+#, no-c-format
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:890
+#, no-c-format
+msgid ""
+"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
+"does not affect the operation of cascades as these are orthogonal concepts."
+msgstr ""
+"Mapear apenas uma das pontas da associação com <literal>inverse=\"true\"</"
+"literal> não afeta as operações em cascata, uma vez que isto é um conceito "
+"ortogonal."
+
+#. Tag: para
+#: collection_mapping.xml:894
+#, no-c-format
+msgid ""
+"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):"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:903
+#, no-c-format
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:910
+#, no-c-format
+msgid ""
+"In this example <classname>@JoinTable</classname> defines a <literal>name</"
+"literal>, an array of join columns, 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\"). 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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:919
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:938
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:955
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:961
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:966
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files you can map a bidirectional many-to-many "
+"association by mapping two many-to-many associations to the same database "
+"table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
"Você deve especificar uma associação muitos-para-muitos bidirecional, "
"simplesmente mapeando as duas associações muitos-para-muitos para alguma "
"tabela de banco de dados e declarando um dos lados como <emphasis>inverso</"
"emphasis> Voce não poderá selecionar uma coleção indexada."
#. Tag: para
+#: collection_mapping.xml:970
#, no-c-format
+msgid "You cannot select an indexed collection."
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:973
+#, fuzzy, no-c-format
msgid ""
-"Here is an example of a bidirectional many-to-many association that "
-"illustrates how each category can have many items and each item can be in "
-"many categories:"
+"shows a bidirectional many-to-many association that illustrates how each "
+"category can have many items and each item can be in many categories:"
msgstr ""
"Segue aqui um exemplo de uma associação muitos-para-muitos bidirecional. "
"Cada categoria pode ter muitos ítens e cada ítem pode estar em várias "
"categorias: "
+#. Tag: title
+#: collection_mapping.xml:979
+#, no-c-format
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, no-c-format
+msgid ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:984
#, no-c-format
msgid ""
"Changes made only to the inverse end of the association are <emphasis>not</"
@@ -1055,48 +2207,51 @@
"sobre o modelo de objetos do Java e como criamos um relacionamento muitos "
"para muitos em Java:"
-#. Tag: para
-#, no-c-format
-msgid ""
-"The non-inverse side is used to save the in-memory representation to the "
-"database."
-msgstr "A outra ponta é usada para salvar a representação em memória à base de dados."
+#. Tag: title
+#: collection_mapping.xml:992
+#, fuzzy, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr "Coleções de valores e associações muitos-para-muitos"
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:995
#, no-c-format
msgid ""
-"You can define a bidirectional one-to-many association by mapping a one-to-"
-"many association to the same table column(s) as a many-to-one association "
-"and declaring the many-valued end <literal>inverse=\"true\"</literal>."
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
msgstr ""
-"Você pode definir uma associação bidirecional um para muitos através de uma "
-"associação um-para-muitos indicando as mesmas colunas da tabela que à "
-"associação muitos-para-um e declarando a propriedade <literal>inverse=\"true"
-"\"</literal>."
#. Tag: para
+#: collection_mapping.xml:998
#, no-c-format
msgid ""
-"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
-"does not affect the operation of cascades as these are orthogonal concepts."
+"The non-inverse side is used to save the in-memory representation to the "
+"database."
msgstr ""
-"Mapear apenas uma das pontas da associação com <literal>inverse=\"true\"</"
-"literal> não afeta as operações em cascata, uma vez que isto é um conceito "
-"ortogonal."
+"A outra ponta é usada para salvar a representação em memória à base de dados."
#. Tag: title
+#: collection_mapping.xml:1003
#, no-c-format
msgid "Bidirectional associations with indexed collections"
msgstr "Associações bidirecionais com coleções indexadas"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1005
+#, fuzzy, no-c-format
msgid ""
-"A bidirectional association where one end is represented as a <literal><"
-"list></literal> or <literal><map></literal>, requires special "
-"consideration. If there is a property of the child class that maps to the "
-"index column you can use <literal>inverse=\"true\"</literal> on the "
-"collection mapping:"
+"There are some additional considerations for bidirectional mappings with "
+"indexed collections (where one end is represented as a <literal><list>"
+"</literal> or <literal><map></literal>) when using Hibernate mapping "
+"files. If there is a property of the child class that maps to the index "
+"column you can use <literal>inverse=\"true\"</literal> on the collection "
+"mapping:"
msgstr ""
"Uma associação bidirecional onde um dos lados é representado por uma "
"<literal><list></literal> ou <literal><map></literal> requer uma "
@@ -1104,7 +2259,41 @@
"mapeamento da coluna do índice sem problemas, pode-se continuar usando "
"<literal>inverse=\"true\"</literal> no mapeamento da coleção:"
+#. Tag: title
+#: collection_mapping.xml:1013
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr "Associações bidirecionais com coleções indexadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1018
#, no-c-format
msgid ""
"If there is no such property on the child class, the association cannot be "
@@ -1119,7 +2308,42 @@
"caso, nós não podemos mapear a coleção usando <literal>inverse=\"true\"</"
"literal>. Devemos usar o seguinte mapeamento: "
+#. Tag: title
+#: collection_mapping.xml:1026
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr "Associações bidirecionais com coleções indexadas"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1032
#, no-c-format
msgid ""
"Note that in this mapping, the collection-valued end of the association is "
@@ -1129,11 +2353,13 @@
"responsável pela atualização da chave exterior. "
#. Tag: title
+#: collection_mapping.xml:1037
#, no-c-format
msgid "Ternary associations"
msgstr "Associações Ternárias"
#. Tag: para
+#: collection_mapping.xml:1039
#, no-c-format
msgid ""
"There are three possible approaches to mapping a ternary association. One "
@@ -1142,40 +2368,64 @@
"Há três meios possíveis de se mapear uma associação ternária. Uma é usar um "
"<literal>Map</literal> com uma associação como seu índice: "
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1044
+#, fuzzy, no-c-format
+msgid "Ternary association mapping"
+msgstr "Associações Ternárias"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1046
#, no-c-format
msgid ""
-"A second approach is to remodel the association as an entity class. This is "
-"the most common approach."
+"@Entity\n"
+"public class Company {\n"
+" @Id \n"
+" int id;\n"
+" ...\n"
+" @OneToMany // unidirectional\n"
+" @MapKeyJoinColumn(name=\"employee_id\")\n"
+" Map<Employee, Contract> contracts;\n"
+"}\n"
+"\n"
+"// or\n"
+"\n"
+"<map name=\"contracts\">\n"
+" <key column=\"employer_id\" not-null=\"true\"/>\n"
+" <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+" <one-to-many class=\"Contract\"/>\n"
+"</map>"
msgstr ""
-"A segunda maneira é simplesmente remodelar a associação das classes da "
-"entidade. Esta é a abordagem que utilizamos com mais freqüência. "
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1049
+#, fuzzy, no-c-format
msgid ""
-"A final alternative is to use composite elements, which will be discussed "
-"later."
+"A second approach is to remodel the association as an entity class. This is "
+"the most common approach. A final alternative is to use composite elements, "
+"which will be discussed later."
msgstr ""
-"Uma alternativa final é usar os elementos compostos, que nós discutiremos "
-"mais tarde. "
+"A segunda maneira é simplesmente remodelar a associação das classes da "
+"entidade. Esta é a abordagem que utilizamos com mais freqüência. "
-#. Tag: title
-#, no-c-format
-msgid "<literal>Using an <idbag></literal>"
+#. Tag: literal
+#: collection_mapping.xml:1055
+#, fuzzy, no-c-format
+msgid "Using an <idbag>"
msgstr "<literal>Using an <idbag></literal>"
#. Tag: para
-#, no-c-format
+#: collection_mapping.xml:1057
+#, fuzzy, no-c-format
msgid ""
"The majority of the many-to-many associations and collections of values "
"shown previously all map to tables with composite keys, even though it has "
-"been have suggested that entities should have synthetic identifiers "
-"(surrogate keys). A pure association table does not seem to benefit much "
-"from a surrogate key, although a collection of composite values "
-"<emphasis>might</emphasis>. It is for this reason that Hibernate provides a "
-"feature that allows you to map many-to-many associations and collections of "
-"values to a table with a surrogate key."
+"been suggested that entities should have synthetic identifiers (surrogate "
+"keys). A pure association table does not seem to benefit much from a "
+"surrogate key, although a collection of composite values <emphasis>might</"
+"emphasis>. For this reason Hibernate provides a feature that allows you to "
+"map many-to-many associations and collections of values to a table with a "
+"surrogate key."
msgstr ""
"A maioria das associações e coleções muitos para muitos de valores "
"apresentados anteriormente mapeiam às tabelas com as chaves de composição, "
@@ -1187,6 +2437,7 @@
"valores para uma tabela com uma chave substituta. "
#. Tag: para
+#: collection_mapping.xml:1066
#, no-c-format
msgid ""
"The <literal><idbag></literal> element lets you map a <literal>List</"
@@ -1196,7 +2447,22 @@
"literal> (ou uma <literal>Collection</literal>) com uma semântica de bag. "
"Por exemplo:"
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, no-c-format
+msgid ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1072
#, no-c-format
msgid ""
"An <literal><idbag></literal> has a synthetic id generator, just like "
@@ -1210,6 +2476,7 @@
"para descobrir qual a chave substituta de uma linha em particular."
#. Tag: para
+#: collection_mapping.xml:1077
#, no-c-format
msgid ""
"The update performance of an <literal><idbag></literal> supersedes a "
@@ -1223,6 +2490,7 @@
"individualmente, como um list, map ou set."
#. Tag: para
+#: collection_mapping.xml:1082
#, no-c-format
msgid ""
"In the current implementation, the <literal>native</literal> identifier "
@@ -1234,21 +2502,58 @@
"usando o <literal><idbag></literal>."
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr "Exemplos de coleções"
#. Tag: para
+#: collection_mapping.xml:1105
#, no-c-format
msgid "This section covers collection examples."
msgstr "Esta sessão cobre os exemplos de coleções."
#. Tag: para
+#: collection_mapping.xml:1107
#, no-c-format
-msgid "The following class has a collection of <literal>Child</literal> instances:"
-msgstr "A seguinte classe possui uma coleção de instâncias <literal>Child</literal>:"
+msgid ""
+"The following class has a collection of <literal>Child</literal> instances:"
+msgstr ""
+"A seguinte classe possui uma coleção de instâncias <literal>Child</literal>:"
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid ""
+"Example classes <classname>Parent</classname> and <classname>Child</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" private long id;\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" private long id;\n"
+" private String name\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, no-c-format
msgid ""
"If each child has, at most, one parent, the most natural mapping is a one-to-"
@@ -1257,12 +2562,103 @@
"Se cada Filho tiver no máximo um Pai, o mapeamento natural é uma associação "
"um para muitos:"
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr "Esse mapeamento gera a seguinte definição de tabelas"
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid ""
+"Table definitions for unidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
msgid ""
"If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-"
@@ -1271,49 +2667,518 @@
"Se o pai for <emphasis>obrigatório</emphasis>, use uma associação "
"bidirecional um para muitos:"
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+" \n"
+" @ManyToOne\n"
+" private Parent parent;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr "Repare na restrição <literal>NOT NULL</literal>:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1164
#, no-c-format
msgid ""
-"Alternatively, if this association must be unidirectional you can declare "
-"the <literal>NOT NULL</literal> constraint on the <literal><key></"
-"literal> mapping:"
+"Table definitions for bidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1171
+#, fuzzy, no-c-format
+msgid ""
+"Alternatively, if this association must be unidirectional you can enforce "
+"the <literal>NOT NULL</literal> constraint."
+msgstr ""
"Uma outra alternativa, no caso de você insistir que esta associação deva ser "
"unidirecional, você pode declarar a restrição como <literal>NOT NULL</"
"literal> no mapeamento <literal><key></literal>:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1175
#, no-c-format
msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(optional=false)\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1188
+#, fuzzy, no-c-format
+msgid ""
"On the other hand, if a child has multiple parents, a many-to-many "
-"association is appropriate:"
+"association is appropriate."
msgstr ""
"Por outro lado, se um filho puder ter os múltiplos pais, a associação "
"apropriada será muitos-para-muitos: "
+#. Tag: title
+#: collection_mapping.xml:1192
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using "
+"annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @ManyToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using mapping "
+"files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr "Definições das tabelas:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1208
#, no-c-format
+msgid "Table definitions for many to many releationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, no-c-format
msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+
+#. Tag: para
+#: collection_mapping.xml:1213
+#, fuzzy, no-c-format
+msgid ""
"For more examples and a complete explanation of a parent/child relationship "
-"mapping, see <xref linkend=\"example-parentchild\" /> for more information."
+"mapping, see <xref linkend=\"example-parentchild\"/> for more information. "
+"Even more complex association mappings are covered in the next chapter."
msgstr ""
"Para mais exemplos e um exemplo completo de mapeamento de relacionamento de "
"mestre/detalhe, consulte <xref linkend=\"example-parentchild\" />."
-#. Tag: para
-#, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
-msgstr ""
-"Até mesmo o mapeamento de associações mais complexos serão discutimos no "
-"próximo capítulo."
+#~ msgid ""
+#~ "Hibernate requires that persistent collection-valued fields be declared "
+#~ "as an interface type. For example:"
+#~ msgstr ""
+#~ "O Hibernate requer que os campos de coleções de valor persistente sejam "
+#~ "declarados como um tipo de interface. Por exemplo:"
+#~ msgid "Collection mappings"
+#~ msgstr "Mapeamento de coleção"
+
+#~ msgid ""
+#~ "There are quite a range of mappings that can be generated for collections "
+#~ "that cover many common relational models. We suggest you experiment with "
+#~ "the schema generation tool so that you understand how various mapping "
+#~ "declarations translate to database tables."
+#~ msgstr ""
+#~ "Existem diversas variedades de mapeamento que podem ser gerados para as "
+#~ "coleções, cobrindo muitos modelos relacionais comuns. Sugerimos que você "
+#~ "faça o teste com a ferramenta de geração do esquema para obter uma idéia "
+#~ "de como diversas declarações de mapeamento traduzem as tabelas de banco "
+#~ "de dados. "
+
+#~ msgid "Collection elements"
+#~ msgstr "Elementos de coleção"
+
+#~ msgid ""
+#~ "The contained type is referred to as the <emphasis>collection element "
+#~ "type</emphasis>. Collection elements are mapped by <literal><"
+#~ "element></literal> or <literal><composite-element></literal>, or "
+#~ "in the case of entity references, with <literal><one-to-many></"
+#~ "literal> or <literal><many-to-many></literal>. The first two map "
+#~ "elements with value semantics, the next two are used to map entity "
+#~ "associations."
+#~ msgstr ""
+#~ "O tipo contido é referido como <emphasis>tipo de elemento de coleção</"
+#~ "emphasis>. Os elementos de coleção são mapeados pelo <literal><"
+#~ "element></literal> ou <literal><composite-element></literal>,ou "
+#~ "no caso de referências de entidade, com <literal><one-to-many></"
+#~ "literal> ou<literal><many-to-many></literal>. Os primeiros dois, "
+#~ "mapeiam elementos com semânticas de valor, os dois outros são usados para "
+#~ "mapear associações de entidade."
+
+#~ msgid ""
+#~ "All collection mappings, except those with set and bag semantics, need an "
+#~ "<emphasis>index column</emphasis> in the collection table. An index "
+#~ "column is a column that maps to an array index, or <literal>List</"
+#~ "literal> index, or <literal>Map</literal> key. The index of a "
+#~ "<literal>Map</literal> may be of any basic type, mapped with <literal><"
+#~ "map-key></literal>. It can be an entity reference mapped with "
+#~ "<literal><map-key-many-to-many></literal>, or it can be a composite "
+#~ "type mapped with <literal><composite-map-key></literal>. The index "
+#~ "of an array or list is always of type <literal>integer</literal> and is "
+#~ "mapped using the <literal><list-index></literal> element. The "
+#~ "mapped column contains sequential integers that are numbered from zero by "
+#~ "default."
+#~ msgstr ""
+#~ "Todos os mapeamentos de coleção, exceto aqueles com semânticas de "
+#~ "conjunto e bag, precisam de uma <emphasis>coluna índice</emphasis> na "
+#~ "tabela de coleção, uma coluna que mapeia para um índice matriz ou índice "
+#~ "<literal>List</literal> ou chave de <literal>Map</literal>. O índice de "
+#~ "um <literal>Map</literal> pode ser de qualquer tipo, mapeado com "
+#~ "<literal><map-key></literal>, pode ser uma referência de entidade "
+#~ "mapeada com <literal><map-key-many-to-many></literal>, ou pode ser "
+#~ "um tipo composto, mapeado com <literal><composite-map-key></"
+#~ "literal>. O índice de uma matriz ou lista é sempre do tipo "
+#~ "<literal>integer</literal> e é mapeado usando o elemento <literal><"
+#~ "list-index></literal>. As colunas mapeadas contém inteiros "
+#~ "sequenciais, dos quais são numerados a partir do zero, por padrão. "
+
+#~ msgid ""
+#~ "Any collection of values or many-to-many associations requires a "
+#~ "dedicated <emphasis>collection table</emphasis> with a foreign key column "
+#~ "or columns, <emphasis>collection element column</emphasis> or columns, "
+#~ "and possibly an index column or columns."
+#~ msgstr ""
+#~ "Quaisquer valores de coleção ou associação muitos-para-muitos requerem "
+#~ "uma <emphasis>tabela de coleção</emphasis> dedicada, com uma coluna de "
+#~ "chave exterior ou colunas, <emphasis>collection element column</emphasis> "
+#~ "ou colunas e possivelmente uma coluna de índice ou colunas."
+
+#~ msgid ""
+#~ "A <emphasis>many-to-many association</emphasis> is specified using the "
+#~ "<literal><many-to-many></literal> element."
+#~ msgstr ""
+#~ "A <emphasis>associação muitos-para-muitos</emphasis> é especificada "
+#~ "usando o elemento <literal><many-to-many></literal>. "
+
+#~ msgid ""
+#~ "<literal>column</literal> (optional): the name of the element foreign key "
+#~ "column."
+#~ msgstr ""
+#~ "<literal>column</literal> (opcional): o nome da coluna da chave exterior "
+#~ "do elemento."
+
+#~ msgid ""
+#~ "<literal>formula</literal> (optional): an SQL formula used to evaluate "
+#~ "the element foreign key value."
+#~ msgstr ""
+#~ "<literal>formula</literal> (opcional): uma fórmula SQL usada para avaliar "
+#~ "o valor da chave exterior do elemento."
+
+#~ msgid ""
+#~ "<literal>fetch</literal> (optional - defaults to <literal>join</"
+#~ "literal>): enables outer-join or sequential select fetching for this "
+#~ "association. This is a special case; for full eager fetching in a single "
+#~ "<literal>SELECT</literal> of an entity and its many-to-many relationships "
+#~ "to other entities, you would enable <literal>join</literal> fetching,not "
+#~ "only of the collection itself, but also with this attribute on the "
+#~ "<literal><many-to-many></literal> nested element."
+#~ msgstr ""
+#~ "<literal>fetch</literal> (opcional - padrão para <literal>join</"
+#~ "literal>): ativa a busca de seleção seqüencial ou união exterior para "
+#~ "esta associação. Isto é um caso especial; para uma busca completa num "
+#~ "<literal>SELECT</literal> único de uma entidade e suas relações muitos-"
+#~ "para-muitos com outras entidades, você deverá ativar a busca "
+#~ "<literal>join</literal>, não apenas a própria coleção, mas também este "
+#~ "atributo no elemento aninhado <literal><many-to-many></literal>."
+
+#~ msgid ""
+#~ "<literal>unique</literal> (optional): enables the DDL generation of a "
+#~ "unique constraint for the foreign-key column. This makes the association "
+#~ "multiplicity effectively one-to-many."
+#~ msgstr ""
+#~ "<literal>unique</literal> (opcional): ativa a geração DDl de uma "
+#~ "restrição única para a coluna de chave exterior. Isto realiza "
+#~ "efetivamente a multiplicidade da associação um-para-muitos."
+
+#~ msgid ""
+#~ "<literal>not-found</literal> (optional - defaults to <literal>exception</"
+#~ "literal>): specifies how foreign keys that reference missing rows will be "
+#~ "handled: <literal>ignore</literal> will treat a missing row as a null "
+#~ "association."
+#~ msgstr ""
+#~ "<literal>not-found</literal> (opcional - padrão para <literal>exception</"
+#~ "literal>): especifica como os identificadores em cache que referenciam as "
+#~ "linhas faltantes serão tratadas: <literal>ignore</literal> tratará a "
+#~ "linha faltante como uma associação nula. "
+
+#~ msgid ""
+#~ "<literal>property-ref</literal> (optional): the name of a property of the "
+#~ "associated class that is joined to this foreign key. If not specified, "
+#~ "the primary key of the associated class is used."
+#~ msgstr ""
+#~ "<literal>property-ref</literal> (opcional): o nome de uma propriedade de "
+#~ "classe associada que é unida a esta chave exterior. caso não "
+#~ "especificada, a chave primária da classe associada será usada."
+
+#~ msgid "Here are some examples."
+#~ msgstr "Segue abaixo alguns exemplos."
+
+#~ msgid "A set of strings:"
+#~ msgstr "Um conjunto de strings:"
+
+#~ msgid ""
+#~ "A bag containing integers with an iteration order determined by the "
+#~ "<literal>order-by</literal> attribute:"
+#~ msgstr ""
+#~ "Uma bag contendo inteiros com uma ordem de iteração determinada pelo "
+#~ "atributo <literal>order-by</literal>):"
+
+#~ msgid "An array of entities, in this case, a many-to-many association:"
+#~ msgstr ""
+#~ "Uma matriz de entidades, neste caso, uma associação muitos-para-muitos: "
+
+#~ msgid "A map from string indices to dates:"
+#~ msgstr "Um mapa desde índices de strigs até datas:"
+
+#~ msgid "A list of components (this is discussed in the next chapter):"
+#~ msgstr "Uma lista de componentes (isto será discutido no próximo capítulo):"
+
+#~ msgid "One-to-many associations"
+#~ msgstr "Associações um-para-muitos"
+
+#~ msgid ""
+#~ "A <emphasis>one-to-many association</emphasis> links the tables of two "
+#~ "classes via a foreign key with no intervening collection table. This "
+#~ "mapping loses certain semantics of normal Java collections:"
+#~ msgstr ""
+#~ "Uma <emphasis>associação um para muitos</emphasis> liga as tabelas das "
+#~ "duas classes através de uma chave exterior, sem a intervenção da tabela "
+#~ "de coleção. Este mapeamento perde um pouco da semântica das coleções "
+#~ "normais do Java: "
+
+#~ msgid ""
+#~ "The following example shows a map of <literal>Part</literal> entities by "
+#~ "name, where <literal>partName</literal> is a persistent property of "
+#~ "<literal>Part</literal>. Notice the use of a formula-based index:"
+#~ msgstr ""
+#~ "Este exemplo demonstra um mapa das entidades <literal>Part</literal> por "
+#~ "nome, onde <literal>partName</literal> é uma propriedade persistente de "
+#~ "<literal>Part</literal>. Note que o uso de um índice baseado em fórmula:"
+
+#~ msgid ""
+#~ "Hibernate supports collections implementing <literal>java.util.SortedMap</"
+#~ "literal> and <literal>java.util.SortedSet</literal>. You must specify a "
+#~ "comparator in the mapping file:"
+#~ msgstr ""
+#~ "O Hibernate suporta a implementação de coleções <literal>java.util."
+#~ "SortedMap</literal> e <literal>java.util.SortedSet</literal>. Você deve "
+#~ "especificar um comparador no arquivo de mapeamento:"
+
+#~ msgid ""
+#~ "A final alternative is to use composite elements, which will be discussed "
+#~ "later."
+#~ msgstr ""
+#~ "Uma alternativa final é usar os elementos compostos, que nós discutiremos "
+#~ "mais tarde. "
+
+#~ msgid ""
+#~ "Even more complex association mappings are covered in the next chapter."
+#~ msgstr ""
+#~ "Até mesmo o mapeamento de associações mais complexos serão discutimos no "
+#~ "próximo capítulo."
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/configuration.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/configuration.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/configuration.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: configuration\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-17 14:39+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,11 +118,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr "Configuration"
#. Tag: para
+#: configuration.xml:33
#, no-c-format
msgid ""
"Hibernate is designed to operate in many different environments and, as "
@@ -140,11 +142,13 @@
"de exemplo no seu classpath e personalize-o. "
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr "Configuração programática"
#. Tag: para
+#: configuration.xml:43
#, no-c-format
msgid ""
"An instance of <classname>org.hibernate.cfg.Configuration</classname> "
@@ -161,6 +165,7 @@
"mapeamento XML. "
#. Tag: para
+#: configuration.xml:51
#, no-c-format
msgid ""
"You can obtain a <classname>org.hibernate.cfg.Configuration</classname> "
@@ -173,7 +178,17 @@
"mapeamento XML. Se os arquivos de mapeamento estiverem no classpath, use "
"<literal>addResource()</literal>. Por exemplo:"
+#. Tag: programlisting
+#: configuration.xml:57
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:59
#, no-c-format
msgid ""
"An alternative way is to specify the mapped class and allow Hibernate to "
@@ -182,7 +197,17 @@
"Uma alternativa é especificar a classe mapeada e permitir que o Hibernate "
"encontre o documento de mapeamento para você:"
+#. Tag: programlisting
+#: configuration.xml:62
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:64
#, no-c-format
msgid ""
"Hibernate will then search for mapping files named <filename>/org/hibernate/"
@@ -196,6 +221,7 @@
"arquivo de difícil compreensão."
#. Tag: para
+#: configuration.xml:69
#, no-c-format
msgid ""
"A <classname>org.hibernate.cfg.Configuration</classname> also allows you to "
@@ -204,7 +230,22 @@
"Uma <literal>Configuration</literal> também permite que você especifique "
"propriedades de configuração específica. Por exemplo:"
+#. Tag: programlisting
+#: configuration.xml:72
+#, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:74
#, no-c-format
msgid ""
"This is not the only way to pass configuration properties to Hibernate. Some "
@@ -214,6 +255,7 @@
"Hibernate. As várias opções incluem: "
#. Tag: para
+#: configuration.xml:79
#, no-c-format
msgid ""
"Pass an instance of <classname>java.util.Properties</classname> to "
@@ -223,6 +265,7 @@
"<literal>Configuration.setProperties()</literal>. "
#. Tag: para
+#: configuration.xml:84
#, no-c-format
msgid ""
"Place a file named <filename>hibernate.properties</filename> in a root "
@@ -232,6 +275,7 @@
"diretório raíz do classpath."
#. Tag: para
+#: configuration.xml:89
#, no-c-format
msgid ""
"Set <literal>System</literal> properties using <literal>java -"
@@ -241,6 +285,7 @@
"-Dproperty=value</literal>."
#. Tag: para
+#: configuration.xml:94
#, no-c-format
msgid ""
"Include <literal><property></literal> elements in <literal>hibernate."
@@ -250,6 +295,7 @@
"cfg.xml</literal> (discutido mais tarde). "
#. Tag: para
+#: configuration.xml:99
#, no-c-format
msgid ""
"If you want to get started quickly<filename>hibernate.properties</filename> "
@@ -259,6 +305,7 @@
"filename> é a abordagem mais rápida."
#. Tag: para
+#: configuration.xml:103
#, no-c-format
msgid ""
"The <classname>org.hibernate.cfg.Configuration</classname> is intended as a "
@@ -270,11 +317,13 @@
"<literal>SessionFactory</literal> for criado."
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr "Obtendo uma SessionFactory"
#. Tag: para
+#: configuration.xml:111
#, no-c-format
msgid ""
"When all mappings have been parsed by the <classname>org.hibernate.cfg."
@@ -285,9 +334,17 @@
"Quando todos os mapeamentos forem analisados pelo <classname>org.hibernate."
"cfg.Configuration</classname>, a aplicação deve obter uma factory para as "
"instâncias do <interfacename>org.hibernate.Session</interfacename>. O "
-"objetivo desta factory é ser compartilhado por todas as threads da aplicação: "
+"objetivo desta factory é ser compartilhado por todas as threads da "
+"aplicação: "
+#. Tag: programlisting
+#: configuration.xml:117
+#, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:119
#, no-c-format
msgid ""
"Hibernate does allow your application to instantiate more than one "
@@ -299,11 +356,13 @@
"se você estiver usando mais do que um banco de dados. "
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr "Conexões JDBC"
#. Tag: para
+#: configuration.xml:127
#, no-c-format
msgid ""
"It is advisable to have the <interfacename>org.hibernate.SessionFactory</"
@@ -316,7 +375,14 @@
"seguir essa abordagem, a abertura de um <interfacename>org.hibernate."
"Session</interfacename> será tão simples quanto:"
+#. Tag: programlisting
+#: configuration.xml:133
+#, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:135
#, no-c-format
msgid ""
"Once you start a task that requires access to the database, a JDBC "
@@ -326,6 +392,7 @@
"conexão JDBC será obtida a partir do pool."
#. Tag: para
+#: configuration.xml:138
#, no-c-format
msgid ""
"Before you can do this, you first need to pass some JDBC connection "
@@ -340,6 +407,7 @@
"Descreveremos agora as configurações mais importantes para a conexão JDBC. "
#. Tag: para
+#: configuration.xml:144
#, no-c-format
msgid ""
"Hibernate will obtain and pool connections using <classname>java.sql."
@@ -349,71 +417,89 @@
"DriverManager</literal> se você determinar as seguintes propriedades: "
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr "Propriedades JDBC Hibernate"
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327
+#: configuration.xml:495 configuration.xml:657 configuration.xml:753
+#: configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr "Nome da Propriedade"
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329
+#: configuration.xml:497 configuration.xml:659 configuration.xml:755
+#: configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr "Propósito"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+#. Tag: property
+#: configuration.xml:166
+#, fuzzy, no-c-format
+msgid "hibernate.connection.driver_class"
msgstr "<property>hibernate.connection.driver_class</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:168
+#, fuzzy, no-c-format
+msgid "JDBC driver class"
msgstr "<emphasis>JDBC driver class</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+#. Tag: property
+#: configuration.xml:172
+#, fuzzy, no-c-format
+msgid "hibernate.connection.url"
msgstr "<property>hibernate.connection.url</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:174
#, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
-msgstr "<emphasis>JDBC URL</emphasis>"
+msgid "JDBC URL"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.username</property>"
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
+#, fuzzy, no-c-format
+msgid "hibernate.connection.username"
msgstr "<property>hibernate.connection.username</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:180
#, no-c-format
-msgid "<emphasis>database user</emphasis>"
-msgstr "<emphasis>usuário de banco de dados</emphasis> "
+msgid "database user"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.password</property>"
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
+#, fuzzy, no-c-format
+msgid "hibernate.connection.password"
msgstr "<property>hibernate.connection.password</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>database user password</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:186
+#, fuzzy, no-c-format
+msgid "database user password"
msgstr "<emphasis>senha de usuário de banco de dados</emphasis> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+#. Tag: property
+#: configuration.xml:190
+#, fuzzy, no-c-format
+msgid "hibernate.connection.pool_size"
msgstr "<property>hibernate.connection.pool_size</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:192
+#, fuzzy, no-c-format
+msgid "maximum number of pooled connections"
msgstr "<emphasis>número máximo de conexões em pool</emphasis>"
#. Tag: para
+#: configuration.xml:199
#, no-c-format
msgid ""
"Hibernate's own connection pooling algorithm is, however, quite rudimentary. "
@@ -434,6 +520,7 @@
"usar C3P0. "
#. Tag: para
+#: configuration.xml:208
#, no-c-format
msgid ""
"C3P0 is an open source JDBC connection pool distributed along with Hibernate "
@@ -453,6 +540,7 @@
"informações."
#. Tag: para
+#: configuration.xml:216
#, no-c-format
msgid ""
"The following is an example <filename>hibernate.properties</filename> file "
@@ -461,7 +549,23 @@
"Este é um exemplo de arquivo <literal>hibernate.properties</literal> para "
"c3p0:"
+#. Tag: programlisting
+#: configuration.xml:219
+#, no-c-format
+msgid ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:221
#, no-c-format
msgid ""
"For use inside an application server, you should almost always configure "
@@ -475,36 +579,43 @@
"precisará determinar pelo menos uma das seguintes propriedades:"
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr "Propriedades do Datasource do Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+#. Tag: property
+#: configuration.xml:244
+#, fuzzy, no-c-format
+msgid "hibernate.connection.datasource"
msgstr "<property>hibernate.connection.datasource</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:246
+#, fuzzy, no-c-format
+msgid "datasource JNDI name"
msgstr "<emphasis>nome JNDI de fonte de dados</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+#. Tag: property
+#: configuration.xml:250
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.url"
msgstr "<property>hibernate.jndi.url</property>"
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr "<emphasis>URL do fornecedor JNDI</emphasis> (opcional)"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+#. Tag: property
+#: configuration.xml:257
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.class"
msgstr "<property>hibernate.jndi.class</property>"
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
msgid ""
"<emphasis>class of the JNDI <literal>InitialContextFactory</literal></"
@@ -514,16 +625,19 @@
"(opcional)"
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr "<emphasis>usuário de banco de dados</emphasis> (opcional)"
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
msgstr "<emphasis>senha de usuário de banco de dados</emphasis> (opcional)"
#. Tag: para
+#: configuration.xml:280
#, no-c-format
msgid ""
"Here is an example <filename>hibernate.properties</filename> file for an "
@@ -532,7 +646,20 @@
"Eis um exemplo de arquivo <literal>hibernate.properties</literal> para um "
"servidor de aplicação fornecedor de fontes de dados JNDI:"
+#. Tag: programlisting
+#: configuration.xml:283
+#, no-c-format
+msgid ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
msgid ""
"JDBC connections obtained from a JNDI datasource will automatically "
@@ -542,6 +669,7 @@
"das transações gerenciadas pelo recipiente no servidor de aplicação."
#. Tag: para
+#: configuration.xml:289
#, no-c-format
msgid ""
"Arbitrary connection properties can be given by prepending "
@@ -555,6 +683,7 @@
"literal> usando <property>hibernate.connection.charSet</property>."
#. Tag: para
+#: configuration.xml:294
#, no-c-format
msgid ""
"You can define your own plugin strategy for obtaining JDBC connections by "
@@ -570,11 +699,13 @@
"literal>."
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr "Propriedades opcionais de configuração"
#. Tag: para
+#: configuration.xml:304
#, no-c-format
msgid ""
"There are a number of other properties that control the behavior of "
@@ -585,6 +716,7 @@
"lógicos. "
#. Tag: para
+#: configuration.xml:309
#, no-c-format
msgid ""
"<emphasis>Some of these properties are \"system-level\" only.</emphasis> "
@@ -592,23 +724,26 @@
"literal> or <filename>hibernate.properties</filename>. They "
"<emphasis>cannot</emphasis> be set by the other techniques described above."
msgstr ""
-"<emphasis>Algumas destas propriedades são somente em nível de sistema.</emphasis>. As propriedades "
-"em nível de sistema podem ser determinadas somente via <literal>java -"
-"Dproperty=value</literal> ou <literal>hibernate.properties</literal>. Elas "
-"<emphasis>não podem</emphasis> ser configuradas por outras técnicas "
-"descritas acima."
+"<emphasis>Algumas destas propriedades são somente em nível de sistema.</"
+"emphasis>. As propriedades em nível de sistema podem ser determinadas "
+"somente via <literal>java -Dproperty=value</literal> ou <literal>hibernate."
+"properties</literal>. Elas <emphasis>não podem</emphasis> ser configuradas "
+"por outras técnicas descritas acima."
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr "Propriedades de Configuração do Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.dialect</property>"
+#. Tag: property
+#: configuration.xml:335
+#, fuzzy, no-c-format
+msgid "hibernate.dialect"
msgstr "<property>hibernate.dialect</property>"
#. Tag: entry
+#: configuration.xml:337
#, no-c-format
msgid ""
"The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</"
@@ -620,6 +755,7 @@
"dados relacional em particular. "
#. Tag: para
+#: configuration.xml:340
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of."
@@ -629,6 +765,7 @@
"Dialect</literal>"
#. Tag: para
+#: configuration.xml:341
#, no-c-format
msgid ""
"In most cases Hibernate will actually be able to choose the correct "
@@ -639,12 +776,14 @@
"implementação <classname>org.hibernate.dialect.Dialect</classname> correta "
"baseada no <literal>JDBC metadata</literal> retornado pelo JDBC driver."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+#. Tag: property
+#: configuration.xml:349
+#, fuzzy, no-c-format
+msgid "hibernate.show_sql"
msgstr "<property>hibernate.show_sql</property>"
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
msgid ""
"Write all SQL statements to console. This is an alternative to setting the "
@@ -656,6 +795,11 @@
"<literal>debug</literal>."
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426
+#: configuration.xml:435 configuration.xml:443 configuration.xml:453
+#: configuration.xml:468 configuration.xml:525 configuration.xml:545
+#: configuration.xml:555 configuration.xml:598 configuration.xml:797
+#: configuration.xml:808 configuration.xml:904
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
@@ -664,22 +808,26 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
"<literal>false</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+#. Tag: property
+#: configuration.xml:359
+#, fuzzy, no-c-format
+msgid "hibernate.format_sql"
msgstr "<property>hibernate.format_sql</property>"
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr "Imprime o SQL formatado no log e recipiente. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+#. Tag: property
+#: configuration.xml:367
+#, fuzzy, no-c-format
+msgid "hibernate.default_schema"
msgstr "<property>hibernate.default_schema</property>"
#. Tag: entry
+#: configuration.xml:369
#, no-c-format
msgid ""
"Qualify unqualified table names with the given schema/tablespace in "
@@ -689,33 +837,44 @@
"espaço da tabela dado."
#. Tag: para
+#: configuration.xml:370
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
-msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+#. Tag: property
+#: configuration.xml:376
+#, fuzzy, no-c-format
+msgid "hibernate.default_catalog"
msgstr "<property>hibernate.default_catalog</property>"
#. Tag: entry
+#: configuration.xml:378
#, no-c-format
-msgid "Qualifies unqualified table names with the given catalog in generated SQL."
+msgid ""
+"Qualifies unqualified table names with the given catalog in generated SQL."
msgstr ""
"Qualifica no SQL gerado, os nome das tabelas desqualificadas com catálogo "
"dado."
#. Tag: para
+#: configuration.xml:379
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
-msgstr "<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
+msgstr ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+#. Tag: property
+#: configuration.xml:384
+#, fuzzy, no-c-format
+msgid "hibernate.session_factory_name"
msgstr "<property>hibernate.session_factory_name</property>"
#. Tag: entry
+#: configuration.xml:386
#, no-c-format
msgid ""
"The <interfacename>org.hibernate.SessionFactory</interfacename> will be "
@@ -725,6 +884,7 @@
"automaticamente se ligar a este nome no JNDI depois de ter sido criado. "
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
@@ -733,12 +893,14 @@
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+#. Tag: property
+#: configuration.xml:394
+#, fuzzy, no-c-format
+msgid "hibernate.max_fetch_depth"
msgstr "<property>hibernate.max_fetch_depth</property>"
#. Tag: entry
+#: configuration.xml:396
#, no-c-format
msgid ""
"Sets a maximum \"depth\" for the outer join fetch tree for single-ended "
@@ -750,6 +912,7 @@
"literal> desativa por padrão a busca de união externa. "
#. Tag: para
+#: configuration.xml:398
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -758,17 +921,21 @@
"<emphasis role=\"strong\">eg.</emphasis> valores recomendados "
"entre<literal>0</literal> e <literal>3</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+#. Tag: property
+#: configuration.xml:404
+#, fuzzy, no-c-format
+msgid "hibernate.default_batch_fetch_size"
msgstr "<property>hibernate.default_batch_fetch_size</property>"
#. Tag: entry
+#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
-msgstr "Determina um tamanho padrão para busca de associações em lotes do Hibernate."
+msgstr ""
+"Determina um tamanho padrão para busca de associações em lotes do Hibernate."
#. Tag: para
+#: configuration.xml:407
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</"
@@ -777,12 +944,14 @@
"<emphasis role=\"strong\">eg.</emphasis> valores recomendados <literal>4</"
"literal>, <literal>8</literal>, <literal>16</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+#. Tag: property
+#: configuration.xml:413
+#, fuzzy, no-c-format
+msgid "hibernate.default_entity_mode"
msgstr "<property>hibernate.default_entity_mode</property>"
#. Tag: entry
+#: configuration.xml:415
#, no-c-format
msgid ""
"Sets a default mode for entity representation for all sessions opened from "
@@ -792,6 +961,7 @@
"sessões abertas desta <literal>SessionFactory</literal> "
#. Tag: para
+#: configuration.xml:416
#, no-c-format
msgid ""
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
@@ -800,12 +970,14 @@
"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
"literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+#. Tag: property
+#: configuration.xml:422
+#, fuzzy, no-c-format
+msgid "hibernate.order_updates"
msgstr "<property>hibernate.order_updates</property>"
#. Tag: entry
+#: configuration.xml:424
#, no-c-format
msgid ""
"Forces Hibernate to order SQL updates by the primary key value of the items "
@@ -816,24 +988,29 @@
"ítens a serem atualizados. Isto resultará em menos deadlocks nas transações "
"em sistemas altamente concorrente. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
-msgstr "<property>hibernate.generate_statistics</property>"
+#. Tag: property
+#: configuration.xml:432
+#, fuzzy, no-c-format
+msgid "hibernate.generate_statistics"
+msgstr "Estatísticas do Hibernate"
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
-msgid "If enabled, Hibernate will collect statistics useful for performance tuning."
+msgid ""
+"If enabled, Hibernate will collect statistics useful for performance tuning."
msgstr ""
"Se habilitado, o Hibernate coletará estatísticas úteis para o ajuste do "
"desempenho. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+#. Tag: property
+#: configuration.xml:440
+#, fuzzy, no-c-format
+msgid "hibernate.use_identifier_rollback"
msgstr "<property>hibernate.use_identifier_rollback</property>"
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
msgid ""
"If enabled, generated identifier properties will be reset to default values "
@@ -842,12 +1019,14 @@
"Se habilitado, propriedades identificadoras geradas serão zeradas para os "
"valores padrão quando os objetos forem apagados. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
+#. Tag: property
+#: configuration.xml:449
+#, fuzzy, no-c-format
+msgid "hibernate.use_sql_comments"
msgstr "<property>hibernate.use_sql_comments</property>"
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
msgid ""
"If turned on, Hibernate will generate comments inside the SQL, for easier "
@@ -856,17 +1035,51 @@
"Se ligado, o Hibernate irá gerar comentários dentro do SQL, para facilitar a "
"depuração, o valor padrão é <literal>false</literal>"
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:460
+#, no-c-format
+msgid ""
+"Setting is relevant when using <classname>@GeneratedValue</classname>. It "
+"indicates whether or not the new <classname>IdentifierGenerator</classname> "
+"implementations are used for <classname>javax.persistence.GenerationType."
+"AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</"
+"classname> and <classname>javax.persistence.GenerationType.SEQUENCE</"
+"classname>. Default to <literal>false</literal> to keep backward "
+"compatibility."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid ""
+"We recommend all new projects which make use of to use "
+"<classname>@GeneratedValue</classname> to also set <code>hibernate.id."
+"new_generator_mappings=true</code> as the new generators are more efficient "
+"and closer to the JPA 2 specification semantic. However they are not "
+"backward compatible with existing databases (if a sequence or a table is "
+"used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr "JDBC Hibernate e Propriedades de Conexão"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+#. Tag: property
+#: configuration.xml:503
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.fetch_size"
msgstr "<property>hibernate.jdbc.fetch_size</property>"
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
msgid ""
"A non-zero value determines the JDBC fetch size (calls <literal>Statement."
@@ -875,12 +1088,14 @@
"Um valor maior que zero determina o tamanho da buscado JDBC (chamadas "
"<literal>Statement.setFetchSize()</literal>)."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+#. Tag: property
+#: configuration.xml:510
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_size"
msgstr "<property>hibernate.jdbc.batch_size</property>"
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr ""
@@ -888,6 +1103,7 @@
"Hibernate. "
#. Tag: para
+#: configuration.xml:513
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
@@ -896,16 +1112,18 @@
"<emphasis role=\"strong\">ex.</emphasis> valores recomentados entre "
"<literal>5</literal> e <literal>30</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+#. Tag: property
+#: configuration.xml:519
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr "<property>hibernate.jdbc.batch_versioned_data</property>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:521
+#, fuzzy, no-c-format
msgid ""
"Set this property to <literal>true</literal> if your JDBC driver returns "
-"correct row counts from <literal>executeBatch()</literal>. Iit is usually "
+"correct row counts from <literal>executeBatch()</literal>. It is usually "
"safe to turn this option on. Hibernate will then use batched DML for "
"automatically versioned data. Defaults to <literal>false</literal>."
msgstr ""
@@ -914,12 +1132,14 @@
"Geralmente é seguro ligar opção. O Hibernate então usará o DML em lotes para "
"dados automaticamente vertidos. Padronizar para <literal>false</literal>."
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+#. Tag: property
+#: configuration.xml:531
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.factory_class"
msgstr "<property>hibernate.jdbc.factory_class</property>"
#. Tag: entry
+#: configuration.xml:533
#, no-c-format
msgid ""
"Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. "
@@ -929,6 +1149,7 @@
"Muitas aplicações não irão precisar desta propriedade de configuração."
#. Tag: para
+#: configuration.xml:535
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -937,12 +1158,14 @@
"<emphasis role=\"strong\">exemplo</emphasis> <literal>classname.of."
"BatcherFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+#. Tag: property
+#: configuration.xml:541
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr "<property>hibernate.jdbc.use_scrollable_resultset</property>"
#. Tag: entry
+#: configuration.xml:543
#, no-c-format
msgid ""
"Enables use of JDBC2 scrollable resultsets by Hibernate. This property is "
@@ -953,12 +1176,14 @@
"Essa propriedade somente é necessária quando se usa Conexões JDBC providas "
"pelo usuário. Do contrário, o Hibernate os os metadados da conexão. "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+#. Tag: property
+#: configuration.xml:551
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr "<property>hibernate.jdbc.use_streams_for_binary</property>"
#. Tag: entry
+#: configuration.xml:553
#, no-c-format
msgid ""
"Use streams when writing/reading <literal>binary</literal> or "
@@ -969,12 +1194,14 @@
"<literal>serializable</literal> para/do JDBC. <emphasis>*system-level "
"property*</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+#. Tag: property
+#: configuration.xml:561
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr "<property>hibernate.jdbc.use_get_generated_keys</property>"
#. Tag: entry
+#: configuration.xml:563
#, no-c-format
msgid ""
"Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> "
@@ -990,16 +1217,21 @@
"determinar o driver capaz de usar metadados da conexão. "
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687
+#: configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
-msgstr "<emphasis role=\"strong\">exemplo</emphasis> <literal>true|false</literal> "
+msgstr ""
+"<emphasis role=\"strong\">exemplo</emphasis> <literal>true|false</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+#. Tag: property
+#: configuration.xml:574
+#, fuzzy, no-c-format
+msgid "hibernate.connection.provider_class"
msgstr "<property>hibernate.connection.provider_class</property>"
#. Tag: entry
+#: configuration.xml:576
#, no-c-format
msgid ""
"The classname of a custom <interfacename>org.hibernate.connection."
@@ -1011,6 +1243,7 @@
"Hibernate. "
#. Tag: para
+#: configuration.xml:578
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1019,12 +1252,14 @@
"<emphasis role=\"strong\">exemplo</emphasis><literal>classname.of."
"ConnectionProvider</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+#. Tag: property
+#: configuration.xml:584
+#, fuzzy, no-c-format
+msgid "hibernate.connection.isolation"
msgstr "<property>hibernate.connection.isolation</property>"
#. Tag: entry
+#: configuration.xml:586
#, no-c-format
msgid ""
"Sets the JDBC transaction isolation level. Check <interfacename>java.sql."
@@ -1038,26 +1273,32 @@
"não são padrões. "
#. Tag: para
+#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
-msgstr "<emphasis role=\"strong\">exemplo</emphasis> <literal>1, 2, 4, 8</literal>"
+msgstr ""
+"<emphasis role=\"strong\">exemplo</emphasis> <literal>1, 2, 4, 8</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+#. Tag: property
+#: configuration.xml:595
+#, fuzzy, no-c-format
+msgid "hibernate.connection.autocommit"
msgstr "<property>hibernate.connection.autocommit</property>"
#. Tag: entry
+#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr "Habilita o auto-commit para conexões no pool JDBC (não recomendado). "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+#. Tag: property
+#: configuration.xml:603
+#, fuzzy, no-c-format
+msgid "hibernate.connection.release_mode"
msgstr "<property>hibernate.connection.release_mode</property>"
#. Tag: entry
+#: configuration.xml:605
#, no-c-format
msgid ""
"Specifies when Hibernate should release JDBC connections. By default, a JDBC "
@@ -1082,6 +1323,7 @@
"estratégias de transação JDBC."
#. Tag: para
+#: configuration.xml:615
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) "
@@ -1093,15 +1335,15 @@
"literal> | <literal>after_statement</literal> "
#. Tag: para
-#, no-c-format
+#: configuration.xml:618
+#, fuzzy, no-c-format
msgid ""
"This setting only affects <literal>Session</literal>s returned from "
"<literal>SessionFactory.openSession</literal>. For <literal>Session</"
"literal>s obtained through <literal>SessionFactory.getCurrentSession</"
"literal>, the <literal>CurrentSessionContext</literal> implementation "
"configured for use controls the connection release mode for those "
-"<literal>Session</literal>s. See <xref linkend=\"architecture-current-session"
-"\" />"
+"<literal>Session</literal>s. See"
msgstr ""
"Note que esta configuração somente afeta as <literal>Session</literal>s "
"retornadas da <literal>SessionFactory.openSession</literal>. Para as "
@@ -1112,6 +1354,7 @@
"current-session\" />"
#. Tag: entry
+#: configuration.xml:630
#, no-c-format
msgid ""
"<property>hibernate.connection.</property><emphasis><propertyName></"
@@ -1121,6 +1364,7 @@
"emphasis>"
#. Tag: entry
+#: configuration.xml:632
#, no-c-format
msgid ""
"Pass the JDBC property <emphasis><propertyName></emphasis> to "
@@ -1130,11 +1374,15 @@
"<literal>DriverManager.getConnection()</literal>."
#. Tag: entry
+#: configuration.xml:638
#, no-c-format
-msgid "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
-msgstr "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
+msgid ""
+"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
+msgstr ""
+"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
#. Tag: entry
+#: configuration.xml:640
#, no-c-format
msgid ""
"Pass the property <emphasis><propertyName></emphasis> to the JNDI "
@@ -1144,21 +1392,26 @@
"<literal>InitialContextFactory</literal>."
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr "Propriedades de Cachê do Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+#. Tag: literal
+#: configuration.xml:665
+#, fuzzy, no-c-format
+msgid "hibernate.cache.provider_class"
msgstr "<literal>hibernate.cache.provider_class</literal>"
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
-msgstr "O nome da classe de um <literal>CacheProvider</literal> personalizado."
+msgstr ""
+"O nome da classe de um <literal>CacheProvider</literal> personalizado."
#. Tag: para
+#: configuration.xml:668
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1167,12 +1420,14 @@
"<emphasis role=\"strong\">exemplo</emphasis> <literal>classname.of."
"CacheProvider</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+#. Tag: literal
+#: configuration.xml:673
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_minimal_puts"
msgstr "<literal>hibernate.cache.use_minimal_puts</literal>"
#. Tag: entry
+#: configuration.xml:675
#, no-c-format
msgid ""
"Optimizes second-level cache operation to minimize writes, at the cost of "
@@ -1184,24 +1439,29 @@
"em cluster e, no Hibernate3, é habilitado por padrão para implementações de "
"cache em cluster. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+#. Tag: literal
+#: configuration.xml:684
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache"
msgstr "<literal>hibernate.cache.use_query_cache</literal>"
#. Tag: entry
+#: configuration.xml:686
#, no-c-format
-msgid "Enables the query cache. Individual queries still have to be set cachable."
+msgid ""
+"Enables the query cache. Individual queries still have to be set cachable."
msgstr ""
"Habilita a cache de consultas. Mesmo assim, consultas individuais ainda têm "
"que ser habilitadas para o cache."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+#. Tag: literal
+#: configuration.xml:692
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_second_level_cache"
msgstr "<literal>hibernate.cache.use_second_level_cache</literal>"
#. Tag: entry
+#: configuration.xml:694
#, no-c-format
msgid ""
"Can be used to completely disable the second level cache, which is enabled "
@@ -1212,12 +1472,14 @@
"o qual é habilitado por padrão para as classes que especificam um mapeamento "
"<literal><cache></literal>."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+#. Tag: literal
+#: configuration.xml:702
+#, fuzzy, no-c-format
+msgid "hibernate.cache.query_cache_factory"
msgstr "<literal>hibernate.cache.query_cache_factory</literal>"
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
msgid ""
"The classname of a custom <literal>QueryCache</literal> interface, defaults "
@@ -1228,6 +1490,7 @@
"automaticamente. "
#. Tag: para
+#: configuration.xml:706
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
@@ -1236,27 +1499,33 @@
"<emphasis role=\"strong\">exemplo</emphasis> <literal>classname.of."
"QueryCache</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+#. Tag: literal
+#: configuration.xml:712
+#, fuzzy, no-c-format
+msgid "hibernate.cache.region_prefix"
msgstr "<literal>hibernate.cache.region_prefix</literal>"
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr "Um prefixo para usar em nomes regionais de cachê de segundo nível"
#. Tag: para
+#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
-msgstr "<emphasis role=\"strong\">exemplo</emphasis> <literal>prefix</literal> "
+msgstr ""
+"<emphasis role=\"strong\">exemplo</emphasis> <literal>prefix</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+#. Tag: literal
+#: configuration.xml:720
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_structured_entries"
msgstr "<literal>hibernate.cache.use_structured_entries</literal>"
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
msgid ""
"Forces Hibernate to store data in the second-level cache in a more human-"
@@ -1265,17 +1534,36 @@
"Força o Hibernate a armazenar dados no cachê de segundo nível em um formato "
"mais humanamente amigável."
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid ""
+"Setting used to give the name of the default <classname>org.hibernate."
+"annotations.CacheConcurrencyStrategy</classname> to use when either "
+"<classname>@Cacheable</classname> or <classname>@Cache</classname> is used. "
+"<code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr "Propriedades de Transação do Hibernate"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:761
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.factory_class"
msgstr "<literal>hibernate.transaction.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
msgid ""
"The classname of a <literal>TransactionFactory</literal> to use with "
@@ -1287,6 +1575,7 @@
"padrão<literal>JDBCTransactionFactory</literal> ). "
#. Tag: para
+#: configuration.xml:765
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1295,12 +1584,14 @@
"<emphasis role=\"strong\">exemplo</emphasis> <literal>classname.of."
"TransactionFactory</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+#. Tag: literal
+#: configuration.xml:771
+#, fuzzy, no-c-format
+msgid "jta.UserTransaction"
msgstr "<literal>jta.UserTransaction</literal>"
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
msgid ""
"A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the "
@@ -1310,12 +1601,14 @@
"uma <literal>UserTransaction</literal> JTA a partir do servidor de "
"aplicação. "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+#. Tag: literal
+#: configuration.xml:781
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.manager_lookup_class"
msgstr "<literal>hibernate.transaction.manager_lookup_class</literal>"
#. Tag: entry
+#: configuration.xml:783
#, no-c-format
msgid ""
"The classname of a <literal>TransactionManagerLookup</literal>. It is "
@@ -1327,6 +1620,7 @@
"estivermos usando um gerador hilo em um ambiente JTA. "
#. Tag: para
+#: configuration.xml:786
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
@@ -1335,34 +1629,38 @@
"<emphasis role=\"strong\">exemplo</emphasis> <literal>classname.of."
"TransactionManagerLookup</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+#. Tag: literal
+#: configuration.xml:792
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.flush_before_completion"
msgstr "<literal>hibernate.transaction.flush_before_completion</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:794
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically flushed during the before "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Se habilitada, a sessão será automaticamente liberada antes da fase de "
"conclusão da transação. Prefere-se o gerenciamento de contexto da sessão "
"criada e automática, veja <xref linkend=\"architecture-current-session\" />."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+#. Tag: literal
+#: configuration.xml:803
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.auto_close_session"
msgstr "<literal>hibernate.transaction.auto_close_session</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:805
+#, fuzzy, no-c-format
msgid ""
"If enabled, the session will be automatically closed during the after "
"completion phase of the transaction. Built-in and automatic session context "
-"management is preferred, see <xref linkend=\"architecture-current-session\" /"
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
">."
msgstr ""
"Se habilitada, a sessão será automaticamente fechada após a fase de "
@@ -1370,27 +1668,31 @@
"contexto da sessão, veja <xref linkend=\"architecture-current-session\" />."
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr "Propriedades Variadas"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+#. Tag: literal
+#: configuration.xml:834
+#, fuzzy, no-c-format
+msgid "hibernate.current_session_context_class"
msgstr "<literal>hibernate.current_session_context_class</literal>"
#. Tag: entry
-#, no-c-format
+#: configuration.xml:836
+#, fuzzy, no-c-format
msgid ""
"Supply a custom strategy for the scoping of the \"current\" "
"<literal>Session</literal>. See <xref linkend=\"architecture-current-session"
-"\" /> for more information about the built-in strategies."
+"\"/> for more information about the built-in strategies."
msgstr ""
"Fornece uma estratégia personalizada para extensão da <literal>Session</"
"literal>\"atual\". Veja <xref linkend=\"architecture-current-session\" /> "
"para mais informação sobre estratégias internas. "
#. Tag: para
+#: configuration.xml:839
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | "
@@ -1401,17 +1703,20 @@
"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
"Class</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:846
+#, fuzzy, no-c-format
+msgid "hibernate.query.factory_class"
msgstr "<literal>hibernate.query.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr "Escolha a implementação de análise HQL. "
#. Tag: para
+#: configuration.xml:848
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast."
@@ -1422,12 +1727,14 @@
"ASTQueryTranslatorFactory</literal> ou <literal>org.hibernate.hql.classic. "
"ClassicQueryTranslatorFactory</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
+#. Tag: literal
+#: configuration.xml:857
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions"
msgstr "<literal>hibernate.query.substitutions</literal>"
#. Tag: entry
+#: configuration.xml:859
#, no-c-format
msgid ""
"Is used to map from tokens in Hibernate queries to SQL tokens (tokens might "
@@ -1437,6 +1744,7 @@
"SQL (símbolos devem ser por exemplo, funções ou nome literais). "
#. Tag: para
+#: configuration.xml:861
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
@@ -1445,12 +1753,14 @@
"<emphasis role=\"strong\">exemplo</emphasis> "
"<literal>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+#. Tag: literal
+#: configuration.xml:867
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.auto"
msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
#. Tag: entry
+#: configuration.xml:869
#, no-c-format
msgid ""
"Automatically validates or exports schema DDL to the database when the "
@@ -1464,6 +1774,7 @@
"<literal>SessionFactory</literal> for fechada explicitamente. "
#. Tag: para
+#: configuration.xml:873
#, no-c-format
msgid ""
"<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | "
@@ -1474,12 +1785,49 @@
"<literal>update</literal> | <literal>create</literal> | <literal>create-"
"drop</literal> "
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:880
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.import_file"
+msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
+
+#. Tag: para
+#: configuration.xml:882
#, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+msgid ""
+"Comma-separated names of the optional files containing SQL DML statements "
+"executed during the <classname>SessionFactory</classname> creation. This is "
+"useful for testing or demoing: by adding INSERT statements for example you "
+"can populate your database with a minimal set of data when it is deployed."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:887
+#, no-c-format
+msgid ""
+"File order matters, the statements of a give file are executed before the "
+"statements of the following files. These statements are only executed if the "
+"schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to "
+"<literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:892
+#, fuzzy, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">exemplo</emphasis> <literal>true|false</literal> "
+
+#. Tag: literal
+#: configuration.xml:898
+#, fuzzy, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
msgstr "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
#. Tag: entry
+#: configuration.xml:900
#, no-c-format
msgid ""
"Enables the use of CGLIB instead of runtime reflection (System-level "
@@ -1494,11 +1842,13 @@
"propriedade no <literal>hibernate.cfg.xml</literal>."
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr "Dialetos SQL"
#. Tag: para
+#: configuration.xml:915
#, no-c-format
msgid ""
"Always set the <literal>hibernate.dialect</literal> property to the correct "
@@ -1514,256 +1864,307 @@
"listadas abaixo, reduzindo o esforço de especificá-los manualmente."
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr "Dialetos SQL do Hibernate (<literal>hibernate.dialect</literal>)"
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr "RDBMS"
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr "Dialeto"
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
-msgstr "DB2"
+msgid "<entry>DB2</entry>"
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:943
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr "<literal>org.hibernate.dialect.DB2Dialect</literal>"
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr "DB2 AS/400"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:949
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr "DB2 OS390"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:955
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr "PostgreSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:961
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr "Meu SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:967
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr "<literal>org.hibernate.dialect.MySQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr "MeuSQL com InnoDB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:973
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr "Meu SQL com MeuISAM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+#. Tag: literal
+#: configuration.xml:979
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr "Oracle (qualquer versão)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+#. Tag: literal
+#: configuration.xml:985
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.OracleDialect"
msgstr "<literal>org.hibernate.dialect.OracleDialect</literal>"
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr "Oracle 9i"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+#. Tag: literal
+#: configuration.xml:991
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr "Oracle 10g"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+#. Tag: literal
+#: configuration.xml:997
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr "Sybase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1003
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr "<literal>org.hibernate.dialect.SybaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr "Sybase Qualquer lugar"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1009
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr "Servidor Microsoft SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1015
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr "SAP DB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1021
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr "Informix"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1027
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InformixDialect"
msgstr "<literal>org.hibernate.dialect.InformixDialect</literal>"
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr "HypersonicSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1033
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr "<literal>org.hibernate.dialect.HSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr "Ingres"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1039
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.IngresDialect"
msgstr "<literal>org.hibernate.dialect.IngresDialect</literal>"
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr "Progresso"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1045
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr "<literal>org.hibernate.dialect.ProgressDialect</literal>"
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr "Mckoi SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1051
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr "<literal>org.hibernate.dialect.MckoiDialect</literal>"
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr "Interbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1057
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr "Base Ponto"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1063
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr "Base Frontal"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1069
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr "Firebird"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1075
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr "Busca por união externa (Outer Join Fetching)"
#. Tag: para
+#: configuration.xml:1085
#, no-c-format
msgid ""
"If your database supports ANSI, Oracle or Sybase style outer joins, "
@@ -1785,6 +2186,7 @@
"literal>."
#. Tag: para
+#: configuration.xml:1094
#, no-c-format
msgid ""
"Outer join fetching can be disabled <emphasis>globally</emphasis> by setting "
@@ -1800,16 +2202,19 @@
"um, cujos quais têm sido mapeados com <literal>fetch=\"join\"</literal>."
#. Tag: para
-#, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+#: configuration.xml:1100
+#, fuzzy, no-c-format
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr "Veja <xref linkend=\"performance-fetching\" /> para mais informações."
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr "Fluxos Binários (Binary Streams)"
#. Tag: para
+#: configuration.xml:1107
#, no-c-format
msgid ""
"Oracle limits the size of <literal>byte</literal> arrays that can be passed "
@@ -1826,16 +2231,18 @@
"</emphasis> "
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr "Cachê de segundo nível e consulta"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1118
+#, fuzzy, no-c-format
msgid ""
"The properties prefixed by <literal>hibernate.cache</literal> allow you to "
"use a process or cluster scoped second-level cache system with Hibernate. "
-"See the <xref linkend=\"performance-cache\" /> for more information."
+"See the <xref linkend=\"performance-cache\"/> for more information."
msgstr ""
"As propriedades pré-fixadas pelo <literal>hibernate.cache</literal> permitem "
"que você use um sistema de cache de segundo nível em um processo executado "
@@ -1843,11 +2250,13 @@
"maiores detalhes. "
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr "Substituição na Linguagem de Consulta"
#. Tag: para
+#: configuration.xml:1127
#, no-c-format
msgid ""
"You can define new Hibernate query tokens using <literal>hibernate.query."
@@ -1856,7 +2265,14 @@
"Você pode definir novos símbolos de consulta Hibernate usando "
"<literal>hibernate.query.substitutions</literal>. Por exemplo: "
+#. Tag: programlisting
+#: configuration.xml:1130
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr "<literal>hibernate.query.substitutions</literal>"
+
#. Tag: para
+#: configuration.xml:1132
#, no-c-format
msgid ""
"This would cause the tokens <literal>true</literal> and <literal>false</"
@@ -1865,17 +2281,28 @@
"Isto faria com que os símbolos <literal>true</literal> e <literal>false</"
"literal> passasem a ser traduzidos para literais inteiros no SQL gerado."
+#. Tag: programlisting
+#: configuration.xml:1136
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr "<literal>hibernate.query.substitutions</literal>"
+
#. Tag: para
+#: configuration.xml:1138
#, no-c-format
-msgid "This would allow you to rename the SQL <literal>LOWER</literal> function."
-msgstr "Isto permitirá que você renomeie a função <literal>LOWER</literal> no SQL."
+msgid ""
+"This would allow you to rename the SQL <literal>LOWER</literal> function."
+msgstr ""
+"Isto permitirá que você renomeie a função <literal>LOWER</literal> no SQL."
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr "Estatísticas do Hibernate"
#. Tag: para
+#: configuration.xml:1145
#, no-c-format
msgid ""
"If you enable <literal>hibernate.generate_statistics</literal>, Hibernate "
@@ -1891,11 +2318,13 @@
"interface <literal>org.hibernate.stats</literal> para mais informações."
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr "Logging"
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
msgid ""
"Hibernate utilizes <ulink url=\"http://www.slf4j.org/\">Simple Logging "
@@ -1926,6 +2355,7 @@
"Hibernate no diretório <literal>src/</literal>. "
#. Tag: para
+#: configuration.xml:1171
#, no-c-format
msgid ""
"It is recommended that you familiarize yourself with Hibernate's log "
@@ -1940,56 +2370,67 @@
"essencial. As categorias de log mais interessantes são as seguintes:"
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr "Categorias de Log do Hibernate"
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr "Categoria"
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr "Função"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
+#. Tag: literal
+#: configuration.xml:1195
+#, fuzzy, no-c-format
+msgid "org.hibernate.SQL"
msgstr "<literal>org.hibernate.SQL</literal>"
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr "Registra todas as instruções SQL DML a medida que elas são executadas"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
+#. Tag: literal
+#: configuration.xml:1201
+#, fuzzy, no-c-format
+msgid "org.hibernate.type"
msgstr "<literal>org.hibernate.type</literal>"
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr "Registra todos os parâmetros JDBC"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+#. Tag: literal
+#: configuration.xml:1207
+#, fuzzy, no-c-format
+msgid "org.hibernate.tool.hbm2ddl"
msgstr "<literal>org.hibernate.tool.hbm2ddl</literal>"
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr "Registra todas as instruções SQL DDL a medida que elas são executadas"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
+#. Tag: literal
+#: configuration.xml:1213
+#, fuzzy, no-c-format
+msgid "org.hibernate.pretty"
msgstr "<literal>org.hibernate.pretty</literal>"
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
msgid ""
"Log the state of all entities (max 20 entities) associated with the session "
@@ -1998,62 +2439,74 @@
"Registra o estado de todas as entidades (máximo 20 entidades) associadas à "
"sessão no momento da liberação (flush)."
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
+#. Tag: literal
+#: configuration.xml:1220
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache"
msgstr "<literal>org.hibernate.cache</literal>"
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr "Registra todas as atividades de cachê de segundo nível"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+#. Tag: literal
+#: configuration.xml:1226
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction"
msgstr "<literal>org.hibernate.transaction</literal>"
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr "Registra atividades relacionada à transação"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
+#. Tag: literal
+#: configuration.xml:1232
+#, fuzzy, no-c-format
+msgid "org.hibernate.jdbc"
msgstr "<literal>org.hibernate.jdbc</literal>"
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr "Registra todas as requisições de recursos JDBC"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+#. Tag: literal
+#: configuration.xml:1238
+#, fuzzy, no-c-format
+msgid "org.hibernate.hql.ast.AST"
msgstr "<literal>org.hibernate.hql.ast.AST</literal>"
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr "Registra instruções SQL e HQL durante a análise da consultas"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
+#. Tag: literal
+#: configuration.xml:1244
+#, fuzzy, no-c-format
+msgid "org.hibernate.secure"
msgstr "<literal>org.hibernate.secure</literal>"
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr "Registra todas as requisições de autorização JAAS"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1250
#, no-c-format
-msgid "<literal>org.hibernate</literal>"
-msgstr "<literal>org.hibernate</literal>"
+msgid "org.hibernate"
+msgstr ""
#. Tag: entry
+#: configuration.xml:1252
#, no-c-format
msgid ""
"Log everything. This is a lot of information but it is useful for "
@@ -2063,6 +2516,7 @@
"de inicialização."
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
msgid ""
"When developing applications with Hibernate, you should almost always work "
@@ -2076,11 +2530,13 @@
"propriedade <literal>hibernate.show_sql</literal> habilitada."
#. Tag: title
+#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr "Implementando um <literal>NamingStrategy</literal>"
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
msgid ""
"The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you "
@@ -2091,6 +2547,7 @@
"elementos de esquema."
#. Tag: para
+#: configuration.xml:1272
#, no-c-format
msgid ""
"You can provide rules for automatically generating database identifiers from "
@@ -2109,6 +2566,7 @@
"pelo Hibernate é bastante mínima. "
#. Tag: para
+#: configuration.xml:1279
#, no-c-format
msgid ""
"You can specify a different strategy by calling <literal>Configuration."
@@ -2118,7 +2576,19 @@
"<literal>Configuration.setNamingStrategy()</literal> antes de adicionar os "
"mapeamentos: "
+#. Tag: programlisting
+#: configuration.xml:1283
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
msgid ""
"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in "
@@ -2128,11 +2598,13 @@
"interna que pode ser um ponto inicial útil para algumas aplicações."
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr "Arquivo de configuração XML"
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
msgid ""
"An alternative approach to configuration is to specify a full configuration "
@@ -2147,6 +2619,7 @@
"propriedades."
#. Tag: para
+#: configuration.xml:1299
#, no-c-format
msgid ""
"The XML configuration file is by default expected to be in the root of your "
@@ -2155,7 +2628,53 @@
"O arquivo XML de configuração deve ser encontrado na raíz do seu "
"<literal>CLASSPATH</literal>. Veja um exemplo: "
+#. Tag: programlisting
+#: configuration.xml:1302
+#, no-c-format
+msgid ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1304
#, no-c-format
msgid ""
"The advantage of this approach is the externalization of the mapping file "
@@ -2173,21 +2692,43 @@
"exceto os acima mencionados de usar a sintaxe de XML. "
#. Tag: para
+#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
-msgstr "Com a configuração do XML, iniciar o Hibernate é então tão simples quanto: "
+msgstr ""
+"Com a configuração do XML, iniciar o Hibernate é então tão simples quanto: "
+#. Tag: programlisting
+#: configuration.xml:1314
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
-msgstr "Você poderá escolher um arquivo de configuração XML diferente, utilizando:"
+msgstr ""
+"Você poderá escolher um arquivo de configuração XML diferente, utilizando:"
+#. Tag: programlisting
+#: configuration.xml:1318
+#, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr "Integração com servidores de aplicação J2EE"
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr ""
@@ -2195,6 +2736,7 @@
"J2EE:"
#. Tag: para
+#: configuration.xml:1329
#, no-c-format
msgid ""
"<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC "
@@ -2217,6 +2759,7 @@
"código portável. "
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
msgid ""
"<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its "
@@ -2227,6 +2770,7 @@
"iniciado."
#. Tag: para
+#: configuration.xml:1350
#, no-c-format
msgid ""
"<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</"
@@ -2247,6 +2791,7 @@
"usuário)."
#. Tag: para
+#: configuration.xml:1362
#, no-c-format
msgid ""
"<emphasis>JMX deployment:</emphasis> if you have a JMX capable application "
@@ -2267,6 +2812,7 @@
"etc.). "
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
msgid ""
"Depending on your environment, you might have to set the configuration "
@@ -2279,11 +2825,13 @@
"de conexão\"."
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr "Configuração de estratégia de transação"
#. Tag: para
+#: configuration.xml:1381
#, no-c-format
msgid ""
"The Hibernate <literal>Session</literal> API is independent of any "
@@ -2302,6 +2850,7 @@
"necessário. "
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
msgid ""
"To keep your code portable between these two (and other) environments we "
@@ -2319,26 +2868,31 @@
"literal>."
#. Tag: para
+#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr "Existem três escolhas, ou internas, padrões: "
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1401
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr "delega as transações (JDBC) para bases de dados (Padrão)"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1409
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1412
#, no-c-format
msgid ""
"delegates to container-managed transactions if an existing transaction is "
@@ -2350,17 +2904,20 @@
"No entanto, uma nova transação será iniciada e serão usadas transações "
"controladas por um bean."
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1420
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr "delega para um container gerenciador de transações JTA"
#. Tag: para
+#: configuration.xml:1428
#, no-c-format
msgid ""
"You can also define your own transaction strategies (for a CORBA transaction "
@@ -2370,6 +2927,7 @@
"serviço de transação CORBA, por exemplo)."
#. Tag: para
+#: configuration.xml:1431
#, no-c-format
msgid ""
"Some features in Hibernate (i.e., the second level cache, Contextual "
@@ -2387,134 +2945,163 @@
"padroniza um mecanismo simples:"
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr "Gerenciadores de transações JTA"
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr "Factory de Transação"
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr "Servidor de Aplicação"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1456
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr "JBoss"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1462
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr "Weblogic"
-#. Tag: entry
-#, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
-"literal>"
+#. Tag: literal
+#: configuration.xml:1468
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr ""
"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr "WebSphere"
-#. Tag: entry
-#, no-c-format
-msgid ""
-"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
-"literal>"
+#. Tag: literal
+#: configuration.xml:1474
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr ""
"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
"literal>"
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr "WebSphere 6"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1480
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr "Orion"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1486
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr "Resin"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1492
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr "JOTM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1498
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr "JOnAS"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1504
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr "JRun4"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1510
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr "Borland ES"
#. Tag: title
+#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr "<literal>SessionFactory</literal> vinculada à JNDI"
#. Tag: para
+#: configuration.xml:1522
#, no-c-format
msgid ""
"A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the "
@@ -2528,6 +3115,7 @@
"literal> ligado a JNDI, simplesmente ambos usam o mesmo registro."
#. Tag: para
+#: configuration.xml:1528
#, no-c-format
msgid ""
"If you wish to have the <literal>SessionFactory</literal> bound to a JNDI "
@@ -2546,6 +3134,7 @@
"Tomcat)."
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
msgid ""
"When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will "
@@ -2560,6 +3149,7 @@
"<literal>InitialContext</literal>."
#. Tag: para
+#: configuration.xml:1542
#, no-c-format
msgid ""
"Hibernate will automatically place the <literal>SessionFactory</literal> in "
@@ -2577,6 +3167,7 @@
"mais tarde). "
#. Tag: para
+#: configuration.xml:1550
#, no-c-format
msgid ""
"If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other "
@@ -2588,7 +3179,8 @@
"localizador JNDI."
#. Tag: para
-#, no-c-format
+#: configuration.xml:1554
+#, fuzzy, no-c-format
msgid ""
"It is recommended that you bind the <literal>SessionFactory</literal> to "
"JNDI in a managed environment and use a <literal>static</literal> singleton "
@@ -2596,7 +3188,7 @@
"recommend to hide the actual lookup code for a <literal>SessionFactory</"
"literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory"
"()</literal>. Note that such a class is also a convenient way to startup "
-"Hibernate—see chapter 1."
+"Hibernate—see chapter 1."
msgstr ""
"Recomendamos que você vincule a <literal>SessionFactory</literal> ao JNDI em "
"um ambiente gerenciado e utilize um singleton <literal>static</literal>. "
@@ -2607,22 +3199,24 @@
"bastante conveniente de inicializar o Hibernate— veja o capítulo 1."
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr "Gerenciamento de contexto de Sessão atual com JTA"
#. Tag: para
-#, no-c-format
+#: configuration.xml:1567
+#, fuzzy, no-c-format
msgid ""
"The easiest way to handle <literal>Sessions</literal> and transactions is "
"Hibernate's automatic \"current\" <literal>Session</literal> management. For "
"a discussion of contextual sessions see <xref linkend=\"architecture-current-"
-"session\" />. Using the <literal>\"jta\"</literal> session context, if there "
+"session\"/>. Using the <literal>\"jta\"</literal> session context, if there "
"is no Hibernate <literal>Session</literal> associated with the current JTA "
"transaction, one will be started and associated with that JTA transaction "
"the first time you call <literal>sessionFactory.getCurrentSession()</"
"literal>. The <literal>Session</literal>s retrieved via "
-"<literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> "
+"<literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> "
"context are set to automatically flush before the transaction completes, "
"close after the transaction completes, and aggressively release JDBC "
"connections after each statement. This allows the <literal>Session</"
@@ -2655,11 +3249,13 @@
"prefira uma demarcação de transação declarativa com CMT. "
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr "implementação JMX "
#. Tag: para
+#: configuration.xml:1592
#, no-c-format
msgid ""
"The line <literal>cfg.buildSessionFactory()</literal> still has to be "
@@ -2676,6 +3272,7 @@
"<emphasis>serviço gerenciado</emphasis>."
#. Tag: para
+#: configuration.xml:1598
#, no-c-format
msgid ""
"Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</"
@@ -2689,7 +3286,64 @@
"Segue aqui um exemplo do <literal>jboss-service.xml</literal> para o JBoss "
"4.0.x:"
+#. Tag: programlisting
+#: configuration.xml:1604
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+msgstr ""
+
#. Tag: para
+#: configuration.xml:1606
#, no-c-format
msgid ""
"This file is deployed in a directory called <literal>META-INF</literal> and "
@@ -2713,3 +3367,17 @@
"Consulte a documentação do JBoss AS para maiores informações sobre o serviço "
"JMX e implementação EJB. "
+#~ msgid "<emphasis>JDBC URL</emphasis>"
+#~ msgstr "<emphasis>JDBC URL</emphasis>"
+
+#~ msgid "<emphasis>database user</emphasis>"
+#~ msgstr "<emphasis>usuário de banco de dados</emphasis> "
+
+#~ msgid "<property>hibernate.generate_statistics</property>"
+#~ msgstr "<property>hibernate.generate_statistics</property>"
+
+#~ msgid "DB2"
+#~ msgstr "DB2"
+
+#~ msgid "<literal>org.hibernate</literal>"
+#~ msgstr "<literal>org.hibernate</literal>"
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/filters.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/filters.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/filters.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: filters\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:35\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-11-16 15:07+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,11 +118,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr "Filtrando dados"
#. Tag: para
+#: filters.xml:33
#, no-c-format
msgid ""
"Hibernate3 provides an innovative new approach to handling data with "
@@ -136,11 +138,13 @@
"Sessão do Hibernate. "
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr "Filtros do Hibernate"
#. Tag: para
+#: filters.xml:41
#, no-c-format
msgid ""
"Hibernate3 has the ability to pre-define filter criteria and attach those "
@@ -162,9 +166,95 @@
"usados como Views de bancos de dados, mas com parâmetros dentro da aplicação."
#. Tag: para
+#: filters.xml:50
#, no-c-format
msgid ""
-"In order to use filters, they must first be defined and then attached to the "
+"Using annotatons filters are defined via <literal>@org.hibernate.annotations."
+"FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</"
+"literal>. A filter definition has a <methodname>name()</methodname> 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 "
+"<methodname>defaultCondition()</methodname> parameter for a given "
+"<literal>@FilterDef</literal> to set the default condition to use when none "
+"are defined in each individual <literal>@Filter</literal>. "
+"<literal>@FilterDef</literal>(s) can be defined at the class or package "
+"level."
+msgstr ""
+
+#. Tag: para
+#: filters.xml:63
+#, 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. The connection between "
+"<classname>@FilterName</classname> and <classname>@Filter</classname> is a "
+"matching name."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
+#, 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 want "
+"to target the association table, use the <literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid ""
+"Using <classname>@FilterJoinTable</classname> for filterting on the "
+"association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files for defining filters the situtation is very "
+"similar. The filters must first be defined and then attached to the "
"appropriate mapping elements. To define a filter, use the <literal><"
"filter-def/></literal> element within a <literal><hibernate-mapping/"
"></literal> element:"
@@ -174,22 +264,58 @@
"elemento <literal><filter-def/></literal> dentro do elemento "
"<literal><hibernate-mapping/></literal>:"
-#. Tag: para
+#. Tag: title
+#: filters.xml:97
#, no-c-format
-msgid "This filter can then be attached to a class:"
-msgstr "Esse filtro pode ser acoplado à uma classe:"
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
+#. Tag: programlisting
+#: filters.xml:100
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"This filter can then be attached to a class or collection (or, to both or "
+"multiples of each at the same time):"
+msgstr "Ou, mesmo para ambos (ou muitos de cada) ao mesmo tempo."
+
+#. Tag: title
+#: filters.xml:107
#, no-c-format
-msgid "Or, to a collection:"
-msgstr "Ou, à uma coleção:"
+msgid ""
+"Attaching a filter to a class or collection using <literal><filter></"
+"literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: filters.xml:110
#, no-c-format
-msgid "Or, to both or multiples of each at the same time."
-msgstr "Ou, mesmo para ambos (ou muitos de cada) ao mesmo tempo."
+msgid ""
+"<class name=\"myClass\" ...>\n"
+" ...\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+"\n"
+" <set ...>\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+" </set> \n"
+"</class>"
+msgstr ""
#. Tag: para
+#: filters.xml:113
#, no-c-format
msgid ""
"The methods on <literal>Session</literal> are: <literal>enableFilter(String "
@@ -210,7 +336,18 @@
"interface <literal>Filter</literal>. Usando o filtro simples definido acima, "
"o código se pareceria com o seguinte: "
+#. Tag: programlisting
+#: filters.xml:123
+#, fuzzy, no-c-format
+msgid ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+msgstr ""
+"<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", "
+"\"some-value\");]]>"
+
#. Tag: para
+#: filters.xml:125
#, no-c-format
msgid ""
"Methods on the org.hibernate.Filter interface do allow the method-chaining "
@@ -220,6 +357,7 @@
"do método, comum à maioria das funções do Hibernate. "
#. Tag: para
+#: filters.xml:128
#, no-c-format
msgid ""
"The following is a full example, using temporal data with an effective "
@@ -228,7 +366,79 @@
"Um exemplo completo, usando dados temporais com um padrão de datas de "
"registro efetivo:"
+#. Tag: programlisting
+#: filters.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department\"/"
+">\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column=\"eff_start_dt"
+"\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt\"/"
+">\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>]]>"
+
#. Tag: para
+#: filters.xml:133
#, no-c-format
msgid ""
"In order to ensure that you are provided with currently effective records, "
@@ -237,7 +447,29 @@
"Para garantir que você sempre tenha registro efetivos, simplesmente habilite "
"o filtro na sessão antes de recuperar os dados dos empregados: "
+#. Tag: programlisting
+#: filters.xml:137
+#, fuzzy, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+msgstr ""
+"<![CDATA[Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();\n"
+"]]>"
+
#. Tag: para
+#: filters.xml:139
#, no-c-format
msgid ""
"Even though a salary constraint was mentioned explicitly on the results in "
@@ -250,6 +482,7 @@
"os funcionários ativos cujo salário é maior que um milhão de dólares. "
#. Tag: para
+#: filters.xml:144
#, no-c-format
msgid ""
"If you want to use filters with outer joining, either through HQL or load "
@@ -263,6 +496,7 @@
"primeiro seguido pelo(s) nome(s) da coluna após o operador. "
#. Tag: para
+#: filters.xml:149
#, no-c-format
msgid ""
"After being defined, a filter might be attached to multiple entities and/or "
@@ -276,7 +510,20 @@
"condições se repetem. Assim, usando o <literal><filter-def/></literal> "
"permite denifir uma condição padrão, tanto como uma função quanto CDATA:"
+#. Tag: programlisting
+#: filters.xml:155
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</filter-"
+"def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:157
#, no-c-format
msgid ""
"This default condition will be used whenever the filter is attached to "
@@ -289,15 +536,12 @@
"dar uma condição específica como parte de um anexo de filtro que substitua a "
"condição padrão neste caso em particular. "
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
+#~ msgid "This filter can then be attached to a class:"
+#~ msgstr "Esse filtro pode ser acoplado à uma classe:"
+#~ msgid "Or, to a collection:"
+#~ msgstr "Ou, à uma coleção:"
+
#~ msgid ""
#~ "<![CDATA[<class name=\"myClass\" ...>\n"
#~ " ...\n"
@@ -321,107 +565,3 @@
#~ " <filter name=\"myFilter\" condition=\":myFilterParam = "
#~ "MY_FILTERED_COLUMN\"/>\n"
#~ "</set>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-#~ msgstr ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/performance.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/performance.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/performance.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: performance\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-18 14:45+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,16 +118,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "Aumentando o desempenho"
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "Estratégias de Busca "
#. Tag: para
+#: performance.xml:36
#, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve "
@@ -142,11 +145,13 @@
"<literal>Criteria</literal>. "
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 define as seguintes estratégias de busca:"
#. Tag: para
+#: performance.xml:46
#, no-c-format
msgid ""
"<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated "
@@ -158,6 +163,7 @@
"literal>. "
#. Tag: para
+#: performance.xml:53
#, no-c-format
msgid ""
"<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is "
@@ -171,6 +177,7 @@
"esse segundo SELECT será executado apenas quando você acessar a associação. "
#. Tag: para
+#: performance.xml:61
#, no-c-format
msgid ""
"<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> "
@@ -186,6 +193,7 @@
"esse segundo SELECT será executado apenas quando você acessar a associação. "
#. Tag: para
+#: performance.xml:70
#, no-c-format
msgid ""
"<emphasis>Batch fetching</emphasis>: an optimization strategy for select "
@@ -199,11 +207,13 @@
"primárias ou chaves externas."
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "O Hibernate distingue também entre:"
#. Tag: para
+#: performance.xml:81
#, no-c-format
msgid ""
"<emphasis>Immediate fetching</emphasis>: an association, collection or "
@@ -213,6 +223,7 @@
"é imediatamente recuperada, quando o proprietário for carregado. "
#. Tag: para
+#: performance.xml:87
#, no-c-format
msgid ""
"<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when "
@@ -224,6 +235,7 @@
"para coleções."
#. Tag: para
+#: performance.xml:93
#, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements "
@@ -238,6 +250,7 @@
"muito grandes."
#. Tag: para
+#: performance.xml:101
#, no-c-format
msgid ""
"<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched "
@@ -249,6 +262,7 @@
"objeto associado."
#. Tag: para
+#: performance.xml:107
#, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is "
@@ -266,6 +280,7 @@
"requer instrumentação de bytecodes em build-time e é raramente necessário."
#. Tag: para
+#: performance.xml:117
#, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued "
@@ -277,6 +292,7 @@
"requer instrumentação de bytecodes em build-time e é raramente necessário."
#. Tag: para
+#: performance.xml:124
#, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when</emphasis> is the "
@@ -294,11 +310,13 @@
"classe particular."
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "Trabalhando com associações preguiçosas (lazy)"
#. Tag: para
+#: performance.xml:134
#, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
@@ -310,6 +328,7 @@
"sentido para quase todas as associações em quase todas a aplicações. "
#. Tag: para
+#: performance.xml:138
#, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate "
@@ -321,6 +340,7 @@
"otimização pode ser também habilitada em um nível mais fino."
#. Tag: para
+#: performance.xml:142
#, no-c-format
msgid ""
"Please be aware that access to a lazy association outside of the context of "
@@ -329,7 +349,25 @@
"Perceba que o acesso a associações preguiçosas fora do contexto de uma "
"sessão aberta do Hibernate irá resultar numa exceção. Por exemplo:"
+#. Tag: programlisting
+#: performance.xml:146
+#, no-c-format
+msgid ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+
#. Tag: para
+#: performance.xml:148
#, no-c-format
msgid ""
"Since the permissions collection was not initialized when the "
@@ -345,6 +383,7 @@
"que carrega a coleção para logo antes da transação ser submetida. "
#. Tag: para
+#: performance.xml:155
#, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
@@ -362,6 +401,7 @@
"precisar buscar no banco de dados inteiro da memória em cada transação."
#. Tag: para
+#: performance.xml:162
#, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
@@ -377,11 +417,13 @@
"para as associações de valor único e para coleções."
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "Personalizando as estratégias de busca"
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
@@ -390,7 +432,25 @@
"O padrão selecionar busca, é extremamente vunerável aos problemas de seleção "
"N+1, então habilitaremos a busca de união no documento de mapeamento:"
+#. Tag: programlisting
+#: performance.xml:176
+#, no-c-format
+msgid ""
+"<set name=\"permissions\"\n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:178
+#, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch</literal> strategy defined in the mapping document "
@@ -400,27 +460,32 @@
"afeta:"
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr "recupera via <literal>get()</literal> ou <literal>load()</literal>"
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr ""
"Recuperações que acontecem implicitamente quando navegamos por uma associação"
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr "consultas por <literal>Criteria</literal> "
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr "consultas HQL se a busca por <literal>subselect</literal> for usada"
#. Tag: para
+#: performance.xml:204
#, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
@@ -433,6 +498,7 @@
"HQL em particular."
#. Tag: para
+#: performance.xml:209
#, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
@@ -450,6 +516,7 @@
"literal>, você irá usar <literal>setFetchMode(FetchMode.JOIN)</literal>."
#. Tag: para
+#: performance.xml:216
#, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get()</literal> "
@@ -460,7 +527,18 @@
"literal> ou <literal>load()</literal>, simplesmente use uma consulta por "
"<literal>Criteria</literal>, por exemplo: "
+#. Tag: programlisting
+#: performance.xml:220
+#, no-c-format
+msgid ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:222
#, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
@@ -470,6 +548,7 @@
"\"plano de busca\"."
#. Tag: para
+#: performance.xml:225
#, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
@@ -479,11 +558,13 @@
"cache de segundo nível. "
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "Proxies de associação final único"
#. Tag: para
+#: performance.xml:232
#, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
@@ -502,6 +583,7 @@
"biblioteca CGLIB. "
#. Tag: para
+#: performance.xml:239
#, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
@@ -513,6 +595,7 @@
"associações <literal>many-to-one</literal> e <literal>one-to-one</literal>. "
#. Tag: para
+#: performance.xml:244
#, no-c-format
msgid ""
"The mapping file may declare an interface to use as the proxy interface for "
@@ -529,6 +612,7 @@
"todas as classes persistentes</emphasis>."
#. Tag: para
+#: performance.xml:251
#, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
@@ -537,7 +621,20 @@
"Existe alguns truques que você deve saber quando estender esse comportamento "
"para classes polimórficas. Por exemplo:"
+#. Tag: programlisting
+#: performance.xml:254
+#, no-c-format
+msgid ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat</literal> will never be castable to "
@@ -548,12 +645,39 @@
"para <literal>DomesticCat</literal>, mesmo que a instância em questão seja "
"uma instância de <literal>DomesticCat</literal>:"
+#. Tag: programlisting
+#: performance.xml:260
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr "E, segundo, é possível quebrar o proxy <literal>==</literal>:"
+#. Tag: programlisting
+#: performance.xml:265
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+msgstr ""
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
@@ -564,7 +688,16 @@
"referências para objetos proxies diferentes, a instância adjacente será do "
"mesmo objeto:"
+#. Tag: programlisting
+#: performance.xml:271
+#, no-c-format
+msgid ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+
#. Tag: para
+#: performance.xml:273
#, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or "
@@ -574,6 +707,7 @@
"<literal>final</literal> ou com quaisquer métodos <literal>final</literal>."
#. Tag: para
+#: performance.xml:276
#, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
@@ -587,6 +721,7 @@
"subclasse da classe persistente. "
#. Tag: para
+#: performance.xml:281
#, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
@@ -605,7 +740,20 @@
"literal> e <literal>DomesticCatImpl</literal> implementa a interface "
"<literal>DomesticCat</literal>. Por exemplo: "
+#. Tag: programlisting
+#: performance.xml:289
+#, no-c-format
+msgid ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:291
#, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat</literal> and "
@@ -616,17 +764,30 @@
"<literal>DomesticCat</literal> podem ser retornadas pelo <literal>load()</"
"literal> ou <literal>iterate()</literal>."
+#. Tag: programlisting
+#: performance.xml:295
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr "Nota"
#. Tag: para
+#: performance.xml:300
#, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr "<literal>list()</literal> normalmente retorna proxies."
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
@@ -638,6 +799,7 @@
"<literal>Cat</literal>, e não <literal>CatImpl</literal>."
#. Tag: para
+#: performance.xml:308
#, no-c-format
msgid ""
"Certain operations do <emphasis>not</emphasis> require proxy initialization:"
@@ -645,6 +807,7 @@
"Algumas operações <emphasis>não</emphasis> requerem inicialização por proxy: "
#. Tag: para
+#: performance.xml:313
#, no-c-format
msgid ""
"<literal>equals()</literal>: if the persistent class does not override "
@@ -654,6 +817,7 @@
"<literal>equals()</literal>"
#. Tag: para
+#: performance.xml:318
#, no-c-format
msgid ""
"<literal>hashCode()</literal>: if the persistent class does not override "
@@ -663,11 +827,13 @@
"<literal>hashCode()</literal>"
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "O método getter do identificador"
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()</"
@@ -677,6 +843,7 @@
"<literal>equals()</literal> ou <literal>hashCode()</literal>."
#. Tag: para
+#: performance.xml:330
#, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default "
@@ -691,11 +858,13 @@
"imediatas. "
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "Inicializando coleções e proxies"
#. Tag: para
+#: performance.xml:340
#, no-c-format
msgid ""
"A <literal>LazyInitializationException</literal> will be thrown by Hibernate "
@@ -709,6 +878,7 @@
"ou que possua a referência ao proxy estiver no estado desanexado. "
#. Tag: para
+#: performance.xml:346
#, no-c-format
msgid ""
"Sometimes a proxy or collection needs to be initialized before closing the "
@@ -724,6 +894,7 @@
"confuso para quem lê o código e não é conveniente para códigos genéricos. "
#. Tag: para
+#: performance.xml:353
#, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize()</literal> and "
@@ -743,6 +914,7 @@
"literal> tem um efeito similar para a coleção de kittens. "
#. Tag: para
+#: performance.xml:362
#, no-c-format
msgid ""
"Another option is to keep the <literal>Session</literal> open until all "
@@ -763,6 +935,7 @@
"problema: "
#. Tag: para
+#: performance.xml:372
#, no-c-format
msgid ""
"In a web-based application, a servlet filter can be used to close the "
@@ -786,6 +959,7 @@
"View\"."
#. Tag: para
+#: performance.xml:385
#, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
@@ -814,6 +988,7 @@
"emphasis>. "
#. Tag: para
+#: performance.xml:401
#, no-c-format
msgid ""
"You can also attach a previously loaded object to a new <literal>Session</"
@@ -829,6 +1004,7 @@
"automaticamente, pois isso introduziria semântica em transações impromptu."
#. Tag: para
+#: performance.xml:410
#, no-c-format
msgid ""
"Sometimes you do not want to initialize a large collection, but still need "
@@ -839,6 +1015,7 @@
"algumas informações, como o mesmo tamanho, ou um subconjunto de seus dados."
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid ""
"You can use a collection filter to get the size of a collection without "
@@ -846,7 +1023,16 @@
msgstr ""
"Você pode usar um filtro de coleção para saber seu tamanho sem inicializá-la:"
+#. Tag: programlisting
+#: performance.xml:417
+#, no-c-format
+msgid ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+msgstr ""
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid ""
"The <literal>createFilter()</literal> method is also used to efficiently "
@@ -857,12 +1043,22 @@
"algus dados de uma coleção eficientemente sem precisar inicializar a coleção "
"inteira:"
+#. Tag: programlisting
+#: performance.xml:423
+#, no-c-format
+msgid ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "Usando busca em lote"
#. Tag: para
+#: performance.xml:429
#, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
@@ -877,6 +1073,7 @@
"da classe ou no nível da coleção."
#. Tag: para
+#: performance.xml:434
#, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
@@ -902,7 +1099,14 @@
"melhorar esse comportamento especificando um <literal>batch-size</literal> "
"no mapeamento da classe <literal>Person</literal>: "
+#. Tag: programlisting
+#: performance.xml:447
+#, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:449
#, no-c-format
msgid ""
"Hibernate will now execute only three queries: the pattern is 10, 10, 5."
@@ -910,6 +1114,7 @@
"O Hibernate irá executar agora apenas três consultas; o padrão é 10, 10, 5."
#. Tag: para
+#: performance.xml:452
#, no-c-format
msgid ""
"You can also enable batch fetching of collections. For example, if each "
@@ -929,7 +1134,19 @@
"mapeamento da classe <literal>Person</literal>, o Hibernate pode fazer uma "
"pré carga das coleções:"
+#. Tag: programlisting
+#: performance.xml:461
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:463
#, no-c-format
msgid ""
"With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 "
@@ -943,6 +1160,7 @@
"<literal>Session</literal>."
#. Tag: para
+#: performance.xml:468
#, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
@@ -957,11 +1175,13 @@
"leitura."
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "Usando busca de subseleção"
#. Tag: para
+#: performance.xml:477
#, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
@@ -973,19 +1193,21 @@
"funciona da mesma maneira que busca em lote, sem carregar tanto."
#. Tag: title
+#: performance.xml:486
#, no-c-format
msgid "Fetch profiles"
msgstr "Perfis de Busca "
#. Tag: para
-#, no-c-format
+#: performance.xml:488
+#, fuzzy, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
"is through something called a fetch profile, which is a named configuration "
"associated with the <interfacename>org.hibernate.SessionFactory</"
"interfacename> but enabled, by name, on the <interfacename>org.hibernate."
"Session</interfacename>. Once enabled on a <interfacename>org.hibernate."
-"Session</interfacename>, the fetch profile wull be in affect for that "
+"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session</interfacename> until it is explicitly "
"disabled."
msgstr ""
@@ -999,25 +1221,118 @@
"completamente desativado."
#. Tag: para
-#, no-c-format
+#: performance.xml:498
+#, fuzzy, no-c-format
msgid ""
-"So what does that mean? Well lets explain that by way of an example. Say we "
-"have the following mappings:"
+"So what does that mean? Well lets explain that by way of an example which "
+"show the different available approaches to configure a fetch profile:"
msgstr ""
"O que isto significa? A explicação será através de um exemplo. Vamos dizer "
"que nós temos os seguintes mapeamentos:"
-#. Tag: para
+#. Tag: title
+#: performance.xml:503
#, no-c-format
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
msgid ""
+"@Entity\n"
+"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+" @FetchProfile.FetchOverride(entity = Customer.class, association = "
+"\"orders\", mode = FetchMode.JOIN)\n"
+"})\n"
+"public class Customer {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" private long customerNumber;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Order> orders;\n"
+"\n"
+" // standard getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
+">\n"
+" </fetch-profile>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch association=\"orders\" style=\"join\"/>\n"
+" </fetch-profile>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:525
+#, fuzzy, no-c-format
+msgid ""
"Now normally when you get a reference to a particular customer, that "
"customer's set of orders will be lazy meaning we will not yet have loaded "
"those orders from the database. Normally this is a good thing. Now lets say "
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
-"to use a fetch profile to achieve that. Just add the following to your "
-"mapping:"
+"to use a fetch profile to achieve that. The following code will load both "
+"the customer <emphasis>and</emphasis>their orders:"
msgstr ""
"Normalmente, quando você recebe uma referência para um cliente em "
"particular, o conjunto do cliente de pedidos será lento, significando que "
@@ -1029,21 +1344,35 @@
"um perfil de busca para atingir o mesmo objeto. Apenas adicione o seguinte a "
"seu mapeamento:"
-#. Tag: para
+#. Tag: title
+#: performance.xml:536
#, no-c-format
-msgid "or even:"
-msgstr "ou ainda:"
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
+msgstr ""
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFetchProfile( \"customer-with-orders\" ); // name matches "
+"from mapping\n"
+"Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
msgid ""
-"Now the following code will actually load both the customer <emphasis>and "
-"their orders</emphasis>:"
+"<classname>@FetchProfile </classname>definitions are global and it does not "
+"matter on which class you place them. You can place the "
+"<classname>@FetchProfile</classname> annotation either onto a class or "
+"package (package-info.java). In order to define multiple fetch profiles for "
+"the same class or package <classname>@FetchProfiles</classname> can be used."
msgstr ""
-"Agora que o código seguinte irá carregar ambos cliente <emphasis>e outros "
-"pedidos</emphasis>:"
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
@@ -1055,11 +1384,13 @@
"projects/hibernate/browse/HHH-3414\">HHH-3414</ulink> para maiores detalhes."
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "Usando busca preguiçosa de propriedade"
#. Tag: para
+#: performance.xml:560
#, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
@@ -1079,6 +1410,7 @@
"colunas e o modelo de dados não pode ser melhorado."
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy</literal> attribute "
@@ -1087,7 +1419,24 @@
"Para habilitar a carga de propriedade lazy, é preciso ajustar a função "
"<literal>lazy</literal> no seu mapeamento de propriedade:"
+#. Tag: programlisting
+#: performance.xml:571
+#, no-c-format
+msgid ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:573
#, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
@@ -1099,11 +1448,34 @@
"silenciosamente essa configuração e usará a busca imediata."
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr "Para instrumentação de bytecode, use a seguinte tarefa do Ant:"
+#. Tag: programlisting
+#: performance.xml:579
+#, no-c-format
+msgid ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+msgstr ""
+
#. Tag: para
+#: performance.xml:581
#, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
@@ -1117,6 +1489,7 @@
"bytecode em build-time e é certamente uma melhor solução."
#. Tag: para
+#: performance.xml:586
#, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
@@ -1126,11 +1499,13 @@
"<literal>buscar todas as propriedades</literal> no HQL."
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "O Cachê de Segundo Nível"
#. Tag: para
+#: performance.xml:594
#, no-c-format
msgid ""
"A Hibernate <literal>Session</literal> is a transaction-level cache of "
@@ -1150,15 +1525,17 @@
"ser configurados para dados em cache vencido regularmente."
#. Tag: para
-#, no-c-format
+#: performance.xml:602
+#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property <literal>hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
-"integrations with the open-source cache providers that are listed below. You "
-"can also implement your own and plug it in as outlined above. Note that "
-"versions prior to 3.2 use EhCache as the default cache provider."
+"integrations with the open-source cache providers that are listed in <xref "
+"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
+"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
+"the default cache provider."
msgstr ""
"Você tem a opção de informar o Hibernate sobre qual implementação de cache "
"utilizar, especificando o nome de uma classe que implementa <literal>org."
@@ -1170,157 +1547,398 @@
"utilizam EhCache como provedor de cache padrão. "
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "Provedores de Cache "
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "Cache"
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "Classe de provedor"
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "Tipo"
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "Segurança de Cluster"
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "Cache de Consulta Suportado"
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Hashtable (não recomendado para uso de produção)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:644
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "memória"
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674
+#: performance.xml:992 performance.xml:994 performance.xml:996
+#: performance.xml:1004 performance.xml:1006 performance.xml:1008
+#: performance.xml:1016 performance.xml:1018 performance.xml:1020
+#: performance.xml:1028 performance.xml:1030 performance.xml:1040
+#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
-msgstr "sim"
+msgid "<entry>yes</entry>"
+msgstr ""
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:656
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr "<literal>org.hibernate.cache.EhCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "memória, disco"
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:668
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr "<literal>org.hibernate.cache.OSCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:680
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "clustered (ip multicast)"
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "sim (invalidação em cluster)"
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr "JBoss Cache 1.x"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:692
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "(ip multicast) em cluster, transacional"
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "sim (replicação)"
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "sim (solicitação de sync. de relógio)"
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr "JBoss Cache 2"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+#. Tag: literal
+#: performance.xml:704
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
#. Tag: entry
+#: performance.xml:708
#, no-c-format
msgid "yes (replication or invalidation)"
msgstr "sim (invalidação ou replicação)"
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "Mapeamento de Cache"
#. Tag: para
+#: performance.xml:719
#, no-c-format
msgid ""
-"The <literal><cache></literal> element of a class or collection "
-"mapping has the following form:"
+"As we have done in previous chapters we are looking at the two different "
+"possibiltites to configure caching. First configuration via annotations and "
+"then via Hibernate mapping files."
msgstr ""
-"O elemento <literal><cache></literal> de uma classe ou mapeamento de "
-"coleção possui a seguinte forma:"
#. Tag: para
+#: performance.xml:723
#, no-c-format
msgid ""
+"By default, entities are not part of the second level cache and we recommend "
+"you to stick to this setting. However, you can override this by setting the "
+"<literal>shared-cache-mode</literal> element in your <filename>persistence."
+"xml</filename> file or by using the <literal>javax.persistence.sharedCache."
+"mode </literal>property in your configuration. The following values are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid ""
+"<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): "
+"entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid ""
+"<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly "
+"marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid ""
+"<literal>ALL</literal>: all entities are always cached even if marked as non "
+"cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid ""
+"<literal>NONE</literal>: no entity are cached even if marked as cacheable. "
+"This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid ""
+"The cache concurrency strategy used by default can be set globaly via the "
+"<literal>hibernate.cache.default_cache_concurrency_strategy</literal> "
+"configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, fuzzy, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr "consultas por <literal>Criteria</literal> "
+
+#. Tag: literal
+#: performance.xml:765
+#, fuzzy, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr "consultas por <literal>Criteria</literal> "
+
+#. Tag: literal
+#: performance.xml:769
+#, fuzzy, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr "leitura-escrita não estrita"
+
+#. Tag: literal
+#: performance.xml:773
+#, fuzzy, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr "consultas por <literal>Criteria</literal> "
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid ""
+"It is recommended to define the cache concurrency strategy per entity rather "
+"than using a global one. Use the <classname>@org.hibernate.annotations."
+"Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid ""
+"Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+"@Entity \n"
+"@Cacheable\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid ""
+"Hibernate also let's you cache the content of a collection or the "
+"identifiers if the collection contains other entities. Use the "
+"<classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, fuzzy, no-c-format
+msgid "Caching collections using annotations"
+msgstr "Inicializando coleções e proxies"
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+"@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: para
+#: performance.xml:802
+#, no-c-format
+msgid ""
+"shows the<literal> @org.hibernate.annotations.Cache</literal> annotations "
+"with its attributes. It allows you to define the caching strategy and region "
+"of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid ""
+"Let's now take a look at Hibernate mapping files. There the <literal><"
+"cache></literal> element of a class or collection mapping is used to "
+"configure the second level cache. Looking at <xref linkend=\"example-"
+"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, no-c-format
+msgid ""
+"<cache\n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
+msgid ""
"<literal>usage</literal> (required) specifies the caching strategy: "
"<literal>transactional</literal>, <literal>read-write</literal>, "
"<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
@@ -1331,6 +1949,7 @@
"literal>"
#. Tag: para
+#: performance.xml:874
#, no-c-format
msgid ""
"<literal>region</literal> (optional: defaults to the class or collection "
@@ -1340,6 +1959,7 @@
"coleção): especifica o nome da região do cache de segundo nível"
#. Tag: para
+#: performance.xml:880
#, no-c-format
msgid ""
"<literal>include</literal> (optional: defaults to <literal>all</literal>) "
@@ -1353,31 +1973,31 @@
"o nível da função busca lazy for habilitada"
#. Tag: para
-#, no-c-format
+#: performance.xml:890
+#, fuzzy, no-c-format
msgid ""
-"Alternatively, you can specify <literal><class-cache></literal> and "
-"<literal><collection-cache></literal> elements in <literal>hibernate."
-"cfg.xml</literal>."
+"Alternatively to <literal><cache></literal>, you can use <literal><"
+"class-cache></literal> and <literal><collection-cache></literal> "
+"elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
"De forma alternativa, você poderá especificar os elementos <literal><"
"class-cache></literal> e <literal><collection-cache></literal> em "
"<literal>hibernate.cfg.xml</literal>."
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid ""
-"The <literal>usage</literal> attribute specifies a <emphasis>cache "
-"concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
-"A função <literal>uso </literal> especifica uma <emphasis>estratégia de "
-"concorrência de cache</emphasis>."
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr "Estratégia: somente leitura"
#. Tag: para
+#: performance.xml:902
#, no-c-format
msgid ""
"If your application needs to read, but not modify, instances of a persistent "
@@ -1391,11 +2011,13 @@
"seguro para uso em um cluster."
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "Estratégia: leitura/escrita"
#. Tag: para
+#: performance.xml:911
#, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write</literal> "
@@ -1424,11 +2046,13 @@
"o bloqueamento."
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr "Estratégia: leitura/escrita não estrita"
#. Tag: para
+#: performance.xml:929
#, no-c-format
msgid ""
"If the application only occasionally needs to update data (i.e. if it is "
@@ -1451,11 +2075,13 @@
"literal> for chamada."
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "Estratégia: transacional"
#. Tag: para
+#: performance.xml:943
#, no-c-format
msgid ""
"The <literal>transactional</literal> cache strategy provides support for "
@@ -1469,11 +2095,13 @@
"<literal>hibernate.transaction.manager_lookup_class</literal>."
#. Tag: title
+#: performance.xml:950
#, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "Compatibilidade de Estratégia de Concorrência de Cache Provedor"
#. Tag: para
+#: performance.xml:953
#, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
@@ -1482,6 +2110,7 @@
"cache. "
#. Tag: para
+#: performance.xml:957
#, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
@@ -1491,36 +2120,43 @@
"concorrência. "
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr "Suporte de Estratégia de Concorrência de Cache"
#. Tag: entry
+#: performance.xml:978
#, no-c-format
-msgid "read-only"
-msgstr "somente leitura"
+msgid "<entry>read-only</entry>"
+msgstr ""
#. Tag: entry
-#, no-c-format
-msgid "nonstrict-read-write"
+#: performance.xml:980
+#, fuzzy, no-c-format
+msgid "<entry>nonstrict-read-write</entry>"
msgstr "leitura-escrita não estrita"
#. Tag: entry
+#: performance.xml:982
#, no-c-format
-msgid "read-write"
-msgstr "leitura-escrita"
+msgid "<entry>read-write</entry>"
+msgstr ""
#. Tag: entry
-#, no-c-format
-msgid "transactional"
+#: performance.xml:984
+#, fuzzy, no-c-format
+msgid "<entry>transactional</entry>"
msgstr "transacional"
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "Gerenciando os caches"
#. Tag: para
+#: performance.xml:1069
#, no-c-format
msgid ""
"Whenever you pass an object to <literal>save()</literal>, <literal>update()</"
@@ -1537,6 +2173,7 @@
"este objeto será adicionado ao cache interno da <literal>Session</literal>."
#. Tag: para
+#: performance.xml:1076
#, no-c-format
msgid ""
"When <literal>flush()</literal> is subsequently called, the state of that "
@@ -1553,7 +2190,29 @@
"método <literal>evict()</literal> pode ser usado para remover o objeto de "
"suas coleções de cache de primeiro nível."
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid ""
+"Explcitly evicting a cached instance from the first level cache using "
+"<methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, no-c-format
+msgid ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session</literal> also provides a <literal>contains()</literal> "
@@ -1563,6 +2222,7 @@
"literal> para determinar se uma instância pertence ao cache de sessão."
#. Tag: para
+#: performance.xml:1094
#, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear()</"
@@ -1572,6 +2232,7 @@
"<literal>Session.clear()</literal>"
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
@@ -1582,7 +2243,28 @@
"<literal>SessionFactory</literal> para despejar o estado de cache de uma "
"instância, classe inteira, instância de coleção ou papel de coleção inteiro."
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid ""
+"Second-level cache eviction via <methodname>SessionFactoty.evict() </"
+"methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, no-c-format
+msgid ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1110
#, no-c-format
msgid ""
"The <literal>CacheMode</literal> controls how a particular session interacts "
@@ -1592,6 +2274,7 @@
"interage com o cache de segundo nível:"
#. Tag: para
+#: performance.xml:1115
#, no-c-format
msgid ""
"<literal>CacheMode.NORMAL</literal>: will read items from and write items to "
@@ -1601,6 +2284,7 @@
"nível."
#. Tag: para
+#: performance.xml:1120
#, no-c-format
msgid ""
"<literal>CacheMode.GET</literal>: will read items from the second-level "
@@ -1610,6 +2294,7 @@
"nível. Não escreve ao cache de segundo nível, exceto quando atualizar dados."
#. Tag: para
+#: performance.xml:1126
#, no-c-format
msgid ""
"<literal>CacheMode.PUT</literal>: will write items to the second-level "
@@ -1619,6 +2304,7 @@
"Não lê a partir do cache de segundo nível."
#. Tag: para
+#: performance.xml:1131
#, no-c-format
msgid ""
"<literal>CacheMode.REFRESH</literal>: will write items to the second-level "
@@ -1633,6 +2319,7 @@
"do banco de dados. "
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
@@ -1641,7 +2328,27 @@
"Para navegar o conteúdo do segundo nível ou região de cache de consulta, use "
"o<literal>Statistics</literal> API:"
+#. Tag: title
+#: performance.xml:1143
+#, fuzzy, no-c-format
+msgid ""
+"Browsing the second-level cache entries via the <classname>Statistics</"
+"classname> API"
+msgstr ""
+"Para navegar o conteúdo do segundo nível ou região de cache de consulta, use "
+"o<literal>Statistics</literal> API:"
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, no-c-format
+msgid ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1149
#, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
@@ -1651,11 +2358,27 @@
"manter as entradas de cache em um formato mais compreensível: "
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, no-c-format
+msgid ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr "O Cache de Consulta"
#. Tag: para
+#: performance.xml:1162
#, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
@@ -1666,11 +2389,13 @@
"parâmetros. "
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr "Ativação do cache de consulta"
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
@@ -1692,12 +2417,20 @@
"o cache de resultados de consulta por padrão. Para uso do cache de consulta, "
"você primeiro precisa ativar o cache de consulta:"
+#. Tag: programlisting
+#: performance.xml:1177
+#, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr "Esta configuração cria duas novas regiões de cache:"
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the "
@@ -1707,6 +2440,7 @@
"resultados da consulta com cache."
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding "
@@ -1719,10 +2453,11 @@
"do cache de consulta."
#. Tag: para
+#: performance.xml:1194
#, fuzzy, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
-"timeouts is is very important that the cache timeout of the underlying cache "
+"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
@@ -1736,6 +2471,7 @@
"expirar. Perceba que uma política expirar do cache LRU nunca será apropriada."
#. Tag: para
+#: performance.xml:1203
#, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
@@ -1754,6 +2490,7 @@
"quando for executado. "
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
@@ -1770,11 +2507,13 @@
"o cache de coleção)."
#. Tag: title
+#: performance.xml:1221
#, no-c-format
msgid "Query cache regions"
msgstr "Regiões de cache de consulta"
#. Tag: para
+#: performance.xml:1223
#, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
@@ -1786,7 +2525,21 @@
"uma consulta em particular, chamando <literal>Query.setCacheRegion()</"
"literal>."
+#. Tag: programlisting
+#: performance.xml:1227
+#, no-c-format
+msgid ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1229
#, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
@@ -1811,11 +2564,13 @@
"<literal>SessionFactory.evictQueries()</literal>."
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "Entendendo o desempenho da Coleção"
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
@@ -1827,31 +2582,37 @@
"execução."
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "Taxonomia"
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "O Hibernate define três tipos básicos de coleções:"
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "Coleções de valores"
#. Tag: para
+#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr "Associações um-para-muitos "
#. Tag: para
+#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr "Associações muitos-para-muitos "
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
@@ -1869,21 +2630,25 @@
"de coleções. Isto sugere a seguinte classificação:"
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "Coleções indexadas"
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "conjuntos"
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "Bags"
#. Tag: para
+#: performance.xml:1288
#, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
@@ -1900,6 +2665,7 @@
"quando o Hibernate tentar atualizar ou deletá-la. "
#. Tag: para
+#: performance.xml:1295
#, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key></literal> and "
@@ -1924,6 +2690,7 @@
"todas as colunas como <literal>not-null=\"true\"</literal>."
#. Tag: para
+#: performance.xml:1306
#, no-c-format
msgid ""
"<literal><idbag></literal> mappings define a surrogate key, so they "
@@ -1934,6 +2701,7 @@
"verdade, este é o melhor caso. "
#. Tag: para
+#: performance.xml:1309
#, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
@@ -1950,6 +2718,7 @@
"bastante ineficiente."
#. Tag: para
+#: performance.xml:1316
#, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
@@ -1963,6 +2732,7 @@
"linhas individuais da coleção."
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
@@ -1971,6 +2741,7 @@
"atualizar"
#. Tag: para
+#: performance.xml:1326
#, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
@@ -1982,6 +2753,7 @@
"adição, remoção e atualização de elementos. "
#. Tag: para
+#: performance.xml:1330
#, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
@@ -2001,6 +2773,7 @@
"consideração não se aplica às associações um para muitos. "
#. Tag: para
+#: performance.xml:1338
#, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
@@ -2016,6 +2789,7 @@
"semânticas \"conjunto\" são mais naturais em modelos relacionais. "
#. Tag: para
+#: performance.xml:1344
#, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
@@ -2032,11 +2806,13 @@
"aplicam a este caso. "
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr "As Bags e listas são as coleções de inversão mais eficientes."
#. Tag: para
+#: performance.xml:1354
#, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
@@ -2058,12 +2834,25 @@
"<literal>List</literal>. Isto pode fazer que o código comum seguinte seja "
"muito mais rápido:"
+#. Tag: programlisting
+#: performance.xml:1365
+#, no-c-format
+msgid ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+msgstr ""
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "Deletar uma vez"
#. Tag: para
+#: performance.xml:1371
#, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
@@ -2078,6 +2867,7 @@
"Neste caso, o Hibernate irá editar um único <literal>DELETE</literal>."
#. Tag: para
+#: performance.xml:1377
#, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
@@ -2091,6 +2881,7 @@
"ser que a coleção seja uma bag. Isto é certamente desejável."
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
@@ -2101,11 +2892,13 @@
"proceder:"
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr "delete dezoito linhas uma por uma e então insira três linhas"
#. Tag: para
+#: performance.xml:1394
#, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE</literal> and insert "
@@ -2115,6 +2908,7 @@
"cinco elementos atuais, um por um"
#. Tag: para
+#: performance.xml:1400
#, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
@@ -2126,6 +2920,7 @@
"deve confundir os triggers do banco de dados, etc."
#. Tag: para
+#: performance.xml:1404
#, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
@@ -2138,6 +2933,7 @@
"os elementos atuais. "
#. Tag: para
+#: performance.xml:1409
#, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
@@ -2147,11 +2943,13 @@
"<literal>inverse=\"true\"</literal>."
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "Monitorando desempenho"
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
@@ -2165,11 +2963,13 @@
"<literal>SessionFactory</literal>."
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "Monitorando uma SessionFactory"
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory</literal> metrics in two ways. Your "
@@ -2181,6 +2981,7 @@
"</literal> e ler ou dispôr as <literal>Estatísticas</literal> você mesmo."
#. Tag: para
+#: performance.xml:1430
#, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
@@ -2194,7 +2995,38 @@
"factory. Veja o seguinte código para exemplos de configurações "
"minimalísticos: "
+#. Tag: programlisting
+#: performance.xml:1435
+#, no-c-format
+msgid ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, no-c-format
+msgid ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1439
#, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
@@ -2204,6 +3036,7 @@
"literal>:"
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics</literal> "
@@ -2213,6 +3046,7 @@
"literal> para <literal>falso</literal>"
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> "
@@ -2222,6 +3056,7 @@
"literal> ou <literal>hibernateStatsBean.setStatisticsEnabled(true)</literal>"
#. Tag: para
+#: performance.xml:1458
#, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear()</"
@@ -2233,11 +3068,13 @@
"de info) usando o método <literal>logSummary()</literal>. "
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "Métricas"
#. Tag: para
+#: performance.xml:1466
#, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
@@ -2251,6 +3088,7 @@
"literal>, em três categorias: "
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid ""
"Metrics related to the general <literal>Session</literal> usage, such as "
@@ -2260,6 +3098,7 @@
"número de sessões em aberto, conexões JDBC recuperadas, etc."
#. Tag: para
+#: performance.xml:1479
#, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
@@ -2269,6 +3108,7 @@
"todo (mais conhecido como métricas globais). "
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
@@ -2278,6 +3118,7 @@
"consulta ou região de cache."
#. Tag: para
+#: performance.xml:1489
#, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
@@ -2293,6 +3134,7 @@
"algumas plataformas a precisão chega a ser de 10 segundos. "
#. Tag: para
+#: performance.xml:1495
#, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
@@ -2315,7 +3157,30 @@
"<literal>QueryStatistics</literal> para maiores informações. O seguinte "
"código mostra um exemplo simples: "
+#. Tag: programlisting
+#: performance.xml:1506
+#, no-c-format
+msgid ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:1508
#, no-c-format
msgid ""
"You can work on all entities, collections, queries and region caches, by "
@@ -2330,3 +3195,36 @@
"</literal>, <literal>getEntityNames()</literal>, "
"<literal>getCollectionRoleNames()</literal>, e "
"<literal>getSecondLevelCacheRegionNames()</literal>. "
+
+#~ msgid "or even:"
+#~ msgstr "ou ainda:"
+
+#~ msgid ""
+#~ "Now the following code will actually load both the customer <emphasis>and "
+#~ "their orders</emphasis>:"
+#~ msgstr ""
+#~ "Agora que o código seguinte irá carregar ambos cliente <emphasis>e outros "
+#~ "pedidos</emphasis>:"
+
+#~ msgid "yes"
+#~ msgstr "sim"
+
+#~ msgid ""
+#~ "The <literal><cache></literal> element of a class or collection "
+#~ "mapping has the following form:"
+#~ msgstr ""
+#~ "O elemento <literal><cache></literal> de uma classe ou mapeamento "
+#~ "de coleção possui a seguinte forma:"
+
+#~ msgid ""
+#~ "The <literal>usage</literal> attribute specifies a <emphasis>cache "
+#~ "concurrency strategy</emphasis>."
+#~ msgstr ""
+#~ "A função <literal>uso </literal> especifica uma <emphasis>estratégia de "
+#~ "concorrência de cache</emphasis>."
+
+#~ msgid "read-only"
+#~ msgstr "somente leitura"
+
+#~ msgid "read-write"
+#~ msgstr "leitura-escrita"
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/persistent_classes.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/persistent_classes.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/persistent_classes.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: persistent_classes\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-18 14:48+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,18 +118,20 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "Classes Persistentes"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:34
+#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
-"application). Not all instances of a persistent class are considered to be "
-"in the persistent state. For example, an instance can instead be transient "
-"or detached."
+"application). The term \"persistent\" here means that the classes are able "
+"to be persisted, not that they are in the persistent state (see <xref "
+"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"As classes persistentes são classes dentro de um aplicativo que implementa "
"as entidades de problemas de negócios (ex.: Cliente e Pedido em um "
@@ -138,13 +140,15 @@
"transiente ou desanexada. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:41
+#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
-"these rules are hard requirements. Indeed, Hibernate3 assumes very little "
+"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
-"in other ways (using trees of <literal>Map</literal> instances, for example)."
+"in other ways (using trees of <interfacename>java.util.Map</interfacename> "
+"instances, for example)."
msgstr ""
"O Hibernate trabalha melhor se estas classes seguirem uma regra simples, "
"também conhecida como modelo de programação Objeto de Java Antigo Simples "
@@ -154,20 +158,103 @@
"exemplo: utilizando árvores de instâncias <literal>Map</literal>)."
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "Um exemplo simples de POJO"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
#, no-c-format
+msgid "Simple POJO representing a cat"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:53
+#, no-c-format
msgid ""
-"Most Java applications require a persistent class representing felines. For "
-"example:"
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+"private Long id; // identifier\n"
+"\n"
+"private Date birthdate;\n"
+"private Color color;\n"
+"private char sex;\n"
+"private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+"\n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() );\n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
msgstr ""
-"A maior parte dos aplicativos Java requerem uma classe persistente que "
-"representa os felinos. Por exemplo:"
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
@@ -177,19 +264,21 @@
"maiores detalhes nas seguintes seções."
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "Implemente um construtor de não argumento"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:64
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> has a no-argument constructor. All persistent classes "
-"must have a default constructor (which can be non-public) so that Hibernate "
-"can instantiate them using <literal>Constructor.newInstance()</literal>. It "
-"is recommended that you have a default constructor with at least "
-"<emphasis>package</emphasis> visibility for runtime proxy generation in "
-"Hibernate."
+"<classname>Cat</classname> has a no-argument constructor. All persistent "
+"classes must have a default constructor (which can be non-public) so that "
+"Hibernate can instantiate them using <literal><classname>java.lang.reflect."
+"Constructor</classname>.newInstance()</literal>. It is recommended that this "
+"constructor be defined with at least <emphasis>package</emphasis> visibility "
+"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat</literal> possui um construtor de não argumento. Todas as "
"classes persistentes devem ter um construtor padrão (que não pode ser "
@@ -199,114 +288,146 @@
"emphasis> para a geração de um proxy de tempo de espera no Hibernate. "
#. Tag: title
-#, no-c-format
-msgid "Provide an identifier property (optional)"
+#: persistent_classes.xml:74
+#, fuzzy, no-c-format
+msgid "Provide an identifier property"
msgstr "Providencie uma propriedade de identificador (opcional)"
#. Tag: para
+#: persistent_classes.xml:77
#, no-c-format
msgid ""
-"<literal>Cat</literal> has a property called <literal>id</literal>. This "
-"property maps to the primary key column of a database table. The property "
-"might have been called anything, and its type might have been any primitive "
-"type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or "
-"<literal>java.util.Date</literal>. If your legacy database table has "
-"composite keys, you can use a user-defined class with properties of these "
-"types (see the section on composite identifiers later in the chapter.)"
+"Historically this was considered option. While still not (yet) enforced, "
+"this should be considered a deprecated feature as it will be completely "
+"required to provide a identifier property in an upcoming release."
msgstr ""
-"<literal>Cat</literal> possui uma propriedade chamada <literal>id</literal>. "
-"Esta propriedade mapeia para a coluna de chave primária de uma tabela de "
-"banco de dados. A propriedade pode ter sido chamada por qualquer nome e seu "
-"tipo pode ter sido qualquer um primitivo, ou qualquer tipo \"wrapper\", "
-"<literal>java.lang.String</literal> ou <literal>java.util.Date</literal>. Se "
-"sua tabela de banco de dados de legacia possuir chaves compostas, você "
-"também poderá usar uma classe de usuário definido, com propriedades destes "
-"tipos (veja a seção de identificadores compostos mais adiante.)"
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
msgid ""
-"The identifier property is strictly optional. You can leave them off and let "
-"Hibernate keep track of object identifiers internally. We do not recommend "
-"this, however."
+"<classname>Cat</classname> has a property named <literal>id</literal>. This "
+"property maps to the primary key column(s) of the underlying database table. "
+"The type of the identifier property can be any \"basic\" type (see <xref "
+"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
+"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
-"A propriedade de identificador é estritamente opcional. Você pode deixá-los "
-"desligados e deixar que o Hibernate encontre os identificadores de objeto "
-"internamente. No entanto, não recomendamos que faça isto."
#. Tag: para
+#: persistent_classes.xml:92
#, no-c-format
msgid ""
-"In fact, some functionality is available only to classes that declare an "
-"identifier property:"
+"Identifiers do not necessarily need to identify column(s) in the database "
+"physically defined as a primary key. They should just identify columns that "
+"can be used to uniquely identify rows in the underlying table."
msgstr ""
-"Na verdade, algumas funcionalidades estão disponíveis somente para classes "
-"que declaram uma propriedade de identificador:"
#. Tag: para
+#: persistent_classes.xml:99
#, no-c-format
msgid ""
-"Transitive reattachment for detached objects (cascade update or cascade "
-"merge) - see <xref linkend=\"objectstate-transitive\" />"
+"We recommend that you declare consistently-named identifier properties on "
+"persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr ""
-"Reconexão transitiva para objetos desanexados (atualização de cascata ou "
-"mesclagem de cascata) - veja <xref linkend=\"objectstate-transitive\" />"
+"Recomendamos que você declare propriedades de identificador nomeados de "
+"forma consistente nas classes persistentes e que você use um tipo anulável "
+"(ou seja, não primitivo)."
+#. Tag: title
+#: persistent_classes.xml:107
+#, fuzzy, no-c-format
+msgid "Prefer non-final classes (semi-optional)"
+msgstr "Prefira classes não finais (opcional)"
+
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
-msgstr "<literal>Session.saveOrUpdate()</literal>"
+msgid ""
+"A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), "
+"depends upon the persistent class being either non-final, or the "
+"implementation of an interface that declares all public methods. You can "
+"persist <literal>final</literal> classes that do not implement an interface "
+"with Hibernate; you will not, however, be able to use proxies for lazy "
+"association fetching which will ultimately limit your options for "
+"performance tuning. To persist a <literal>final</literal> class which does "
+"not implement a \"full\" interface you must disable proxy generation. See "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
+"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
+"ann\"/>."
+msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:121
#, no-c-format
-msgid "<literal>Session.merge()</literal>"
-msgstr "<literal>Session.merge()</literal>"
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:122
#, no-c-format
-msgid ""
-"We recommend that you declare consistently-named identifier properties on "
-"persistent classes and that you use a nullable (i.e., non-primitive) type."
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
msgstr ""
-"Recomendamos que você declare propriedades de identificador nomeados de "
-"forma consistente nas classes persistentes e que você use um tipo anulável "
-"(ou seja, não primitivo)."
#. Tag: title
+#: persistent_classes.xml:126
#, no-c-format
-msgid "Prefer non-final classes (optional)"
-msgstr "Prefira classes não finais (opcional)"
+msgid "Disabling proxies in annotations"
+msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:127
+#, no-c-format
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:130
#, no-c-format
msgid ""
-"A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon "
-"the persistent class being either non-final, or the implementation of an "
-"interface that declares all public methods."
+"If the <literal>final</literal> class does implement a proper interface, you "
+"could alternatively tell Hibernate to use the interface instead when "
+"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
+"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
+"final-example-proxy-interface-ann\"/>."
msgstr ""
-"Um recurso central do Hibernate, <emphasis>proxies</emphasis>, depende da "
-"classe persistente ser tanto não final como uma implementação de uma "
-"interface que declare todos os métodos públicos."
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:139
#, no-c-format
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:144
+#, no-c-format
+msgid "Proxying an interface in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:145
+#, no-c-format
msgid ""
-"You can persist <literal>final</literal> classes that do not implement an "
-"interface with Hibernate. You will not, however, be able to use proxies for "
-"lazy association fetching which will ultimately limit your options for "
-"performance tuning."
+"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
+"ICat { ... }]]>"
msgstr ""
-"Você pode persistir as classes <literal>final</literal> que não implementam "
-"uma interface com o Hibernate, mas não poderá usar os proxies para busca por "
-"associação lazy, que irá limitar suas opções para ajuste de desempenho. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:148
+#, fuzzy, no-c-format
msgid ""
-"You should also avoid declaring <literal>public final</literal> methods on "
-"the non-final classes. If you want to use a class with a <literal>public "
-"final</literal> method, you must explicitly disable proxying by setting "
-"<literal>lazy=\"false\"</literal>."
+"You should also avoid declaring <literal>public final</literal> methods as "
+"this will again limit the ability to generate <emphasis>proxies</emphasis> "
+"from this class. If you want to use a class with <literal>public final</"
+"literal> methods, you must explicitly disable proxying. Again, see <xref "
+"linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/"
+">."
msgstr ""
"Você deve evitar declarar métodos <literal>public final</literal> em classes "
"não finais. Se você desejar usar uma classe com um método <literal>public "
@@ -314,14 +435,16 @@
"<literal>lazy=\"false\"</literal>. "
#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr "Declare acessores e mutadores para campos persistentes (opcional)"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:160
+#, fuzzy, no-c-format
msgid ""
-"<literal>Cat</literal> declares accessor methods for all its persistent "
+"<classname>Cat</classname> declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
@@ -339,22 +462,26 @@
"acesso ao campo para certas propriedades, caso seja necessário. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:169
+#, fuzzy, no-c-format
msgid ""
-"Properties need <emphasis>not</emphasis> be declared public - Hibernate can "
-"persist a property with a default, <literal>protected</literal> or "
-"<literal>private</literal> get / set pair."
+"Properties need <emphasis>not</emphasis> be declared public. Hibernate can "
+"persist a property declared with <literal>package</literal>, "
+"<literal>protected</literal> or <literal>private</literal> visibility as "
+"well."
msgstr ""
"As propriedades precisam <emphasis>not</emphasis> ser declaradas como "
"públicas. O Hibernate pode persistir uma propriedade com um par get/set "
"padrão <literal>protegido</literal> ou <literal>privado</literal>."
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "Implementando herança"
#. Tag: para
+#: persistent_classes.xml:180
#, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
@@ -364,12 +491,34 @@
"sua propriedade de identificador a partir das superclasses, <literal>Cat</"
"literal>. Por exemplo:"
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:188
#, no-c-format
-msgid "Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
-msgstr "Implementando <literal>equals()</literal> e <literal>hashCode()</literal> "
+msgid ""
+"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
+msgstr ""
+"Implementando <literal>equals()</literal> e <literal>hashCode()</literal> "
#. Tag: para
+#: persistent_classes.xml:191
#, no-c-format
msgid ""
"You have to override the <literal>equals()</literal> and <literal>hashCode()"
@@ -379,6 +528,7 @@
"<literal>hashCode()</literal> se você:"
#. Tag: para
+#: persistent_classes.xml:196
#, no-c-format
msgid ""
"intend to put instances of persistent classes in a <literal>Set</literal> "
@@ -390,11 +540,13 @@
"valores), <emphasis>e</emphasis>"
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "pretender usar reconexão de instâncias desanexadas"
#. Tag: para
+#: persistent_classes.xml:206
#, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
@@ -411,6 +563,7 @@
"para os <literal>Set</literal>s. "
#. Tag: para
+#: persistent_classes.xml:212
#, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()</literal>/"
@@ -446,6 +599,7 @@
"Hibernate, e sim semânticas naturais do Java de igualdade e identidade."
#. Tag: para
+#: persistent_classes.xml:228
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals()</literal> and "
@@ -462,37 +616,72 @@
"nossa instância na realidade (uma chave de candidato <emphasis>natural</"
"emphasis>): "
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:235
#, no-c-format
msgid ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:237
+#, fuzzy, no-c-format
+msgid ""
"A business key does not have to be as solid as a database primary key "
-"candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable "
+"candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable "
"or unique properties are usually good candidates for a business key."
msgstr ""
"Note que uma chave de negócios não tem que ser tão sólida quanto um "
-"candidato de chave primária de base de dados (veja <xref linkend=\"transactions-basics-identity\" />). Propriedades imutáveis ou únicas são "
+"candidato de chave primária de base de dados (veja <xref linkend="
+"\"transactions-basics-identity\" />). Propriedades imutáveis ou únicas são "
"bons candidatos para uma chave de negócios. "
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr "Modelos dinâmicos"
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr "Nota"
-#. Tag: para
-#, no-c-format
+#. Tag: emphasis
+#: persistent_classes.xml:249
+#, fuzzy, no-c-format
msgid ""
-"<emphasis>The following features are currently considered experimental and "
-"may change in the near future.</emphasis>"
+"The following features are currently considered experimental and may change "
+"in the near future."
msgstr ""
"<emphasis>Os recursos seguintes são considerados experimentais no momento e "
"podem mudar no futuro.</emphasis> "
#. Tag: para
+#: persistent_classes.xml:253
#, no-c-format
msgid ""
"Persistent entities do not necessarily have to be represented as POJO "
@@ -509,19 +698,22 @@
"mapeamentos. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:259
+#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactory</"
"literal> using the <literal>default_entity_mode</literal> configuration "
-"option (see <xref linkend=\"configuration-optional-properties\" />)."
+"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"Por padrão, o Hibernate funciona em modo POJO normal. Você deve ajustar um "
"modo de representação de entidade por padrão para uma certa "
"<literal>SessionFactory</literal> usando a opção de configuração "
-"<literal>default_entity_mode</literal> (veja <xref linkend=\"configuration-optional-properties\" />). "
+"<literal>default_entity_mode</literal> (veja <xref linkend=\"configuration-"
+"optional-properties\" />). "
#. Tag: para
+#: persistent_classes.xml:265
#, no-c-format
msgid ""
"The following examples demonstrate the representation using <literal>Map</"
@@ -532,7 +724,47 @@
"literal>s. Primeiro, no arquivo de mapeamento, um <literal>entity-name</"
"literal> precisa ser declarado ao invés de (ou além de) um nome de classe:"
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:272
#, no-c-format
msgid ""
"Even though associations are declared using target class names, the target "
@@ -543,6 +775,7 @@
"invés de um POJO. "
#. Tag: para
+#: persistent_classes.xml:276
#, no-c-format
msgid ""
"After setting the default entity mode to <literal>dynamic-map</literal> for "
@@ -553,7 +786,34 @@
"para a <literal>SessionFactory</literal>, você poderá trabalhar com "
"<literal>Map</literal>s de <literal>Map</literal>s no período de execução: "
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, no-c-format
+msgid ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:283
#, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
@@ -572,6 +832,7 @@
"modelo de domínio apropriado na camada do topo num futuro próximo. "
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session</"
@@ -580,7 +841,25 @@
"Modos de representação de entidade podem ser também ajustados para base por "
"<literal>Session</literal>:"
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, no-c-format
+msgid ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:295
#, no-c-format
msgid ""
"Please note that the call to <literal>getSession()</literal> using an "
@@ -602,31 +881,35 @@
"manuseio da conexão para a unidade primária do trabalho. "
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:304
+#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
-"<xref linkend=\"xml\" />."
+"<xref linkend=\"xml\"/>."
msgstr ""
"Você poderá encontrar maiores informações sobre as atividades de "
"representação XML em <xref linkend=\"xml\" />. "
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizadores"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:312
+#, fuzzy, no-c-format
msgid ""
-"<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO "
-"through its constructor. It also knows how to access the POJO properties "
-"using the defined property accessors."
+"<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-"
+"interfaces are responsible for managing a particular representation of a "
+"piece of data given that representation's <classname>org.hibernate."
+"EntityMode</classname>. If a given piece of data is thought of as a data "
+"structure, then a tuplizer is the thing that knows how to create such a data "
+"structure, how to extract values from such a data structure and how to "
+"inject values into such a data structure. For example, for the POJO entity "
+"mode, the corresponding tuplizer knows how create the POJO through its "
+"constructor. It also knows how to access the POJO properties using the "
+"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer</literal>, e suas sub-interfaces, são "
"responsáveis por gerenciar uma certa representação de uma parte de dado, "
@@ -639,34 +922,45 @@
"propriedades definidas. "
#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
+msgid "There are two (high-level) types of Tuplizers:"
+msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:326
+#, no-c-format
msgid ""
-"There are two high-level types of Tuplizers, represented by the <literal>org."
-"hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate."
-"tuple.component.ComponentTuplizer</literal> interfaces. "
-"<literal>EntityTuplizer</literal>s are responsible for managing the above "
-"mentioned contracts in regards to entities, while "
-"<literal>ComponentTuplizer</literal>s do the same for components."
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"which is responsible for managing the above mentioned contracts in regards "
+"to entities"
msgstr ""
-"Existem dois tipos de alto nível de Tuplizadores, representados pelas "
-"interfaces <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> e "
-"<literal>org.hibernate.tuple.component.ComponentTuplizer</literal>. Os "
-"<literal>EntityTuplizer</literal>s são responsáveis pelo gerenciamento dos "
-"contratos mencionados acima em relação às entidades, enquanto os "
-"<literal>ComponentTuplizer</literal>s realizam o mesmo para os componentes."
#. Tag: para
+#: persistent_classes.xml:332
#, no-c-format
msgid ""
-"Users can also plug in their own tuplizers. Perhaps you require that a "
-"<literal>java.util.Map</literal> implementation other than <literal>java."
-"util.HashMap</literal> be used while in the dynamic-map entity-mode. Or "
-"perhaps you need to define a different proxy generation strategy than the "
-"one used by default. Both would be achieved by defining a custom tuplizer "
-"implementation. Tuplizer definitions are attached to the entity or component "
-"mapping they are meant to manage. Going back to the example of our customer "
-"entity:"
+"<interfacename>org.hibernate.tuple.component.ComponentTuplizer</"
+"interfacename> which does the same for components"
msgstr ""
+
+#. Tag: para
+#: persistent_classes.xml:340
+#, fuzzy, no-c-format
+msgid ""
+"Users can also plug in their own tuplizers. Perhaps you require that "
+"<interfacename>java.util.Map</interfacename> implementation other than "
+"<classname>java.util.HashMap</classname> be used while in the dynamic-map "
+"entity-mode. Or perhaps you need to define a different proxy generation "
+"strategy than the one used by default. Both would be achieved by defining a "
+"custom tuplizer implementation. Tuplizer definitions are attached to the "
+"entity or component mapping they are meant to manage. Going back to the "
+"example of our <classname>Customer</classname> entity, <xref linkend="
+"\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom "
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
+"\"/> shows how to do the same in <literal>hbm.xml</literal>"
+msgstr ""
"Os usuários podem também plugar seu próprio tuplizador. Talvez você queira "
"usar uma implementação <literal>java.util.Map</literal> ao invés de uma "
"<literal>java.util.HashMap</literal> enquanto estiver no modo de entidade "
@@ -678,26 +972,83 @@
"nosso cliente:"
#. Tag: title
+#: persistent_classes.xml:353
#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class entity-name=\"Customer\">\n"
+" <!--\n"
+" Override the dynamic-map entity-mode\n"
+" tuplizer for the customer entity\n"
+" -->\n"
+" <tuplizer entity-mode=\"dynamic-map\"\n"
+" class=\"CustomMapTuplizerImpl\"/>\n"
+"\n"
+" <id name=\"id\" type=\"long\" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <!-- other properties -->\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
+#, no-c-format
msgid "EntityNameResolvers"
msgstr "EntityNameResolvers"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:365
+#, fuzzy, no-c-format
msgid ""
-"The <interfacename>org.hibernate.EntityNameResolver</interfacename> "
-"interface is a contract for resolving the entity name of a given entity "
-"instance. The interface defines a single method "
-"<methodname>resolveEntityName</methodname> which is passed the entity "
-"instance and is expected to return the appropriate entity name (null is "
-"allowed and would indicate that the resolver does not know how to resolve "
-"the entity name of the given entity instance). Generally speaking, an "
-"<interfacename>org.hibernate.EntityNameResolver</interfacename> is going to "
-"be most useful in the case of dynamic models. One example might be using "
-"proxied interfaces as your domain model. The hibernate test suite has an "
-"example of this exact style of usage under the <package>org.hibernate.test."
-"dynamicentity.tuplizer2</package>. Here is some of the code from that "
-"package for illustration."
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> is a "
+"contract for resolving the entity name of a given entity instance. The "
+"interface defines a single method <methodname>resolveEntityName</methodname> "
+"which is passed the entity instance and is expected to return the "
+"appropriate entity name (null is allowed and would indicate that the "
+"resolver does not know how to resolve the entity name of the given entity "
+"instance). Generally speaking, an <interfacename>org.hibernate."
+"EntityNameResolver</interfacename> is going to be most useful in the case of "
+"dynamic models. One example might be using proxied interfaces as your domain "
+"model. The hibernate test suite has an example of this exact style of usage "
+"under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. "
+"Here is some of the code from that package for illustration."
msgstr ""
"A interface <interfacename>org.hibernate.EntityNameResolver</interfacename> "
"é um contrato para resolver o nome da entidade de uma instância de entidade "
@@ -713,7 +1064,138 @@
"package>. Segue abaixo parte do código a partir daquele pacote para "
"ilustração."
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, no-c-format
+msgid ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an\n"
+" * interface as the domain model and simply store persistent state in an "
+"internal\n"
+" * Map. This is an extremely trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" *\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names\n"
+" * should be resolved. Since this particular impl can handle resolution for "
+"all of our\n"
+" * entities we want to take advantage of the fact that SessionFactoryImpl "
+"keeps these\n"
+" * in a Set so that we only ever have one instance registered. Why? Well, "
+"when it\n"
+" * comes time to resolve an entity name, Hibernate must iterate over all the "
+"registered\n"
+" * resolvers. So keeping that number down helps that process be as speedy "
+"as possible.\n"
+" * Hence the equals and hashCode implementations as is\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ..."
+msgstr ""
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
msgid ""
"In order to register an <interfacename>org.hibernate.EntityNameResolver</"
@@ -723,16 +1205,19 @@
"EntityNameResolver</interfacename>, os usuários devem tanto:"
#. Tag: para
-#, no-c-format
+#: persistent_classes.xml:383
+#, fuzzy, no-c-format
msgid ""
-"Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link>, implementing the <methodname>getEntityNameResolvers</methodname> "
-"method."
+"Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers"
+"\"/>), implementing the <methodname>getEntityNameResolvers</methodname> "
+"method"
msgstr ""
"Implementar um <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
-"link> personalizado, implementando o método <methodname>getEntityNameResolvers</methodname>."
+"link> personalizado, implementando o método "
+"<methodname>getEntityNameResolvers</methodname>."
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</"
@@ -745,3 +1230,94 @@
"hibernate.SessionFactory</interfacename>) usando o método "
"<methodname>registerEntityNameResolver</methodname>."
+#~ msgid ""
+#~ "Most Java applications require a persistent class representing felines. "
+#~ "For example:"
+#~ msgstr ""
+#~ "A maior parte dos aplicativos Java requerem uma classe persistente que "
+#~ "representa os felinos. Por exemplo:"
+
+#~ msgid ""
+#~ "<literal>Cat</literal> has a property called <literal>id</literal>. This "
+#~ "property maps to the primary key column of a database table. The property "
+#~ "might have been called anything, and its type might have been any "
+#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
+#~ "String</literal> or <literal>java.util.Date</literal>. If your legacy "
+#~ "database table has composite keys, you can use a user-defined class with "
+#~ "properties of these types (see the section on composite identifiers later "
+#~ "in the chapter.)"
+#~ msgstr ""
+#~ "<literal>Cat</literal> possui uma propriedade chamada <literal>id</"
+#~ "literal>. Esta propriedade mapeia para a coluna de chave primária de uma "
+#~ "tabela de banco de dados. A propriedade pode ter sido chamada por "
+#~ "qualquer nome e seu tipo pode ter sido qualquer um primitivo, ou qualquer "
+#~ "tipo \"wrapper\", <literal>java.lang.String</literal> ou <literal>java."
+#~ "util.Date</literal>. Se sua tabela de banco de dados de legacia possuir "
+#~ "chaves compostas, você também poderá usar uma classe de usuário definido, "
+#~ "com propriedades destes tipos (veja a seção de identificadores compostos "
+#~ "mais adiante.)"
+
+#~ msgid ""
+#~ "The identifier property is strictly optional. You can leave them off and "
+#~ "let Hibernate keep track of object identifiers internally. We do not "
+#~ "recommend this, however."
+#~ msgstr ""
+#~ "A propriedade de identificador é estritamente opcional. Você pode deixá-"
+#~ "los desligados e deixar que o Hibernate encontre os identificadores de "
+#~ "objeto internamente. No entanto, não recomendamos que faça isto."
+
+#~ msgid ""
+#~ "In fact, some functionality is available only to classes that declare an "
+#~ "identifier property:"
+#~ msgstr ""
+#~ "Na verdade, algumas funcionalidades estão disponíveis somente para "
+#~ "classes que declaram uma propriedade de identificador:"
+
+#~ msgid ""
+#~ "Transitive reattachment for detached objects (cascade update or cascade "
+#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
+#~ msgstr ""
+#~ "Reconexão transitiva para objetos desanexados (atualização de cascata ou "
+#~ "mesclagem de cascata) - veja <xref linkend=\"objectstate-transitive\" />"
+
+#~ msgid "<literal>Session.saveOrUpdate()</literal>"
+#~ msgstr "<literal>Session.saveOrUpdate()</literal>"
+
+#~ msgid "<literal>Session.merge()</literal>"
+#~ msgstr "<literal>Session.merge()</literal>"
+
+#~ msgid ""
+#~ "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends "
+#~ "upon the persistent class being either non-final, or the implementation "
+#~ "of an interface that declares all public methods."
+#~ msgstr ""
+#~ "Um recurso central do Hibernate, <emphasis>proxies</emphasis>, depende da "
+#~ "classe persistente ser tanto não final como uma implementação de uma "
+#~ "interface que declare todos os métodos públicos."
+
+#~ msgid ""
+#~ "You can persist <literal>final</literal> classes that do not implement an "
+#~ "interface with Hibernate. You will not, however, be able to use proxies "
+#~ "for lazy association fetching which will ultimately limit your options "
+#~ "for performance tuning."
+#~ msgstr ""
+#~ "Você pode persistir as classes <literal>final</literal> que não "
+#~ "implementam uma interface com o Hibernate, mas não poderá usar os proxies "
+#~ "para busca por associação lazy, que irá limitar suas opções para ajuste "
+#~ "de desempenho. "
+
+#~ msgid ""
+#~ "There are two high-level types of Tuplizers, represented by the "
+#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal> "
+#~ "interfaces. <literal>EntityTuplizer</literal>s are responsible for "
+#~ "managing the above mentioned contracts in regards to entities, while "
+#~ "<literal>ComponentTuplizer</literal>s do the same for components."
+#~ msgstr ""
+#~ "Existem dois tipos de alto nível de Tuplizadores, representados pelas "
+#~ "interfaces <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> e "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal>. Os "
+#~ "<literal>EntityTuplizer</literal>s são responsáveis pelo gerenciamento "
+#~ "dos contratos mencionados acima em relação às entidades, enquanto os "
+#~ "<literal>ComponentTuplizer</literal>s realizam o mesmo para os "
+#~ "componentes."
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/preface.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/preface.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -109,7 +109,7 @@
msgstr ""
"Project-Id-Version: preface\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-18 15:24+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -119,19 +119,24 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr "Prefácio"
#. Tag: para
-#, no-c-format
+#: preface.xml:35
+#, fuzzy, no-c-format
msgid ""
-"Working with object-oriented software and a relational database can be "
-"cumbersome and time consuming in today's enterprise environments. Hibernate "
-"is an Object/Relational Mapping tool for Java environments. The term Object/"
-"Relational Mapping (ORM) refers to the technique of mapping a data "
-"representation from an object model to a relational data model with a SQL-"
-"based schema."
+"Working with both Object-Oriented software and Relational Databases can be "
+"cumbersome and time consuming. Development costs are significantly higher "
+"due to a paradigm mismatch between how data is represented in objects versus "
+"relational databases. Hibernate is an Object/Relational Mapping solution for "
+"Java environments. The term Object/Relational Mapping refers to the "
+"technique of mapping a data representation from an object model to a "
+"relational data model with a SQL-based schema; see <ulink url=\"http://en."
+"wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/"
+"Object-relational_mapping</ulink> for a discussion."
msgstr ""
"O trabalho com o software objeto relacional e banco de dados relacionais, "
"pode ser incômodo e desgastante atualmente num meio empresarial. Hibernate é "
@@ -141,8 +146,32 @@
"um esquema baseado na SQL. "
#. Tag: para
+#: preface.xml:46
#, no-c-format
msgid ""
+"While having a strong background in SQL is not required to use Hibernate, "
+"having a basic understanding of the concepts can greatly help you understand "
+"Hibernate more fully and quickly. Probably the single best background is an "
+"understanding of data modeling principles. You might want to consider these "
+"resources as a good starting point:"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:54
+#, no-c-format
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
+
+#. Tag: ulink
+#: preface.xml:59
+#, no-c-format
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
+
+#. Tag: para
+#: preface.xml:66
+#, no-c-format
+msgid ""
"Hibernate not only takes care of the mapping from Java classes to database "
"tables (and from Java data types to SQL data types), but also provides data "
"query and retrieval facilities. It can also significantly reduce development "
@@ -155,17 +184,29 @@
"contrário, consumido com o manual de dados executados em SQL e JDBC. "
#. Tag: para
+#: preface.xml:72
#, no-c-format
msgid ""
-"Hibernate's goal is to relieve the developer from 95 percent of common data "
-"persistence related programming tasks. Hibernate may not be the best "
-"solution for data-centric applications that only use stored-procedures to "
-"implement the business logic in the database, it is most useful with object-"
-"oriented domain models and business logic in the Java-based middle-tier. "
-"However, Hibernate can certainly help you to remove or encapsulate vendor-"
-"specific SQL code and will help with the common task of result set "
-"translation from a tabular representation to a graph of objects."
+"Hibernate’s design goal is to relieve the developer from 95% of common data "
+"persistence-related programming tasks by eliminating the need for manual, "
+"hand-crafted data processing using SQL and JDBC. However, unlike many other "
+"persistence solutions, Hibernate does not hide the power of SQL from you and "
+"guarantees that your investment in relational technology and knowledge is as "
+"valid as always."
msgstr ""
+
+#. Tag: para
+#: preface.xml:79
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate may not be the best solution for data-centric applications that "
+"only use stored-procedures to implement the business logic in the database, "
+"it is most useful with object-oriented domain models and business logic in "
+"the Java-based middle-tier. However, Hibernate can certainly help you to "
+"remove or encapsulate vendor-specific SQL code and will help with the common "
+"task of result set translation from a tabular representation to a graph of "
+"objects."
+msgstr ""
"A meta de Hibernate é aliviar o desenvolvedor em 95% de dados comuns de "
"persistência relacionados as tarefas de programação. O Hibernate talvez não "
"seja a melhor solução para as aplicações centradas em dados, das quais "
@@ -178,6 +219,7 @@
"gráfico de objetos."
#. Tag: para
+#: preface.xml:88
#, no-c-format
msgid ""
"If you are new to Hibernate and Object/Relational Mapping or even Java, "
@@ -187,25 +229,29 @@
"Hibernate, Mapeamento Objeto/Relacional ou mesmo Java:"
#. Tag: para
-#, no-c-format
+#: preface.xml:95
+#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step "
+"Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step "
"instructions. The source code for the tutorial is included in the "
"distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
-"Leia <xref linkend=\"tutorial\" /> com passo-a-passo de instruções tutoriais. "
-"O código de origem tutorial está incluído no diretório de distribuição <literal>doc/reference/tutorial/</literal>."
+"Leia <xref linkend=\"tutorial\" /> com passo-a-passo de instruções "
+"tutoriais. O código de origem tutorial está incluído no diretório de "
+"distribuição <literal>doc/reference/tutorial/</literal>."
#. Tag: para
-#, no-c-format
+#: preface.xml:103
+#, fuzzy, no-c-format
msgid ""
-"Read <xref linkend=\"architecture\" /> to understand the environments where "
+"Read <xref linkend=\"architecture\"/> to understand the environments where "
"Hibernate can be used."
msgstr ""
"Leia <xref linkend=\"architecture\"/> para melhor entendimento dos meios "
"onde Hibernate pode ser utilizado. "
#. Tag: para
+#: preface.xml:109
#, no-c-format
msgid ""
"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
@@ -224,20 +270,25 @@
"literal>. "
#. Tag: para
-#, no-c-format
+#: preface.xml:120
+#, fuzzy, no-c-format
msgid ""
"Use this reference documentation as your primary source of information. "
"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
"more help with application design, or if you prefer a step-by-step tutorial. "
-"Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download "
-"the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+"Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and "
+"download the example application from <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>."
msgstr ""
"Utilize esta documentação de referência como a sua primeira fonte de "
-"informação. Considere a leitura <biblioref linkend=\"biblio-JPwH\"></biblioref>, caso você precise de auxílio com a aplicação de design, ou tutorial com passo-a-passo, caso seja desejado. "
-"Você pode também visitar <ulink url=\"http://caveatemptor.hibernate.org\" /> e fazer o "
-"download do exemplo de aplicação da <biblioref linkend=\"biblio-JPwH\"></biblioref>."
+"informação. Considere a leitura <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>, caso você precise de auxílio com a aplicação de design, ou "
+"tutorial com passo-a-passo, caso seja desejado. Você pode também visitar "
+"<ulink url=\"http://caveatemptor.hibernate.org\" /> e fazer o download do "
+"exemplo de aplicação da <biblioref linkend=\"biblio-JPwH\"></biblioref>."
#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr ""
@@ -245,6 +296,7 @@
"Hibernate. "
#. Tag: para
+#: preface.xml:135
#, no-c-format
msgid ""
"Links to third party demos, examples, and tutorials are maintained on the "
@@ -254,6 +306,7 @@
"website Hibernate. "
#. Tag: para
+#: preface.xml:141
#, no-c-format
msgid ""
"The Community Area on the Hibernate website is a good resource for design "
@@ -264,34 +317,93 @@
"design e várias soluções integradas. ( Tomcat, JBoss AS, Struts, EJB, etc. )"
#. Tag: para
+#: preface.xml:149
#, no-c-format
msgid ""
-"If you have questions, use the user forum linked on the Hibernate website. "
-"We also provide a JIRA issue tracking system for bug reports and feature "
-"requests. If you are interested in the development of Hibernate, join the "
-"developer mailing list. If you are interested in translating this "
-"documentation into your language, contact us on the developer mailing list."
+"There are a number of ways to become involved in the Hibernate community, "
+"including"
msgstr ""
-"Em caso de dúvidas, utilize o fórum do usuário encontrado no website "
-"Hibernate. Nós também provemos o JIRA sistema de questão de rastreamento "
-"para os relatórios de erros de programação e recursos solicitados. Se você "
-"tem interesse no desenvolvimento do Hibernate, participe da lista de correio "
-"eletrônico do desenvolvedor. Caso você tenha interesse em traduzir este "
-"documento na sua própria língua, por favor entre em contato conosco através "
-"da lista de correio eletrônico do desenvolvedor. "
#. Tag: para
+#: preface.xml:153
#, no-c-format
msgid ""
-"Commercial development support, production support, and training for "
-"Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
-"SupportTraining/). Hibernate is a Professional Open Source project and a "
-"critical component of the JBoss Enterprise Middleware System (JEMS) suite of "
-"products."
+"Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/"
+"issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
msgstr ""
-"O suporte do desenvolvimento comercial, suporte de produção e treinamento de "
-"Hibernate está disponível através do JBoss Inc. ( see http://www.hibernate."
-"org/SupportTraining/ ). Hibernate é um projeto de Fonte Aberta Profissional "
-"e componente crítico do Sistema Jboss de Empreendimento e Middleware "
-"( JEMS ) suíte de produtos. "
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid ""
+"Trying your hand at fixing some bugs or implementing enhancements. Again, "
+"see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate."
+"org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid ""
+"<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/"
+"community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid ""
+"There are forums for users to ask questions and receive help from the "
+"community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid ""
+"There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat"
+"\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid ""
+"Helping improve or translate this documentation. Contact us on the developer "
+"mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
+
+#~ msgid ""
+#~ "If you have questions, use the user forum linked on the Hibernate "
+#~ "website. We also provide a JIRA issue tracking system for bug reports and "
+#~ "feature requests. If you are interested in the development of Hibernate, "
+#~ "join the developer mailing list. If you are interested in translating "
+#~ "this documentation into your language, contact us on the developer "
+#~ "mailing list."
+#~ msgstr ""
+#~ "Em caso de dúvidas, utilize o fórum do usuário encontrado no website "
+#~ "Hibernate. Nós também provemos o JIRA sistema de questão de rastreamento "
+#~ "para os relatórios de erros de programação e recursos solicitados. Se "
+#~ "você tem interesse no desenvolvimento do Hibernate, participe da lista de "
+#~ "correio eletrônico do desenvolvedor. Caso você tenha interesse em "
+#~ "traduzir este documento na sua própria língua, por favor entre em contato "
+#~ "conosco através da lista de correio eletrônico do desenvolvedor. "
+
+#~ msgid ""
+#~ "Commercial development support, production support, and training for "
+#~ "Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
+#~ "SupportTraining/). Hibernate is a Professional Open Source project and a "
+#~ "critical component of the JBoss Enterprise Middleware System (JEMS) suite "
+#~ "of products."
+#~ msgstr ""
+#~ "O suporte do desenvolvimento comercial, suporte de produção e treinamento "
+#~ "de Hibernate está disponível através do JBoss Inc. ( see http://www."
+#~ "hibernate.org/SupportTraining/ ). Hibernate é um projeto de Fonte Aberta "
+#~ "Profissional e componente crítico do Sistema Jboss de Empreendimento e "
+#~ "Middleware ( JEMS ) suíte de produtos. "
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/query_sql.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/query_sql.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/query_sql.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: query_sql\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-19 09:46+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,11 +118,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr "SQL Nativo"
#. Tag: para
+#: query_sql.xml:33
#, no-c-format
msgid ""
"You can also express queries in the native SQL dialect of your database. "
@@ -138,6 +140,7 @@
"de uma aplicação baseada em SQL/JDBC direta até o Hibernate. "
#. Tag: para
+#: query_sql.xml:39
#, no-c-format
msgid ""
"Hibernate3 allows you to specify handwritten SQL, including stored "
@@ -148,11 +151,13 @@
"deletar e carregar."
#. Tag: title
+#: query_sql.xml:43
#, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr "Usando um <literal>SQLQuery</literal>"
#. Tag: para
+#: query_sql.xml:45
#, no-c-format
msgid ""
"Execution of native SQL queries is controlled via the <literal>SQLQuery</"
@@ -166,16 +171,27 @@
"para consultas."
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr "Consultas Escalares"
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr "A consulta SQL mais básica é obter uma lista dos escalares (valores)."
+#. Tag: programlisting
+#: query_sql.xml:56
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:58
#, no-c-format
msgid ""
"These will return a List of Object arrays (Object[]) with scalar values for "
@@ -188,6 +204,7 @@
"retornados."
#. Tag: para
+#: query_sql.xml:63
#, no-c-format
msgid ""
"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or "
@@ -198,22 +215,36 @@
"para ser mais explícito em o quê é retornado, você poderá usar o "
"<literal>addScalar()</literal>:"
+#. Tag: programlisting
+#: query_sql.xml:67
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr "Esta consulta especificou:"
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr "A string da consulta SQL"
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr "as colunas e tipos para retornar"
#. Tag: para
+#: query_sql.xml:81
#, no-c-format
msgid ""
"This will return Object arrays, but now it will not use "
@@ -232,6 +263,7 @@
"colunas listadas. "
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
msgid ""
"It is possible to leave out the type information for all or some of the "
@@ -240,7 +272,18 @@
"É possível deixar de fora o tipo de informação para todos ou alguns dos "
"escalares."
+#. Tag: programlisting
+#: query_sql.xml:92
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:94
#, no-c-format
msgid ""
"This is essentially the same query as before, but now "
@@ -252,6 +295,7 @@
"e DATA DE NASCIMENTO onde o tipo de ID é explicitamente especificado. "
#. Tag: para
+#: query_sql.xml:99
#, no-c-format
msgid ""
"How the java.sql.Types returned from ResultSetMetaData is mapped to "
@@ -265,11 +309,13 @@
"chamadas para <literal>registerHibernateType</literal> no Dialeto. "
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr "Consultas de Entidade"
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
msgid ""
"The above queries were all about returning scalar values, basically "
@@ -282,12 +328,23 @@
"resultados. A seguir, mostramos como obter objetos de entidade da consulta "
"sql nativa através do <literal>addEntity()</literal>."
+#. Tag: programlisting
+#: query_sql.xml:114
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr "A entidade retornada por uma consulta"
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
msgid ""
"Assuming that Cat is mapped as a class with the columns ID, NAME and "
@@ -299,6 +356,7 @@
"elemento é uma entidade de Cat."
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
msgid ""
"If the entity is mapped with a <literal>many-to-one</literal> to another "
@@ -315,17 +373,28 @@
"a anotação, mas preferimos ser explícitos como no seguinte exemplo para "
"uma<literal>muitos-para-um</literal> para um <literal>Dog</literal>:"
+#. Tag: programlisting
+#: query_sql.xml:140
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr "Isto irá permitir que o cat.getDog() funcione de forma apropriada"
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr "Manuseio de associações e coleções"
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
msgid ""
"It is possible to eagerly join in the <literal>Dog</literal> to avoid the "
@@ -338,7 +407,18 @@
"método <literal>addJoin()</literal>que permite que você se una à associação "
"ou coleção."
+#. Tag: programlisting
+#: query_sql.xml:153
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:155
#, no-c-format
msgid ""
"In this example, the returned <literal>Cat</literal>'s will have their "
@@ -355,7 +435,18 @@
"união para coleções, ex.: se ao invés disso, o <literal>Cat</literal> "
"tivesse um-para-muitos para <literal>Dog</literal>."
+#. Tag: programlisting
+#: query_sql.xml:163
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:165
#, no-c-format
msgid ""
"At this stage you are reaching the limits of what is possible with native "
@@ -370,11 +461,13 @@
"suficientes. "
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr "Retorno de entidades múltiplas"
#. Tag: para
+#: query_sql.xml:175
#, no-c-format
msgid ""
"Until now, the result set column names are assumed to be the same as the "
@@ -389,6 +482,7 @@
"mais de uma tabela. "
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
msgid ""
"Column alias injection is needed in the following query (which most likely "
@@ -397,7 +491,18 @@
"É necessário uma injeção de alias de coluna na seguinte consulta (a qual é "
"bem provável que falhe):"
+#. Tag: programlisting
+#: query_sql.xml:183
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:185
#, no-c-format
msgid ""
"The query was intended to return two Cat instances per row: a cat and its "
@@ -415,11 +520,23 @@
"mapeamento (\"ID\" e \"NOME\"). "
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
msgstr "A seguinte forma não é vulnerável à duplicação do nome de coluna:"
+#. Tag: programlisting
+#: query_sql.xml:195
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
msgid ""
"the SQL query string, with placeholders for Hibernate to inject column "
@@ -429,11 +546,13 @@
"aliases de coluna."
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr "as entidades retornadas pela consulta"
#. Tag: para
+#: query_sql.xml:210
#, no-c-format
msgid ""
"The {cat.*} and {mother.*} notation used above is a shorthand for \"all "
@@ -454,12 +573,28 @@
"Note que podemos até usar os aliases de propriedade na cláusula where se "
"quisermos."
+#. Tag: programlisting
+#: query_sql.xml:219
+#, no-c-format
+msgid ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr "Alias e referências de propriedades"
#. Tag: para
+#: query_sql.xml:224
#, no-c-format
msgid ""
"In most cases the above alias injection is needed. For queries relating to "
@@ -473,6 +608,7 @@
"aliases específicos que permitem o Hibernate injetar os aliases apropriados."
#. Tag: para
+#: query_sql.xml:229
#, no-c-format
msgid ""
"The following table shows the different ways you can use the alias "
@@ -485,180 +621,213 @@
"alias terá um nome único e provavelmente diferente quando usado."
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr "Nomes de injeção de alias"
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr "Descrição"
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr "Sintáxe"
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr "Exemplo"
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr "Uma propriedade simples"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+#. Tag: literal
+#: query_sql.xml:258
+#, fuzzy, no-c-format
+msgid "{[aliasname].[propertyname]"
msgstr "<literal>{[aliasname].[propertyname]</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
+#. Tag: literal
+#: query_sql.xml:260
+#, fuzzy, no-c-format
+msgid "A_NAME as {item.name}"
msgstr "<literal>A_NAME as {item.name}</literal>"
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr "Uma propriedade composta"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+#. Tag: literal
+#: query_sql.xml:266
+#, fuzzy, no-c-format
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid ""
-"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
-"literal>"
+#. Tag: literal
+#: query_sql.xml:268
+#, fuzzy, no-c-format
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
msgstr ""
"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
"literal>"
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr "Discriminador de uma entidade"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
+#. Tag: literal
+#: query_sql.xml:275
+#, fuzzy, no-c-format
+msgid "{[aliasname].class}"
msgstr "<literal>{[aliasname].class}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
+#. Tag: literal
+#: query_sql.xml:277
+#, fuzzy, no-c-format
+msgid "DISC as {item.class}"
msgstr "<literal>DISC as {item.class}</literal>"
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr "Todas as propriedades de uma entidade"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
+#, fuzzy, no-c-format
+msgid "{[aliasname].*}"
msgstr "<literal>{[aliasname].*}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:285
#, no-c-format
-msgid "<literal>{item.*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{item.*}"
+msgstr ""
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr "Uma chave de coleção"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
+#. Tag: literal
+#: query_sql.xml:291
+#, fuzzy, no-c-format
+msgid "{[aliasname].key}"
msgstr "<literal>{[aliasname].key}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
+#. Tag: literal
+#: query_sql.xml:293
+#, fuzzy, no-c-format
+msgid "ORGID as {coll.key}"
msgstr "<literal>ORGID as {coll.key}</literal>"
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr "O id de uma coleção"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
+#. Tag: literal
+#: query_sql.xml:299
+#, fuzzy, no-c-format
+msgid "{[aliasname].id}"
msgstr "<literal>{[aliasname].id}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
+#. Tag: literal
+#: query_sql.xml:301
+#, fuzzy, no-c-format
+msgid "EMPID as {coll.id}"
msgstr "<literal>EMPID as {coll.id}</literal>"
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr "O elemento de uma coleção"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
+#. Tag: literal
+#: query_sql.xml:307
+#, fuzzy, no-c-format
+msgid "{[aliasname].element}"
msgstr "<literal>{[aliasname].element}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
+#. Tag: literal
+#: query_sql.xml:309
+#, fuzzy, no-c-format
+msgid "XID as {coll.element}"
msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry
+#: query_sql.xml:313
#, no-c-format
msgid "property of the element in the collection"
msgstr "propriedade de elemento na coleção "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+#. Tag: literal
+#: query_sql.xml:315
+#, fuzzy, no-c-format
+msgid "{[aliasname].element.[propertyname]}"
msgstr "<literal>{[aliasname].element.[propertyname]}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
+#. Tag: literal
+#: query_sql.xml:317
+#, fuzzy, no-c-format
+msgid "NAME as {coll.element.name}"
msgstr "<literal>NAME as {coll.element.name}</literal>"
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr "Todas as propriedades de elemento na coleção"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:323
+#, fuzzy, no-c-format
+msgid "{[aliasname].element.*}"
msgstr "<literal>{[aliasname].element.*}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:325
+#, fuzzy, no-c-format
+msgid "{coll.element.*}"
msgstr "<literal>{coll.element.*}</literal>"
#. Tag: entry
+#: query_sql.xml:329
#, no-c-format
msgid "All properties of the collection"
msgstr "Todas as propriedades da coleção "
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:333
#, no-c-format
-msgid "<literal>{coll.*}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "{coll.*}"
+msgstr ""
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr "Retorno de entidades não gerenciadas"
#. Tag: para
+#: query_sql.xml:344
#, no-c-format
msgid ""
"It is possible to apply a ResultTransformer to native SQL queries, allowing "
@@ -667,12 +836,22 @@
"É possível aplicar um ResultTransformer para consultas sql nativas, "
"permitindo que o retorno de entidades não gerenciadas."
+#. Tag: programlisting
+#: query_sql.xml:347
+#, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr "um transformador de resultado"
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
msgid ""
"The above query will return a list of <literal>CatDTO</literal> which has "
@@ -684,11 +863,13 @@
"propriedades correspondentes ou campos."
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr "Manuseio de herança"
#. Tag: para
+#: query_sql.xml:369
#, no-c-format
msgid ""
"Native SQL queries which query for entities that are mapped as part of an "
@@ -700,35 +881,90 @@
"as suas subclasses. "
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr "Parâmetros"
#. Tag: para
+#: query_sql.xml:377
#, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr ""
"Consultas sql Nativas suportam parâmetros posicionais assim como parâmetros "
"nomeados:"
+#. Tag: programlisting
+#: query_sql.xml:380
+#, no-c-format
+msgid ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr "Consultas SQL Nomeadas"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:387
+#, fuzzy, no-c-format
msgid ""
-"Named SQL queries can be defined in the mapping document and called in "
-"exactly the same way as a named HQL query. In this case, you do "
-"<emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
+"Named SQL queries can also be defined in the mapping document and called in "
+"exactly the same way as a named HQL query (see <xref linkend=\"objectstate-"
+"querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> "
+"need to call <literal>addEntity()</literal>."
msgstr ""
"Consultas SQL Nomeadas podem ser definidas no documento de mapeamento e "
"chamadas exatamente da mesma forma que uma consulta HQL nomeada. Neste caso "
"nós <emphasis>não</emphasis> precisamos chamar o <literal>addEntity()</"
"literal>."
+#. Tag: title
+#: query_sql.xml:394
+#, no-c-format
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:397
+#, no-c-format
+msgid ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, no-c-format
+msgid ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:406
#, no-c-format
msgid ""
"The <literal><return-join></literal> element is use to join "
@@ -739,7 +975,36 @@
"collection></literal> são usados para unir associações e definir "
"consultas que inicializam coleções, "
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, no-c-format
+msgid ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
msgid ""
"A named SQL query may return a scalar value. You must declare the column "
@@ -750,7 +1015,27 @@
"um alias de coluna e um tipo Hibernate usando o elemento <literal><return-"
"scalar></literal>:"
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name, \n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:426
#, no-c-format
msgid ""
"You can externalize the resultset mapping information in a <literal><"
@@ -763,7 +1048,39 @@
"diversas consultas nomeadas quanto através da API "
"<literal>setResultSetMapping()</literal>."
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, no-c-format
+msgid ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:438
#, no-c-format
msgid ""
"You can, alternatively, use the resultset mapping information in your hbm "
@@ -773,13 +1090,340 @@
"conjunto de resultado em seus arquivos hbm em código de java. "
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, no-c-format
+msgid ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid ""
+"So far we have only looked at externalizing SQL queries using Hibernate "
+"mapping files. The same concept is also available with anntations and is "
+"called named native queries. You can use <classname>@NamedNativeQuery</"
+"classname> (<classname>@NamedNativeQueries</classname>) in conjunction with "
+"<literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</"
+"literal>). Like <literal>@NamedQuery</literal>, "
+"<classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</"
+"literal> can be defined at class level, but their scope is global to the "
+"application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid ""
+"shows how 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. "
+"In the example 2 entities, <literal>Night</literal> and <literal>Area</"
+"literal>, are returned and each property is declared and associated to a "
+"column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid ""
+"In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set "
+"mapping is implicit. We only describe the entity class of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid ""
+"Finally, 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. This can be seen in "
+"<xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid ""
+"Named SQL query using <classname>@NamedNativeQuery</classname> together with "
+"<classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+" resultSetMapping=\"joinMapping\")\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"implicit\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", \n"
+" query=\"select * from SpaceShip\", \n"
+" resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column = \"name\"),\n"
+" @FieldResult(name=\"model\", column = \"model\"),\n"
+" @FieldResult(name=\"speed\", column = \"speed\"),\n"
+" @FieldResult(name=\"captain.firstname\", column = "
+"\"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column = \"lastn"
+"\"),\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"
+"@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
+#: query_sql.xml:510
+#, no-c-format
+msgid ""
+"If you retrieve a single entity using the default mapping, you can specify "
+"the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip"
+"\", resultClass=SpaceShip.class)\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+"@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension"
+"\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension "
+"from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr ""
"Utilizando a propriedade retorno para especificar explicitamente os nomes de "
"colunas/alias"
#. Tag: para
+#: query_sql.xml:538
#, no-c-format
msgid ""
"You can explicitly tell Hibernate what column aliases to use with "
@@ -791,7 +1435,25 @@
"<literal>{}</literal> para deixar o Hibernate injetar seus próprios aliases. "
"Por exemplo:"
+#. Tag: programlisting
+#: query_sql.xml:543
+#, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:545
#, no-c-format
msgid ""
"<literal><return-property></literal> also works with multiple columns. "
@@ -803,7 +1465,29 @@
"não pode permitir controle granulado fino de muitas propriedades de colunas "
"múltiplas. "
+#. Tag: programlisting
+#: query_sql.xml:550
+#, no-c-format
+msgid ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:552
#, no-c-format
msgid ""
"In this example <literal><return-property></literal> was used in "
@@ -816,6 +1500,7 @@
"propriedades. "
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
msgid ""
"If your mapping has a discriminator you must use <literal><return-"
@@ -826,11 +1511,13 @@
"discriminador."
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr "Usando procedimentos de armazenamento para consultas"
#. Tag: para
+#: query_sql.xml:565
#, no-c-format
msgid ""
"Hibernate3 provides support for queries via stored procedures and functions. "
@@ -846,14 +1533,55 @@
"trabalhar com o Hibernate. Um exemplo disto é a função armazenada em Oracle "
"9 e versões posteriores como se segue: "
+#. Tag: programlisting
+#: query_sql.xml:571
+#, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr ""
"Para usar esta consulta no Hibernate você vai precisar mapeá-lo através de "
"uma consulta nomeada"
+#. Tag: programlisting
+#: query_sql.xml:576
+#, no-c-format
+msgid ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:578
#, no-c-format
msgid ""
"Stored procedures currently only return scalars and entities. <literal><"
@@ -865,11 +1593,13 @@
"collection></literal> não são suportados."
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr "Regras e limitações para utilizar procedimentos armazenados."
#. Tag: para
+#: query_sql.xml:585
#, no-c-format
msgid ""
"You cannot use stored procedures with Hibernate unless you follow some "
@@ -887,6 +1617,7 @@
"os fabricantes possuem procedimentos de semânticas/sintáxe armazenados. "
#. Tag: para
+#: query_sql.xml:593
#, no-c-format
msgid ""
"Stored procedure queries cannot be paged with <literal>setFirstResult()/"
@@ -896,6 +1627,7 @@
"<literal>setFirstResult()/setMaxResults()</literal>. "
#. Tag: para
+#: query_sql.xml:596
#, no-c-format
msgid ""
"The recommended call form is standard SQL92: <literal>{ ? = call functionName"
@@ -908,11 +1640,13 @@
"é suportada."
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr "As seguintes regras se aplicam para Oracle:"
#. Tag: para
+#: query_sql.xml:605
#, no-c-format
msgid ""
"A function must return a result set. The first parameter of a procedure must "
@@ -928,11 +1662,13 @@
"CURSOR</literal>, veja a documentação do Oracle. "
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr "Para servidores Sybase ou MS SQL aplicam-se as seguintes regras:"
#. Tag: para
+#: query_sql.xml:618
#, no-c-format
msgid ""
"The procedure must return a result set. Note that since these servers can "
@@ -947,6 +1683,7 @@
"será descartado."
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
msgid ""
"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it "
@@ -956,75 +1693,179 @@
"provavelmente será mais eficiente. Mas, isto não é obrigatório"
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr "SQL padronizado para criar, atualizar e deletar"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:638
+#, fuzzy, no-c-format
msgid ""
"Hibernate3 can use custom SQL for create, update, and delete operations. The "
"SQL can be overridden at the statement level or inidividual column level. "
"This section describes statement overrides. For columns, see <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-"
+"annotations\"/> shows how to define custom SQL operatons using annotations."
msgstr ""
-"O Hibernate 3 pode usar um SQL personalizado para criar, atualizar e deletar operações. O SQL pode ser substituído com o nível de declaração oi nível de coluna individua. Esta seção descreve as substituições de declaração. Para colunas, consulte <xref linkend="
-"\"mapping-column-read-and-write\" />."
+"O Hibernate 3 pode usar um SQL personalizado para criar, atualizar e deletar "
+"operações. O SQL pode ser substituído com o nível de declaração oi nível de "
+"coluna individua. Esta seção descreve as substituições de declaração. Para "
+"colunas, consulte <xref linkend=\"mapping-column-read-and-write\" />."
+#. Tag: title
+#: query_sql.xml:646
+#, no-c-format
+msgid "Custom CRUD via annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:648
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"@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"
+"@Loader(namedQuery = \"chaos\")\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
+#: query_sql.xml:651
#, no-c-format
msgid ""
-"The class and collection persisters in Hibernate already contain a set of "
-"configuration time generated strings (insertsql, deletesql, updatesql etc.). "
-"The mapping tags <literal><sql-insert></literal>, <literal><sql-"
-"delete></literal>, and <literal><sql-update></literal> override "
-"these strings:"
+"<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can "
+"be achieved using Hibernate mapping files and the <literal><sql-insert>"
+"</literal>, <literal><sql-update></literal> and <literal><sql-"
+"delete></literal> nodes. This can be seen in <xref linkend=\"example-"
+"custom-crdu-via-xml\"/>."
msgstr ""
-"A persistência de classe e coleção no Hibernate já contém um "
-"conjunto de strings gerados por tempo de configuração (insertsql, deletesql, "
-"updatesql etc.). O mapeamento das tags <literal><sql-insert></"
-"literal>, <literal><sql-delete></literal>, e <literal><sql-"
-"update></literal> sobrescreve essas strings:"
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:666
#, no-c-format
msgid ""
-"The SQL is directly executed in your database, so you can use any dialect "
-"you like. This will reduce the portability of your mapping if you use "
-"database specific SQL."
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to <constant>true</constant>. In "
+"annotations as well as in xml."
msgstr ""
-"O SQL é executado diretamente no seu banco de dados, então você pode usar "
-"qualquer linguagem que quiser. Isto com certeza reduzirá a portabilidade do "
-"seu mapeamento se você utilizar um SQL para um banco de dados específico."
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
msgid ""
-"Stored procedures are supported if the <literal>callable</literal> attribute "
-"is set:"
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
msgstr ""
-"Os procedimentos armazenados são suportados se a função <literal>callable</"
-"literal> estiver ativada:"
#. Tag: para
+#: query_sql.xml:675
#, no-c-format
msgid ""
-"The order of the positional parameters is vital, as they must be in the same "
-"sequence as Hibernate expects them."
+"none: no check is performed: the store procedure is expected to fail upon "
+"issues"
msgstr ""
-"A ordem de posições dos parâmetros são vitais, pois eles devem estar na "
-"mesma seqüência esperada pelo Hibernate. "
#. Tag: para
+#: query_sql.xml:680
#, no-c-format
+msgid "count: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:685
+#, no-c-format
msgid ""
-"You can view 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 view the expected sequence, do not include "
-"your custom SQL in the mapping files, as this will override the Hibernate "
-"generated static SQL."
+"param: like COUNT but using an output parameter rather that the standard "
+"mechanism"
msgstr ""
+
+#. Tag: para
+#: query_sql.xml:690
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal> parameter "
+"which is again available in annoations as well as in xml."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:693
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations respectively xml nodes to "
+"override the collection related statements -see <xref linkend=\"example-"
+"overriding-sql-collections-annotations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:698
+#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?"
+"\")\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:705
+#, fuzzy, no-c-format
+msgid ""
+"The parameter order is important and is defined by the order Hibernate "
+"handles 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 or mapping files "
+"as that will override the Hibernate generated static sql)"
+msgstr ""
"Você pode ver a ordem esperada ativando o debug logging no nível "
"<literal>org.hibernate.persister.entity</literal>. Com este nível ativado, "
"o Hibernate irá imprimir o SQL estático que foi usado para criar, atualizar, "
@@ -1033,13 +1874,68 @@
"sobrescrever o SQL estático gerado pelo Hibernate."
#. Tag: para
+#: query_sql.xml:715
#, no-c-format
msgid ""
-"The stored procedures are in most cases required to return the number of "
-"rows inserted, updated and deleted, as Hibernate has some runtime checks for "
-"the success of the statement. Hibernate always registers the first statement "
-"parameter as a numeric output parameter for the CUD operations:"
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>@org.hibernate.annotations.Table</literal> and either (or all) "
+"attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
msgstr ""
+
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"@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"
+" sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values"
+"(upper(?), ?)\") )\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:726
+#, no-c-format
+msgid ""
+"The previous example also shows that you can give a comment to a given table "
+"(primary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:731
+#, fuzzy, no-c-format
+msgid ""
+"The SQL is directly executed in your database, so you can use any dialect "
+"you like. This will, however, reduce the portability of your mapping if you "
+"use database specific SQL."
+msgstr ""
+"O SQL é executado diretamente no seu banco de dados, então você pode usar "
+"qualquer linguagem que quiser. Isto com certeza reduzirá a portabilidade do "
+"seu mapeamento se você utilizar um SQL para um banco de dados específico."
+
+#. Tag: para
+#: query_sql.xml:736
+#, fuzzy, no-c-format
+msgid ""
+"Last but not least, stored procedures are in most cases required to return "
+"the number of rows inserted, updated and deleted. Hibernate always registers "
+"the first statement parameter as a numeric output parameter for the CUD "
+"operations:"
+msgstr ""
"Os procedimentos armazenados são na maioria dos casos requeridos para "
"retornar o número de linhas inseridas/atualizadas/deletadas, uma vez que o "
"Hibernate possui algumas verificações em tempo de espera para o sucesso das "
@@ -1047,23 +1943,67 @@
"como um parâmetro de saída numérica para as operações CUD:"
#. Tag: title
+#: query_sql.xml:742
#, no-c-format
+msgid "Stored procedures and their return value"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:744
+#, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
msgid "Custom SQL for loading"
msgstr "SQL padronizado para carga"
#. Tag: para
-#, no-c-format
+#: query_sql.xml:751
+#, fuzzy, no-c-format
msgid ""
"You can also declare your own SQL (or HQL) queries for entity loading. As "
"with inserts, updates, and deletes, this can be done at the individual "
-"column level as described in <xref linkend=\"mapping-column-read-and-write"
-"\" /> or at the statement level. Here is an example of a statement level "
+"column level as described in <xref linkend=\"mapping-column-read-and-write\"/"
+"> or at the statement level. Here is an example of a statement level "
"override:"
msgstr ""
-"Você pode declarar também a sua própria consulta SQL (or HQL) para carregamento de entidade. Assim como inserções, atualizações e deletações, isto pode ser feito no nível de coluna individual conforme descrito no <xref linkend=\"mapping-column-read-and-write"
-"\" />ou no nível de declaração. Segue abaixo um exemplo de uma substituição no nível de declaração:"
+"Você pode declarar também a sua própria consulta SQL (or HQL) para "
+"carregamento de entidade. Assim como inserções, atualizações e deletações, "
+"isto pode ser feito no nível de coluna individual conforme descrito no <xref "
+"linkend=\"mapping-column-read-and-write\" />ou no nível de declaração. Segue "
+"abaixo um exemplo de uma substituição no nível de declaração:"
+#. Tag: programlisting
+#: query_sql.xml:757
+#, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:759
#, no-c-format
msgid ""
"This is just a named query declaration, as discussed earlier. You can "
@@ -1073,17 +2013,57 @@
"anteriormente. Você pode referenciar esta consulta nomeada em um mapeamento "
"de classe:"
+#. Tag: programlisting
+#: query_sql.xml:762
+#, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:764
#, no-c-format
msgid "This even works with stored procedures."
msgstr "Este também funciona com procedimentos armazenados."
#. Tag: para
+#: query_sql.xml:766
#, no-c-format
msgid "You can even define a query for collection loading:"
msgstr "Você pode também definir uma consulta para carregar uma coleção: "
+#. Tag: programlisting
+#: query_sql.xml:768
+#, no-c-format
+msgid ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:770
+#, no-c-format
+msgid ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:772
#, no-c-format
msgid ""
"You can also define an entity loader that loads a collection by join "
@@ -1092,3 +2072,59 @@
"Você pode até definir um carregador de entidade que carregue uma coleção por "
"busca de união: "
+#. Tag: programlisting
+#: query_sql.xml:775
+#, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid ""
+"The annotation equivalent <literal><loader></literal> is the @Loader "
+"annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/"
+">."
+msgstr ""
+
+#~ msgid "<literal>{item.*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
+
+#~ msgid "<literal>{coll.*}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
+
+#~ msgid ""
+#~ "The class and collection persisters in Hibernate already contain a set of "
+#~ "configuration time generated strings (insertsql, deletesql, updatesql "
+#~ "etc.). The mapping tags <literal><sql-insert></literal>, "
+#~ "<literal><sql-delete></literal>, and <literal><sql-update></"
+#~ "literal> override these strings:"
+#~ msgstr ""
+#~ "A persistência de classe e coleção no Hibernate já contém um conjunto de "
+#~ "strings gerados por tempo de configuração (insertsql, deletesql, "
+#~ "updatesql etc.). O mapeamento das tags <literal><sql-insert></"
+#~ "literal>, <literal><sql-delete></literal>, e <literal><sql-"
+#~ "update></literal> sobrescreve essas strings:"
+
+#~ msgid ""
+#~ "Stored procedures are supported if the <literal>callable</literal> "
+#~ "attribute is set:"
+#~ msgstr ""
+#~ "Os procedimentos armazenados são suportados se a função "
+#~ "<literal>callable</literal> estiver ativada:"
+
+#~ msgid ""
+#~ "The order of the positional parameters is vital, as they must be in the "
+#~ "same sequence as Hibernate expects them."
+#~ msgstr ""
+#~ "A ordem de posições dos parâmetros são vitais, pois eles devem estar na "
+#~ "mesma seqüência esperada pelo Hibernate. "
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/session_api.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/session_api.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/session_api.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: session_api\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:48\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-19 10:25+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,11 +118,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "Trabalhando com objetos"
#. Tag: para
+#: session_api.xml:33
#, no-c-format
msgid ""
"Hibernate is a full object/relational mapping solution that not only shields "
@@ -141,6 +143,7 @@
"a objetos em aplicações Java. "
#. Tag: para
+#: session_api.xml:40
#, no-c-format
msgid ""
"In other words, Hibernate application developers should always think about "
@@ -156,16 +159,19 @@
"estão ajustando o desempenho do sistema."
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "Estado dos objetos no Hibernate"
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr "O Hibernate define e suporta os seguintes estados de objetos:"
#. Tag: para
+#: session_api.xml:53
#, no-c-format
msgid ""
"<emphasis>Transient</emphasis> - an object is transient if it has just been "
@@ -189,6 +195,7 @@
"transição)."
#. Tag: para
+#: session_api.xml:65
#, no-c-format
msgid ""
"<emphasis>Persistent</emphasis> - a persistent instance has a representation "
@@ -210,6 +217,7 @@
"o objeto se tornar transiente. "
#. Tag: para
+#: session_api.xml:77
#, no-c-format
msgid ""
"<emphasis>Detached</emphasis> - a detached instance is an object that has "
@@ -233,6 +241,7 @@
"trabalho do ponto de vista do usuário."
#. Tag: para
+#: session_api.xml:90
#, no-c-format
msgid ""
"We will now discuss the states and state transitions (and the Hibernate "
@@ -242,11 +251,13 @@
"Hibernate que disparam uma transição) em mais detalhes."
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "Tornando os objetos persistentes"
#. Tag: para
+#: session_api.xml:97
#, no-c-format
msgid ""
"Newly instantiated instances of a persistent class are considered "
@@ -258,7 +269,19 @@
"transformar uma instância transiente em <emphasis>persistente</emphasis> "
"associando-a a uma sessão: "
+#. Tag: programlisting
+#: session_api.xml:102
+#, no-c-format
+msgid ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:104
#, no-c-format
msgid ""
"If <literal>Cat</literal> has a generated identifier, the identifier is "
@@ -280,6 +303,7 @@
"do EJB3. "
#. Tag: para
+#: session_api.xml:115
#, no-c-format
msgid ""
"<literal>persist()</literal> makes a transient instance persistent. However, "
@@ -299,6 +323,7 @@
"execução com um contexto de Sessão/persistência estendido."
#. Tag: para
+#: session_api.xml:126
#, no-c-format
msgid ""
"<literal>save()</literal> does guarantee to return an identifier. If an "
@@ -314,6 +339,7 @@
"de longa execução com um contexto de Sessão/persistência estendido."
#. Tag: para
+#: session_api.xml:135
#, no-c-format
msgid ""
"Alternatively, you can assign the identifier using an overloaded version of "
@@ -322,7 +348,21 @@
"Alternativamente, pode-se atribuir o identificador usando uma versão "
"sobrecarregada de <literal>save()</literal>. "
+#. Tag: programlisting
+#: session_api.xml:138
+#, no-c-format
+msgid ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:140
#, no-c-format
msgid ""
"If the object you make persistent has associated objects (e.g. the "
@@ -342,6 +382,7 @@
"<literal>save()</literal> for usado nos objetos em uma ordem errada. "
#. Tag: para
+#: session_api.xml:148
#, no-c-format
msgid ""
"Usually you do not bother with this detail, as you will normally use "
@@ -358,11 +399,13 @@
"adiante nesse mesmo capítulo. "
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr "Carregando o objeto"
#. Tag: para
+#: session_api.xml:159
#, no-c-format
msgid ""
"The <literal>load()</literal> methods of <literal>Session</literal> provide "
@@ -376,12 +419,39 @@
"do objeto e carregará o estado em uma instância mais recente dessa classe, "
"em estado persistente."
+#. Tag: programlisting
+#: session_api.xml:165
+#, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, no-c-format
+msgid ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr "Alternativamente, pode-se carregar um estado em uma instância dada:"
+#. Tag: programlisting
+#: session_api.xml:171
+#, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:173
#, no-c-format
msgid ""
"Be aware that <literal>load()</literal> will throw an unrecoverable "
@@ -404,6 +474,7 @@
"classe. "
#. Tag: para
+#: session_api.xml:182
#, no-c-format
msgid ""
"If you are not certain that a matching row exists, you should use the "
@@ -414,7 +485,20 @@
"o método <literal>get()</literal>, que consulta o banco imediatamente e "
"retorna um null se não existir o registro. "
+#. Tag: programlisting
+#: session_api.xml:186
+#, no-c-format
+msgid ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:188
#, no-c-format
msgid ""
"You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</"
@@ -425,7 +509,14 @@
"literal>, usando um <literal>LockMode</literal>. Veja a documentação da API "
"para maiores informações. "
+#. Tag: programlisting
+#: session_api.xml:192
+#, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:194
#, no-c-format
msgid ""
"Any associated instances or contained collections will <emphasis>not</"
@@ -439,6 +530,7 @@
"<literal>all</literal> como um estilo cascata para a associação. "
#. Tag: para
+#: session_api.xml:199
#, no-c-format
msgid ""
"It is possible to re-load an object and all its collections at any time, "
@@ -450,25 +542,36 @@
"os disparos do banco de dados são usados para inicializar algumas "
"propriedades do objeto."
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:204
#, no-c-format
msgid ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:206
+#, fuzzy, no-c-format
+msgid ""
"How much does Hibernate load from the database and how many SQL "
"<literal>SELECT</literal>s will it use? This depends on the "
"<emphasis>fetching strategy</emphasis>. This is explained in <xref linkend="
-"\"performance-fetching\" />."
+"\"performance-fetching\"/>."
msgstr ""
"O quanto Hibernate carrega do banco de dados e quantos SQL <literal>SELECT</"
-"literal> ele irá usar? Isto depende da <emphasis>estratégia de "
-"busca</emphasis> usada e explicada na <xref linkend="
-"\"performance-fetching\" />."
+"literal> ele irá usar? Isto depende da <emphasis>estratégia de busca</"
+"emphasis> usada e explicada na <xref linkend=\"performance-fetching\" />."
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "Consultando"
#. Tag: para
+#: session_api.xml:215
#, no-c-format
msgid ""
"If you do not know the identifiers of the objects you are looking for, you "
@@ -487,11 +590,13 @@
"opcional do Hibernate para conversão do conjunto de resultados em objetos. "
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "Executando consultas"
#. Tag: para
+#: session_api.xml:226
#, no-c-format
msgid ""
"HQL and native SQL queries are represented with an instance of <literal>org."
@@ -506,7 +611,38 @@
"execução de consultas reais. Você pode obter uma <literal>Query</literal> "
"usando a <literal>Session</literal> atual:"
+#. Tag: programlisting
+#: session_api.xml:232
+#, no-c-format
+msgid ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:234
#, no-c-format
msgid ""
"A query is usually executed by invoking <literal>list()</literal>. The "
@@ -529,11 +665,13 @@
"simples <literal>Set</literal>."
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "Interagindo com resultados"
#. Tag: para
+#: session_api.xml:246
#, no-c-format
msgid ""
"Occasionally, you might be able to achieve better performance by executing "
@@ -557,12 +695,33 @@
"<emphasis>n</emphasis> consultas adicionais para inicializar as instâncias "
"reais. "
+#. Tag: programlisting
+#: session_api.xml:257
+#, no-c-format
+msgid ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "Consultas que retornam tuplas"
#. Tag: para
+#: session_api.xml:263
#, no-c-format
msgid ""
"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
@@ -571,12 +730,32 @@
"Algumas vezes as consultas do Hibernate retornam tuplas de objetos. Cada "
"tupla é retornada como uma matriz:"
+#. Tag: programlisting
+#: session_api.xml:266
+#, no-c-format
+msgid ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "Resultados escalares"
#. Tag: para
+#: session_api.xml:272
#, no-c-format
msgid ""
"Queries can specify a property of a class in the <literal>select</literal> "
@@ -588,12 +767,34 @@
"agregações. Propriedades ou agregações são consideradas resultados agregados "
"e não entidades no estado persistente. "
+#. Tag: programlisting
+#: session_api.xml:277
+#, no-c-format
+msgid ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "Parâmetros de vínculo"
#. Tag: para
+#: session_api.xml:283
#, no-c-format
msgid ""
"Methods on <literal>Query</literal> are provided for binding values to named "
@@ -610,28 +811,69 @@
"são: "
#. Tag: para
+#: session_api.xml:292
#, no-c-format
-msgid "named parameters are insensitive to the order they occur in the query string"
+msgid ""
+"named parameters are insensitive to the order they occur in the query string"
msgstr ""
"Parâmetros nomeados são insensíveis à ordem que eles ocorrem na faixa de "
"consulta"
#. Tag: para
+#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "eles podem ocorrer em tempos múltiplos na mesma consulta "
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "eles são auto documentáveis"
+#. Tag: programlisting
+#: session_api.xml:305
+#, no-c-format
+msgid ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, no-c-format
+msgid ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, no-c-format
+msgid ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "Paginação"
#. Tag: para
+#: session_api.xml:315
#, no-c-format
msgid ""
"If you need to specify bounds upon your result set, that is, the maximum "
@@ -642,7 +884,18 @@
"números por linha que quiser recuperar e/ou a primeira linha que quiser "
"recuperar, você deve usar métodos de interface <literal>Consulta</literal>:"
+#. Tag: programlisting
+#: session_api.xml:320
+#, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
msgid ""
"Hibernate knows how to translate this limit query into the native SQL of "
@@ -652,11 +905,13 @@
"seu DBMS"
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr "Iteração rolável"
#. Tag: para
+#: session_api.xml:329
#, no-c-format
msgid ""
"If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the "
@@ -669,7 +924,37 @@
"objeto de <literal>ScrollableResults</literal>, que permite uma navegação "
"flexível dos resultados de consulta. "
+#. Tag: programlisting
+#: session_api.xml:334
+#, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:336
#, no-c-format
msgid ""
"Note that an open database connection and cursor is required for this "
@@ -681,27 +966,106 @@
"</literal> se precisar da função de paginação offline. "
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "Externando consultas nomeadas"
#. Tag: para
+#: session_api.xml:345
#, no-c-format
msgid ""
-"You can also define named queries in the mapping document. Remember to use a "
-"<literal>CDATA</literal> section if your query contains characters that "
-"could be interpreted as markup."
+"Queries can also be configured as so called named queries using annotations "
+"or Hibernate mapping documents. <literal>@NamedQuery</literal> and "
+"<literal>@NamedQueries</literal> can be defined at the class level as seen "
+"in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: session_api.xml:361
+#, fuzzy, no-c-format
+msgid ""
+"Using a mapping document can be configured using the <literal><query></"
+"literal> node. Remember to use a <literal>CDATA</literal> section if your "
+"query contains characters that could be interpreted as markup."
+msgstr ""
"Você pode também definir consultas nomeadas no documento de mapeamento. "
"Lembre-se de usar uma seção <literal>CDATA</literal> se sua consulta "
"contiver caracteres que possam ser interpretados como marcação."
+#. Tag: title
+#: session_api.xml:367
+#, no-c-format
+msgid "Defining a named query using <literal><query></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, no-c-format
+msgid ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+msgstr ""
+
#. Tag: para
-#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+#: session_api.xml:373
+#, fuzzy, no-c-format
+msgid ""
+"Parameter binding and executing is done programatically as seen in <xref "
+"linkend=\"example-parameter-binding-named-query\"/>."
msgstr "O vínculo e execução de parâmetro são feitos programaticamente :"
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, no-c-format
+msgid ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:382
#, no-c-format
msgid ""
"The actual program code is independent of the query language that is used. "
@@ -714,6 +1078,7 @@
"arquivos de mapeamento. "
#. Tag: para
+#: session_api.xml:387
#, no-c-format
msgid ""
"Also note that a query declaration inside a <literal><hibernate-"
@@ -730,11 +1095,13 @@
"Cat.ByNameAndMaximumWeight</literal>. "
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "Filtrando coleções"
#. Tag: para
+#: session_api.xml:399
#, no-c-format
msgid ""
"A collection <emphasis>filter</emphasis> is a special type of query that can "
@@ -746,7 +1113,20 @@
"consulta pode referir-se ao <literal>this</literal>, significando o elemento "
"de coleção atual. "
+#. Tag: programlisting
+#: session_api.xml:404
+#, no-c-format
+msgid ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:406
#, no-c-format
msgid ""
"The returned collection is considered a bag that is a copy of the given "
@@ -758,6 +1138,7 @@
"\", mas é consistente com o comportamento esperado."
#. Tag: para
+#: session_api.xml:411
#, no-c-format
msgid ""
"Observe that filters do not require a <literal>from</literal> clause, "
@@ -768,7 +1149,18 @@
"embora possam ter um, se requerido. Os filtros não são limitados a retornar "
"aos elementos de coleção. "
+#. Tag: programlisting
+#: session_api.xml:415
+#, no-c-format
+msgid ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:417
#, no-c-format
msgid ""
"Even an empty filter query is useful, e.g. to load a subset of elements in a "
@@ -777,12 +1169,24 @@
"Até mesmo um filtro vazio é útil, ex.: para carregar um subconjunto em uma "
"coleção enorme:"
+#. Tag: programlisting
+#: session_api.xml:420
+#, no-c-format
+msgid ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+msgstr ""
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr "Consulta por critério"
#. Tag: para
+#: session_api.xml:426
#, no-c-format
msgid ""
"HQL is extremely powerful, but some developers prefer to build queries "
@@ -795,23 +1199,35 @@
"construir faixas de consultas. O Hibernate oferece uma API de consulta de "
"<literal>Critério</literal> intuitiva para estes casos: "
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:431
#, no-c-format
msgid ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:433
+#, fuzzy, no-c-format
+msgid ""
"The <literal>Criteria</literal> and the associated <literal>Example</"
-"literal> API are discussed in more detail in <xref linkend=\"querycriteria"
-"\" />."
+"literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"
+">."
msgstr ""
"Um <literal>Criteria</literal> e API associado <literal>Example</literal> "
-"serão discutidos em mais detalhes em <xref linkend=\"querycriteria"
-"\" />."
+"serão discutidos em mais detalhes em <xref linkend=\"querycriteria\" />."
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "Consultas em SQL nativa"
#. Tag: para
+#: session_api.xml:441
#, no-c-format
msgid ""
"You can express a query in SQL, using <literal>createSQLQuery()</literal> "
@@ -827,23 +1243,49 @@
"literal> JDBC diretamente. Se você escolher utilizar a API Hibernate, você "
"deve incluir as aliases SQL dentro de chaves: "
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:448
#, no-c-format
msgid ""
+"List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE "
+"ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:452
+#, fuzzy, no-c-format
+msgid ""
"SQL queries can contain named and positional parameters, just like Hibernate "
"queries. More information about native SQL queries in Hibernate can be found "
-"in <xref linkend=\"querysql\" />."
+"in <xref linkend=\"querysql\"/>."
msgstr ""
"As consultas SQL podem conter parâmetros nomeados e posicionais, assim como "
"as consultas Hibernate. Maiores informações sobre as consultas nativas SQL "
"no Hibernate poderão ser encontradas em <xref linkend=\"querysql\" />."
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr "Modificando objetos persistentes"
#. Tag: para
+#: session_api.xml:461
#, no-c-format
msgid ""
"<emphasis>Transactional persistent instances</emphasis> (i.e. objects "
@@ -867,7 +1309,17 @@
"objeto é <literal>carregá-lo()</literal> e depois manipulá-lo diretamente, "
"enquanto a <literal>Sessão</literal> estiver aberta:"
+#. Tag: programlisting
+#: session_api.xml:473
+#, no-c-format
+msgid ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:475
#, no-c-format
msgid ""
"Sometimes this programming model is inefficient, as it requires in the same "
@@ -882,7 +1334,8 @@
"instâncias desanexadas."
#. Tag: para
-#, no-c-format
+#: session_api.xml:481
+#, fuzzy, no-c-format
msgid ""
"Hibernate does not offer its own API for direct execution of "
"<literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate "
@@ -893,7 +1346,7 @@
"the notion of mass operations conflicts with object/relational mapping for "
"online transaction processing-oriented applications. Future versions of "
"Hibernate can, however, provide special mass operation functions. See <xref "
-"linkend=\"batch\" /> for some possible batch operation tricks."
+"linkend=\"batch\"/> for some possible batch operation tricks."
msgstr ""
"Note que o Hibernate não oferece seu próprio API para execução direta de "
"instruções <literal>UPDATE</literal> ou <literal>DELETE</literal>. O "
@@ -905,14 +1358,17 @@
"massa conflitua com o mapeamento de objeto/relacional para aplicativos de "
"transações online com processamento. No entanto, versões futuras do "
"Hibernate poderão oferecer funções especiais de operação em massa. Veja "
-"<xref linkend=\"batch\" /> para alguns possíveis truques de operação em lote. "
+"<xref linkend=\"batch\" /> para alguns possíveis truques de operação em "
+"lote. "
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr "Modificando objetos desacoplados"
#. Tag: para
+#: session_api.xml:499
#, no-c-format
msgid ""
"Many applications need to retrieve an object in one transaction, send it to "
@@ -928,6 +1384,7 @@
"durante a \"longa\" unidade de trabalho."
#. Tag: para
+#: session_api.xml:505
#, no-c-format
msgid ""
"Hibernate supports this model by providing for reattachment of detached "
@@ -938,7 +1395,25 @@
"usando os métodos <literal>Session.update()</literal> ou<literal>Session."
"merge()</literal>:"
+#. Tag: programlisting
+#: session_api.xml:509
+#, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
msgid ""
"If the <literal>Cat</literal> with identifier <literal>catId</literal> had "
@@ -950,6 +1425,7 @@
"aplicação tentou re-acoplá-lo, teria surgido uma exceção."
#. Tag: para
+#: session_api.xml:516
#, no-c-format
msgid ""
"Use <literal>update()</literal> if you are certain that the session does not "
@@ -969,22 +1445,24 @@
"executada. "
#. Tag: para
-#, no-c-format
+#: session_api.xml:524
+#, fuzzy, no-c-format
msgid ""
"The application should individually <literal>update()</literal> detached "
"instances that are reachable from the given detached instance "
"<emphasis>only</emphasis> if it wants their state to be updated. This can be "
"automated using <emphasis>transitive persistence</emphasis>. See <xref "
-"linkend=\"objectstate-transitive\" /> for more information."
+"linkend=\"objectstate-transitive\"/> for more information."
msgstr ""
"A aplicação deve <literal>update()</literal> instâncias desanexadas "
"individualmente, ao alcance da atual instância desanexada, se e "
"<emphasis>somente</emphasis> se, esta requerer uma atualização também de seu "
-"estado. Esta ação pode ser automatizada utilizando "
-"<emphasis>persistência transitiva</emphasis>. Consulte <xref linkend="
-"\"objectstate-transitive\"/> para maiores informações. "
+"estado. Esta ação pode ser automatizada utilizando <emphasis>persistência "
+"transitiva</emphasis>. Consulte <xref linkend=\"objectstate-transitive\"/> "
+"para maiores informações. "
#. Tag: para
+#: session_api.xml:530
#, no-c-format
msgid ""
"The <literal>lock()</literal> method also allows an application to "
@@ -995,7 +1473,20 @@
"associe um objeto com uma nova sessão. No entanto, a instância desanexada "
"não pode ser modificada."
+#. Tag: programlisting
+#: session_api.xml:534
+#, no-c-format
+msgid ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:536
#, no-c-format
msgid ""
"Note that <literal>lock()</literal> can be used with various "
@@ -1009,20 +1500,23 @@
"único caso de uso para <literal>lock()</literal>. "
#. Tag: para
-#, no-c-format
+#: session_api.xml:541
+#, fuzzy, no-c-format
msgid ""
"Other models for long units of work are discussed in <xref linkend="
-"\"transactions-optimistic\" />."
+"\"transactions-optimistic\"/>."
msgstr ""
-"Outros modelos para unidades longas de trabalho serão discutidas em <xref linkend="
-"\"transactions-optimistic\" />."
+"Outros modelos para unidades longas de trabalho serão discutidas em <xref "
+"linkend=\"transactions-optimistic\" />."
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr "Detecção automática de estado"
#. Tag: para
+#: session_api.xml:548
#, no-c-format
msgid ""
"Hibernate users have requested a general purpose method that either saves a "
@@ -1035,7 +1529,26 @@
"re-acoplar as instâncias desanexadas associadas ao seu identificador atual. "
"O método <literal>saveOrUpdate()</literal> implementa esta funcionalidade."
+#. Tag: programlisting
+#: session_api.xml:554
+#, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
msgid ""
"The usage and semantics of <literal>saveOrUpdate()</literal> seems to be "
@@ -1053,6 +1566,7 @@
"métodos."
#. Tag: para
+#: session_api.xml:563
#, no-c-format
msgid ""
"Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are "
@@ -1062,26 +1576,31 @@
"literal>são utilizados nos seguintes cenários:"
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr "a aplicação carrega um objeto na primeira sessão"
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr "o objeto é passado para a camada UI"
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr "algumas modificações são feitas ao objeto"
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr "o objeto é retornado à camada lógica de negócios"
#. Tag: para
+#: session_api.xml:585
#, no-c-format
msgid ""
"the application persists these modifications by calling <literal>update()</"
@@ -1091,16 +1610,19 @@
"literal> em uma segunda sessão."
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr "<literal>saveOrUpdate()</literal> faz o seguinte:"
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr "se o objeto já estiver persistente nesta sessão, não faça nada"
#. Tag: para
+#: session_api.xml:599
#, no-c-format
msgid ""
"if another object associated with the session has the same identifier, throw "
@@ -1110,6 +1632,7 @@
"uma exceção"
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
msgstr ""
@@ -1117,6 +1640,7 @@
"literal> "
#. Tag: para
+#: session_api.xml:609
#, no-c-format
msgid ""
"if the object's identifier has the value assigned to a newly instantiated "
@@ -1126,6 +1650,7 @@
"recentemente instanciado, <literal>salve-o()</literal> "
#. Tag: para
+#: session_api.xml:614
#, no-c-format
msgid ""
"if the object is versioned by a <literal><version></literal> or "
@@ -1139,16 +1664,19 @@
"</literal> o mesmo"
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
msgstr "do contrário <literal>atualize()</literal> o objeto"
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr "e a <literal>mesclagem()</literal> é bastante diferente:"
#. Tag: para
+#: session_api.xml:630
#, no-c-format
msgid ""
"if there is a persistent instance with the same identifier currently "
@@ -1160,6 +1688,7 @@
"persistente."
#. Tag: para
+#: session_api.xml:636
#, no-c-format
msgid ""
"if there is no persistent instance currently associated with the session, "
@@ -1170,11 +1699,13 @@
"persistente"
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr "a instância persistente é retornada"
#. Tag: para
+#: session_api.xml:646
#, no-c-format
msgid ""
"the given instance does not become associated with the session, it remains "
@@ -1184,11 +1715,13 @@
"desanexada"
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr "Apagando objetos persistentes"
#. Tag: para
+#: session_api.xml:655
#, no-c-format
msgid ""
"<literal>Session.delete()</literal> will remove an object's state from the "
@@ -1201,7 +1734,14 @@
"objeto apagado. É melhor pensar em <literal>delete()</literal> como fazer "
"uma instância persistente se tornar transiente. "
+#. Tag: programlisting
+#: session_api.xml:660
+#, no-c-format
+msgid "sess.delete(cat);"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:662
#, no-c-format
msgid ""
"You can delete objects in any order, without risk of foreign key constraint "
@@ -1216,11 +1756,13 @@
"filho. "
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "Replicando objeto entre dois armazenamentos de dados diferentes."
#. Tag: para
+#: session_api.xml:672
#, no-c-format
msgid ""
"It is sometimes useful to be able to take a graph of persistent instances "
@@ -1231,7 +1773,27 @@
"fazê-los persistentes em um armazenamento de dados diferente, sem gerar "
"novamente valores de identificador. "
+#. Tag: programlisting
+#: session_api.xml:676
+#, no-c-format
+msgid ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:678
#, no-c-format
msgid ""
"The <literal>ReplicationMode</literal> determines how <literal>replicate()</"
@@ -1241,6 +1803,7 @@
"literal> irá lidar com conflitos em linhas existentes no banco de dados: "
#. Tag: para
+#: session_api.xml:684
#, no-c-format
msgid ""
"<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is "
@@ -1250,6 +1813,7 @@
"linha de banco de dados existente com o mesmo identificador."
#. Tag: para
+#: session_api.xml:689
#, no-c-format
msgid ""
"<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing "
@@ -1259,6 +1823,7 @@
"de dados existente com um mesmo identificador."
#. Tag: para
+#: session_api.xml:694
#, no-c-format
msgid ""
"<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there "
@@ -1268,6 +1833,7 @@
"uma linha de banco de dados existente com o mesmo identificador. "
#. Tag: para
+#: session_api.xml:700
#, no-c-format
msgid ""
"<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its "
@@ -1279,6 +1845,7 @@
"ignore o objeto."
#. Tag: para
+#: session_api.xml:706
#, no-c-format
msgid ""
"Usecases for this feature include reconciling data entered into different "
@@ -1292,11 +1859,13 @@
"durante transações não ACID entre outras funções."
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr "Limpando a Sessão"
#. Tag: para
+#: session_api.xml:715
#, no-c-format
msgid ""
"Sometimes the <literal>Session</literal> will execute the SQL statements "
@@ -1310,26 +1879,31 @@
"ocorre por padrão nos seguintes pontos: "
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr "antes de algumas execuções de consultas"
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr "a partir de<literal>org.hibernate.Transaction.commit()</literal>"
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr "a partir de <literal>Session.flush()</literal>"
#. Tag: para
+#: session_api.xml:736
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "As instruções SQL são editadas na seguinte ordem:"
#. Tag: para
+#: session_api.xml:740
#, no-c-format
msgid ""
"all entity insertions in the same order the corresponding objects were saved "
@@ -1339,26 +1913,31 @@
"correspondentes foram salvos usando <literal>Session.save()</literal> "
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr "todas as atualizações de entidades"
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr "todas as deleções de coleções"
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr "todas as deleções, atualizações e inserções de elementos de coleção."
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr "todas as inserções de coleção"
#. Tag: para
+#: session_api.xml:761
#, no-c-format
msgid ""
"all entity deletions in the same order the corresponding objects were "
@@ -1368,6 +1947,7 @@
"foram deletados usando <literal>Session.delete()</literal> "
#. Tag: para
+#: session_api.xml:766
#, no-c-format
msgid ""
"An exception is that objects using <literal>native</literal> ID generation "
@@ -1377,6 +1957,7 @@
"literal> é inserido quando salvo."
#. Tag: para
+#: session_api.xml:769
#, no-c-format
msgid ""
"Except when you explicitly <literal>flush()</literal>, there are absolutely "
@@ -1393,7 +1974,8 @@
"retornará dados errados. "
#. Tag: para
-#, no-c-format
+#: session_api.xml:776
+#, fuzzy, no-c-format
msgid ""
"It is possible to change the default behavior so that flush occurs less "
"frequently. The <literal>FlushMode</literal> class defines three different "
@@ -1402,7 +1984,7 @@
"never flush unless <literal>flush()</literal> is called explicitly. The last "
"mode is useful for long running units of work, where a <literal>Session</"
"literal> is kept open and disconnected for a long time (see <xref linkend="
-"\"transactions-optimistic-longsession\" />)."
+"\"transactions-optimistic-longsession\"/>)."
msgstr ""
"É possível mudar o comportamento padrão para que a limpeza ocorra com menos "
"freqüência. A classe <literal>FlushMode</literal> define três modos "
@@ -1414,26 +1996,48 @@
"aberta e disconectada por um longo tempo (veja <xref linkend=\"transactions-"
"optimistic-longsession\"/>). "
-#. Tag: para
+#. Tag: programlisting
+#: session_api.xml:786
#, no-c-format
msgid ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:788
+#, fuzzy, no-c-format
+msgid ""
"During flush, an exception might occur (e.g. if a DML operation violates a "
"constraint). Since handling exceptions involves some understanding of "
"Hibernate's transactional behavior, we discuss it in <xref linkend="
-"\"transactions\" />."
+"\"transactions\"/>."
msgstr ""
"Durante uma limpeza, pode ocorrer uma exceção (ex.: se uma operação DML "
"violar uma restrição). Como o manuseio de exceções envolve algum "
"entendimento do comportamento transacional do Hibernate, discutiremos sobre "
-"isso em <xref linkend="
-"\"transactions\" />."
+"isso em <xref linkend=\"transactions\" />."
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr "Persistência Transitiva"
#. Tag: para
+#: session_api.xml:797
#, no-c-format
msgid ""
"It is quite cumbersome to save, delete, or reattach individual objects, "
@@ -1445,6 +2049,7 @@
"um relacionamento pai/filho. Considere o seguinte exemplo: "
#. Tag: para
+#: session_api.xml:802
#, no-c-format
msgid ""
"If the children in a parent/child relationship would be value typed (e.g. a "
@@ -1466,6 +2071,7 @@
"deletar o filho do banco de dados. "
#. Tag: para
+#: session_api.xml:812
#, no-c-format
msgid ""
"Now consider the same scenario with parent and child objects being entities, "
@@ -1485,6 +2091,7 @@
"<emphasis>persistência por alcance</emphasis> por padrão. "
#. Tag: para
+#: session_api.xml:820
#, no-c-format
msgid ""
"For each basic operation of the Hibernate session - including "
@@ -1503,12 +2110,26 @@
"literal>. Se desejar uma operação em cascata junto a associação, você deverá "
"indicar isto no documento de mapeamento. Por exemplo:"
+#. Tag: programlisting
+#: session_api.xml:828
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr "Estilo cascata pode ser combinado:"
+#. Tag: programlisting
+#: session_api.xml:832
+#, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:834
#, no-c-format
msgid ""
"You can even use <literal>cascade=\"all\"</literal> to specify that "
@@ -1522,30 +2143,133 @@
"nenhuma operação deve estar em cascata. "
#. Tag: para
+#: session_api.xml:839
#, no-c-format
msgid ""
+"In case you are using annotatons you probably have noticed the "
+"<literal>cascade</literal> attribute taking an array of "
+"<classname>CascadeType</classname> as a value. The cascade concept in JPA is "
+"very is similar to the transitive persistence and cascading of operations as "
+"described above, but with slightly different semantics and cascading types:"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:848
+#, no-c-format
+msgid ""
+"<literal>CascadeType.PERSIST</literal>: cascades the persist (create) "
+"operation to associated entities persist() is called or if the entity is "
+"managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:854
+#, no-c-format
+msgid ""
+"<literal>CascadeType.MERGE</literal>: cascades the merge operation to "
+"associated entities if merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:860
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REMOVE</literal>: cascades the remove operation to "
+"associated entities if delete() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:865
+#, no-c-format
+msgid ""
+"<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to "
+"associated entities if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:870
+#, no-c-format
+msgid ""
+"<literal>CascadeType.DETACH:</literal> cascades the detach operation to "
+"associated entities if detach() is called"
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:875
+#, fuzzy, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr "<literal>saveOrUpdate()</literal> faz o seguinte:"
+
+#. Tag: para
+#: session_api.xml:880
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc..."
+msgstr ""
+
+#. Tag: para
+#: session_api.xml:884
+#, no-c-format
+msgid ""
"A special cascade style, <literal>delete-orphan</literal>, applies only to "
"one-to-many associations, and indicates that the <literal>delete()</literal> "
"operation should be applied to any child object that is removed from the "
-"association."
+"association. Using annotations there is no <literal>CascadeType.DELETE-"
+"ORPHAN</literal> equivalent. Instead you can use the attribute "
+"<literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-"
+"many-with-orphan-removal\"/>. If an entity is removed from a "
+"<classname>@OneToMany</classname> collection or an associated entity is "
+"dereferenced from a <classname>@OneToOne</classname> association, this "
+"associated entity can be marked for deletion if <literal>orphanRemoval</"
+"literal> is set to true."
msgstr ""
-"Um estilo especial em cascata, <literal>delete-orphan</literal>, aplica "
-"somente associações um-para-um, e indica que a operação <literal>delete()</"
-"literal> deve ser aplicada em qualquer objeto filho que seja removido da "
-"associação."
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+"@Entity \n"
+"public class Customer {\n"
+" private Set<Order> orders;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+" public Set<Order> getOrders() { return orders; }\n"
+"\n"
+" public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+"\n"
+" [...]\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Order { ... }\n"
+"\n"
+"Customer customer = em.find(Customer.class, 1l);\n"
+"Order order = em.find(Order.class, 1l);\n"
+"customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:903
#, no-c-format
msgid "Recommendations:"
msgstr "Recomendações:"
#. Tag: para
-#, no-c-format
+#: session_api.xml:907
+#, fuzzy, no-c-format
msgid ""
-"It does not usually make sense to enable cascade on a <literal><many-to-"
-"one></literal> or <literal><many-to-many></literal> association. "
-"Cascade is often useful for <literal><one-to-one></literal> and "
-"<literal><one-to-many></literal> associations."
+"It does not usually make sense to enable cascade on a many-to-one or many-to-"
+"many association. In fact the <literal>@ManyToOne</literal> and "
+"<literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</"
+"literal> attribute. Cascading is often useful for one-to-one and one-to-many "
+"associations."
msgstr ""
"Não faz sentido habilitar a cascata em uma associação. <literal><many-to-"
"one></literal> ou <literal><many-to-many></literal> A Cascata é "
@@ -1553,17 +2277,20 @@
"<literal><one-to-many></literal>."
#. Tag: para
-#, no-c-format
+#: session_api.xml:915
+#, fuzzy, no-c-format
msgid ""
"If the child object's lifespan is bounded by the lifespan of the parent "
"object, make it a <emphasis>life cycle object</emphasis> by specifying "
-"<literal>cascade=\"all,delete-orphan\"</literal>."
+"<literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany"
+"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
msgstr ""
"Se o tempo de vida do objeto filho estiver vinculado ao tempo de vida do "
"objeto pai, faça disto um <emphasis>objeto de ciclo de vida</emphasis> "
"especificando um <literal>cascade=\"all,delete-orphan\"</literal>."
#. Tag: para
+#: session_api.xml:923
#, no-c-format
msgid ""
"Otherwise, you might not need cascade at all. But if you think that you will "
@@ -1577,6 +2304,7 @@
"\"persistir,mesclar,salvar-atualizar\"</literal>."
#. Tag: para
+#: session_api.xml:931
#, no-c-format
msgid ""
"Mapping an association (either a single valued association, or a collection) "
@@ -1591,15 +2319,16 @@
"filho(s)."
#. Tag: para
-#, no-c-format
+#: session_api.xml:937
+#, fuzzy, no-c-format
msgid ""
"Furthermore, a mere reference to a child from a persistent parent will "
"result in save/update of the child. This metaphor is incomplete, however. A "
"child which becomes unreferenced by its parent is <emphasis>not</emphasis> "
-"automatically deleted, except in the case of a <literal><one-to-many></"
-"literal> association mapped with <literal>cascade=\"delete-orphan\"</"
-"literal>. The precise semantics of cascading operations for a parent/child "
-"relationship are as follows:"
+"automatically deleted, except in the case of a one-to-many association "
+"mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise "
+"semantics of cascading operations for a parent/child relationship are as "
+"follows:"
msgstr ""
"Além disso, uma mera referência ao filho de um pai persistente irá resultar "
"em salvar/atualizar/ o filho. Entretanto, esta metáfora está incompleta. Um "
@@ -1610,6 +2339,7 @@
"pai/filho, são como as que se seguem: "
#. Tag: para
+#: session_api.xml:948
#, no-c-format
msgid ""
"If a parent is passed to <literal>persist()</literal>, all children are "
@@ -1619,6 +2349,7 @@
"passados para <literal>persist()</literal>"
#. Tag: para
+#: session_api.xml:953
#, no-c-format
msgid ""
"If a parent is passed to <literal>merge()</literal>, all children are passed "
@@ -1628,6 +2359,7 @@
"passados para <literal>merge()</literal>"
#. Tag: para
+#: session_api.xml:958
#, no-c-format
msgid ""
"If a parent is passed to <literal>save()</literal>, <literal>update()</"
@@ -1639,6 +2371,7 @@
"<literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:964
#, no-c-format
msgid ""
"If a transient or detached child becomes referenced by a persistent parent, "
@@ -1648,6 +2381,7 @@
"persistente, ele será passado para <literal>saveOrUpdate()</literal>"
#. Tag: para
+#: session_api.xml:970
#, no-c-format
msgid ""
"If a parent is deleted, all children are passed to <literal>delete()</"
@@ -1657,6 +2391,7 @@
"</literal>"
#. Tag: para
+#: session_api.xml:975
#, no-c-format
msgid ""
"If a child is dereferenced by a persistent parent, <emphasis>nothing special "
@@ -1670,6 +2405,7 @@
"literal>, nos quais casos o filho \"órfão\" é deletado."
#. Tag: para
+#: session_api.xml:983
#, no-c-format
msgid ""
"Finally, note that cascading of operations can be applied to an object graph "
@@ -1688,11 +2424,13 @@
"associadas atingíveis durante a limpeza da <literal>Sessão</literal>. "
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr "Usando metadados"
#. Tag: para
+#: session_api.xml:995
#, no-c-format
msgid ""
"Hibernate requires a rich meta-level model of all entity and value types. "
@@ -1711,6 +2449,7 @@
"associadas). "
#. Tag: para
+#: session_api.xml:1002
#, no-c-format
msgid ""
"Hibernate exposes metadata via the <literal>ClassMetadata</literal> and "
@@ -1723,3 +2462,34 @@
"<literal>Type</literal>. Instâncias das interfaces de metadados podem ser "
"obtidas a partir do <literal>SessionFactory</literal>. "
+#. Tag: programlisting
+#: session_api.xml:1007
+#, no-c-format
+msgid ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
+msgstr ""
+
+#~ msgid ""
+#~ "A special cascade style, <literal>delete-orphan</literal>, applies only "
+#~ "to one-to-many associations, and indicates that the <literal>delete()</"
+#~ "literal> operation should be applied to any child object that is removed "
+#~ "from the association."
+#~ msgstr ""
+#~ "Um estilo especial em cascata, <literal>delete-orphan</literal>, aplica "
+#~ "somente associações um-para-um, e indica que a operação <literal>delete()"
+#~ "</literal> deve ser aplicada em qualquer objeto filho que seja removido "
+#~ "da associação."
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/tutorial.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/tutorial.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/tutorial.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: tutorial\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-19 14:09+1000\n"
"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
@@ -118,11 +118,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr "Tutorial"
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
msgid ""
"Intended for new users, this chapter provides an step-by-step introduction "
@@ -138,6 +140,7 @@
"<filename>tutorials/web</filename> da fonte do projeto."
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
msgid ""
"This tutorial expects the user have knowledge of both Java and SQL. If you "
@@ -150,6 +153,7 @@
"entender o Hibernate."
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
msgid ""
"The distribution contains another example application under the "
@@ -159,11 +163,13 @@
"fonte do projeto <filename>tutorial/eg</filename>."
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr "Parte 1 – A primeira aplicação Hibernate"
#. Tag: para
+#: tutorial.xml:64
#, no-c-format
msgid ""
"For this example, we will set up a small database application that can store "
@@ -174,6 +180,7 @@
"sobre os hosts destes eventos. "
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
msgid ""
"Although you can use whatever database you feel comfortable using, we will "
@@ -187,11 +194,13 @@
"quaisquer servidores do banco de dados."
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr "Configuração"
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
msgid ""
"The first thing we need to do is to set up the development environment. We "
@@ -214,6 +223,7 @@
"e <filename>src/main/webapp</filename>."
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
msgid ""
"We will be using Maven in this tutorial, taking advantage of its transitive "
@@ -224,11 +234,65 @@
"dependência transitiva assim como a habilidade de muitos IDEs de configurar "
"automaticamente um projeto baseado no descritor maven."
-#. Tag: para
+#. Tag: programlisting
+#: tutorial.xml:97
#, no-c-format
msgid ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
+msgstr ""
+
+#. Tag: para
+#: tutorial.xml:100
+#, fuzzy, no-c-format
+msgid ""
"It is not a requirement to use Maven. If you wish to use something else to "
-"build this tutoial (such as Ant), the layout will remain the same. The only "
+"build this tutorial (such as Ant), the layout will remain the same. The only "
"change is that you will need to manually account for all the needed "
"dependencies. If you use something like <ulink url=\"http://ant.apache.org/"
"ivy/\">Ivy</ulink> providing transitive dependency management you would "
@@ -247,28 +311,32 @@
"dependências necessárias. Caso você utilize <ulink url=\"http://ant.apache."
"org/ivy/\">Ivy</ulink> para fornecer um gerenciamento de dependência "
"transitiva, você continuará a usar as dependências mencionadas abaixo. Do "
-"contrário, você precisará encontrar <emphasis>todas</emphasis> as dependências, ambas explícitas "
-"e transitivas, além de adicioná-las às classpath de projetos. Caso "
-"trabalhando da vinculação de distribuição Hibernate, quer dizer "
-"<filename>hibernate3.jar</filename>, todos os artefatos no diretório "
-"<filename>lib/required</filename> e todos os arquivos a partir do diretório "
-"<filename>lib/bytecode/cglib</filename> ou <filename>lib/bytecode/javassist</"
-"filename>. Adicionalmente, você precisará de ambos servlet-api jar e um dos "
-"slf4j logging backends. "
+"contrário, você precisará encontrar <emphasis>todas</emphasis> as "
+"dependências, ambas explícitas e transitivas, além de adicioná-las às "
+"classpath de projetos. Caso trabalhando da vinculação de distribuição "
+"Hibernate, quer dizer <filename>hibernate3.jar</filename>, todos os "
+"artefatos no diretório <filename>lib/required</filename> e todos os arquivos "
+"a partir do diretório <filename>lib/bytecode/cglib</filename> ou "
+"<filename>lib/bytecode/javassist</filename>. Adicionalmente, você precisará "
+"de ambos servlet-api jar e um dos slf4j logging backends. "
#. Tag: para
+#: tutorial.xml:117
#, no-c-format
-msgid "Save this file as <filename>pom.xml</filename> in the project root directory."
+msgid ""
+"Save this file as <filename>pom.xml</filename> in the project root directory."
msgstr ""
"Salve este arquivo como <filename>pom.xml</filename> no diretório raiz do "
"projeto."
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr "A primeira Classe"
#. Tag: para
+#: tutorial.xml:126
#, no-c-format
msgid ""
"Next, we create a class that represents the event we want to store in the "
@@ -278,7 +346,50 @@
"armazenar na base de dados. Isto é uma classe JavaBean simples com algumas "
"propriedades:"
+#. Tag: programlisting
+#: tutorial.xml:131
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:133
#, no-c-format
msgid ""
"This class uses standard JavaBean naming conventions for property getter and "
@@ -294,6 +405,7 @@
"para os métodos de acesso é a robustez para o refactoring. "
#. Tag: para
+#: tutorial.xml:141
#, no-c-format
msgid ""
"The <literal>id</literal> property holds a unique identifier value for a "
@@ -323,6 +435,7 @@
"pode adaptar seu projeto de aplicação."
#. Tag: para
+#: tutorial.xml:156
#, no-c-format
msgid ""
"The no-argument constructor is a requirement for all persistent classes; "
@@ -338,6 +451,7 @@
"eficiente dos dados sem a instrumentação de bytecode."
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
msgid ""
"Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</"
@@ -347,11 +461,13 @@
"tutorial/domain</filename>."
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr "O mapeamento do arquivo"
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
msgid ""
"Hibernate needs to know how to load and store objects of the persistent "
@@ -365,11 +481,27 @@
"ele deverá acessar, e quais as colunas na tabela ele deverá usar."
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr "A estrutura básica de um arquivo de mapeamento é parecida com:"
+#. Tag: programlisting
+#: tutorial.xml:185
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:187
#, no-c-format
msgid ""
"Hibernate DTD is sophisticated. You can use it for auto-completion of XML "
@@ -392,6 +524,7 @@
"distribuição."
#. Tag: para
+#: tutorial.xml:200
#, no-c-format
msgid ""
"We will omit the DTD declaration in future examples to shorten the code. It "
@@ -401,6 +534,7 @@
"código. Isto, é claro, não é opcional. "
#. Tag: para
+#: tutorial.xml:206
#, no-c-format
msgid ""
"Between the two <literal>hibernate-mapping</literal> tags, include a "
@@ -414,7 +548,21 @@
"são classes-primárias de entidades) necessitam do tal mapeamento, para uma "
"tabela na base de dados SQL:"
+#. Tag: programlisting
+#: tutorial.xml:213
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:215
#, no-c-format
msgid ""
"So far we have told Hibernate how to persist and load object of class "
@@ -432,7 +580,23 @@
"em manipular este identificador, iremos configurar uma estratégia de geração "
"de id’s do Hibernate para uma coluna de chave primária substituta: "
+#. Tag: programlisting
+#: tutorial.xml:225
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
msgid ""
"The <literal>id</literal> element is the declaration of the identifier "
@@ -450,6 +614,7 @@
"da tabela <literal>EVENTS</literal> mantém o valor de chave primária."
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
msgid ""
"The nested <literal>generator</literal> element specifies the identifier "
@@ -470,17 +635,18 @@
"o plugin na sua própria estratégia."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:249
+#, fuzzy, no-c-format
msgid ""
"<literal>native</literal> is no longer consider the best strategy in terms "
-"of portability. for further discussion, see <xref linkend=\"portability-idgen"
-"\" />"
+"of portability. for further discussion, see"
msgstr ""
"<literal>native</literal> não é mais considerada a melhor estratégia em "
-"termos de portabilidade. Para maiores informações, consulte <xref linkend=\"portability-idgen"
-"\" />"
+"termos de portabilidade. Para maiores informações, consulte <xref linkend="
+"\"portability-idgen\" />"
#. Tag: para
+#: tutorial.xml:255
#, no-c-format
msgid ""
"Lastly, we need to tell Hibernate about the remaining entity class "
@@ -490,7 +656,26 @@
"classe no arquivo mapeado. Por padrão, nenhuma das propriedades da classe é "
"considerada persistente:"
+#. Tag: programlisting
+#: tutorial.xml:261
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:263
#, no-c-format
msgid ""
"Similar to the <literal>id</literal> element, the <literal>name</literal> "
@@ -506,6 +691,7 @@
"literal>, <literal>getTitle()</literal> e <literal>setTitle()</literal>."
#. Tag: para
+#: tutorial.xml:274
#, no-c-format
msgid ""
"Why does the <literal>date</literal> property mapping include the "
@@ -524,6 +710,7 @@
"melhor mapeá-lo com um nome diferente. "
#. Tag: para
+#: tutorial.xml:284
#, no-c-format
msgid ""
"The <literal>title</literal> mapping also lacks a <literal>type</literal> "
@@ -559,6 +746,7 @@
"pelo mapeamento da propriedade com um conversor <literal>timestamp</literal>."
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
msgid ""
"Hibernate makes this mapping type determination using reflection when the "
@@ -572,6 +760,7 @@
"que você considere claramente a definição do tipo para uso."
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
msgid ""
"Save this mapping file as <filename>src/main/resources/org/hibernate/"
@@ -581,11 +770,13 @@
"hibernate/tutorial/domain/Event.hbm.xml</filename>."
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr "Configuração do Hibernate"
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
msgid ""
"At this point, you should have the persistent class and its mapping file in "
@@ -597,11 +788,14 @@
"configurar o HSQLDB para rodar no \"modo do servidor\"."
#. Tag: para
+#: tutorial.xml:324
#, no-c-format
msgid "We do this do that the data remains between runs."
-msgstr "Nós realizamos isto para que aqueles dados permaneçam entre as execuções. "
+msgstr ""
+"Nós realizamos isto para que aqueles dados permaneçam entre as execuções. "
#. Tag: para
+#: tutorial.xml:329
#, no-c-format
msgid ""
"We will utilize the Maven exec plugin to launch the HSQLDB server by "
@@ -621,6 +815,7 @@
"diretório <filename>target/data</filename>, e inicie o HSQLBD novamente."
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
msgid ""
"Hibernate will be connecting to the database on behalf of your application, "
@@ -642,15 +837,18 @@
"do Hibernate para este tutorial."
#. Tag: para
+#: tutorial.xml:351
#, no-c-format
msgid ""
"The built-in Hibernate connection pool is in no way intended for production "
"use. It lacks several features found on any decent connection pool."
msgstr ""
"O pool de conexão interna do Hibernate não é recomendado para uso de "
-"produção. Ele possui deficiência em diversos recursos encontrados em qualquer pool de conexão apropriado."
+"produção. Ele possui deficiência em diversos recursos encontrados em "
+"qualquer pool de conexão apropriado."
#. Tag: para
+#: tutorial.xml:357
#, no-c-format
msgid ""
"For Hibernate's configuration, we can use a simple <literal>hibernate."
@@ -664,12 +862,63 @@
"programática completa. A maioria dos usuários prefere utilizar o arquivo de "
"configuração XML:"
+#. Tag: programlisting
+#: tutorial.xml:363
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr "Perceba que este arquivo de configuração especifica um DTD diferente"
#. Tag: para
+#: tutorial.xml:369
#, no-c-format
msgid ""
"You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory "
@@ -684,6 +933,7 @@
"configuração, para uma inicialização mais fácil. "
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
msgid ""
"The first four <literal>property</literal> elements contain the necessary "
@@ -696,16 +946,18 @@
"gera."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:383
+#, fuzzy, no-c-format
msgid ""
"In most cases, Hibernate is able to properly determine which dialect to use. "
-"See <xref linkend=\"portability-dialectresolver\" /> for more information."
+"See <xref linkend=\"portability-dialectresolver\"/> for more information."
msgstr ""
"Na maioria dos casos, o Hibernate está apto a determinar corretamente qual "
"dialeto em uso. Consulte <xref linkend=\"portability-dialectresolver\" /> "
"para maiores informações. "
#. Tag: para
+#: tutorial.xml:389
#, no-c-format
msgid ""
"Hibernate's automatic session management for persistence contexts is "
@@ -726,6 +978,7 @@
"configuração."
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
msgid ""
"Save this file as <filename>hibernate.cfg.xml</filename> into the "
@@ -735,11 +988,13 @@
"<filename>src/main/resources</filename>."
#. Tag: title
+#: tutorial.xml:406
#, no-c-format
msgid "Building with Maven"
msgstr "Construindo com o Maven"
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
msgid ""
"We will now build the tutorial with Maven. You will need to have Maven "
@@ -757,12 +1012,43 @@
"vamos rodar o objetivo <literal>compile</literal> para nos certificarmos de "
"que tudo foi compilado até agora:"
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+"<![CDATA[[hibernateTutorial]$ mvn compile\n"
+"[INFO] Scanning for projects...\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Building First Hibernate Tutorial\n"
+"[INFO] task-segment: [compile]\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] [resources:resources]\n"
+"[INFO] Using default encoding to copy filtered resources.\n"
+"[INFO] [compiler:compile]\n"
+"[INFO] Compiling 1 source file to /home/steve/projects/sandbox/"
+"hibernateTutorial/target/classes\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] BUILD SUCCESSFUL\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Total time: 2 seconds\n"
+"[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+"[INFO] Final Memory: 5M/547M\n"
+"[INFO] "
+"------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr "Inicialização e Auxiliares "
#. Tag: para
+#: tutorial.xml:425
#, no-c-format
msgid ""
"It is time to load and store some <literal>Event</literal> objects, but "
@@ -789,6 +1075,7 @@
"instanciado uma vez. "
#. Tag: para
+#: tutorial.xml:439
#, no-c-format
msgid ""
"We will create a <literal>HibernateUtil</literal> helper class that takes "
@@ -799,7 +1086,42 @@
"inicialização e faz acesso a uma <interfacename>org.hibernate."
"SessionFactory</interfacename> mais conveniente. "
+#. Tag: programlisting
+#: tutorial.xml:445
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.util;\n"
+"\n"
+"import org.hibernate.SessionFactory;\n"
+"import org.hibernate.cfg.Configuration;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory = buildSessionFactory"
+"();\n"
+"\n"
+" private static SessionFactory buildSessionFactory() {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" return new Configuration().configure().buildSessionFactory();\n"
+" }\n"
+" catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
msgid ""
"Save this code as <filename>src/main/java/org/hibernate/tutorial/util/"
@@ -809,6 +1131,7 @@
"HibernateUtil.java</filename>"
#. Tag: para
+#: tutorial.xml:452
#, no-c-format
msgid ""
"This class not only produces the global <interfacename>org.hibernate."
@@ -826,6 +1149,7 @@
"localização para este assunto."
#. Tag: para
+#: tutorial.xml:461
#, no-c-format
msgid ""
"If you give the <interfacename>org.hibernate.SessionFactory</interfacename> "
@@ -844,6 +1168,7 @@
"serão discutidas mais tarde."
#. Tag: para
+#: tutorial.xml:470
#, no-c-format
msgid ""
"You now need to configure a logging system. Hibernate uses commons logging "
@@ -866,6 +1191,7 @@
"mostradas no stdout."
#. Tag: para
+#: tutorial.xml:480
#, no-c-format
msgid ""
"The tutorial infrastructure is complete and you are now ready to do some "
@@ -875,14 +1201,16 @@
"algum trabalho de verdade com o Hibernate. "
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr "Carregando e salvando objetos"
#. Tag: para
-#, no-c-format
+#: tutorial.xml:490
+#, fuzzy, no-c-format
msgid ""
-"We are now ready to start doing some real worjk with Hibernate. Let's start "
+"We are now ready to start doing some real work with Hibernate. Let's start "
"by writing an <literal>EventManager</literal> class with a <literal>main()</"
"literal> method:"
msgstr ""
@@ -890,7 +1218,49 @@
"Vamos começar escrevendo uma classe <literal>EventManager</literal> com um "
"método <literal>main()</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:496
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial;\n"
+"\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.*;\n"
+"\n"
+"import org.hibernate.tutorial.domain.Event;\n"
+"import org.hibernate.tutorial.util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:498
#, no-c-format
msgid ""
"In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</"
@@ -903,10 +1273,11 @@
"tomar conta do SQL e executa <literal>INSERT</literal>s no banco de dados. "
#. Tag: para
-#, no-c-format
+#: tutorial.xml:505
+#, fuzzy, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> is designed to represent a "
-"single unit of work (a single atmoic piece of work to be performed). For now "
+"single unit of work (a single atomic piece of work to be performed). For now "
"we will keep things simple and assume a one-to-one granularity between a "
"Hibernate <interface>org.hibernate.Session</interface> and a database "
"transaction. To shield our code from the actual underlying transaction "
@@ -925,6 +1296,7 @@
"mas isto pode rodar também com o JTA."
#. Tag: para
+#: tutorial.xml:518
#, no-c-format
msgid ""
"What does <literal>sessionFactory.getCurrentSession()</literal> do? First, "
@@ -947,6 +1319,7 @@
"aplicação. "
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
msgid ""
"Hibernate offers three methods of current session tracking. The \"thread\" "
@@ -960,6 +1333,7 @@
"em mais detalhes mais tarde."
#. Tag: para
+#: tutorial.xml:541
#, no-c-format
msgid ""
"A <interface>org.hibernate.Session</interface> begins when the first call to "
@@ -981,6 +1355,7 @@
"trabalho. "
#. Tag: para
+#: tutorial.xml:554
#, no-c-format
msgid ""
"Related to the unit of work scope, should the Hibernate <interface>org."
@@ -1009,9 +1384,10 @@
"aplicativo da web real será demonstrado mais adiante neste tutorial."
#. Tag: para
-#, no-c-format
+#: tutorial.xml:571
+#, fuzzy, no-c-format
msgid ""
-"See <xref linkend=\"transactions\" /> for more information about transaction "
+"See <xref linkend=\"transactions\"/> for more information about transaction "
"handling and demarcation. The previous example also skipped any error "
"handling and rollback."
msgstr ""
@@ -1020,6 +1396,7 @@
"qualquer manipulação de erro e rollback no exemplo anterior. "
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
msgid ""
"To run this, we will make use of the Maven exec plugin to call our class "
@@ -1032,11 +1409,13 @@
"\"</command>"
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
msgstr "Você precisa executar o <command>mvn compile</command> primeiramente."
#. Tag: para
+#: tutorial.xml:589
#, no-c-format
msgid ""
"You should see Hibernate starting up and, depending on your configuration, "
@@ -1046,33 +1425,78 @@
"dependendo da sua configuração, muito log de saída. No final, você verá a "
"seguinte linha: "
+#. Tag: programlisting
+#: tutorial.xml:594
+#, no-c-format
+msgid ""
+"<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) "
+"values (?, ?, ?)]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:596
#, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr "Este é o <literal>INSERT</literal> executado pelo Hibernate."
#. Tag: para
+#: tutorial.xml:600
#, no-c-format
msgid "To list stored events an option is added to the main method:"
msgstr ""
"Adicionamos uma opção para o método principal com o objetivo de listar os "
"eventos arquivados: "
+#. Tag: programlisting
+#: tutorial.xml:604
+#, no-c-format
+msgid ""
+"<![CDATA[ if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+" else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\n"
+" \"Event: \" + theEvent.getTitle() + \" Time: \" + "
+"theEvent.getDate()\n"
+" );\n"
+" }\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:606
#, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr ""
"Nos também adicionamos um novo <literal>listEvents() method is also added</"
"literal>: "
-#. Tag: para
+#. Tag: programlisting
+#: tutorial.xml:610
#, no-c-format
msgid ""
+"<![CDATA[ private List listEvents() {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+" session.getTransaction().commit();\n"
+" return result;\n"
+" }]]>"
+msgstr ""
+
+#. Tag: para
+#: tutorial.xml:612
+#, fuzzy, no-c-format
+msgid ""
"Here, we are using a Hibernate Query Language (HQL) query to load all "
"existing <literal>Event</literal> objects from the database. Hibernate will "
"generate the appropriate SQL, send it to the database and populate "
"<literal>Event</literal> objects with the data. You can create more complex "
-"queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
+"queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
msgstr ""
"Neste caso, nós usamos uma consulta Hibernate Query LanguageHQL (HQL), para "
"carregar todos os objetos <literal>Event</literal> existentes no banco de "
@@ -1082,6 +1506,7 @@
"maiores informações. "
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
msgid ""
"Now we can call our new functionality, again using the Maven exec plugin: "
@@ -1093,11 +1518,13 @@
"tutorial.EventManager\" -Dexec.args=\"list\"</command>"
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr "Parte 2 - Mapeando associações "
#. Tag: para
+#: tutorial.xml:632
#, no-c-format
msgid ""
"So far we have mapped a single persistent entity class to a table in "
@@ -1111,16 +1538,40 @@
"participam. "
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr "Mapeando a classe Person "
#. Tag: para
+#: tutorial.xml:642
#, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
-msgstr "O primeira parte da classe <literal>Person</literal> parece-se com isto: "
+msgstr ""
+"O primeira parte da classe <literal>Person</literal> parece-se com isto: "
+#. Tag: programlisting
+#: tutorial.xml:646
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
msgid ""
"Save this to a file named <filename>src/main/java/org/hibernate/tutorial/"
@@ -1130,6 +1581,7 @@
"domain/Person.java</filename>"
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
msgid ""
"Next, create the new mapping file as <filename>src/main/resources/org/"
@@ -1138,12 +1590,40 @@
"Após isto, crie um novo arquivo de mapeamento como <filename>src/main/"
"resources/org/hibernate/tutorial/domain/Person.hbm.xml</filename>"
+#. Tag: programlisting
+#: tutorial.xml:658
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr "Finalmente, adicione o novo mapeamento à configuração do Hibernate: "
+#. Tag: programlisting
+#: tutorial.xml:664
+#, no-c-format
+msgid ""
+"<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:666
#, no-c-format
msgid ""
"Create an association between these two entities. Persons can participate in "
@@ -1156,11 +1636,13 @@
"comportamento de coleção. "
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr "Uma associação unidirecional baseada em Configuração"
#. Tag: para
+#: tutorial.xml:678
#, no-c-format
msgid ""
"By adding a collection of events to the <literal>Person</literal> class, you "
@@ -1180,7 +1662,26 @@
"interfacename>, uma vez que a coleção não conterá elementos duplicados e a "
"ordem não é relevante em nossos exemplos:"
+#. Tag: programlisting
+#: tutorial.xml:689
+#, no-c-format
+msgid ""
+"<![CDATA[public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:691
#, no-c-format
msgid ""
"Before mapping this association, let's consider the other side. We could "
@@ -1204,7 +1705,28 @@
"<emphasis>muitos-para-muitos</emphasis>. Daqui pra frente, usaremos o "
"mapeamento muitos-para-muitos do Hibernate: "
+#. Tag: programlisting
+#: tutorial.xml:704
+#, no-c-format
+msgid ""
+"<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:706
#, no-c-format
msgid ""
"Hibernate supports a broad range of collection mappings, a <literal>set</"
@@ -1232,16 +1754,38 @@
"do outro lado das coleções de referência)."
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr "O esquema de mapeamento para o banco de dados está a seguir: "
+#. Tag: programlisting
+#: tutorial.xml:726
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr "Trabalhando a associação "
#. Tag: para
+#: tutorial.xml:733
#, no-c-format
msgid ""
"Now we will bring some people and events together in a new method in "
@@ -1250,7 +1794,25 @@
"Vamos reunir algumas pessoas e eventos em um novo método na classe "
"<literal>EventManager</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:737
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:739
#, no-c-format
msgid ""
"After loading a <literal>Person</literal> and an <literal>Event</literal>, "
@@ -1284,6 +1846,7 @@
"transação do banco de dados. "
#. Tag: para
+#: tutorial.xml:758
#, no-c-format
msgid ""
"You can load person and event in different units of work. Or you can modify "
@@ -1299,7 +1862,43 @@
"<emphasis>detached</emphasis>). Você pode até mesmo modificar uma coleção "
"quando esta se encontrar no estado detached:"
+#. Tag: programlisting
+#: tutorial.xml:767
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p."
+"events where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use "
+"it detached\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory()."
+"getCurrentSession();\n"
+" session2.beginTransaction();\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:769
#, no-c-format
msgid ""
"The call to <literal>update</literal> makes a detached object persistent "
@@ -1316,6 +1915,7 @@
"objeto. "
#. Tag: para
+#: tutorial.xml:778
#, no-c-format
msgid ""
"This is not much use in our example, but it is an important concept you can "
@@ -1333,7 +1933,22 @@
"<literal>save()</literal> retornará estes identificadores (você poderá "
"modificar alguns dos métodos anteriores para retornar aquele identificador): "
+#. Tag: programlisting
+#: tutorial.xml:786
+#, no-c-format
+msgid ""
+"<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
+"());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" "
+"+ eventId);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:788
#, no-c-format
msgid ""
"This is an example of an association between two equally important classes : "
@@ -1364,6 +1979,7 @@
"aplicativo Hibernate todas as classes JDK são consideradas tipos de valores."
#. Tag: para
+#: tutorial.xml:806
#, no-c-format
msgid ""
"You can also design a collection of value types. This is conceptually "
@@ -1375,11 +1991,13 @@
"entidades, mas em Java parece ser quase a mesma coisa. "
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr "Coleção de valores "
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
msgid ""
"Let's add a collection of email addresses to the <literal>Person</literal> "
@@ -1391,12 +2009,39 @@
"<interfacename>java.util.Set</interfacename> das instâncias <classname>java."
"lang.String</classname>:"
+#. Tag: programlisting
+#: tutorial.xml:823
+#, no-c-format
+msgid ""
+"<![CDATA[ private Set emailAddresses = new HashSet();\n"
+"\n"
+" public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+" }\n"
+"\n"
+" public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:825
#, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr "Segue abaixo o mapeamento deste <literal>Set</literal>: "
+#. Tag: programlisting
+#: tutorial.xml:829
+#, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+" </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:831
#, no-c-format
msgid ""
"The difference compared with the earlier mapping is the use of the "
@@ -1423,11 +2068,39 @@
"coluna onde os valores da <literal>String</literal> serão armazenados. "
#. Tag: para
+#: tutorial.xml:847
#, no-c-format
msgid "Here is the updated schema:"
msgstr "Segue abaixo o esquema atualizado: "
+#. Tag: programlisting
+#: tutorial.xml:851
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
+"*PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:853
#, no-c-format
msgid ""
"You can see that the primary key of the collection table is in fact a "
@@ -1441,6 +2114,7 @@
"semântica que precisamos para um set em Java. "
#. Tag: para
+#: tutorial.xml:859
#, no-c-format
msgid ""
"You can now try to add elements to this collection, just like we did before "
@@ -1449,7 +2123,27 @@
"Você pode agora tentar adicionar elementos à essa coleção, do mesmo modo que "
"fizemos anteriormente ligando pessoas e eventos. É o mesmo código em Java: "
+#. Tag: programlisting
+#: tutorial.xml:864
+#, no-c-format
+msgid ""
+"<![CDATA[ private void addEmailToPerson(Long personId, String "
+"emailAddress) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" // adding to the emailAddress collection might trigger a lazy load "
+"of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:866
#, no-c-format
msgid ""
"This time we did not use a <emphasis>fetch</emphasis> query to initialize "
@@ -1461,11 +2155,13 @@
"busca. "
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr "Associações bidirecionais "
#. Tag: para
+#: tutorial.xml:877
#, no-c-format
msgid ""
"Next you will map a bi-directional association. You will make the "
@@ -1479,6 +2175,7 @@
"multiplicidade muitos-para-muitos. "
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
msgid ""
"A relational database is more flexible than a network programming language, "
@@ -1490,6 +2187,7 @@
"dados podem ser visualizados e restaurados de qualquer maneira."
#. Tag: para
+#: tutorial.xml:893
#, no-c-format
msgid ""
"First, add a collection of participants to the <literal>Event</literal> "
@@ -1498,12 +2196,42 @@
"Primeiramente, adicione uma coleção de participantes à classe "
"<literal>Event</literal>: "
+#. Tag: programlisting
+#: tutorial.xml:898
+#, no-c-format
+msgid ""
+"<![CDATA[ private Set participants = new HashSet();\n"
+"\n"
+" public Set getParticipants() {\n"
+" return participants;\n"
+" }\n"
+"\n"
+" public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:900
#, no-c-format
-msgid "Now map this side of the association in <literal>Event.hbm.xml</literal>."
-msgstr "Agora mapeie este lado da associação em <literal>Event.hbm.xml</literal>. "
+msgid ""
+"Now map this side of the association in <literal>Event.hbm.xml</literal>."
+msgstr ""
+"Agora mapeie este lado da associação em <literal>Event.hbm.xml</literal>. "
+#. Tag: programlisting
+#: tutorial.xml:904
+#, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse="
+"\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+" </set>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:906
#, no-c-format
msgid ""
"These are normal <literal>set</literal> mappings in both mapping documents. "
@@ -1521,6 +2249,7 @@
"literal> da coleção da classe <literal>Event</literal>. "
#. Tag: para
+#: tutorial.xml:914
#, no-c-format
msgid ""
"What this means is that Hibernate should take the other side, the "
@@ -1535,11 +2264,13 @@
"criada. "
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr "Trabalhando com links bidirecionais "
#. Tag: para
+#: tutorial.xml:925
#, no-c-format
msgid ""
"First, keep in mind that Hibernate does not affect normal Java semantics. "
@@ -1563,6 +2294,7 @@
"os lados\" é absolutamente necessária e você nunca deve esquecer de fazê-la. "
#. Tag: para
+#: tutorial.xml:935
#, no-c-format
msgid ""
"Many developers program defensively and create link management methods to "
@@ -1572,7 +2304,31 @@
"gerenciamento de um link que ajustam-se corretamente em ambos os lados (como "
"por exemplo, em <literal>Person</literal>): "
+#. Tag: programlisting
+#: tutorial.xml:940
+#, no-c-format
+msgid ""
+"<![CDATA[ protected Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"\n"
+" public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+" }\n"
+"\n"
+" public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:942
#, no-c-format
msgid ""
"The get and set methods for the collection are now protected. This allows "
@@ -1586,6 +2342,7 @@
"coleção diretamente. Repita os passos para a coleção do outro lado. "
#. Tag: para
+#: tutorial.xml:949
#, no-c-format
msgid ""
"What about the <literal>inverse</literal> mapping attribute? For you, and "
@@ -1619,11 +2376,13 @@
"selecionar qualquer lado. "
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr "EventManager um aplicativo da web"
#. Tag: para
+#: tutorial.xml:967
#, no-c-format
msgid ""
"A Hibernate web application uses <literal>Session</literal> and "
@@ -1640,11 +2399,13 @@
"novos eventos. "
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr "Criando um servlet básico "
#. Tag: para
+#: tutorial.xml:977
#, no-c-format
msgid ""
"First we need create our basic processing servlet. Since our servlet only "
@@ -1655,7 +2416,52 @@
"Uma vez que o servlet manuseia somente requisições <literal>GET</literal> do "
"HTTP, o método que iremos implementar é <literal>doGet()</literal>: "
+#. Tag: programlisting
+#: tutorial.xml:983
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.web;\n"
+"\n"
+"// Imports\n"
+"\n"
+"public class EventManagerServlet extends HttpServlet {\n"
+"\n"
+" protected void doGet(\n"
+" HttpServletRequest request,\n"
+" HttpServletResponse response) throws ServletException, "
+"IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy"
+"\" );\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().commit();\n"
+" }\n"
+" catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().rollback();\n"
+" if ( ServletException.class.isInstance( ex ) ) {\n"
+" throw ( ServletException ) ex;\n"
+" }\n"
+" else {\n"
+" throw new ServletException( ex );\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
msgid ""
"Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/"
@@ -1665,6 +2471,7 @@
"EventManagerServlet.java</filename>"
#. Tag: para
+#: tutorial.xml:990
#, no-c-format
msgid ""
"The pattern applied here is called <emphasis>session-per-request</emphasis>. "
@@ -1683,6 +2490,7 @@
"leitura ou escrita. Não se deve utilizar o modo auto-commit em aplicações. "
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
msgid ""
"Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> "
@@ -1697,6 +2505,7 @@
"vinculado automaticamente à thread atual de Java. "
#. Tag: para
+#: tutorial.xml:1006
#, no-c-format
msgid ""
"Next, the possible actions of the request are processed and the response "
@@ -1706,6 +2515,7 @@
"resposta HTML será renderizada. Já chegaremos nesta parte. "
#. Tag: para
+#: tutorial.xml:1011
#, no-c-format
msgid ""
"Finally, the unit of work ends when processing and rendering are complete. "
@@ -1728,18 +2538,58 @@
"considerar renderizar sua visualização no JSP, não apenas num servlet. "
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr "Processando e renderizando"
#. Tag: para
+#: tutorial.xml:1027
#, no-c-format
msgid ""
"Now you can implement the processing of the request and the rendering of the "
"page."
-msgstr "Vamos implementar o processamento da solicitação e renderização da página. "
+msgstr ""
+"Vamos implementar o processamento da solicitação e renderização da página. "
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, no-c-format
+msgid ""
+"<![CDATA[ // Write HTML header\n"
+" PrintWriter out = response.getWriter();\n"
+" out.println(\"<html><head><title>Event Manager</title></head><body>"
+"\");\n"
+"\n"
+" // Handle actions\n"
+" if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date.</i></"
+"b>\");\n"
+" }\n"
+" else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse"
+"(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>\");\n"
+" }\n"
+" }\n"
+"\n"
+" // Print page\n"
+" printEventForm(out);\n"
+" listEvents(out, dateFormatter);\n"
+"\n"
+" // Write HTML footer\n"
+" out.println(\"</body></html>\");\n"
+" out.flush();\n"
+" out.close();]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1033
#, no-c-format
msgid ""
"This coding style, with a mix of Java and HTML, would not scale in a more "
@@ -1756,7 +2606,25 @@
"para entrada de evento em HTML e uma lista de todos os evento no banco de "
"dados. O primeiro método é trivial e somente produz um HTML:"
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, no-c-format
+msgid ""
+"<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
+"\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
msgid ""
"The <literal>listEvents()</literal> method uses the Hibernate "
@@ -1765,7 +2633,38 @@
"O método <literal>listEvents()</literal> utiliza a <literal>Session</"
"literal> do Hibernate, limitado ao thread atual para executar uma consulta: "
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, no-c-format
+msgid ""
+"<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
+"dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" Iterator it = result.iterator();\n"
+" while (it.hasNext()) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate()) "
+"+ \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
msgid ""
"Finally, the <literal>store</literal> action is dispatched to the "
@@ -1776,7 +2675,23 @@
"<literal>createAndStoreEvent()</literal>, que também utiliza a "
"<literal>Session</literal> da thread atual:"
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, no-c-format
+msgid ""
+"<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) "
+"{\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+" }]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1060
#, no-c-format
msgid ""
"The servlet is now complete. A request to the servlet will be processed in a "
@@ -1798,11 +2713,13 @@
"(o modelo DAO). Veja o Hibernate Wiki para mais exemplos. "
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr "Implementando e testando"
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
msgid ""
"To deploy this application for testing we must create a Web ARchive (WAR). "
@@ -1813,7 +2730,32 @@
"Web (WAR). Primeiro, nós devemos definir o descritor WAR como <filename>src/"
"main/webapp/WEB-INF/web.xml</filename>"
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/"
+"xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
+"servlet-class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>]]>"
+msgstr ""
+
#. Tag: para
+#: tutorial.xml:1084
#, no-c-format
msgid ""
"To build and deploy call <literal>mvn package</literal> in your project "
@@ -1825,17 +2767,19 @@
"para seu diretório Tomcat <literal>webapp</literal>. "
#. Tag: para
-#, no-c-format
+#: tutorial.xml:1091
+#, fuzzy, no-c-format
msgid ""
"If you do not have Tomcat installed, download it from <ulink url=\"http://"
-"tomcat.apache.org/\" /> and follow the installation instructions. Our "
+"tomcat.apache.org/\"></ulink> and follow the installation instructions. Our "
"application requires no changes to the standard Tomcat configuration."
msgstr ""
"Caso você não possua o Tomcat instalado, baixe isto do <ulink url=\"http://"
-"tomcat.apache.org/\" /> e siga as instruções de instalação. Nosso "
-"aplicativo não solicita alterações à configuração Tomcat padrão. "
+"tomcat.apache.org/\" /> e siga as instruções de instalação. Nosso aplicativo "
+"não solicita alterações à configuração Tomcat padrão. "
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
msgid ""
"Once deployed and Tomcat is running, access the application at "
@@ -1853,11 +2797,13 @@
"resultado detalhado caso exceções aconteçam. "
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr "Sumário"
#. Tag: para
+#: tutorial.xml:1114
#, no-c-format
msgid ""
"This tutorial covered the basics of writing a simple standalone Hibernate "
@@ -1868,4 +2814,3 @@
"autônomo simples e um aplicativo da web pequeno. A partir do Hibernate "
"<ulink url=\"http://hibernate.org\">website</ulink> você poderá encontrar "
"mais tutoriais disponíveis."
-
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/author_group.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/author_group.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/author_group.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-04T04:51:21\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 08:43+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: none\n"
@@ -13,138 +13,296 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:28
#, no-c-format
-msgid "Gavin"
-msgstr "Gavin"
+msgid "<firstname>Gavin</firstname> <surname>King</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:32
#, no-c-format
-msgid "Christian"
-msgstr "Christian"
+msgid "<firstname>Christian</firstname> <surname>Bauer</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:36
#, no-c-format
-msgid "Max"
-msgstr "Max"
+msgid ""
+"<firstname>Max</firstname> <othername>Rydahl</othername> <surname>Andersen</"
+"surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:41
#, no-c-format
-msgid "Emmanuel"
-msgstr "Emmanuel"
+msgid ""
+"<author><firstname>Emmanuel</firstname> <surname>Bernard</surname></author>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:45
#, no-c-format
-msgid "Steve"
-msgstr "Steve"
+msgid "<firstname>Steve</firstname> <surname>Ebersole</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: author
+#: author_group.xml:49
#, no-c-format
-msgid "James"
-msgstr "James"
+msgid "<firstname>Hardy</firstname> <surname>Ferentschik</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:54
#, no-c-format
-msgid "Cheyenne"
-msgstr "Cheyenne"
+msgid "<firstname>James</firstname> <surname>Cobb</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: shortaffil
+#: author_group.xml:58 author_group.xml:65
#, no-c-format
-msgid "Vincent"
-msgstr "Vincent"
+msgid "Graphic Design"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:61
#, no-c-format
-msgid "Sebastien"
-msgstr "Sebastien"
+msgid "<firstname>Cheyenne</firstname> <surname>Weaver</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:74
#, no-c-format
-msgid "Michael"
-msgstr "Michael"
+msgid ""
+"<othername><![CDATA[Bernardo Antonio Buffa Colomé]]></othername> "
+"<email>kreimer at bbs.frc.utn.edu.ar</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:84
#, no-c-format
-msgid "Baptiste"
-msgstr "Baptiste"
+msgid "<firstname>Vincent</firstname> <surname>Ricard</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:88
#, no-c-format
-msgid "Anthony"
-msgstr "Anthony"
+msgid "<firstname>Sebastien</firstname> <surname>Cesbron</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:92
#, no-c-format
-msgid "Alvaro"
-msgstr "Alvaro"
+msgid "<firstname>Michael</firstname> <surname>Courcy</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:96
#, no-c-format
-msgid "Anderson"
-msgstr "Anderson"
+msgid "<firstname>Vincent</firstname> <surname>Giguère</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:100
#, no-c-format
-msgid "Daniel Vieira"
-msgstr "Daniel Vieira"
+msgid "<firstname>Baptiste</firstname> <surname>Mathus</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:104
#, no-c-format
-msgid "Francisco"
-msgstr "Francisco"
+msgid ""
+"<othercredit><firstname>Emmanuel</firstname> <surname>Bernard</surname></"
+"othercredit>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:108
#, no-c-format
-msgid "Gamarra"
-msgstr "Gamarra"
+msgid "<firstname>Anthony</firstname> <surname>Patricio</surname>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:118
#, no-c-format
-msgid "Luiz Carlos"
-msgstr "Luiz Carlos"
+msgid ""
+"<firstname>Alvaro</firstname> <surname>Netto</surname> "
+"<email>alvaronetto at cetip.com.br</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:123
#, no-c-format
-msgid "Marcel"
-msgstr "Marcel"
+msgid ""
+"<firstname>Anderson</firstname> <surname>Braulio</surname> "
+"<email>andersonbraulio at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:128
#, no-c-format
-msgid "Paulo"
-msgstr "Paulo"
+msgid ""
+"<firstname>Daniel Vieira</firstname> <surname>Costa</surname> "
+"<email>danielvc at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:133
#, no-c-format
-msgid "Pablo L."
-msgstr "Pablo L."
+msgid ""
+"<firstname>Francisco</firstname> <surname>gamarra</surname> <email>francisco."
+"gamarra at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:138
#, no-c-format
-msgid "Renato"
-msgstr "Renato"
+msgid ""
+"<firstname>Gamarra</firstname> <email>mauricio.gamarra at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:142
#, no-c-format
-msgid "Rogério"
-msgstr "Rogério"
+msgid ""
+"<firstname>Luiz Carlos</firstname> <surname>Rodrigues</surname> "
+"<email>luizcarlos_rodrigues at yahoo.com.br</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:147
#, no-c-format
-msgid "Wanderson"
-msgstr "Wanderson"
+msgid ""
+"<firstname>Marcel</firstname> <surname>Castelo</surname> <email>marcel."
+"castelo at gmail.com</email>"
+msgstr ""
-#. Tag: firstname
+#. Tag: othercredit
+#: author_group.xml:152
#, no-c-format
-msgid "Cao"
-msgstr "Cao"
+msgid ""
+"<firstname>Paulo</firstname> <surname>César</surname> <email>paulocol at gmail."
+"com</email>"
+msgstr ""
-#. Tag: orgname
+#. Tag: othercredit
+#: author_group.xml:157
#, no-c-format
-msgid "RedSaga"
-msgstr "RedSaga"
+msgid ""
+"<firstname>Pablo L.</firstname> <surname>de Miranda</surname> "
+"<email>pablolmiranda at gmail.com</email>"
+msgstr ""
-#. Tag: contrib
+#. Tag: othercredit
+#: author_group.xml:162
#, no-c-format
-msgid "Translation Lead"
-msgstr "Translation Lead"
+msgid ""
+"<firstname>Renato</firstname> <surname>Deggau</surname> <email>rdeggau at gmail."
+"com</email>"
+msgstr ""
+#. Tag: othercredit
+#: author_group.xml:167
+#, no-c-format
+msgid ""
+"<firstname>Rogério</firstname> <surname>Araújo</surname> "
+"<email>rgildoaraujo at yahoo.com.br</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:172
+#, no-c-format
+msgid ""
+"<firstname>Wanderson</firstname> <surname>Siqueira</surname> "
+"<email>wandersonxs at gmail.com</email>"
+msgstr ""
+
+#. Tag: othercredit
+#: author_group.xml:183
+#, no-c-format
+msgid ""
+"<firstname>Cao</firstname> <surname>Xiaogang</surname> <affiliation> "
+"<orgname>RedSaga</orgname> </affiliation> <contrib>Translation Lead</"
+"contrib> <email>caoxg at yahoo.com</email>"
+msgstr ""
+
+#~ msgid "Gavin"
+#~ msgstr "Gavin"
+
+#~ msgid "Christian"
+#~ msgstr "Christian"
+
+#~ msgid "Max"
+#~ msgstr "Max"
+
+#~ msgid "Emmanuel"
+#~ msgstr "Emmanuel"
+
+#~ msgid "Steve"
+#~ msgstr "Steve"
+
+#~ msgid "James"
+#~ msgstr "James"
+
+#~ msgid "Cheyenne"
+#~ msgstr "Cheyenne"
+
+#~ msgid "Vincent"
+#~ msgstr "Vincent"
+
+#~ msgid "Sebastien"
+#~ msgstr "Sebastien"
+
+#~ msgid "Michael"
+#~ msgstr "Michael"
+
+#~ msgid "Baptiste"
+#~ msgstr "Baptiste"
+
+#~ msgid "Anthony"
+#~ msgstr "Anthony"
+
+#~ msgid "Alvaro"
+#~ msgstr "Alvaro"
+
+#~ msgid "Anderson"
+#~ msgstr "Anderson"
+
+#~ msgid "Daniel Vieira"
+#~ msgstr "Daniel Vieira"
+
+#~ msgid "Francisco"
+#~ msgstr "Francisco"
+
+#~ msgid "Gamarra"
+#~ msgstr "Gamarra"
+
+#~ msgid "Luiz Carlos"
+#~ msgstr "Luiz Carlos"
+
+#~ msgid "Marcel"
+#~ msgstr "Marcel"
+
+#~ msgid "Paulo"
+#~ msgstr "Paulo"
+
+#~ msgid "Pablo L."
+#~ msgstr "Pablo L."
+
+#~ msgid "Renato"
+#~ msgstr "Renato"
+
+#~ msgid "Rogério"
+#~ msgstr "Rogério"
+
+#~ msgid "Wanderson"
+#~ msgstr "Wanderson"
+
+#~ msgid "Cao"
+#~ msgstr "Cao"
+
+#~ msgid "RedSaga"
+#~ msgstr "RedSaga"
+
+#~ msgid "Translation Lead"
+#~ msgstr "Translation Lead"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/basic_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/basic_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/basic_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: basic_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 08:56+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -16,3331 +16,9498 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "对象/关系数据库映射基础(Basic O/R Mapping)"
#. Tag: title
+#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "映射定义(Mapping declaration)"
#. Tag: para
+#: basic_mapping.xml:36
#, no-c-format
-msgid "Object/relational mappings are usually defined in an XML document. The mapping document is designed to be readable and hand-editable. The mapping language is Java-centric, meaning that mappings are constructed around persistent class declarations and not table declarations."
-msgstr "对象和关系数据库之间的映射通常是用一个 XML 文档来定义的。这个映射文档被设计为易读的,并且可以手工修改。映射语言是以 Java 为中心,这意味着映射文档是按照持久化类的定义来创建的,而非表的定义。 "
+msgid "Object/relational mappings can be defined in three approaches:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:41
#, no-c-format
-msgid "Please note that even though many Hibernate users choose to write the XML by hand, a number of tools exist to generate the mapping document. These include XDoclet, Middlegen and AndroMDA."
-msgstr "请注意,虽然很多 Hibernate 用户选择手写 XML 映射文档,但也有一些工具可以用来生成映射文档,包括 XDoclet、Middlegen 和 AndroMDA。"
+msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:46
#, no-c-format
-msgid "Here is an example mapping:"
+msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:51
+#, no-c-format
+msgid "using the Hibernate legacy XML files approach known as hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:56
+#, no-c-format
+msgid ""
+"Annotations are split in two categories, the logical mapping annotations "
+"(describing the object model, the association between two entities 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
+#: basic_mapping.xml:62
+#, no-c-format
+msgid ""
+"JPA annotations are in the <literal>javax.persistence.*</literal> package. "
+"Hibernate specific extensions are in <literal>org.hibernate.annotations.*</"
+"literal>. You favorite IDE can auto-complete annotations and their "
+"attributes for you (even without a specific \"JPA\" plugin, since JPA "
+"annotations are plain Java 5 annotations)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:69
+#, fuzzy, no-c-format
+msgid "Here is an example of mapping"
msgstr "下面是一个映射的例子:"
+#. Tag: programlisting
+#: basic_mapping.xml:71
+#, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"@Entity \n"
+"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
+"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
+"discriminatorType=CHAR)\n"
+"public class Cat {\n"
+" \n"
+" @Id @GeneratedValue\n"
+" public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public BigDecimal getWeight() { return weight; }\n"
+" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
+" private BigDecimal weight;\n"
+"\n"
+" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
+" public Date getBirthdate() { return birthdate; }\n"
+" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
+" private Date birthdate;\n"
+"\n"
+" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
+" @NotNull @Column(updatable=false)\n"
+" public ColorType getColor() { return color; }\n"
+" public void setColor(ColorType color) { this.color = color; }\n"
+" private ColorType color;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public String getSex() { return sex; }\n"
+" public void setSex(String sex) { this.sex = sex; }\n"
+" private String sex;\n"
+"\n"
+" @NotNull @Column(updatable=false)\n"
+" public Integer getLitterId() { return litterId; }\n"
+" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
+" private Integer litterId;\n"
+"\n"
+" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
+" public Cat getMother() { return mother; }\n"
+" public void setMother(Cat mother) { this.mother = mother; }\n"
+" private Cat mother;\n"
+"\n"
+" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
+" public Set<Cat> getKittens() { return kittens; }\n"
+" public void setKittens(Set<Cat> kittens) { this.kittens = "
+"kittens; }\n"
+" private Set<Cat> kittens = new HashSet<Cat>();\n"
+"}\n"
+"\n"
+"@Entity @DiscriminatorValue(\"D\")\n"
+"public class DomesticCat extends Cat {\n"
+"\n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name }\n"
+" private String name;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Dog { ... }"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:73
+#, fuzzy, no-c-format
+msgid ""
+"The legacy hbm.xml approach uses an XML schema designed to be readable and "
+"hand-editable. The mapping language is Java-centric, meaning that mappings "
+"are constructed around persistent class declarations and not table "
+"declarations."
+msgstr ""
+"对象和关系数据库之间的映射通常是用一个 XML 文档来定义的。这个映射文档被设计为"
+"易读的,并且可以手工修改。映射语言是以 Java 为中心,这意味着映射文档是按照持"
+"久化类的定义来创建的,而非表的定义。 "
+
+#. Tag: para
+#: basic_mapping.xml:78
#, no-c-format
-msgid "We will now discuss the content of the mapping document. We will only describe, however, the document elements and attributes that are used by Hibernate at runtime. The mapping document also contains some extra optional attributes and elements that affect the database schemas exported by the schema export tool (for example, the <literal> not-null</literal> attribute)."
-msgstr "我们现在开始讨论映射文档的内容。我们只描述 Hibernate 在运行时用到的文档元素和属性。映射文档还包括一些额外的可选属性和元素,它们在使用 schema 导出工具的时候会影响导出的数据库 schema 结果(比如,<literal>not-null</literal> 属性)。"
+msgid ""
+"Please note that even though many Hibernate users choose to write the XML by "
+"hand, a number of tools exist to generate the mapping document. These "
+"include XDoclet, Middlegen and AndroMDA."
+msgstr ""
+"请注意,虽然很多 Hibernate 用户选择手写 XML 映射文档,但也有一些工具可以用来"
+"生成映射文档,包括 XDoclet、Middlegen 和 AndroMDA。"
+#. Tag: para
+#: basic_mapping.xml:82
+#, no-c-format
+msgid "Here is an example mapping:"
+msgstr "下面是一个映射的例子:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:84
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\"\n"
+" table=\"cats\"\n"
+" discriminator-value=\"C\">\n"
+"\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"\n"
+" <discriminator column=\"subclass\"\n"
+" type=\"character\"/>\n"
+"\n"
+" <property name=\"weight\"/>\n"
+"\n"
+" <property name=\"birthdate\"\n"
+" type=\"date\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"color\"\n"
+" type=\"eg.types.ColorUserType\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"sex\"\n"
+" not-null=\"true\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <property name=\"litterId\"\n"
+" column=\"litterId\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <many-to-one name=\"mother\"\n"
+" column=\"mother_id\"\n"
+" update=\"false\"/>\n"
+"\n"
+" <set name=\"kittens\"\n"
+" inverse=\"true\"\n"
+" order-by=\"litter_id\">\n"
+" <key column=\"mother_id\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+"\n"
+" <subclass name=\"DomesticCat\"\n"
+" discriminator-value=\"D\">\n"
+"\n"
+" <property name=\"name\"\n"
+" type=\"string\"/>\n"
+"\n"
+" </subclass>\n"
+"\n"
+" </class>\n"
+"\n"
+" <class name=\"Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:86
+#, fuzzy, no-c-format
+msgid ""
+"We will now discuss the concepts of the mapping documents (both annotations "
+"and XML). We will only describe, however, the document elements and "
+"attributes that are used by Hibernate at runtime. The mapping document also "
+"contains some extra optional attributes and elements that affect the "
+"database schemas exported by the schema export tool (for example, the "
+"<literal> not-null</literal> attribute)."
+msgstr ""
+"我们现在开始讨论映射文档的内容。我们只描述 Hibernate 在运行时用到的文档元素和"
+"属性。映射文档还包括一些额外的可选属性和元素,它们在使用 schema 导出工具的时"
+"候会影响导出的数据库 schema 结果(比如,<literal>not-null</literal> 属性)。"
+
#. Tag: title
+#: basic_mapping.xml:94
+#, fuzzy, no-c-format
+msgid "Entity"
+msgstr "identity"
+
+#. Tag: para
+#: basic_mapping.xml:96
#, no-c-format
-msgid "Doctype"
-msgstr "Doctype"
+msgid ""
+"An entity is a regular Java object (aka POJO) which will be persisted by "
+"Hibernate."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:99
#, no-c-format
-msgid "All XML mappings should declare the doctype shown. The actual DTD can be found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate will always look for the DTD in its classpath first. If you experience lookups of the DTD using an Internet connection, check the DTD declaration against the contents of your classpath."
-msgstr "所有的 XML 映射都需要定义如上所示的 doctype。DTD 可以从上述 URL 中获取,也可以从 <literal>hibernate-x.x.x/src/org/hibernate </literal> 目录中、或 <literal>hibernate.jar</literal> 文件中找到。Hibernate 总是会首先在它的 classptah 中搜索 DTD 文件。如果你发现它是通过连接 Internet 查找 DTD 文件,就对照你的 classpath 目录检查 XML 文件里的 DTD 声明。"
+msgid ""
+"To mark an object as an entity in annotations, use the <classname>@Entity</"
+"classname> annotation."
+msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: basic_mapping.xml:102
#, no-c-format
-msgid "EntityResolver"
-msgstr "EntityResolver"
+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
+#: basic_mapping.xml:104
#, no-c-format
-msgid "Hibernate will first attempt to resolve DTDs in its classpath. It does this is by registering a custom <literal>org.xml.sax.EntityResolver</literal> implementation with the SAXReader it uses to read in the xml files. This custom <literal>EntityResolver</literal> recognizes two different systemId namespaces:"
-msgstr "Hibernate 首先试图在其 classpath 中解析 DTD。这是依靠在系统中注册的 <literal>org.xml.sax.EntityResolver</literal> 的一个具体实现,SAXReader 依靠它来读取 xml 文件。这个自定义的 <literal>EntityResolver</literal> 能辨认两种不同的 systenId 命名空间:"
+msgid ""
+"That's pretty much it, the rest is optional. There are however any options "
+"to tweak your entity mapping, let's explore them."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:107
#, no-c-format
-msgid "a <literal>hibernate namespace</literal> is recognized whenever the resolver encounters a systemId starting with <literal>http://hibernate.sourceforge.net/</literal>. The resolver attempts to resolve these entities via the classloader which loaded the Hibernate classes."
-msgstr "若 resolver 遇到了一个以 <literal>http://hibernate.sourceforge.net/</literal> 为开头的 systemId,它会辨认出是 <literal>hibernate namespace</literal>,resolver 就试图通过加载 Hibernate 类的 classloader 来查找这些实体。 "
+msgid ""
+"<classname>@Table</classname> lets you define the table the entity will be "
+"persisted into. If undefined, the table name is the unqualified class name "
+"of the entity. You can also optionally define the catalog, the schema as "
+"well as unique constraints on the table."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:112
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"TBL_FLIGHT\", \n"
+" schema=\"AIR_COMMAND\", \n"
+" uniqueConstraints=\n"
+" @UniqueConstraint(\n"
+" name=\"flight_number\", \n"
+" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
+"public class Flight implements Serializable {\n"
+" @Column(name=\"comp_prefix\")\n"
+" public String getCompagnyPrefix() { return companyPrefix; }\n"
+"\n"
+" @Column(name=\"flight_number\")\n"
+" public String getNumber() { return number; }\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:114
#, no-c-format
-msgid "a <literal>user namespace</literal> is recognized whenever the resolver encounters a systemId using a <literal>classpath://</literal> URL protocol. The resolver will attempt to resolve these entities via (1) the current thread context classloader and (2) the classloader which loaded the Hibernate classes."
-msgstr "若 resolver 遇到了一个使用 <literal>classpath://</literal> URL 协议的 systemId,它会辨认出这是 <literal>user namespace</literal>,resolver 试图通过(1) 当前线程上下文的 classloader 和(2) 加载 Hibernate class 的 classloader 来查找这些实体。"
+msgid ""
+"The constraint name is optional (generated if left undefined). The column "
+"names composing the constraint correspond to the column names as defined "
+"before the Hibernate <classname>NamingStrategy</classname> is applied."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:119
#, no-c-format
-msgid "The following is an example of utilizing user namespacing:"
-msgstr "下面是一个使用用户命名空间(user namespace)的例子:"
+msgid ""
+"<literal>@Entity.name</literal> lets you define the shortcut name of the "
+"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
+"class name of the class."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:123
#, no-c-format
-msgid "Where <literal>types.xml</literal> is a resource in the <literal>your.domain</literal> package and contains a custom <link linkend=\"mapping-types-custom\">typedef</link>."
-msgstr "这里的 <literal>types.xml</literal> 是 <literal>your.domain</literal> 包中的一个资源,它包含了一个自定义的 <link linkend=\"mapping-types-custom\">typedef</link>。 "
+msgid ""
+"Hibernate goes beyond the JPA specification and provide additional "
+"configurations. Some of them are hosted on <classname>@org.hibernate."
+"annotations.Entity</classname>:"
+msgstr ""
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:129
+#, fuzzy, no-c-format
+msgid ""
+"<literal>dynamicInsert</literal> / <literal>dynamicUpdate</literal> "
+"(defaults to false): specifies that <literal>INSERT</literal> / "
+"<literal>UPDATE</literal> SQL should be generated at runtime and contain "
+"only the columns whose values are not null. The <literal>dynamic-update</"
+"literal> and <literal>dynamic-insert</literal> settings are not inherited by "
+"subclasses. Although these settings can increase performance in some cases, "
+"they can actually decrease performance in others."
+msgstr ""
+"请注意 <literal>dynamic-update</literal> 和 <literal>dynamic-insert</"
+"literal> 的设置并不会继承到子类,所以在 <literal><subclass></literal> "
+"或者 <literal><joined-subclass></literal> 元素中可能需要再次设置。这些"
+"设置在某些情况下能够提高效率,而其他情况下则反而可能降低性能。"
+
+#. Tag: para
+#: basic_mapping.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"<literal>selectBeforeUpdate</literal> (defaults to false): specifies that "
+"Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</"
+"literal> unless it is certain that an object is actually modified. Only when "
+"a transient object has been associated with a new session using "
+"<literal>update()</literal>, will Hibernate perform an extra SQL "
+"<literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is "
+"actually required. Use of <literal>select-before-update</literal> will "
+"usually decrease performance. It is useful to prevent a database update "
+"trigger being called unnecessarily if you reattach a graph of detached "
+"instances to a <literal>Session</literal>."
+msgstr ""
+"<literal>select-before-update</literal>(可选,默认为 <literal>false</"
+"literal>):指定 Hibernate 除非确定对象真正被修改了(如果该值为 true — 译"
+"注),否则<emphasis>不会</emphasis>执行 SQL <literal>UPDATE</literal> 操作。"
+"在特定场合(实际上,它只在一个瞬时对象(transient object)关联到一个新的 "
+"session 中时执行的 update() 中生效),这说明 Hibernate 会在 <literal>UPDATE</"
+"literal> 之前执行一次额外的 SQL <literal>SELECT</literal> 操作来决定是否确实"
+"需要执行 <literal>UPDATE</literal>。"
+
+#. Tag: para
+#: basic_mapping.xml:154
+#, fuzzy, no-c-format
+msgid ""
+"<literal>polymorphisms</literal> (defaults to <literal>IMPLICIT</literal>): "
+"determines whether implicit or explicit query polymorphisms is used. "
+"<emphasis>Implicit</emphasis> polymorphisms means that instances of the "
+"class will be returned by a query that names any superclass or implemented "
+"interface or class, and that instances of any subclass of the class will be "
+"returned by a query that names the class itself. <emphasis>Explicit</"
+"emphasis> polymorphisms means that class instances will be returned only by "
+"queries that explicitly name that class. Queries that name the class will "
+"return only instances of subclasses mapped. For most purposes, the default "
+"<literal>polymorphisms=IMPLICIT</literal> is appropriate. Explicit "
+"polymorphisms is useful when two different classes are mapped to the same "
+"table This allows a \"lightweight\" class that contains a subset of the "
+"table columns."
+msgstr ""
+"<emphasis>Implicit</emphasis>(隐式)的多态是指,如果查询时给出的是任何超类、"
+"该类实现的接口或者该类的名字,都会返回这个类的实例;如果查询中给出的是子类的"
+"名字,则会返回子类的实例。<emphasis>Explicit</emphasis>(显式)的多态是指,只"
+"有在查询时给出明确的该类名字时才会返回这个类的实例; 同时只有在这个 "
+"<literal><class></literal> 的定义中作为 <literal><subclass></"
+"literal> 或者 <literal><joined-subclass></literal> 出现的子类,才会可能"
+"返回。在大多数情况下,默认的 <literal>polymorphism=\"implicit\"</literal> 都"
+"是合适的。显式的多态在有两个不同的类映射到同一个表的时候很有用。(允许一个“轻"
+"量级”的类,只包含部分表字段)。 "
+
+#. Tag: para
+#: basic_mapping.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"<literal>persister</literal>: specifies a custom <literal>ClassPersister</"
+"literal>. The <literal>persister</literal> attribute lets you customize the "
+"persistence strategy used for the class. You can, for example, specify your "
+"own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, "
+"or you can even provide a completely new implementation of the interface "
+"<literal>org.hibernate.persister.ClassPersister</literal> that implements, "
+"for example, persistence via stored procedure calls, serialization to flat "
+"files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for "
+"a simple example of \"persistence\" to a <literal>Hashtable</literal>."
+msgstr ""
+"<literal>persister</literal> 属性可以让你定制这个类使用的持久化策略。你可以指"
+"定你自己实现 <literal>org.hibernate.persister.EntityPersister</literal> 的子"
+"类,你甚至可以完全从头开始编写一个 <literal>org.hibernate.persister."
+"ClassPersister</literal> 接口的实现,比如是用储存过程调用、序列化到文件或者 "
+"LDAP 数据库来实现。参阅 <literal>org.hibernate.test.CustomPersister</"
+"literal>,这是持久化到 <literal>Hashtable</literal> 的一个简单例子。 "
+
+#. Tag: para
+#: basic_mapping.xml:185
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimisticLock</literal> (defaults to <literal>VERSION</literal>): "
+"determines the optimistic locking strategy. If you enable "
+"<literal>dynamicUpdate</literal>, you will have a choice of optimistic "
+"locking strategies:"
+msgstr ""
+"如果你打开了<literal>dynamic-update</literal>,你可以选择几种乐观锁定的策略:"
+
+#. Tag: para
+#: basic_mapping.xml:192
#, no-c-format
-msgid "Hibernate-mapping"
-msgstr "Hibernate-mapping"
+msgid "<literal>version</literal>: check the version/timestamp columns"
+msgstr "<literal>version(版本检查)</literal>:检查 version/timestamp 字段"
#. Tag: para
+#: basic_mapping.xml:197
#, no-c-format
-msgid "This element has several optional attributes. The <literal>schema</literal> and <literal>catalog</literal> attributes specify that tables referred to in this mapping belong to the named schema and/or catalog. If they are specified, tablenames will be qualified by the given schema and catalog names. If they are missing, tablenames will be unqualified. The <literal>default-cascade</literal> attribute specifies what cascade style should be assumed for properties and collections that do not specify a <literal>cascade</literal> attribute. By default, the <literal>auto-import</literal> attribute allows you to use unqualified class names in the query language."
-msgstr "这个元素包括一些可选的属性。<literal>schema</literal> 和 <literal>catalog</literal> 属性, 指明了这个映射所连接(refer)的表所在的 schema 和/或 catalog 名称。假若指定了这个属性,表名会加上所指定的 schema 和 catalog 的名字扩展为全限定名。假若没有指定,表名就不会使用全限定名。<literal>default-cascade</literal> 指定了未明确注明 <literal>cascade</literal> 属性的 Java 属性和 集合类 Hibernate 会采取什么样的默认级联风格。<literal>auto-import</literal> 属性默认让我们在查询语言中可以使用非全限定名的类名。"
+msgid "<literal>all</literal>: check all columns"
+msgstr "<literal>all(全部)</literal>:检查全部字段"
#. Tag: para
+#: basic_mapping.xml:201
#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a database schema."
-msgstr "<literal>schema</literal>(可选):数据库 schema 的名称。"
+msgid ""
+"<literal>dirty</literal>: check the changed columns, allowing some "
+"concurrent updates"
+msgstr ""
+"<literal>dirty(脏检查)</literal>:只检察修改过的字段,允许某些并行更新"
#. Tag: para
+#: basic_mapping.xml:206
#, no-c-format
-msgid "<literal>catalog</literal> (optional): the name of a database catalog."
-msgstr "<literal>catalog</literal>(可选):数据库 catalog 的名称。 "
+msgid "<literal>none</literal>: do not use optimistic locking"
+msgstr "<literal>none(不检查)</literal>:不使用乐观锁定"
#. Tag: para
+#: basic_mapping.xml:211
#, no-c-format
-msgid "<literal>default-cascade</literal> (optional - defaults to <literal>none</literal>): a default cascade style."
-msgstr "<literal>default-cascade</literal>(可选 — 默认为 <literal>none</literal>):默认的级联风格。 "
+msgid ""
+"It is <emphasis>strongly</emphasis> recommended that you use version/"
+"timestamp columns for optimistic locking with Hibernate. This strategy "
+"optimizes performance and correctly handles modifications made to detached "
+"instances (i.e. when <literal>Session.merge()</literal> is used)."
+msgstr ""
+"我们<emphasis>强烈</emphasis>建议你在 Hibernate 中使用 version/timestamp 字段"
+"来进行乐观锁定。这个选择可以优化性能,且能够处理对脱管实例的修改(例如:在使"
+"用 <literal>Session.merge()</literal> 的时候)。"
#. Tag: para
+#: basic_mapping.xml:220
#, no-c-format
-msgid "<literal>default-access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate should use for accessing all properties. It can be a custom implementation of <literal>PropertyAccessor</literal>."
-msgstr "<literal>default-access</literal>(可选 — 默认为 <literal>property</literal>):Hibernate 用来访问所有属性的策略。可以通过实现 <literal>PropertyAccessor</literal> 接口自定义。 "
+msgid ""
+"Be sure to import <classname>@javax.persistence.Entity</classname> to mark a "
+"class as an entity. It's a common mistake to import <classname>@org."
+"hibernate.annotations.Entity</classname> by accident."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:227
+#, fuzzy, no-c-format
+msgid ""
+"Some entities are not mutable. They cannot be updated or deleted by the "
+"application. This allows Hibernate to make some minor performance "
+"optimizations.. Use the <classname>@Immutable</classname> annotation."
+msgstr ""
+"不可变类,<literal>mutable=\"false\"</literal> 不可以被应用程序更新或者删除。"
+"这允许 Hibernate 实现一些小小的性能优化。"
+
+#. Tag: para
+#: basic_mapping.xml:232
+#, fuzzy, no-c-format
+msgid ""
+"You can also alter how Hibernate deals with lazy initialization for this "
+"class. On <classname>@Proxy</classname>, use <literal>lazy</literal>=false "
+"to disable lazy fetching (not recommended). You can also specify an "
+"interface to use for lazy initializing proxies (defaults to the class "
+"itself): use <literal>proxyClass</literal> on <classname>@Proxy</classname>. "
+"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
+"the named interface. The persistent object will load when a method of the "
+"proxy is invoked. See \"Initializing collections and proxies\" below."
+msgstr ""
+"可选的 <literal>proxy</literal> 属性允许延迟加载类的持久化实例。Hibernate 开"
+"始会返回实现了这个命名接口的 CGLIB 代理。当代理的某个方法被实际调用的时候,真"
+"实的持久化对象才会被装载。参见下面的“用于延迟装载的代理”。 "
+
+#. Tag: para
+#: basic_mapping.xml:243
#, no-c-format
-msgid "<literal>default-lazy</literal> (optional - defaults to <literal>true</literal>): the default value for unspecified <literal>lazy</literal> attributes of class and collection mappings."
-msgstr "<literal>default-lazy</literal>(可选 — 默认为 <literal>true</literal>):指定了未明确注明 <literal>lazy</literal> 属性的 Java 属性和集合类,Hibernate 会采取什么样的默认加载风格。 "
+msgid ""
+"<classname>@BatchSize</classname> specifies a \"batch size\" for fetching "
+"instances of this class by identifier. Not yet loaded instances are loaded "
+"batch-size at a time (default 1)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:247
+#, fuzzy, no-c-format
+msgid ""
+"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
+"objects of this class. Use <classname>@Where</classname> for that."
+msgstr ""
+"<literal>where</literal>(可选)指定一个附加的 SQL <literal>WHERE</literal> "
+"条件,在抓取这个类的对象时会一直增加这个条件。 "
+
+#. Tag: para
+#: basic_mapping.xml:251
+#, fuzzy, no-c-format
+msgid ""
+"In the same vein, <classname>@Check</classname> lets you define an SQL "
+"expression used to generate a multi-row <emphasis>check</emphasis> "
+"constraint for automatic schema generation."
+msgstr ""
+"<literal>check</literal>(可选):这是一个 SQL 表达式, 用于为自动生成的 "
+"schema 添加多行(multi-row)约束<emphasis>检查</emphasis>。 "
+
+#. Tag: para
+#: basic_mapping.xml:255
+#, fuzzy, no-c-format
+msgid ""
+"There is no difference between a view and a base table for a Hibernate "
+"mapping. This is transparent at the database level, although some DBMS do "
+"not support views properly, especially with updates. Sometimes you want to "
+"use a view, but you cannot create one in the database (i.e. with a legacy "
+"schema). In this case, you can map an immutable and read-only entity to a "
+"given SQL subselect expression using <classname>@org.hibernate.annotations."
+"Subselect</classname>:"
+msgstr ""
+"对 Hibernate 映射来说视图和表是没有区别的,这是因为它们在数据层都是透明的"
+"( 注意:一些数据库不支持视图属性,特别是更新的时候)。有时你想使用视图,但却"
+"不能在数据库中创建它(例如:在遗留的 schema 中)。这样的话,你可以映射一个不"
+"可变的(immutable)并且是 只读的实体到一个给定的 SQL 子查询表达式: "
+
+#. Tag: programlisting
+#: basic_mapping.xml:263
+#, fuzzy, no-c-format
+msgid ""
+"@Entity\n"
+"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
+" + \"from item \"\n"
+" + \"join bid on bid.item_id = item.id \"\n"
+" + \"group by item.name\")\n"
+"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
+"public class Summary {\n"
+" @Id\n"
+" public String getId() { return id; }\n"
+" ...\n"
+"}"
+msgstr ""
+"<![CDATA[<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:265
#, no-c-format
-msgid "<literal>auto-import</literal> (optional - defaults to <literal>true</literal>): specifies whether we can use unqualified class names of classes in this mapping in the query language."
-msgstr "<literal>auto-import</literal>(可选 — 默认为 <literal>true</literal>):指定我们是否可以在查询语言中使用非全限定的类名(仅限于本映射文件中的类)。 "
+msgid ""
+"Declare the tables to synchronize this entity with, ensuring that auto-flush "
+"happens correctly and that queries against the derived entity do not return "
+"stale data. The <literal><subselect></literal> is available both as an "
+"attribute and a nested mapping element."
+msgstr ""
+"定义这个实体用到的表为同步(synchronize),确保自动刷新(auto-flush)正确执"
+"行,并且依赖原实体的查询不会返回过期数据。在属性元素和嵌套映射元素中都可使用 "
+"<literal><subselect></literal>。"
#. Tag: para
+#: basic_mapping.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"We will now explore the same options using the hbm.xml structure. You can "
+"declare a persistent class using the <literal>class</literal> element. For "
+"example:"
+msgstr "你可以使用 <literal>class</literal> 元素来定义一个持久化类。例如:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:319
+#, fuzzy, no-c-format
+msgid ""
+"<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+"<![CDATA[<class\n"
+" name=\"ClassName\"\n"
+" table=\"tableName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" mutable=\"true|false\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" proxy=\"ProxyInterface\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" select-before-update=\"true|false\"\n"
+" polymorphism=\"implicit|explicit\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" persister=\"PersisterClass\"\n"
+" batch-size=\"N\"\n"
+" optimistic-lock=\"none|version|dirty|all\"\n"
+" lazy=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" check=\"arbitrary sql check condition\"\n"
+" rowid=\"rowid\"\n"
+" subselect=\"SQL expression\"\n"
+" abstract=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:323
#, no-c-format
-msgid "<literal>package</literal> (optional): specifies a package prefix to use for unqualified class names in the mapping document."
-msgstr "<literal>package</literal>(可选):指定一个包前缀,如果在映射文档中没有指定全限定的类名,就使用这个作为包名。 "
+msgid ""
+"<literal>name</literal> (optional): the fully qualified Java class name of "
+"the persistent class or interface. If this attribute is missing, it is "
+"assumed that the mapping is for a non-POJO entity."
+msgstr ""
+"<literal>name</literal>(可选):持久化类(或者接口)的 Java 全限定名。 如果"
+"这个属性不存在,Hibernate 将假定这是一个非 POJO 的实体映射。 "
#. Tag: para
+#: basic_mapping.xml:330
#, no-c-format
-msgid "If you have two persistent classes with the same unqualified name, you should set <literal>auto-import=\"false\"</literal>. An exception will result if you attempt to assign two classes to the same \"imported\" name."
-msgstr "假若你有两个持久化类,它们的非全限定名是一样的(就是两个类的名字一样,所在的包不一样 — 译者注),你应该设置 <literal>auto-import=\"false\"</literal>。如果你把一个“导入过”的名字同时对应两个类,Hibernate 会抛出一个异常。"
+msgid ""
+"<literal>table</literal> (optional - defaults to the unqualified class "
+"name): the name of its database table."
+msgstr ""
+"<literal>table</literal>(可选 — 默认是类的非全限定名):对应的数据库表名。 "
#. Tag: para
+#: basic_mapping.xml:335
#, no-c-format
-msgid "The <literal>hibernate-mapping</literal> element allows you to nest several persistent <literal><class></literal> mappings, as shown above. It is, however, good practice (and expected by some tools) to map only a single persistent class, or a single class hierarchy, in one mapping file and name it after the persistent superclass. For example, <literal>Cat.hbm.xml</literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, <literal>Animal.hbm.xml</literal>."
-msgstr "注意 <literal>hibernate-mapping</literal> 元素允许你嵌套多个如上所示的 <literal><class></literal> 映射。但是最好的做法(也许一些工具需要的)是一个持久化类(或一个类的继承层次)对应一个映射文件,并以持久化的超类名称命名,例如:<literal>Cat.hbm.xml</literal>、<literal>Dog.hbm.xml</literal>,或者如果使用继承,<literal>Animal.hbm.xml</literal>。"
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses that is used for "
+"polymorphic behavior. Acceptable values include <literal>null</literal> and "
+"<literal>not null</literal>."
+msgstr ""
+"<literal>discriminator-value</literal>(可选 — 默认和类名一样):一个用于区分"
+"不同的子类的值,在多态行为时使用。它可以接受的值包括 <literal>null</literal> "
+"和 <literal>not null</literal>。 "
+#. Tag: para
+#: basic_mapping.xml:343
+#, no-c-format
+msgid ""
+"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
+"specifies that instances of the class are (not) mutable."
+msgstr ""
+"<literal>mutable</literal>(可选,默认值为 <literal>true</literal>):表明该"
+"类的实例是可变的或者不可变的。 "
+
+#. Tag: para
+#: basic_mapping.xml:349 basic_mapping.xml:2912
+#, no-c-format
+msgid ""
+"<literal>schema</literal> (optional): overrides the schema name specified by "
+"the root <literal><hibernate-mapping></literal> element."
+msgstr ""
+"<literal>schema</literal>(可选):覆盖在根 <literal><hibernate-"
+"mapping></literal> 元素中指定的 schema 名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:355 basic_mapping.xml:2918
+#, no-c-format
+msgid ""
+"<literal>catalog</literal> (optional): overrides the catalog name specified "
+"by the root <literal><hibernate-mapping></literal> element."
+msgstr ""
+"<literal>catalog</literal>(可选):覆盖在根 <literal><hibernate-"
+"mapping></literal> 元素中指定的 catalog 名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:361
+#, no-c-format
+msgid ""
+"<literal>proxy</literal> (optional): specifies an interface to use for lazy "
+"initializing proxies. You can specify the name of the class itself."
+msgstr ""
+"<literal>proxy</literal>(可选):指定一个接口,在延迟装载时作为代理使用。你"
+"可以在这里使用该类自己的名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:367
+#, no-c-format
+msgid ""
+"<literal>dynamic-update</literal> (optional - defaults to <literal>false</"
+"literal>): specifies that <literal>UPDATE</literal> SQL should be generated "
+"at runtime and can contain only those columns whose values have changed."
+msgstr ""
+"<literal>dynamic-update</literal>(可选,默认为 <literal>false</literal>):"
+"指定用于 <literal>UPDATE</literal> 的 SQL 将会在运行时动态生成,并且只更新那"
+"些改变过的字段。 "
+
+#. Tag: para
+#: basic_mapping.xml:374
+#, no-c-format
+msgid ""
+"<literal>dynamic-insert</literal> (optional - defaults to <literal>false</"
+"literal>): specifies that <literal>INSERT</literal> SQL should be generated "
+"at runtime and contain only the columns whose values are not null."
+msgstr ""
+"<literal>dynamic-insert</literal>(可选,默认为 <literal>false</literal>):"
+"指定用于 <literal>INSERT</literal> 的 SQL 将会在运行时动态生成,并且只包含那"
+"些非空值字段。 "
+
+#. Tag: para
+#: basic_mapping.xml:381
+#, no-c-format
+msgid ""
+"<literal>select-before-update</literal> (optional - defaults to "
+"<literal>false</literal>): specifies that Hibernate should <emphasis>never</"
+"emphasis> perform an SQL <literal>UPDATE</literal> unless it is certain that "
+"an object is actually modified. Only when a transient object has been "
+"associated with a new session using <literal>update()</literal>, will "
+"Hibernate perform an extra SQL <literal>SELECT</literal> to determine if an "
+"<literal>UPDATE</literal> is actually required."
+msgstr ""
+"<literal>select-before-update</literal>(可选,默认为 <literal>false</"
+"literal>):指定 Hibernate 除非确定对象真正被修改了(如果该值为 true — 译"
+"注),否则<emphasis>不会</emphasis>执行 SQL <literal>UPDATE</literal> 操作。"
+"在特定场合(实际上,它只在一个瞬时对象(transient object)关联到一个新的 "
+"session 中时执行的 update() 中生效),这说明 Hibernate 会在 <literal>UPDATE</"
+"literal> 之前执行一次额外的 SQL <literal>SELECT</literal> 操作来决定是否确实"
+"需要执行 <literal>UPDATE</literal>。"
+
+#. Tag: para
+#: basic_mapping.xml:393
+#, fuzzy, no-c-format
+msgid ""
+"<literal>polymorphisms</literal> (optional - defaults to <literal>implicit</"
+"literal>): determines whether implicit or explicit query polymorphisms is "
+"used."
+msgstr ""
+"<literal>polymorphism(多态)</literal>(可选,默认值为 <literal>implicit "
+"(隐式)</literal>):界定是隐式还是显式的使用多态查询(这只在 Hibernate 的具"
+"体表继承策略中用到 — 译注)。 "
+
+#. Tag: para
+#: basic_mapping.xml:399
+#, no-c-format
+msgid ""
+"<literal>where</literal> (optional): specifies an arbitrary SQL "
+"<literal>WHERE</literal> condition to be used when retrieving objects of "
+"this class."
+msgstr ""
+"<literal>where</literal>(可选)指定一个附加的 SQL <literal>WHERE</literal> "
+"条件,在抓取这个类的对象时会一直增加这个条件。 "
+
+#. Tag: para
+#: basic_mapping.xml:405
+#, no-c-format
+msgid ""
+"<literal>persister</literal> (optional): specifies a custom "
+"<literal>ClassPersister</literal>."
+msgstr ""
+"<literal>persister</literal>(可选):指定一个定制的 "
+"<literal>ClassPersister</literal>。 "
+
+#. Tag: para
+#: basic_mapping.xml:410
+#, no-c-format
+msgid ""
+"<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): "
+"specifies a \"batch size\" for fetching instances of this class by "
+"identifier."
+msgstr ""
+"<literal>batch-size</literal>(可选,默认是 <literal>1</literal>)指定一个用"
+"于 根据标识符(identifier)抓取实例时使用的 \"batch size\"(批次抓取数量)。 "
+
+#. Tag: para
+#: basic_mapping.xml:416
+#, no-c-format
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>version</"
+"literal>): determines the optimistic locking strategy."
+msgstr ""
+"<literal>optimistic-lock(乐观锁定)</literal>(可选,默认是 "
+"<literal>version</literal>):决定乐观锁定的策略。 "
+
+#. Tag: para
+#: basic_mapping.xml:422
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional): lazy fetching can be disabled by setting "
+"<literal>lazy=\"false\"</literal>."
+msgstr ""
+"<literal>lazy</literal>(可选):通过设置 <literal>lazy=\"false\"</literal>,"
+"所有的延迟加载(Lazy fetching)功能将被全部禁用(disabled)。"
+
+#. Tag: para
+#: basic_mapping.xml:427
+#, fuzzy, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional - defaults to the class name): "
+"Hibernate3 allows a class to be mapped multiple times, potentially to "
+"different tables. It also allows entity mappings that are represented by "
+"Maps or XML at the Java level. In these cases, you should provide an "
+"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
+"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
+msgstr ""
+"<literal>entity-name</literal>(可选,默认为类名):Hibernate3 允许一个类进行"
+"多次映射(前提是映射到不同的表),并且允许使用 Maps 或 XML 代替 Java 层次的实"
+"体映射(也就是实现动态领域模型,不用写持久化类-译注)。更多信息请看 <xref "
+"linkend=\"persistent-classes-dynamicmodels\"/> 和 <xref linkend=\"xml\"/>。 "
+
+#. Tag: para
+#: basic_mapping.xml:437
+#, no-c-format
+msgid ""
+"<literal>check</literal> (optional): an SQL expression used to generate a "
+"multi-row <emphasis>check</emphasis> constraint for automatic schema "
+"generation."
+msgstr ""
+"<literal>check</literal>(可选):这是一个 SQL 表达式, 用于为自动生成的 "
+"schema 添加多行(multi-row)约束<emphasis>检查</emphasis>。 "
+
+#. Tag: para
+#: basic_mapping.xml:443
+#, no-c-format
+msgid ""
+"<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. "
+"On Oracle, for example, Hibernate can use the <literal>rowid</literal> extra "
+"column for fast updates once this option has been set to <literal>rowid</"
+"literal>. A ROWID is an implementation detail and represents the physical "
+"location of a stored tuple."
+msgstr ""
+"<literal>rowid</literal>(可选):Hibernate 可以使用数据库支持的所谓的 "
+"ROWIDs,例如:Oracle 数据库,如果你设置这个可选的 <literal>rowid</literal>,"
+"Hibernate 可以使用额外的字段 <literal>rowid</literal> 实现快速更新。ROWID 是"
+"这个功能实现的重点,它代表了一个存储元组(tuple)的物理位置。 "
+
+#. Tag: para
+#: basic_mapping.xml:452
+#, no-c-format
+msgid ""
+"<literal>subselect</literal> (optional): maps an immutable and read-only "
+"entity to a database subselect. This is useful if you want to have a view "
+"instead of a base table. See below for more information."
+msgstr ""
+"<literal>subselect</literal>(可选):它将一个不可变(immutable)并且只读的实"
+"体映射到一个数据库的子查询中。当你想用视图代替一张基本表的时候,这是有用的,"
+"但最好不要这样做。更多的介绍请看下面内容。 "
+
+#. Tag: para
+#: basic_mapping.xml:459
+#, no-c-format
+msgid ""
+"<literal>abstract</literal> (optional): is used to mark abstract "
+"superclasses in <literal><union-subclass></literal> hierarchies."
+msgstr ""
+"<literal>abstract</literal>(可选):用于在 <literal><union-subclass></"
+"literal> 的层次结构(hierarchies)中标识抽象超类。"
+
+#. Tag: para
+#: basic_mapping.xml:466
+#, no-c-format
+msgid ""
+"It is acceptable for the named persistent class to be an interface. You can "
+"declare implementing classes of that interface using the <literal><"
+"subclass></literal> element. You can persist any <emphasis>static</"
+"emphasis> inner class. Specify the class name using the standard form i.e. "
+"<literal>e.g.Foo$Bar</literal>."
+msgstr ""
+"若指明的持久化类实际上是一个接口,这也是完全可以接受的。之后你可以用元素 "
+"<literal><subclass></literal> 来指定该接口的实际实现类。你可以持久化任"
+"何 <emphasis>static</emphasis>(静态的)内部类。你应该使用标准的类名格式来指"
+"定类名,比如:<literal>Foo$Bar</literal>。"
+
+#. Tag: para
+#: basic_mapping.xml:472
+#, no-c-format
+msgid "Here is how to do a virtual view (subselect) in XML:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:474
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Summary\">\n"
+" <subselect>\n"
+" select item.name, max(bid.amount), count(*)\n"
+" from item\n"
+" join bid on bid.item_id = item.id\n"
+" group by item.name\n"
+" </subselect>\n"
+" <synchronize table=\"item\"/>\n"
+" <synchronize table=\"bid\"/>\n"
+" <id name=\"name\"/>\n"
+" ...\n"
+"</class>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:476
+#, no-c-format
+msgid ""
+"The <literal><subselect></literal> is available both as an attribute "
+"and a nested mapping element."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:481
+#, fuzzy, no-c-format
+msgid "Identifiers"
+msgstr "程序分配的标识符(Assigned Identifiers)"
+
+#. Tag: para
+#: basic_mapping.xml:483
+#, fuzzy, no-c-format
+msgid ""
+"Mapped classes <emphasis>must</emphasis> declare the primary key column of "
+"the database table. Most classes will also have a JavaBeans-style property "
+"holding the unique identifier of an instance."
+msgstr ""
+"被映射的类<emphasis>必须</emphasis>定义对应数据库表主键字段。大多数类有一个 "
+"JavaBeans 风格的属性, 为每一个实例包含唯一的标识。<literal><id></"
+"literal> 元素定义了该属性到数据库表主键字段的映射。"
+
+#. Tag: para
+#: basic_mapping.xml:488
#, no-c-format
-msgid "Class"
-msgstr "类"
+msgid "Mark the identifier property with <classname>@Id</classname>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:491
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Id Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:493
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><id></literal> element which defines the "
+"mapping from that property to the primary key column."
+msgstr ""
+"注意使用 <literal><column></literal> 标签来把一个属性映射到多个字段的做"
+"法。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:509
+#, fuzzy, no-c-format
+msgid ""
+"<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" column=\"column_name\"\n"
+" unsaved-value=\"null|any|none|undefined|id_value\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"\n"
+" <generator class=\"generatorClass\"/>\n"
+"</id>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:513
#, no-c-format
-msgid "You can declare a persistent class using the <literal>class</literal> element. For example:"
-msgstr "你可以使用 <literal>class</literal> 元素来定义一个持久化类。例如:"
+msgid ""
+"<literal>name</literal> (optional): the name of the identifier property."
+msgstr "<literal>name</literal>(可选):标识属性的名字。 "
#. Tag: para
+#: basic_mapping.xml:518 basic_mapping.xml:2141
#, no-c-format
-msgid "<literal>name</literal> (optional): the fully qualified Java class name of the persistent class or interface. If this attribute is missing, it is assumed that the mapping is for a non-POJO entity."
-msgstr "<literal>name</literal>(可选):持久化类(或者接口)的 Java 全限定名。 如果这个属性不存在,Hibernate 将假定这是一个非 POJO 的实体映射。 "
+msgid ""
+"<literal>type</literal> (optional): a name that indicates the Hibernate type."
+msgstr "<literal>type</literal>(可选):一个 Hibernate 类型的名字。"
#. Tag: para
+#: basic_mapping.xml:523
#, no-c-format
-msgid "<literal>table</literal> (optional - defaults to the unqualified class name): the name of its database table."
-msgstr "<literal>table</literal>(可选 — 默认是类的非全限定名):对应的数据库表名。 "
+msgid ""
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the primary key column."
+msgstr "<literal>column</literal>(可选 — 默认为属性名):主键字段的名字。 "
#. Tag: para
+#: basic_mapping.xml:528
#, no-c-format
-msgid "<literal>discriminator-value</literal> (optional - defaults to the class name): a value that distinguishes individual subclasses that is used for polymorphic behavior. Acceptable values include <literal>null</literal> and <literal>not null</literal>."
-msgstr "<literal>discriminator-value</literal>(可选 — 默认和类名一样):一个用于区分不同的子类的值,在多态行为时使用。它可以接受的值包括 <literal>null</literal> 和 <literal>not null</literal>。 "
+msgid ""
+"<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" "
+"value): an identifier property value that indicates an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session."
+msgstr ""
+"<literal>unsaved-value</literal>(可选 — 默认为一个切合实际(sensible)的"
+"值):一个特定的标识属性值,用来标志该实例是刚刚创建的,尚未保存。这可以把这"
+"种实例和从以前的 session 中装载过(可能又做过修改--译者注)但未再次持久化的实"
+"例区分开来。 "
#. Tag: para
+#: basic_mapping.xml:536
#, no-c-format
-msgid "<literal>mutable</literal> (optional - defaults to <literal>true</literal>): specifies that instances of the class are (not) mutable."
-msgstr "<literal>mutable</literal>(可选,默认值为 <literal>true</literal>):表明该类的实例是可变的或者不可变的。 "
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing the property "
+"value."
+msgstr ""
+"<literal>access</literal>(可选 — 默认为 <literal>property</literal>):"
+"Hibernate 用来访问属性值的策略。 "
#. Tag: para
+#: basic_mapping.xml:543
#, no-c-format
-msgid "<literal>schema</literal> (optional): overrides the schema name specified by the root <literal><hibernate-mapping></literal> element."
-msgstr "<literal>schema</literal>(可选):覆盖在根 <literal><hibernate-mapping></literal> 元素中指定的 schema 名字。 "
+msgid ""
+"If the <literal>name</literal> attribute is missing, it is assumed that the "
+"class has no identifier property."
+msgstr "如果 <literal>name</literal> 属性不存在,会认为这个类没有标识属性。"
#. Tag: para
+#: basic_mapping.xml:546
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>unsaved-value</literal> attribute is almost never needed in "
+"Hibernate3 and indeed has no corresponding element in annotations."
+msgstr "<literal>unsaved-value</literal> 属性在 Hibernate3 中几乎不再需要。"
+
+#. Tag: para
+#: basic_mapping.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"You can also declare the identifier as a composite identifier. This allows "
+"access to legacy data with composite keys. Its use is strongly discouraged "
+"for anything else."
+msgstr ""
+"还有一个另外的 <literal><composite-id></literal> 定义可以访问旧式的多主"
+"键数据。我们非常不鼓励使用这种方式。"
+
+#. Tag: title
+#: basic_mapping.xml:555
+#, fuzzy, no-c-format
+msgid "Composite identifier"
+msgstr "程序分配的标识符(Assigned Identifiers)"
+
+#. Tag: para
+#: basic_mapping.xml:557
#, no-c-format
-msgid "<literal>catalog</literal> (optional): overrides the catalog name specified by the root <literal><hibernate-mapping></literal> element."
-msgstr "<literal>catalog</literal>(可选):覆盖在根 <literal><hibernate-mapping></literal> 元素中指定的 catalog 名字。 "
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:562
#, no-c-format
-msgid "<literal>proxy</literal> (optional): specifies an interface to use for lazy initializing proxies. You can specify the name of the class itself."
-msgstr "<literal>proxy</literal>(可选):指定一个接口,在延迟装载时作为代理使用。你可以在这里使用该类自己的名字。 "
+msgid ""
+"use a component type to represent the identifier and map it as a property in "
+"the entity: you then annotated the property as <classname>@EmbeddedId</"
+"classname>. The component type has to be <classname>Serializable</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:569
#, no-c-format
-msgid "<literal>dynamic-update</literal> (optional - defaults to <literal>false</literal>): specifies that <literal>UPDATE</literal> SQL should be generated at runtime and can contain only those columns whose values have changed."
-msgstr "<literal>dynamic-update</literal>(可选,默认为 <literal>false</literal>):指定用于 <literal>UPDATE</literal> 的 SQL 将会在运行时动态生成,并且只更新那些改变过的字段。 "
+msgid ""
+"map multiple properties as <classname>@Id</classname> properties: the "
+"identifier type is then the entity class itself and needs to be "
+"<classname>Serializable</classname>. This approach is unfortunately not "
+"standard and only supported by Hibernate."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:577
#, no-c-format
-msgid "<literal>dynamic-insert</literal> (optional - defaults to <literal>false</literal>): specifies that <literal>INSERT</literal> SQL should be generated at runtime and contain only the columns whose values are not null."
-msgstr "<literal>dynamic-insert</literal>(可选,默认为 <literal>false</literal>):指定用于 <literal>INSERT</literal> 的 SQL 将会在运行时动态生成,并且只包含那些非空值字段。 "
+msgid ""
+"map multiple properties as <classname>@Id</classname> properties and declare "
+"an external class to be the identifier type. This class, which needs to be "
+"<classname>Serializable</classname>, is declared on the entity via the "
+"<classname>@IdClass</classname> annotation. The identifier type must contain "
+"the same properties as the identifier properties of the entity: each "
+"property name must be the same, its type must be the same as well if the "
+"entity property is of a basic type, its type must be the type of the primary "
+"key of the associated entity if the entity property is an association "
+"(either a <classname>@OneToOne</classname> or a <classname>@ManyToOne</"
+"classname>)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:592
#, no-c-format
-msgid "<literal>select-before-update</literal> (optional - defaults to <literal>false</literal>): specifies that Hibernate should <emphasis>never</emphasis> perform an SQL <literal>UPDATE</literal> unless it is certain that an object is actually modified. Only when a transient object has been associated with a new session using <literal>update()</literal>, will Hibernate perform an extra SQL <literal>SELECT</literal> to determine if an <literal>UPDATE</literal> is actually required."
-msgstr "<literal>select-before-update</literal>(可选,默认为 <literal>false</literal>):指定 Hibernate 除非确定对象真正被修改了(如果该值为 true — 译注),否则<emphasis>不会</emphasis>执行 SQL <literal>UPDATE</literal> 操作。在特定场合(实际上,它只在一个瞬时对象(transient object)关联到一个新的 session 中时执行的 update() 中生效),这说明 Hibernate 会在 <literal>UPDATE</literal> 之前执行一次额外的 SQL <literal>SELECT</literal> 操作来决定是否确实需要执行 <literal>UPDATE</literal>。"
+msgid ""
+"As you can see the last case is far from obvious. It has been inherited from "
+"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
+"to use it (for simplicity sake)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:596
#, no-c-format
-msgid "<literal>polymorphism</literal> (optional - defaults to <literal>implicit</literal>): determines whether implicit or explicit query polymorphism is used."
-msgstr "<literal>polymorphism(多态)</literal>(可选,默认值为 <literal>implicit (隐式)</literal>):界定是隐式还是显式的使用多态查询(这只在 Hibernate 的具体表继承策略中用到 — 译注)。 "
+msgid "Let's explore all three cases using examples."
+msgstr ""
+#. Tag: title
+#: basic_mapping.xml:599
+#, no-c-format
+msgid "id as a property using a component type"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:601
#, no-c-format
-msgid "<literal>where</literal> (optional): specifies an arbitrary SQL <literal>WHERE</literal> condition to be used when retrieving objects of this class."
-msgstr "<literal>where</literal>(可选)指定一个附加的 SQL <literal>WHERE</literal> 条件,在抓取这个类的对象时会一直增加这个条件。 "
+msgid "Here is a simple example of <classname>@EmbeddedId</classname>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:604
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class User {\n"
+" @EmbeddedId\n"
+" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
+"\")\n"
+" UserId id;\n"
+"\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:606
#, no-c-format
-msgid "<literal>persister</literal> (optional): specifies a custom <literal>ClassPersister</literal>."
-msgstr "<literal>persister</literal>(可选):指定一个定制的 <literal>ClassPersister</literal>。 "
+msgid ""
+"You can notice that the <classname>UserId</classname> class is serializable. "
+"To override the column mapping, use <classname>@AttributeOverride</"
+"classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:610
#, no-c-format
-msgid "<literal>batch-size</literal> (optional - defaults to <literal>1</literal>): specifies a \"batch size\" for fetching instances of this class by identifier."
-msgstr "<literal>batch-size</literal>(可选,默认是 <literal>1</literal>)指定一个用于 根据标识符(identifier)抓取实例时使用的 \"batch size\"(批次抓取数量)。 "
+msgid ""
+"An embedded id can itself contains the primary key of an associated entity."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:613
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"\n"
+" @MapsId(\"userId\")\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" @OneToOne User user;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" UserId userId;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:615
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>version</literal>): determines the optimistic locking strategy."
-msgstr "<literal>optimistic-lock(乐观锁定)</literal>(可选,默认是 <literal>version</literal>):决定乐观锁定的策略。 "
+msgid ""
+"In the embedded id object, the association is represented as the identifier "
+"of the associated entity. But you can link its value to a regular "
+"association in the entity via the <classname>@MapsId</classname> annotation. "
+"The <classname>@MapsId</classname> value correspond to the property name of "
+"the embedded id object containing the associated entity's identifier. In the "
+"database, it means that the <literal>Customer.user</literal> and the "
+"<literal>CustomerId.userId</literal> properties share the same underlying "
+"column (<literal>user_fk</literal> in this case)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:627
#, no-c-format
-msgid "<literal>lazy</literal> (optional): lazy fetching can be disabled by setting <literal>lazy=\"false\"</literal>."
-msgstr "<literal>lazy</literal>(可选):通过设置 <literal>lazy=\"false\"</literal>,所有的延迟加载(Lazy fetching)功能将被全部禁用(disabled)。"
+msgid ""
+"The component type used as identifier must implement <methodname>equals()</"
+"methodname> and <methodname>hashCode()</methodname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:632
#, no-c-format
-msgid "<literal>entity-name</literal> (optional - defaults to the class name): Hibernate3 allows a class to be mapped multiple times, potentially to different tables. It also allows entity mappings that are represented by Maps or XML at the Java level. In these cases, you should provide an explicit arbitrary name for the entity. See <xref linkend=\"persistent-classes-dynamicmodels\" /> and <xref linkend=\"xml\" /> for more information."
-msgstr "<literal>entity-name</literal>(可选,默认为类名):Hibernate3 允许一个类进行多次映射(前提是映射到不同的表),并且允许使用 Maps 或 XML 代替 Java 层次的实体映射(也就是实现动态领域模型,不用写持久化类-译注)。更多信息请看 <xref linkend=\"persistent-classes-dynamicmodels\"/> 和 <xref linkend=\"xml\"/>。 "
+msgid ""
+"In practice, your code only sets the <literal>Customer.user</literal> "
+"property and the user id value is copied by Hibernate into the "
+"<literal>CustomerId.userId</literal> property."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:638
#, no-c-format
-msgid "<literal>check</literal> (optional): an SQL expression used to generate a multi-row <emphasis>check</emphasis> constraint for automatic schema generation."
-msgstr "<literal>check</literal>(可选):这是一个 SQL 表达式, 用于为自动生成的 schema 添加多行(multi-row)约束<emphasis>检查</emphasis>。 "
+msgid ""
+"The id value can be copied as late as flush time, don't rely on it until "
+"after flush time."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:642
#, no-c-format
-msgid "<literal>rowid</literal> (optional): Hibernate can use ROWIDs on databases. On Oracle, for example, Hibernate can use the <literal>rowid</literal> extra column for fast updates once this option has been set to <literal>rowid</literal>. A ROWID is an implementation detail and represents the physical location of a stored tuple."
-msgstr "<literal>rowid</literal>(可选):Hibernate 可以使用数据库支持的所谓的 ROWIDs,例如:Oracle 数据库,如果你设置这个可选的 <literal>rowid</literal>,Hibernate 可以使用额外的字段 <literal>rowid</literal> 实现快速更新。ROWID 是这个功能实现的重点,它代表了一个存储元组(tuple)的物理位置。 "
+msgid ""
+"While not supported in JPA, Hibernate lets you place your association "
+"directly in the embedded id component (instead of having to use the "
+"<classname>@MapsId</classname> annotation)."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:646
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer {\n"
+" @EmbeddedId CustomerId id;\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:648
#, no-c-format
-msgid "<literal>subselect</literal> (optional): maps an immutable and read-only entity to a database subselect. This is useful if you want to have a view instead of a base table. See below for more information."
-msgstr "<literal>subselect</literal>(可选):它将一个不可变(immutable)并且只读的实体映射到一个数据库的子查询中。当你想用视图代替一张基本表的时候,这是有用的,但最好不要这样做。更多的介绍请看下面内容。 "
+msgid "Let's now rewrite these examples using the hbm.xml syntax."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:651
+#, fuzzy, no-c-format
+msgid ""
+"<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" node=\"element-name|.\">\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>"
+msgstr ""
+"<![CDATA[<composite-id\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" mapped=\"true|false\"\n"
+" access=\"field|property|ClassName\">\n"
+" node=\"element-name|.\"\n"
+"\n"
+" <key-property name=\"propertyName\" type=\"typename\" column="
+"\"column_name\"/>\n"
+" <key-many-to-one name=\"propertyName class=\"ClassName\" column="
+"\"column_name\"/>\n"
+" ......\n"
+"</composite-id>]]>"
+
#. Tag: para
+#: basic_mapping.xml:653
#, no-c-format
-msgid "<literal>abstract</literal> (optional): is used to mark abstract superclasses in <literal><union-subclass></literal> hierarchies."
-msgstr "<literal>abstract</literal>(可选):用于在 <literal><union-subclass></literal> 的层次结构(hierarchies)中标识抽象超类。"
+msgid "First a simple example:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:655
+#, no-c-format
+msgid ""
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:657
#, no-c-format
-msgid "It is acceptable for the named persistent class to be an interface. You can declare implementing classes of that interface using the <literal><subclass></literal> element. You can persist any <emphasis>static</emphasis> inner class. Specify the class name using the standard form i.e. <literal>e.g.Foo$Bar</literal>."
-msgstr "若指明的持久化类实际上是一个接口,这也是完全可以接受的。之后你可以用元素 <literal><subclass></literal> 来指定该接口的实际实现类。你可以持久化任何 <emphasis>static</emphasis>(静态的)内部类。你应该使用标准的类名格式来指定类名,比如:<literal>Foo$Bar</literal>。"
+msgid "Then an example showing how an association can be mapped."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:660
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"\n"
+" <many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
+"\"false\"/>\n"
+" </many-to-one>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:662
#, no-c-format
-msgid "Immutable classes, <literal>mutable=\"false\"</literal>, cannot be updated or deleted by the application. This allows Hibernate to make some minor performance optimizations."
-msgstr "不可变类,<literal>mutable=\"false\"</literal> 不可以被应用程序更新或者删除。这允许 Hibernate 实现一些小小的性能优化。"
+msgid "Notice a few things in the previous example:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:666
#, no-c-format
-msgid "The optional <literal>proxy</literal> attribute enables lazy initialization of persistent instances of the class. Hibernate will initially return CGLIB proxies that implement the named interface. The persistent object will load when a method of the proxy is invoked. See \"Initializing collections and proxies\" below."
-msgstr "可选的 <literal>proxy</literal> 属性允许延迟加载类的持久化实例。Hibernate 开始会返回实现了这个命名接口的 CGLIB 代理。当代理的某个方法被实际调用的时候,真实的持久化对象才会被装载。参见下面的“用于延迟装载的代理”。 "
+msgid ""
+"the order of the properties (and column) matters. It must be the same "
+"between the association and the primary key of the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:672
#, no-c-format
-msgid "<emphasis>Implicit</emphasis> polymorphism means that instances of the class will be returned by a query that names any superclass or implemented interface or class, and that instances of any subclass of the class will be returned by a query that names the class itself. <emphasis>Explicit</emphasis> polymorphism means that class instances will be returned only by queries that explicitly name that class. Queries that name the class will return only instances of subclasses mapped inside this <literal><class></literal> declaration as a <literal><subclass></literal> or <literal><joined-subclass></literal>. For most purposes, the default <literal>polymorphism=\"implicit\"</literal> is appropriate. Explicit polymorphism is useful when two different classes are mapped to the same table This allows a \"lightweight\" class that contains a subset of the table columns."
-msgstr "<emphasis>Implicit</emphasis>(隐式)的多态是指,如果查询时给出的是任何超类、该类实现的接口或者该类的名字,都会返回这个类的实例;如果查询中给出的是子类的名字,则会返回子类的实例。<emphasis>Explicit</emphasis>(显式)的多态是指,只有在查询时给出明确的该类名字时才会返回这个类的实例; 同时只有在这个 <literal><class></literal> 的定义中作为 <literal><subclass></literal> 或者 <literal><joined-subclass></literal> 出现的子类,才会可能返回。在大多数情况下,默认的 <literal>polymorphism=\"implicit\"</literal> 都是合适的。显式的多态在有两个不同的类映射到同一个表的时候很有用。(允许一个“轻量级”的类,只包含部分表字段)。 "
+msgid ""
+"the many to one uses the same columns as the primary key and thus must be "
+"marked as read only (<literal>insertable</literal> and <literal>updatable</"
+"literal> to false)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:679
#, no-c-format
-msgid "The <literal>persister</literal> attribute lets you customize the persistence strategy used for the class. You can, for example, specify your own subclass of <literal>org.hibernate.persister.EntityPersister</literal>, or you can even provide a completely new implementation of the interface <literal>org.hibernate.persister.ClassPersister</literal> that implements, for example, persistence via stored procedure calls, serialization to flat files or LDAP. See <literal>org.hibernate.test.CustomPersister</literal> for a simple example of \"persistence\" to a <literal>Hashtable</literal>."
-msgstr "<literal>persister</literal> 属性可以让你定制这个类使用的持久化策略。你可以指定你自己实现 <literal>org.hibernate.persister.EntityPersister</literal> 的子类,你甚至可以完全从头开始编写一个 <literal>org.hibernate.persister.ClassPersister</literal> 接口的实现,比如是用储存过程调用、序列化到文件或者 LDAP 数据库来实现。参阅 <literal>org.hibernate.test.CustomPersister</literal>,这是持久化到 <literal>Hashtable</literal> 的一个简单例子。 "
+msgid ""
+"unlike with <classname>@MapsId</classname>, the id value of the associated "
+"entity is not transparently copied, check the <literal>foreign</literal> id "
+"generator for more information."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:686
#, no-c-format
-msgid "The <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> settings are not inherited by subclasses, so they can also be specified on the <literal><subclass></literal> or <literal><joined-subclass></literal> elements. Although these settings can increase performance in some cases, they can actually decrease performance in others."
-msgstr "请注意 <literal>dynamic-update</literal> 和 <literal>dynamic-insert</literal> 的设置并不会继承到子类,所以在 <literal><subclass></literal> 或者 <literal><joined-subclass></literal> 元素中可能需要再次设置。这些设置在某些情况下能够提高效率,而其他情况下则反而可能降低性能。"
+msgid ""
+"The last example shows how to map association directly in the embedded id "
+"component."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:689
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id name=\"id\" class=\"CustomerId\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:691
#, no-c-format
-msgid "Use of <literal>select-before-update</literal> will usually decrease performance. It is useful to prevent a database update trigger being called unnecessarily if you reattach a graph of detached instances to a <literal>Session</literal>."
-msgstr "使用 <literal>select-before-update</literal> 通常会降低性能。如果你重新连接一个脱管(detached)对象实例 到一个 <literal>Session</literal> 中时,它可以防止数据库不必要的触发 update。这就很有用了。"
+msgid ""
+"This is the recommended approach to map composite identifier. The following "
+"options should not be considered unless some constraint are present."
+msgstr ""
+#. Tag: title
+#: basic_mapping.xml:697
+#, no-c-format
+msgid "Multiple id properties without identifier type"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:699
#, no-c-format
-msgid "If you enable <literal>dynamic-update</literal>, you will have a choice of optimistic locking strategies:"
-msgstr "如果你打开了<literal>dynamic-update</literal>,你可以选择几种乐观锁定的策略:"
+msgid ""
+"Another, arguably more natural, approach is to place <classname>@Id</"
+"classname> on multiple properties of your entity. This approach is only "
+"supported by Hibernate (not JPA compliant) but does not require an extra "
+"embeddable component."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" })\n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:706
#, no-c-format
-msgid "<literal>version</literal>: check the version/timestamp columns"
-msgstr "<literal>version(版本检查)</literal>:检查 version/timestamp 字段"
+msgid ""
+"In this case <classname>Customer</classname> is its own identifier "
+"representation: it must implement <classname>Serializable</classname> and "
+"must implement <methodname>equals()</methodname> and <methodname>hashCode()</"
+"methodname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:712
#, no-c-format
-msgid "<literal>all</literal>: check all columns"
-msgstr "<literal>all(全部)</literal>:检查全部字段"
+msgid "In hbm.xml, the same mapping is:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:714
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id>\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:718
+#, no-c-format
+msgid "Multiple id properties with with a dedicated identifier type"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:721
#, no-c-format
-msgid "<literal>dirty</literal>: check the changed columns, allowing some concurrent updates"
-msgstr "<literal>dirty(脏检查)</literal>:只检察修改过的字段,允许某些并行更新"
+msgid ""
+"<classname>@IdClass</classname> on an entity points to the class (component) "
+"representing the identifier of the class. The properties marked "
+"<classname>@Id</classname> on the entity must have their corresponding "
+"property on the <classname>@IdClass</classname>. The return type of search "
+"twin property must be either identical for basic properties or must "
+"correspond to the identifier class of the associated entity for an "
+"association."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:730
#, no-c-format
-msgid "<literal>none</literal>: do not use optimistic locking"
-msgstr "<literal>none(不检查)</literal>:不使用乐观锁定"
+msgid ""
+"This approach is inherited from the EJB 2 days and we recommend against its "
+"use. But, after all it's your application and Hibernate supports it."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:735
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" UserId user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:737
#, no-c-format
-msgid "It is <emphasis>strongly</emphasis> recommended that you use version/timestamp columns for optimistic locking with Hibernate. This strategy optimizes performance and correctly handles modifications made to detached instances (i.e. when <literal>Session.merge()</literal> is used)."
-msgstr "我们<emphasis>强烈</emphasis>建议你在 Hibernate 中使用 version/timestamp 字段来进行乐观锁定。这个选择可以优化性能,且能够处理对脱管实例的修改(例如:在使用 <literal>Session.merge()</literal> 的时候)。"
+msgid ""
+"<classname>Customer</classname> and <classname>CustomerId</classname> do "
+"have the same properties <literal>customerNumber</literal> as well as "
+"<literal>user</literal>. <classname>CustomerId</classname> must be "
+"<classname>Serializable</classname> and implement <classname>equals()</"
+"classname> and <classname>hashCode()</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:745
#, no-c-format
-msgid "There is no difference between a view and a base table for a Hibernate mapping. This is transparent at the database level, although some DBMS do not support views properly, especially with updates. Sometimes you want to use a view, but you cannot create one in the database (i.e. with a legacy schema). In this case, you can map an immutable and read-only entity to a given SQL subselect expression:"
-msgstr "对 Hibernate 映射来说视图和表是没有区别的,这是因为它们在数据层都是透明的( 注意:一些数据库不支持视图属性,特别是更新的时候)。有时你想使用视图,但却不能在数据库中创建它(例如:在遗留的 schema 中)。这样的话,你可以映射一个不可变的(immutable)并且是 只读的实体到一个给定的 SQL 子查询表达式: "
+msgid ""
+"While not JPA standard, Hibernate let's you declare the vanilla associated "
+"property in the <classname>@IdClass</classname>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:749
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@IdClass(CustomerId.class)\n"
+"class Customer implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
+"\"),\n"
+" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
+"\")\n"
+" }) \n"
+" User user;\n"
+" \n"
+" @Id String customerNumber;\n"
+"\n"
+" boolean preferredCustomer;\n"
+"}\n"
+"\n"
+"class CustomerId implements Serializable {\n"
+" @OneToOne User user;\n"
+" String customerNumber;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Entity \n"
+"class User {\n"
+" @EmbeddedId UserId id;\n"
+" Integer age;\n"
+"\n"
+" //implements equals and hashCode\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"class UserId implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:751
#, no-c-format
-msgid "Declare the tables to synchronize this entity with, ensuring that auto-flush happens correctly and that queries against the derived entity do not return stale data. The <literal><subselect></literal> is available both as an attribute and a nested mapping element."
-msgstr "定义这个实体用到的表为同步(synchronize),确保自动刷新(auto-flush)正确执行,并且依赖原实体的查询不会返回过期数据。在属性元素和嵌套映射元素中都可使用 <literal><subselect></literal>。"
+msgid ""
+"This feature is of limited interest though as you are likely to have chosen "
+"the <classname>@IdClass</classname> approach to stay JPA compliant or you "
+"have a quite twisted mind."
+msgstr ""
+#. Tag: para
+#: basic_mapping.xml:755
+#, no-c-format
+msgid "Here are the equivalent on hbm.xml files:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:757
+#, no-c-format
+msgid ""
+"<class name=\"Customer\">\n"
+" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
+" <key-many-to-one name=\"user\">\n"
+" <column name=\"userfirstname_fk\"/>\n"
+" <column name=\"userlastname_fk\"/>\n"
+" </key-many-to-one>\n"
+" <key-property name=\"customerNumber\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"preferredCustomer\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"User\">\n"
+" <composite-id name=\"id\" class=\"UserId\">\n"
+" <key-property name=\"firstName\"/>\n"
+" <key-property name=\"lastName\"/>\n"
+" </composite-id>\n"
+"\n"
+" <property name=\"age\"/>\n"
+"</class>"
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:762
+#, fuzzy, no-c-format
+msgid "Identifier generator"
+msgstr "增强的标识符生成器"
+
+#. Tag: para
+#: basic_mapping.xml:764
#, no-c-format
-msgid "id"
-msgstr "id"
+msgid ""
+"Hibernate can generate and populate identifier values for you automatically. "
+"This is the recommended approach over \"business\" or \"natural\" id "
+"(especially composite ids)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:768
#, no-c-format
-msgid "Mapped classes <emphasis>must</emphasis> declare the primary key column of the database table. Most classes will also have a JavaBeans-style property holding the unique identifier of an instance. The <literal><id></literal> element defines the mapping from that property to the primary key column."
-msgstr "被映射的类<emphasis>必须</emphasis>定义对应数据库表主键字段。大多数类有一个 JavaBeans 风格的属性, 为每一个实例包含唯一的标识。<literal><id></literal> 元素定义了该属性到数据库表主键字段的映射。"
+msgid ""
+"Hibernate offers various generation strategies, let's explore the most "
+"common ones first that happens to be standardized by JPA:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:774
+#, fuzzy, no-c-format
+msgid ""
+"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
+msgstr ""
+"对 DB2,MySQL,MS SQL Server,Sybase 和 HypersonicSQL 的内置标识字段提供支"
+"持。返回的标识符是 <literal>long</literal>,<literal>short</literal> 或者 "
+"<literal>int</literal> 类型的。"
+
+#. Tag: para
+#: basic_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"SEQUENCE (called <literal>seqhilo</literal> in Hibernate): uses a hi/lo "
+"algorithm to efficiently generate identifiers of type <literal>long</"
+"literal>, <literal>short</literal> or <literal>int</literal>, given a named "
+"database sequence."
+msgstr ""
+"使用一个高/低位算法来高效的生成 <literal>long</literal>,<literal>short</"
+"literal> 或者 <literal>int</literal> 类型的标识符,给定一个数据库序列"
+"(sequence)的名字。"
+
+#. Tag: para
+#: basic_mapping.xml:788
+#, fuzzy, no-c-format
+msgid ""
+"TABLE (called <classname>MultipleHiLoPerTableGenerator</classname> in "
+"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
+"type <literal>long</literal>, <literal>short</literal> or <literal>int</"
+"literal>, given a table and column as a source of hi values. The hi/lo "
+"algorithm generates identifiers that are unique only for a particular "
+"database."
+msgstr ""
+"使用一个高/低位算法高效的生成 <literal>long</literal>,<literal>short</"
+"literal> 或者 <literal>int</literal> 类型的标识符。给定一个表和字段(默认分别"
+"是 <literal>hibernate_unique_key</literal> 和 <literal>next_hi</literal>)作"
+"为高位值的来源。高/低位算法生成的标识符只在一个特定的数据库中是唯一的。"
+
+#. Tag: para
+#: basic_mapping.xml:798
+#, fuzzy, no-c-format
+msgid ""
+"AUTO: selects <literal>IDENTITY</literal>, <literal>SEQUENCE</literal> or "
+"<literal>TABLE</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"根据底层数据库的能力选择 <literal>identity</literal>、<literal>sequence</"
+"literal> 或者 <literal>hilo</literal> 中的一个。"
+
+#. Tag: para
+#: basic_mapping.xml:805
#, no-c-format
-msgid "<literal>name</literal> (optional): the name of the identifier property."
+msgid ""
+"We recommend all new projects to use the new enhanced identifier generators. "
+"They are deactivated by default for entities using annotations but can be "
+"activated using <code>hibernate.id.new_generator_mappings=true</code>. These "
+"new generators are more efficient and closer to the JPA 2 specification "
+"semantic."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:812
+#, no-c-format
+msgid ""
+"However they are not backward compatible with existing Hibernate based "
+"application (if a sequence or a table is used for id generation). See "
+"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
+"to activate them."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:818
+#, no-c-format
+msgid ""
+"To mark an id property as generated, use the <classname>@GeneratedValue</"
+"classname> annotation. You can specify the strategy used (default to "
+"<literal>AUTO</literal>) by setting <literal>strategy</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:823
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue\n"
+" Integer getId() { ... };\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Invoice {\n"
+" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+" Integer getId() { ... };\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:825
+#, no-c-format
+msgid ""
+"<literal>SEQUENCE</literal> and <literal>TABLE</literal> require additional "
+"configurations that you can set using <classname>@SequenceGenerator</"
+"classname> and <classname>@TableGenerator</classname>:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:832
+#, fuzzy, no-c-format
+msgid "<literal>name</literal>: name of the generator"
+msgstr "<literal>name</literal>:属性名。"
+
+#. Tag: para
+#: basic_mapping.xml:836
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> / <literal>sequenceName</literal>: name of the "
+"table or the sequence (defaulting respectively to "
+"<literal>hibernate_sequences</literal> and <literal>hibernate_sequence</"
+"literal>)"
+msgstr ""
+"<literal>sequence_name</literal>(可选 — 默认为 <literal>hibernate_sequence</"
+"literal>):序列或表的名字"
+
+#. Tag: para
+#: basic_mapping.xml:843
+#, fuzzy, no-c-format
+msgid "<literal>catalog</literal> / <literal>schema</literal>:"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:848
+#, fuzzy, no-c-format
+msgid ""
+"<literal>initialValue</literal>: the value from which the id is to start "
+"generating"
+msgstr "<literal>table</literal>:被连接表的名称。 "
+
+#. Tag: para
+#: basic_mapping.xml:853
+#, no-c-format
+msgid ""
+"<literal>allocationSize</literal>: the amount to increment by when "
+"allocating id numbers from the generator"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:858
+#, no-c-format
+msgid ""
+"In addition, the <classname>TABLE</classname> strategy also let you "
+"customize:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:863
+#, fuzzy, no-c-format
+msgid ""
+"<literal>pkColumnName</literal>: the column name containing the entity "
+"identifier"
+msgstr "<literal>name</literal>:属性名。"
+
+#. Tag: para
+#: basic_mapping.xml:868
+#, fuzzy, no-c-format
+msgid ""
+"<literal>valueColumnName</literal>: the column name containing the "
+"identifier value"
msgstr "<literal>name</literal>(可选):标识属性的名字。 "
#. Tag: para
+#: basic_mapping.xml:873
+#, fuzzy, no-c-format
+msgid "<literal>pkColumnValue</literal>: the entity identifier"
+msgstr "<literal>id-type</literal>:标识符类型"
+
+#. Tag: para
+#: basic_mapping.xml:878
#, no-c-format
-msgid "<literal>type</literal> (optional): a name that indicates the Hibernate type."
-msgstr "<literal>type</literal>(可选):一个 Hibernate 类型的名字。"
+msgid ""
+"<literal>uniqueConstraints</literal>: any potential column constraint on the "
+"table containing the ids"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:883
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of the primary key column."
-msgstr "<literal>column</literal>(可选 — 默认为属性名):主键字段的名字。 "
+msgid ""
+"To link a table or sequence generator definition with an actual generated "
+"property, use the same name in both the definition <literal>name</literal> "
+"and the generator value <literal>generator</literal> as shown below."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:888
+#, no-c-format
+msgid ""
+"@Id \n"
+"@GeneratedValue(\n"
+" strategy=GenerationType.SEQUENCE, \n"
+" generator=\"SEQ_GEN\")\n"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:890
#, no-c-format
-msgid "<literal>unsaved-value</literal> (optional - defaults to a \"sensible\" value): an identifier property value that indicates an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session."
-msgstr "<literal>unsaved-value</literal>(可选 — 默认为一个切合实际(sensible)的值):一个特定的标识属性值,用来标志该实例是刚刚创建的,尚未保存。这可以把这种实例和从以前的 session 中装载过(可能又做过修改--译者注)但未再次持久化的实例区分开来。 "
+msgid ""
+"The scope of a generator definition 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 in "
+"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
+"\"/>):"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:896
+#, 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"
+"@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"
+"@javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:898
#, no-c-format
-msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate should use for accessing the property value."
-msgstr "<literal>access</literal>(可选 — 默认为 <literal>property</literal>):Hibernate 用来访问属性值的策略。 "
+msgid ""
+"If a JPA XML descriptor (like <filename>META-INF/orm.xml</filename>) is used "
+"to define the generators, <literal>EMP_GEN</literal> and <literal>SEQ_GEN</"
+"literal> are application level generators."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:904
#, no-c-format
-msgid "If the <literal>name</literal> attribute is missing, it is assumed that the class has no identifier property."
-msgstr "如果 <literal>name</literal> 属性不存在,会认为这个类没有标识属性。"
+msgid ""
+"Package level definition is not supported by the JPA specification. However, "
+"you can use the <literal>@GenericGenerator</literal> at the package level "
+"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:910
#, no-c-format
-msgid "The <literal>unsaved-value</literal> attribute is almost never needed in Hibernate3."
-msgstr "<literal>unsaved-value</literal> 属性在 Hibernate3 中几乎不再需要。"
+msgid ""
+"These are the four standard JPA generators. Hibernate goes beyond that and "
+"provide additional generators or additional options as we will see below. "
+"You can also write your own custom identifier generator by implementing "
+"<classname>org.hibernate.id.IdentifierGenerator</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:916
#, no-c-format
-msgid "There is an alternative <literal><composite-id></literal> declaration that allows access to legacy data with composite keys. Its use is strongly discouraged for anything else."
-msgstr "还有一个另外的 <literal><composite-id></literal> 定义可以访问旧式的多主键数据。我们非常不鼓励使用这种方式。"
+msgid ""
+"To define a custom generator, use the <classname>@GenericGenerator</"
+"classname> annotation (and its plural counter part "
+"<classname>@GenericGenerators</classname>) that describes the class of the "
+"identifier generator or its short cut name (as described below) and a list "
+"of key/value parameters. When using <classname>@GenericGenerator</classname> "
+"and assigning it via <classname>@GeneratedValue.generator</classname>, the "
+"<classname>@GeneratedValue.strategy</classname> is ignored: leave it blank."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:926
+#, 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=\"trigger-generated\")\n"
+"@GenericGenerator(\n"
+" name=\"trigger-generated\", \n"
+" strategy = \"select\",\n"
+" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
+")\n"
+"public String getId() {"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:928
+#, fuzzy, no-c-format
+msgid ""
+"The hbm.xml approach uses the optional <literal><generator></literal> "
+"child element inside <literal><id></literal>. If any parameters are "
+"required to configure or initialize the generator instance, they are passed "
+"using the <literal><param></literal> element."
+msgstr ""
+"可选的 <literal><generator></literal> 子元素是一个 Java 类的名字,用来"
+"为该持久化类的实例生成唯一的标识。如果这个生成器实例需要某些配置值或者初始化"
+"参数,用 <literal><param></literal> 元素来传递。"
+
+#. Tag: programlisting
+#: basic_mapping.xml:934
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
+" <param name=\"table\">uid_table</param>\n"
+" <param name=\"column\">next_hi_value_column</param>\n"
+" </generator>\n"
+"</id>]]>"
+
#. Tag: title
+#: basic_mapping.xml:937
#, no-c-format
-msgid "Generator"
-msgstr "Generator"
+msgid "Various additional generators"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:939
#, no-c-format
-msgid "The optional <literal><generator></literal> child element names a Java class used to generate unique identifiers for instances of the persistent class. If any parameters are required to configure or initialize the generator instance, they are passed using the <literal><param></literal> element."
-msgstr "可选的 <literal><generator></literal> 子元素是一个 Java 类的名字,用来为该持久化类的实例生成唯一的标识。如果这个生成器实例需要某些配置值或者初始化参数,用 <literal><param></literal> 元素来传递。"
+msgid ""
+"All generators implement the interface <literal>org.hibernate.id."
+"IdentifierGenerator</literal>. This is a very simple interface. Some "
+"applications can choose to provide their own specialized implementations, "
+"however, Hibernate provides a range of built-in implementations. The "
+"shortcut names for the built-in generators are as follows:"
+msgstr ""
+"所有的生成器都实现 <literal>org.hibernate.id.IdentifierGenerator</literal> 接"
+"口。这是一个非常简单的接口;某些应用程序可以选择提供他们自己特定的实现。当"
+"然,Hibernate 提供了很多内置的实现。下面是一些内置生成器的快捷名字: "
+#. Tag: literal
+#: basic_mapping.xml:946
+#, no-c-format
+msgid "increment"
+msgstr "increment"
+
#. Tag: para
+#: basic_mapping.xml:949
#, no-c-format
-msgid "All generators implement the interface <literal>org.hibernate.id.IdentifierGenerator</literal>. This is a very simple interface. Some applications can choose to provide their own specialized implementations, however, Hibernate provides a range of built-in implementations. The shortcut names for the built-in generators are as follows:"
-msgstr "所有的生成器都实现 <literal>org.hibernate.id.IdentifierGenerator</literal> 接口。这是一个非常简单的接口;某些应用程序可以选择提供他们自己特定的实现。当然,Hibernate 提供了很多内置的实现。下面是一些内置生成器的快捷名字: "
+msgid ""
+"generates identifiers of type <literal>long</literal>, <literal>short</"
+"literal> or <literal>int</literal> that are unique only when no other "
+"process is inserting data into the same table. <emphasis>Do not use in a "
+"cluster.</emphasis>"
+msgstr ""
+"用于为 <literal>long</literal>, <literal>short</literal> 或者 <literal>int</"
+"literal> 类型生成 唯一标识。只有在没有其他进程往同一张表中插入数据时才能使"
+"用。<emphasis>在集群下不要使用。</emphasis>"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:958
#, no-c-format
-msgid "<literal>increment</literal>"
-msgstr "<literal>increment</literal>"
+msgid "identity"
+msgstr "identity"
#. Tag: para
+#: basic_mapping.xml:961
#, no-c-format
-msgid "generates identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal> that are unique only when no other process is inserting data into the same table. <emphasis>Do not use in a cluster.</emphasis>"
-msgstr "用于为 <literal>long</literal>, <literal>short</literal> 或者 <literal>int</literal> 类型生成 唯一标识。只有在没有其他进程往同一张表中插入数据时才能使用。<emphasis>在集群下不要使用。</emphasis>"
+msgid ""
+"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
+"HypersonicSQL. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>."
+msgstr ""
+"对 DB2,MySQL,MS SQL Server,Sybase 和 HypersonicSQL 的内置标识字段提供支"
+"持。返回的标识符是 <literal>long</literal>,<literal>short</literal> 或者 "
+"<literal>int</literal> 类型的。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:969
#, no-c-format
-msgid "<literal>identity</literal>"
-msgstr "<literal>identity</literal>"
+msgid "sequence"
+msgstr "sequence"
#. Tag: para
+#: basic_mapping.xml:972
#, no-c-format
-msgid "supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>."
-msgstr "对 DB2,MySQL,MS SQL Server,Sybase 和 HypersonicSQL 的内置标识字段提供支持。返回的标识符是 <literal>long</literal>,<literal>short</literal> 或者 <literal>int</literal> 类型的。"
+msgid ""
+"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
+"Interbase. The returned identifier is of type <literal>long</literal>, "
+"<literal>short</literal> or <literal>int</literal>"
+msgstr ""
+"在 DB2,PostgreSQL,Oracle,SAP DB,McKoi 中使用序列(sequence), 而在 "
+"Interbase 中使用生成器(generator)。返回的标识符是 <literal>long</literal>,"
+"<literal>short</literal> 或者 <literal>int</literal> 类型的。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:980
#, no-c-format
-msgid "<literal>sequence</literal>"
-msgstr "<literal>sequence</literal>"
+msgid "hilo"
+msgstr "hilo"
#. Tag: para
+#: basic_mapping.xml:984
#, no-c-format
-msgid "uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>"
-msgstr "在 DB2,PostgreSQL,Oracle,SAP DB,McKoi 中使用序列(sequence), 而在 Interbase 中使用生成器(generator)。返回的标识符是 <literal>long</literal>,<literal>short</literal> 或者 <literal>int</literal> 类型的。"
+msgid ""
+"uses a hi/lo algorithm to efficiently generate identifiers of type "
+"<literal>long</literal>, <literal>short</literal> or <literal>int</literal>, "
+"given a table and column (by default <literal>hibernate_unique_key</literal> "
+"and <literal>next_hi</literal> respectively) as a source of hi values. The "
+"hi/lo algorithm generates identifiers that are unique only for a particular "
+"database."
+msgstr ""
+"使用一个高/低位算法高效的生成 <literal>long</literal>,<literal>short</"
+"literal> 或者 <literal>int</literal> 类型的标识符。给定一个表和字段(默认分别"
+"是 <literal>hibernate_unique_key</literal> 和 <literal>next_hi</literal>)作"
+"为高位值的来源。高/低位算法生成的标识符只在一个特定的数据库中是唯一的。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:996
#, no-c-format
-msgid "<literal>hilo</literal>"
-msgstr "<literal>hilo</literal>"
+msgid "seqhilo"
+msgstr "seqhilo"
#. Tag: para
+#: basic_mapping.xml:999
#, no-c-format
-msgid "uses a hi/lo algorithm to efficiently generate identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>, given a table and column (by default <literal>hibernate_unique_key</literal> and <literal>next_hi</literal> respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database."
-msgstr "使用一个高/低位算法高效的生成 <literal>long</literal>,<literal>short</literal> 或者 <literal>int</literal> 类型的标识符。给定一个表和字段(默认分别是 <literal>hibernate_unique_key</literal> 和 <literal>next_hi</literal>)作为高位值的来源。高/低位算法生成的标识符只在一个特定的数据库中是唯一的。"
+msgid ""
+"uses a hi/lo algorithm to efficiently generate identifiers of type "
+"<literal>long</literal>, <literal>short</literal> or <literal>int</literal>, "
+"given a named database sequence."
+msgstr ""
+"使用一个高/低位算法来高效的生成 <literal>long</literal>,<literal>short</"
+"literal> 或者 <literal>int</literal> 类型的标识符,给定一个数据库序列"
+"(sequence)的名字。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1007
+#, fuzzy, no-c-format
+msgid "uuid"
+msgstr "guid"
+
+#. Tag: para
+#: basic_mapping.xml:1010
#, no-c-format
-msgid "<literal>seqhilo</literal>"
-msgstr "<literal>seqhilo</literal>"
+msgid ""
+"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
+"represented as a string of 32 hexidecimal digits. Users can also configure "
+"it to use a separator (config parameter \"separator\") which separates the "
+"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
+"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
+"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
+"discussed below."
+msgstr ""
+#. Tag: literal
+#: basic_mapping.xml:1023
+#, fuzzy, no-c-format
+msgid "uuid2"
+msgstr "guid"
+
#. Tag: para
+#: basic_mapping.xml:1026
#, no-c-format
-msgid "uses a hi/lo algorithm to efficiently generate identifiers of type <literal>long</literal>, <literal>short</literal> or <literal>int</literal>, given a named database sequence."
-msgstr "使用一个高/低位算法来高效的生成 <literal>long</literal>,<literal>short</literal> 或者 <literal>int</literal> 类型的标识符,给定一个数据库序列(sequence)的名字。"
+msgid ""
+"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
+"\"version\" (the RFC term) generated depends on the pluggable \"generation "
+"strategy\" used (see below). Capable of generating values as <classname>java."
+"util.UUID</classname>, <classname>java.lang.String</classname> or as a byte "
+"array of length 16 (<literal>byte[16]</literal>). The \"generation strategy"
+"\" is defined by the interface <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
+"configuration parameters for defining which generation strategy to use:"
+msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1038
#, no-c-format
-msgid "<literal>uuid</literal>"
-msgstr "<literal>uuid</literal>"
+msgid "uuid_gen_strategy_class"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1041
#, no-c-format
-msgid "uses a 128-bit UUID algorithm to generate identifiers of type string that are unique within a network (the IP address is used). The UUID is encoded as a string of 32 hexadecimal digits in length."
-msgstr "用一个 128-bit 的 UUID 算法生成字符串类型的标识符,这在一个网络中是唯一的(使用了 IP 地址)。UUID 被编码为一个 32 位 16 进制数字的字符串。 "
+msgid "Names the UUIDGenerationStrategy class to use"
+msgstr ""
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1047
#, no-c-format
-msgid "<literal>guid</literal>"
-msgstr "<literal>guid</literal>"
+msgid "uuid_gen_strategy"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1050
#, no-c-format
+msgid "Names the UUIDGenerationStrategy instance to use"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1056
+#, no-c-format
+msgid "Out of the box, comes with the following strategies:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1059
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.StandardRandomStrategy</classname> (the "
+"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
+"<methodname>randomUUID</methodname> method of <classname>java.util.UUID</"
+"classname>"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1067
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy</classname> - "
+"generates \"version 1\" UUID values, using IP address since mac address not "
+"available. If you need mac address to be used, consider leveraging one of "
+"the existing third party UUID generators which sniff out mac address and "
+"integrating it via the <interfacename>org.hibernate.id."
+"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
+"time of this writing include <ulink url=\"http://johannburkard.de/software/"
+"uuid/\">http://johannburkard.de/software/uuid/</ulink> and <ulink url="
+"\"http://commons.apache.org/sandbox/id/uuid.html\">http://commons.apache.org/"
+"sandbox/id/uuid.html</ulink>"
+msgstr ""
+
+#. Tag: literal
+#: basic_mapping.xml:1085
+#, no-c-format
+msgid "guid"
+msgstr "guid"
+
+#. Tag: para
+#: basic_mapping.xml:1088
+#, no-c-format
msgid "uses a database-generated GUID string on MS SQL Server and MySQL."
msgstr "在 MS SQL Server 和 MySQL 中使用数据库生成的 GUID 字符串。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1094
#, no-c-format
-msgid "<literal>native</literal>"
-msgstr "<literal>native</literal>"
+msgid "native"
+msgstr "native"
#. Tag: para
+#: basic_mapping.xml:1097
#, no-c-format
-msgid "selects <literal>identity</literal>, <literal>sequence</literal> or <literal>hilo</literal> depending upon the capabilities of the underlying database."
-msgstr "根据底层数据库的能力选择 <literal>identity</literal>、<literal>sequence</literal> 或者 <literal>hilo</literal> 中的一个。"
+msgid ""
+"selects <literal>identity</literal>, <literal>sequence</literal> or "
+"<literal>hilo</literal> depending upon the capabilities of the underlying "
+"database."
+msgstr ""
+"根据底层数据库的能力选择 <literal>identity</literal>、<literal>sequence</"
+"literal> 或者 <literal>hilo</literal> 中的一个。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1105
#, no-c-format
-msgid "<literal>assigned</literal>"
-msgstr "<literal>assigned</literal>"
+msgid "assigned"
+msgstr "assigned"
#. Tag: para
+#: basic_mapping.xml:1108
#, no-c-format
-msgid "lets the application assign an identifier to the object before <literal>save()</literal> is called. This is the default strategy if no <literal><generator></literal> element is specified."
-msgstr "让应用程序在调用 <literal>save()</literal> 之前为对象分配一个标识符。这是 <literal><generator></literal> 元素没有指定时的默认生成策略。"
+msgid ""
+"lets the application assign an identifier to the object before <literal>save"
+"()</literal> is called. This is the default strategy if no <literal><"
+"generator></literal> element is specified."
+msgstr ""
+"让应用程序在调用 <literal>save()</literal> 之前为对象分配一个标识符。这是 "
+"<literal><generator></literal> 元素没有指定时的默认生成策略。"
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1117
#, no-c-format
-msgid "<literal>select</literal>"
-msgstr "<literal>select</literal>"
+msgid "select"
+msgstr "select"
#. Tag: para
+#: basic_mapping.xml:1120
#, no-c-format
-msgid "retrieves a primary key, assigned by a database trigger, by selecting the row by some unique key and retrieving the primary key value."
+msgid ""
+"retrieves a primary key, assigned by a database trigger, by selecting the "
+"row by some unique key and retrieving the primary key value."
msgstr "通过数据库触发器选择一些唯一主键的行并返回主键值来分配一个主键。 "
-#. Tag: term
+#. Tag: literal
+#: basic_mapping.xml:1127
#, no-c-format
-msgid "<literal>foreign</literal>"
-msgstr "<literal>foreign</literal>"
+msgid "foreign"
+msgstr "foreign"
#. Tag: para
+#: basic_mapping.xml:1130
#, no-c-format
-msgid "uses the identifier of another associated object. It is usually used in conjunction with a <literal><one-to-one></literal> primary key association."
-msgstr "使用另外一个相关联的对象的标识符。它通常和 <literal><one-to-one></literal> 联合起来使用。"
+msgid ""
+"uses the identifier of another associated object. It is usually used in "
+"conjunction with a <literal><one-to-one></literal> primary key "
+"association."
+msgstr ""
+"使用另外一个相关联的对象的标识符。它通常和 <literal><one-to-one></"
+"literal> 联合起来使用。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>sequence-identity</literal>"
+#. Tag: literal
+#: basic_mapping.xml:1138
+#, fuzzy, no-c-format
+msgid "sequence-identity"
msgstr "<literal>sequence-identity</literal>"
#. Tag: para
+#: basic_mapping.xml:1141
#, no-c-format
-msgid "a specialized sequence generation strategy that utilizes a database sequence for the actual value generation, but combines this with JDBC3 getGeneratedKeys to return the generated identifier value as part of the insert statement execution. This strategy is only supported on Oracle 10g drivers targeted for JDK 1.4. Comments on these insert statements are disabled due to a bug in the Oracle drivers."
-msgstr "一种特别的序列生成策略,它使用数据库序列来生成实际值,但将它和 JDBC3 的 getGeneratedKeys 结合在一起,使得在插入语句执行的时候就返回生成的值。目前为止只有面向 JDK 1.4 的 Oracle 10g 驱动支持这一策略。由于 Oracle 驱动程序的一个 bug,这些插入语句的注释被关闭了。"
+msgid ""
+"a specialized sequence generation strategy that utilizes a database sequence "
+"for the actual value generation, but combines this with JDBC3 "
+"getGeneratedKeys to return the generated identifier value as part of the "
+"insert statement execution. This strategy is only supported on Oracle 10g "
+"drivers targeted for JDK 1.4. Comments on these insert statements are "
+"disabled due to a bug in the Oracle drivers."
+msgstr ""
+"一种特别的序列生成策略,它使用数据库序列来生成实际值,但将它和 JDBC3 的 "
+"getGeneratedKeys 结合在一起,使得在插入语句执行的时候就返回生成的值。目前为止"
+"只有面向 JDK 1.4 的 Oracle 10g 驱动支持这一策略。由于 Oracle 驱动程序的一个 "
+"bug,这些插入语句的注释被关闭了。"
#. Tag: title
+#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "高/低位算法(Hi/Lo Algorithm)"
#. Tag: para
+#: basic_mapping.xml:1157
#, no-c-format
-msgid "The <literal>hilo</literal> and <literal>seqhilo</literal> generators provide two alternate implementations of the hi/lo algorithm. The first implementation requires a \"special\" database table to hold the next available \"hi\" value. Where supported, the second uses an Oracle-style sequence."
-msgstr "<literal>hilo</literal> 和 <literal>seqhilo</literal> 生成器给出了两种 hi/lo 算法的实现, 这是一种很令人满意的标识符生成算法。第一种实现需要一个“特殊”的数据库表来保存下一个可用的“hi”值。 第二种实现使用一个 Oracle 风格的序列(在被支持的情况下)。 "
+msgid ""
+"The <literal>hilo</literal> and <literal>seqhilo</literal> generators "
+"provide two alternate implementations of the hi/lo algorithm. The first "
+"implementation requires a \"special\" database table to hold the next "
+"available \"hi\" value. Where supported, the second uses an Oracle-style "
+"sequence."
+msgstr ""
+"<literal>hilo</literal> 和 <literal>seqhilo</literal> 生成器给出了两种 hi/lo "
+"算法的实现, 这是一种很令人满意的标识符生成算法。第一种实现需要一个“特殊”的数"
+"据库表来保存下一个可用的“hi”值。 第二种实现使用一个 Oracle 风格的序列(在被支"
+"持的情况下)。 "
+#. Tag: programlisting
+#: basic_mapping.xml:1163
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"hilo\">\n"
+" <param name=\"table\">hi_value</param>\n"
+" <param name=\"column\">next_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>]]>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1165
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
+" <generator class=\"seqhilo\">\n"
+" <param name=\"sequence\">hi_value</param>\n"
+" <param name=\"max_lo\">100</param>\n"
+" </generator>\n"
+"</id>]]>"
+
#. Tag: para
+#: basic_mapping.xml:1167
#, no-c-format
-msgid "Unfortunately, you cannot use <literal>hilo</literal> when supplying your own <literal>Connection</literal> to Hibernate. When Hibernate uses an application server datasource to obtain connections enlisted with JTA, you must configure the <literal>hibernate.transaction.manager_lookup_class</literal>."
-msgstr "可惜的是,你在为 Hibernate 自行提供 <literal>Connection</literal> 时无法使用 <literal>hilo</literal>。 当 Hibernate 使用 JTA 获取应用服务器的数据源连接时,你必须正确地配置 <literal>hibernate.transaction.manager_lookup_class</literal>。"
+msgid ""
+"Unfortunately, you cannot use <literal>hilo</literal> when supplying your "
+"own <literal>Connection</literal> to Hibernate. When Hibernate uses an "
+"application server datasource to obtain connections enlisted with JTA, you "
+"must configure the <literal>hibernate.transaction.manager_lookup_class</"
+"literal>."
+msgstr ""
+"可惜的是,你在为 Hibernate 自行提供 <literal>Connection</literal> 时无法使用 "
+"<literal>hilo</literal>。 当 Hibernate 使用 JTA 获取应用服务器的数据源连接"
+"时,你必须正确地配置 <literal>hibernate.transaction.manager_lookup_class</"
+"literal>。"
#. Tag: title
+#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "UUID 算法(UUID Algorithm )"
#. Tag: para
+#: basic_mapping.xml:1177
#, no-c-format
-msgid "The UUID contains: IP address, startup time of the JVM that is accurate to a quarter second, system time and a counter value that is unique within the JVM. It is not possible to obtain a MAC address or memory address from Java code, so this is the best option without using JNI."
-msgstr "UUID 包含:IP 地址、JVM 的启动时间(精确到 1/4 秒)、系统时间和一个计数器值(在 JVM 中唯一)。 在 Java 代码中不可能获得 MAC 地址或者内存地址,所以这已经是我们在不使用 JNI 的前提下的能做的最好实现了。"
+msgid ""
+"The UUID contains: IP address, startup time of the JVM that is accurate to a "
+"quarter second, system time and a counter value that is unique within the "
+"JVM. It is not possible to obtain a MAC address or memory address from Java "
+"code, so this is the best option without using JNI."
+msgstr ""
+"UUID 包含:IP 地址、JVM 的启动时间(精确到 1/4 秒)、系统时间和一个计数器值"
+"(在 JVM 中唯一)。 在 Java 代码中不可能获得 MAC 地址或者内存地址,所以这已经"
+"是我们在不使用 JNI 的前提下的能做的最好实现了。"
#. Tag: title
+#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "标识字段和序列(Identity columns and Sequences)"
#. Tag: para
+#: basic_mapping.xml:1187
#, no-c-format
-msgid "For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), you can use <literal>identity</literal> key generation. For databases that support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you can use <literal>sequence</literal> style key generation. Both of these strategies require two SQL queries to insert a new object. For example:"
-msgstr "对于内部支持标识字段的数据库(DB2、MySQL、Sybase 和 MS SQL),你可以使用 <literal>identity</literal> 关键字生成。对于内部支持序列的数据库(DB2、Oracle、PostgreSQL、Interbase、McKoi 和 SAP DB),你可以使用 <literal>sequence</literal> 风格的关键字生成。这两种方式对于插入一个新的对象都需要两次 SQL 查询。例如:"
+msgid ""
+"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
+"you can use <literal>identity</literal> key generation. For databases that "
+"support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you "
+"can use <literal>sequence</literal> style key generation. Both of these "
+"strategies require two SQL queries to insert a new object. For example:"
+msgstr ""
+"对于内部支持标识字段的数据库(DB2、MySQL、Sybase 和 MS SQL),你可以使用 "
+"<literal>identity</literal> 关键字生成。对于内部支持序列的数据库(DB2、"
+"Oracle、PostgreSQL、Interbase、McKoi 和 SAP DB),你可以使用 "
+"<literal>sequence</literal> 风格的关键字生成。这两种方式对于插入一个新的对象"
+"都需要两次 SQL 查询。例如:"
+#. Tag: programlisting
+#: basic_mapping.xml:1195
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"sequence\">\n"
+" <param name=\"sequence\">person_id_sequence</param>\n"
+" </generator>\n"
+"</id>]]>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1197
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
+"\">\n"
+" <generator class=\"identity\"/>\n"
+"</id>]]>"
+
#. Tag: para
+#: basic_mapping.xml:1199
#, no-c-format
-msgid "For cross-platform development, the <literal>native</literal> strategy will, depending on the capabilities of the underlying database, choose from the <literal>identity</literal>, <literal>sequence</literal> and <literal>hilo</literal> strategies."
-msgstr "对于跨平台开发,<literal>native</literal> 策略会从 <literal>identity</literal>、<literal>sequence</literal> 和 <literal>hilo</literal> 中进行选择,选择哪一个,这取决于底层数据库的支持能力。"
+msgid ""
+"For cross-platform development, the <literal>native</literal> strategy will, "
+"depending on the capabilities of the underlying database, choose from the "
+"<literal>identity</literal>, <literal>sequence</literal> and <literal>hilo</"
+"literal> strategies."
+msgstr ""
+"对于跨平台开发,<literal>native</literal> 策略会从 <literal>identity</"
+"literal>、<literal>sequence</literal> 和 <literal>hilo</literal> 中进行选择,"
+"选择哪一个,这取决于底层数据库的支持能力。"
#. Tag: title
+#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "程序分配的标识符(Assigned Identifiers)"
#. Tag: para
-#, no-c-format
-msgid "If you want the application to assign identifiers, as opposed to having Hibernate generate them, you can use the <literal>assigned</literal> generator. This special generator uses the identifier value already assigned to the object's identifier property. The generator is used when the primary key is a natural key instead of a surrogate key. This is the default behavior if you do not specify a <literal><generator></literal> element."
-msgstr "如果你需要应用程序分配一个标示符(而非 Hibernate 来生成),你可以使用 <literal>assigned</literal> 生成器。这种特殊的生成器会使用已经分配给对象的标识符属性的标识符值。 这个生成器使用一个自然键(natural key,有商业意义的列-译注)作为主键,而不是使用一个代理键( surrogate key,没有商业意义的列-译注)。这是没有指定 <literal><generator></literal> 元素时的默认行为。"
+#: basic_mapping.xml:1209
+#, fuzzy, no-c-format
+msgid ""
+"If you want the application to assign identifiers, as opposed to having "
+"Hibernate generate them, you can use the <literal>assigned</literal> "
+"generator. This special generator uses the identifier value already assigned "
+"to the object's identifier property. The generator is used when the primary "
+"key is a natural key instead of a surrogate key. This is the default "
+"behavior if you do not specify <classname>@GeneratedValue</classname> nor "
+"<literal><generator></literal> elements."
+msgstr ""
+"如果你需要应用程序分配一个标示符(而非 Hibernate 来生成),你可以使用 "
+"<literal>assigned</literal> 生成器。这种特殊的生成器会使用已经分配给对象的标"
+"识符属性的标识符值。 这个生成器使用一个自然键(natural key,有商业意义的列-"
+"译注)作为主键,而不是使用一个代理键( surrogate key,没有商业意义的列-译"
+"注)。这是没有指定 <literal><generator></literal> 元素时的默认行为。"
#. Tag: para
+#: basic_mapping.xml:1218
#, no-c-format
-msgid "The <literal>assigned</literal> generator makes Hibernate use <literal>unsaved-value=\"undefined\"</literal>. This forces Hibernate to go to the database to determine if an instance is transient or detached, unless there is a version or timestamp property, or you define <literal>Interceptor.isUnsaved()</literal>."
-msgstr "当选择 <literal>assigned</literal> 生成器时,除非有一个 version 或 timestamp 属性,或者你定义了 <literal>Interceptor.isUnsaved()</literal>,否则需要让 Hiberante 使用 <literal>unsaved-value=\"undefined\"</literal>,强制 Hibernatet 查询数据库来确定一个实例是瞬时的(transient) 还是脱管的(detached)。"
+msgid ""
+"The <literal>assigned</literal> generator makes Hibernate use "
+"<literal>unsaved-value=\"undefined\"</literal>. This forces Hibernate to go "
+"to the database to determine if an instance is transient or detached, unless "
+"there is a version or timestamp property, or you define <literal>Interceptor."
+"isUnsaved()</literal>."
+msgstr ""
+"当选择 <literal>assigned</literal> 生成器时,除非有一个 version 或 timestamp "
+"属性,或者你定义了 <literal>Interceptor.isUnsaved()</literal>,否则需要让 "
+"Hiberante 使用 <literal>unsaved-value=\"undefined\"</literal>,强制 "
+"Hibernatet 查询数据库来确定一个实例是瞬时的(transient) 还是脱管的"
+"(detached)。"
#. Tag: title
+#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "触发器实现的主键生成器(Primary keys assigned by triggers)"
#. Tag: para
+#: basic_mapping.xml:1228
#, no-c-format
-msgid "Hibernate does not generate DDL with triggers. It is for legacy schemas only."
+msgid ""
+"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
msgstr "仅仅用于遗留的 schema 中(Hibernate 不能用触发器生成 DDL)。"
+#. Tag: programlisting
+#: basic_mapping.xml:1231
+#, fuzzy, no-c-format
+msgid ""
+"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</"
+"param>\n"
+" </generator>\n"
+"</id>"
+msgstr ""
+"<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
+" <generator class=\"select\">\n"
+" <param name=\"key\">socialSecurityNumber</param>\n"
+" </generator>\n"
+"</id>]]>"
+
#. Tag: para
+#: basic_mapping.xml:1233
#, no-c-format
-msgid "In the above example, there is a unique valued property named <literal>socialSecurityNumber</literal>. It is defined by the class, as a natural key and a surrogate key named <literal>person_id</literal>, whose value is generated by a trigger."
-msgstr "在上面的例子中,类定义了一个命名为 <literal>socialSecurityNumber</literal> 的具有唯一值的属性,它是一个自然键(natural key),命名为 <literal>person_id</literal> 的代理键(surrogate key)的值由触发器生成。"
+msgid ""
+"In the above example, there is a unique valued property named "
+"<literal>socialSecurityNumber</literal>. It is defined by the class, as a "
+"natural key and a surrogate key named <literal>person_id</literal>, whose "
+"value is generated by a trigger."
+msgstr ""
+"在上面的例子中,类定义了一个命名为 <literal>socialSecurityNumber</literal> 的"
+"具有唯一值的属性,它是一个自然键(natural key),命名为 <literal>person_id</"
+"literal> 的代理键(surrogate key)的值由触发器生成。"
#. Tag: title
+#: basic_mapping.xml:1241
#, no-c-format
-msgid "Enhanced identifier generators"
-msgstr "增强的标识符生成器"
+msgid "Identity copy (foreign generator)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1243
#, no-c-format
-msgid "Starting with release 3.2.3, there are 2 new generators which represent a re-thinking of 2 different aspects of identifier generation. The first aspect is database portability; the second is optimization Optimization means that you do not have to query the database for every request for a new identifier value. These two new generators are intended to take the place of some of the named generators described above, starting in 3.3.x. However, they are included in the current releases and can be referenced by FQN."
-msgstr "从 3.2.3 版本开始,有两个代表不同标识符生成概念的新的生成器。第一个概念是数据库移植性;第二个是优化。优化表示你不需对每个新标识符的请求都查询数据库。从 3.3.x 开始,这两个新的生成器都是用来取代上面所述的生成器的。然而,它们也包括在当前版本里且可以由 FQN 进行引用。"
+msgid ""
+"Finally, you can ask Hibernate to copy the identifier from another "
+"associated entity. In the Hibernate jargon, it is known as a foreign "
+"generator but the JPA mapping reads better and is encouraged."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1248
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id @OneToOne\n"
+" @JoinColumn(name = \"person_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1250
+#, fuzzy, no-c-format
+msgid "Or alternatively"
+msgstr "其他元数据(Metadata)"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1252
#, no-c-format
-msgid "The first of these new generators is <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal> which is intended, firstly, as a replacement for the <literal>sequence</literal> generator and, secondly, as a better portability generator than <literal>native</literal>. This is because <literal>native</literal> generally chooses between <literal>identity</literal> and <literal>sequence</literal> which have largely different semantics that can cause subtle issues in applications eyeing portability. <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal>, however, achieves portability in a different manner. It chooses between a table or a sequence in the database to store its incrementing values, depending on the capabilities of the dialect being used. The difference between this and <literal>native</literal> is that table-based and sequence-based storage have the same exact semantic. In fact, sequences are exactly what Hibernate tries to emulate with!
its table-based generators. This generator has a number of configuration parameters:"
-msgstr "这些生成器的第一个是 <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal>,首先,它是作为 <literal>sequence</literal> 生成器的替代物,其次,它是比 <literal>native</literal> 具有更好移植性的生成器。这是因为 <literal>native</literal> 通常在 <literal>identity</literal> 和 <literal>sequence</literal> 之间选择,它有差别很大的 semantic,在移植时会导致潜在的问题。然而,<literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal> 以不同的方式实现移植性。它根据所使用的方言的能力,在数据库表或序列之间选择以存储其增量。这和 <literal>native</literal> 的区别是基于表或序列的存储具有恰好相同的 semantic。实际上,序列就是 Hibernate 试图用基于表的生成器来模拟的。这个生成器有如下的配置参数:"
+msgid ""
+"@Entity\n"
+"class MedicalHistory implements Serializable {\n"
+" @Id Integer id;\n"
+"\n"
+" @MapsId @OneToOne\n"
+" @JoinColumn(name = \"patient_id\")\n"
+" Person patient;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Person {\n"
+" @Id @GeneratedValue Integer id;\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1254
#, no-c-format
-msgid "<literal>sequence_name</literal> (optional, defaults to <literal>hibernate_sequence</literal>): the name of the sequence or table to be used."
-msgstr "<literal>sequence_name</literal>(可选 — 默认为 <literal>hibernate_sequence</literal>):序列或表的名字"
+msgid "In hbm.xml use the following approach:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1256
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"MedicalHistory\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">patient</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
+">\n"
+"</class>"
+msgstr ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+
+#. Tag: title
+#: basic_mapping.xml:1261
+#, no-c-format
+msgid "Enhanced identifier generators"
+msgstr "增强的标识符生成器"
+
#. Tag: para
+#: basic_mapping.xml:1263
#, no-c-format
-msgid "<literal>initial_value</literal> (optional, defaults to <literal>1</literal>): the initial value to be retrieved from the sequence/table. In sequence creation terms, this is analogous to the clause typically named \"STARTS WITH\"."
-msgstr "<literal>initial_value</literal>(可选,默认为 <literal>1</literal>):从序列/表里获取的初始值。按照序列创建的术语,这等同于子句 \"STARTS WITH\"。"
+msgid ""
+"Starting with release 3.2.3, there are 2 new generators which represent a re-"
+"thinking of 2 different aspects of identifier generation. The first aspect "
+"is database portability; the second is optimization Optimization means that "
+"you do not have to query the database for every request for a new identifier "
+"value. These two new generators are intended to take the place of some of "
+"the named generators described above, starting in 3.3.x. However, they are "
+"included in the current releases and can be referenced by FQN."
+msgstr ""
+"从 3.2.3 版本开始,有两个代表不同标识符生成概念的新的生成器。第一个概念是数据"
+"库移植性;第二个是优化。优化表示你不需对每个新标识符的请求都查询数据库。从 "
+"3.3.x 开始,这两个新的生成器都是用来取代上面所述的生成器的。然而,它们也包括"
+"在当前版本里且可以由 FQN 进行引用。"
#. Tag: para
+#: basic_mapping.xml:1272
#, no-c-format
-msgid "<literal>increment_size</literal> (optional - defaults to <literal>1</literal>): the value by which subsequent calls to the sequence/table should differ. In sequence creation terms, this is analogous to the clause typically named \"INCREMENT BY\"."
-msgstr "<literal>increment_size</literal>(可选 - 缺省为 <literal>1</literal>):对序列/表的调用应该区分的值。按照序列创建的术语,这等同于子句 \"INCREMENT BY\"。"
+msgid ""
+"The first of these new generators is <literal>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</literal> which is intended, firstly, as a "
+"replacement for the <literal>sequence</literal> generator and, secondly, as "
+"a better portability generator than <literal>native</literal>. This is "
+"because <literal>native</literal> generally chooses between "
+"<literal>identity</literal> and <literal>sequence</literal> which have "
+"largely different semantics that can cause subtle issues in applications "
+"eyeing portability. <literal>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</literal>, however, achieves portability in a "
+"different manner. It chooses between a table or a sequence in the database "
+"to store its incrementing values, depending on the capabilities of the "
+"dialect being used. The difference between this and <literal>native</"
+"literal> is that table-based and sequence-based storage have the same exact "
+"semantic. In fact, sequences are exactly what Hibernate tries to emulate "
+"with its table-based generators. This generator has a number of "
+"configuration parameters:"
+msgstr ""
+"这些生成器的第一个是 <literal>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</literal>,首先,它是作为 <literal>sequence</literal> "
+"生成器的替代物,其次,它是比 <literal>native</literal> 具有更好移植性的生成"
+"器。这是因为 <literal>native</literal> 通常在 <literal>identity</literal> 和 "
+"<literal>sequence</literal> 之间选择,它有差别很大的 semantic,在移植时会导致"
+"潜在的问题。然而,<literal>org.hibernate.id.enhanced.SequenceStyleGenerator</"
+"literal> 以不同的方式实现移植性。它根据所使用的方言的能力,在数据库表或序列之"
+"间选择以存储其增量。这和 <literal>native</literal> 的区别是基于表或序列的存储"
+"具有恰好相同的 semantic。实际上,序列就是 Hibernate 试图用基于表的生成器来模"
+"拟的。这个生成器有如下的配置参数:"
#. Tag: para
+#: basic_mapping.xml:1291
#, no-c-format
-msgid "<literal>force_table_use</literal> (optional - defaults to <literal>false</literal>): should we force the use of a table as the backing structure even though the dialect might support sequence?"
-msgstr "<literal>force_table_use</literal>(可选 - 缺省为 <literal>false</literal>):即使方言可能支持序列,是否也应该强制把表用作后台结构。"
+msgid ""
+"<literal>sequence_name</literal> (optional, defaults to "
+"<literal>hibernate_sequence</literal>): the name of the sequence or table to "
+"be used."
+msgstr ""
+"<literal>sequence_name</literal>(可选 — 默认为 <literal>hibernate_sequence</"
+"literal>):序列或表的名字"
#. Tag: para
+#: basic_mapping.xml:1297
#, no-c-format
-msgid "<literal>value_column</literal> (optional - defaults to <literal>next_val</literal>): only relevant for table structures, it is the name of the column on the table which is used to hold the value."
-msgstr "<literal>value_column</literal>(可选 - 缺省为 <literal>next_val</literal>):只和表结构相关,它是用于保存值的字段的名称。"
+msgid ""
+"<literal>initial_value</literal> (optional, defaults to <literal>1</"
+"literal>): the initial value to be retrieved from the sequence/table. In "
+"sequence creation terms, this is analogous to the clause typically named "
+"\"STARTS WITH\"."
+msgstr ""
+"<literal>initial_value</literal>(可选,默认为 <literal>1</literal>):从序"
+"列/表里获取的初始值。按照序列创建的术语,这等同于子句 \"STARTS WITH\"。"
#. Tag: para
+#: basic_mapping.xml:1304
#, no-c-format
-msgid "<literal>optimizer</literal> (optional - defaults to <literal>none</literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
-msgstr "<literal>optimizer</literal>(可选 — 默认是<literal>none</literal>):请参考 <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />。"
+msgid ""
+"<literal>increment_size</literal> (optional - defaults to <literal>1</"
+"literal>): the value by which subsequent calls to the sequence/table should "
+"differ. In sequence creation terms, this is analogous to the clause "
+"typically named \"INCREMENT BY\"."
+msgstr ""
+"<literal>increment_size</literal>(可选 - 缺省为 <literal>1</literal>):对序"
+"列/表的调用应该区分的值。按照序列创建的术语,这等同于子句 \"INCREMENT BY\"。"
#. Tag: para
+#: basic_mapping.xml:1312
#, no-c-format
-msgid "The second of these new generators is <literal>org.hibernate.id.enhanced.TableGenerator</literal>, which is intended, firstly, as a replacement for the <literal>table</literal> generator, even though it actually functions much more like <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal>, and secondly, as a re-implementation of <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal> that utilizes the notion of pluggable optimizers. Essentially this generator defines a table capable of holding a number of different increment values simultaneously by using multiple distinctly keyed rows. This generator has a number of configuration parameters:"
-msgstr "新生成器的第二个是 <literal>org.hibernate.id.enhanced.TableGenerator</literal>,它的目的首先是替代 <literal>table</literal> 生成器,即使它实际上比 <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal> 功能要强得多;其次,作为利用可插拔 optimizer 的 <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal> 的替代品。基本上这个生成器定义了一个可以利用多个不同的键值记录存储大量不同增量值的表。这个生成器有如下的配置参数:"
+msgid ""
+"<literal>force_table_use</literal> (optional - defaults to <literal>false</"
+"literal>): should we force the use of a table as the backing structure even "
+"though the dialect might support sequence?"
+msgstr ""
+"<literal>force_table_use</literal>(可选 - 缺省为 <literal>false</"
+"literal>):即使方言可能支持序列,是否也应该强制把表用作后台结构。"
#. Tag: para
+#: basic_mapping.xml:1319
#, no-c-format
-msgid "<literal>table_name</literal> (optional - defaults to <literal>hibernate_sequences</literal>): the name of the table to be used."
-msgstr "<literal>table_name</literal>(可选 — 默认是 <literal>hibernate_sequences</literal>):所用的表的名称。"
+msgid ""
+"<literal>value_column</literal> (optional - defaults to <literal>next_val</"
+"literal>): only relevant for table structures, it is the name of the column "
+"on the table which is used to hold the value."
+msgstr ""
+"<literal>value_column</literal>(可选 - 缺省为 <literal>next_val</"
+"literal>):只和表结构相关,它是用于保存值的字段的名称。"
#. Tag: para
+#: basic_mapping.xml:1326
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimizer</literal> (optional - defaults to <literal>none</"
+"literal>): See"
+msgstr ""
+"<literal>cascade</literal>(可选 — 默认是<literal>none</literal>):级联的类"
+"型。"
+
+#. Tag: para
+#: basic_mapping.xml:1332
#, no-c-format
-msgid "<literal>value_column_name</literal> (optional - defaults to <literal>next_val</literal>): the name of the column on the table that is used to hold the value."
-msgstr "<literal>value_column_name</literal>(可选 — 默认为 <literal>next_val</literal>):用于存储这些值的表的字段的名字。"
+msgid ""
+"The second of these new generators is <literal>org.hibernate.id.enhanced."
+"TableGenerator</literal>, which is intended, firstly, as a replacement for "
+"the <literal>table</literal> generator, even though it actually functions "
+"much more like <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</"
+"literal>, and secondly, as a re-implementation of <literal>org.hibernate.id."
+"MultipleHiLoPerTableGenerator</literal> that utilizes the notion of "
+"pluggable optimizers. Essentially this generator defines a table capable of "
+"holding a number of different increment values simultaneously by using "
+"multiple distinctly keyed rows. This generator has a number of configuration "
+"parameters:"
+msgstr ""
+"新生成器的第二个是 <literal>org.hibernate.id.enhanced.TableGenerator</"
+"literal>,它的目的首先是替代 <literal>table</literal> 生成器,即使它实际上比 "
+"<literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal> 功能要强得"
+"多;其次,作为利用可插拔 optimizer 的 <literal>org.hibernate.id."
+"MultipleHiLoPerTableGenerator</literal> 的替代品。基本上这个生成器定义了一个"
+"可以利用多个不同的键值记录存储大量不同增量值的表。这个生成器有如下的配置参"
+"数:"
#. Tag: para
+#: basic_mapping.xml:1345
#, no-c-format
-msgid "<literal>segment_column_name</literal> (optional - defaults to <literal>sequence_name</literal>): the name of the column on the table that is used to hold the \"segment key\". This is the value which identifies which increment value to use."
-msgstr "<literal>segment_column_name</literal>(可选,默认为 <literal>sequence_name</literal>):用于保存 \"segment key\" 的字段的名称。这是标识使用哪个增量值的值。"
+msgid ""
+"<literal>table_name</literal> (optional - defaults to "
+"<literal>hibernate_sequences</literal>): the name of the table to be used."
+msgstr ""
+"<literal>table_name</literal>(可选 — 默认是 <literal>hibernate_sequences</"
+"literal>):所用的表的名称。"
#. Tag: para
+#: basic_mapping.xml:1351
#, no-c-format
-msgid "<literal>segment_value</literal> (optional - defaults to <literal>default</literal>): The \"segment key\" value for the segment from which we want to pull increment values for this generator."
-msgstr "<literal>segment_value</literal>(可选,默认为 <literal>default</literal>):我们为这个生成器获取增量值的 segment 的 \"segment key\"。"
+msgid ""
+"<literal>value_column_name</literal> (optional - defaults to "
+"<literal>next_val</literal>): the name of the column on the table that is "
+"used to hold the value."
+msgstr ""
+"<literal>value_column_name</literal>(可选 — 默认为 <literal>next_val</"
+"literal>):用于存储这些值的表的字段的名字。"
#. Tag: para
+#: basic_mapping.xml:1357
#, no-c-format
-msgid "<literal>segment_value_length</literal> (optional - defaults to <literal>255</literal>): Used for schema generation; the column size to create this segment key column."
-msgstr "<literal>segment_value_length</literal>(可选 — 默认为 <literal>255</literal>):用于 schema 生成;创建 Segment Key 字段的字段大小。"
+msgid ""
+"<literal>segment_column_name</literal> (optional - defaults to "
+"<literal>sequence_name</literal>): the name of the column on the table that "
+"is used to hold the \"segment key\". This is the value which identifies "
+"which increment value to use."
+msgstr ""
+"<literal>segment_column_name</literal>(可选,默认为 <literal>sequence_name</"
+"literal>):用于保存 \"segment key\" 的字段的名称。这是标识使用哪个增量值的"
+"值。"
#. Tag: para
+#: basic_mapping.xml:1365
#, no-c-format
-msgid "<literal>initial_value</literal> (optional - defaults to <literal>1</literal>): The initial value to be retrieved from the table."
-msgstr "<literal>initial_value</literal>(可选 — 默认是 <literal>1</literal>):从表里获取的初始值。"
+msgid ""
+"<literal>segment_value</literal> (optional - defaults to <literal>default</"
+"literal>): The \"segment key\" value for the segment from which we want to "
+"pull increment values for this generator."
+msgstr ""
+"<literal>segment_value</literal>(可选,默认为 <literal>default</literal>):"
+"我们为这个生成器获取增量值的 segment 的 \"segment key\"。"
#. Tag: para
+#: basic_mapping.xml:1372
#, no-c-format
-msgid "<literal>increment_size</literal> (optional - defaults to <literal>1</literal>): The value by which subsequent calls to the table should differ."
-msgstr "<literal>increment_size</literal>(可选 — 默认是 <literal>1</literal>):对表随后的调用应该区分的值。"
+msgid ""
+"<literal>segment_value_length</literal> (optional - defaults to "
+"<literal>255</literal>): Used for schema generation; the column size to "
+"create this segment key column."
+msgstr ""
+"<literal>segment_value_length</literal>(可选 — 默认为 <literal>255</"
+"literal>):用于 schema 生成;创建 Segment Key 字段的字段大小。"
#. Tag: para
+#: basic_mapping.xml:1378
#, no-c-format
-msgid "<literal>optimizer</literal> (optional - defaults to <literal></literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />"
-msgstr "<literal>optimizer</literal>(可选 — 默认是 <literal> </literal>):请参考 <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />。"
+msgid ""
+"<literal>initial_value</literal> (optional - defaults to <literal>1</"
+"literal>): The initial value to be retrieved from the table."
+msgstr ""
+"<literal>initial_value</literal>(可选 — 默认是 <literal>1</literal>):从表"
+"里获取的初始值。"
+#. Tag: para
+#: basic_mapping.xml:1384
+#, no-c-format
+msgid ""
+"<literal>increment_size</literal> (optional - defaults to <literal>1</"
+"literal>): The value by which subsequent calls to the table should differ."
+msgstr ""
+"<literal>increment_size</literal>(可选 — 默认是 <literal>1</literal>):对表"
+"随后的调用应该区分的值。"
+
+#. Tag: para
+#: basic_mapping.xml:1390
+#, fuzzy, no-c-format
+msgid ""
+"<literal>optimizer</literal> (optional - defaults to <literal>??</literal>): "
+"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
+msgstr ""
+"<literal>optimizer</literal>(可选 — 默认是 <literal> </literal>):请参考 "
+"<xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />。"
+
#. Tag: title
+#: basic_mapping.xml:1397
#, no-c-format
msgid "Identifier generator optimization"
msgstr "标识符生成器的优化"
#. Tag: para
+#: basic_mapping.xml:1399
+#, fuzzy, no-c-format
+msgid ""
+"For identifier generators that store values in the database, it is "
+"inefficient for them to hit the database on each and every call to generate "
+"a new identifier value. Instead, you can group a bunch of them in memory and "
+"only hit the database when you have exhausted your in-memory value group. "
+"This is the role of the pluggable optimizers. Currently only the two "
+"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
+"support this operation."
+msgstr ""
+"对于在数据库里存储值的标识符生成器,生成新标识符时的每次调用都访问数据库是低"
+"效的。因此,你可以把它们在内存里分组并只有在快用光内存时才访问数据库。这是可"
+"插拔 optimizer 的任务。目前只有两个增强型的生成器支持这个操作(<xref linkend="
+"\"mapping-declaration-id-enhanced\"/>)。 "
+
+#. Tag: para
+#: basic_mapping.xml:1410
#, no-c-format
-msgid "For identifier generators that store values in the database, it is inefficient for them to hit the database on each and every call to generate a new identifier value. Instead, you can group a bunch of them in memory and only hit the database when you have exhausted your in-memory value group. This is the role of the pluggable optimizers. Currently only the two enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\" /> support this operation."
-msgstr "对于在数据库里存储值的标识符生成器,生成新标识符时的每次调用都访问数据库是低效的。因此,你可以把它们在内存里分组并只有在快用光内存时才访问数据库。这是可插拔 optimizer 的任务。目前只有两个增强型的生成器支持这个操作(<xref linkend=\"mapping-declaration-id-enhanced\"/>)。 "
+msgid ""
+"<literal>none</literal> (generally this is the default if no optimizer was "
+"specified): this will not perform any optimizations and hit the database for "
+"each and every request."
+msgstr ""
+"<literal>none</literal>(如果没有指定 optimizer,通常这是缺省配置):这不会执"
+"行任何优化,在每次请求时都访问数据库。"
#. Tag: para
+#: basic_mapping.xml:1417
#, no-c-format
-msgid "<literal>none</literal> (generally this is the default if no optimizer was specified): this will not perform any optimizations and hit the database for each and every request."
-msgstr "<literal>none</literal>(如果没有指定 optimizer,通常这是缺省配置):这不会执行任何优化,在每次请求时都访问数据库。"
+msgid ""
+"<literal>hilo</literal>: applies a hi/lo algorithm around the database "
+"retrieved values. The values from the database for this optimizer are "
+"expected to be sequential. The values retrieved from the database structure "
+"for this optimizer indicates the \"group number\". The "
+"<literal>increment_size</literal> is multiplied by that value in memory to "
+"define a group \"hi value\"."
+msgstr ""
+"<literal>hilo</literal>:对从数据库获取的值应用 hi/lo 算法。用于这个 "
+"optimizer 的从数据库获取的值应该是有序的。它们表明“组编号”。"
+"<literal>increment_size</literal> 将乘以内存里的值来定义组的“hi 值”。"
#. Tag: para
+#: basic_mapping.xml:1427
#, no-c-format
-msgid "<literal>hilo</literal>: applies a hi/lo algorithm around the database retrieved values. The values from the database for this optimizer are expected to be sequential. The values retrieved from the database structure for this optimizer indicates the \"group number\". The <literal>increment_size</literal> is multiplied by that value in memory to define a group \"hi value\"."
-msgstr "<literal>hilo</literal>:对从数据库获取的值应用 hi/lo 算法。用于这个 optimizer 的从数据库获取的值应该是有序的。它们表明“组编号”。<literal>increment_size</literal> 将乘以内存里的值来定义组的“hi 值”。"
+msgid ""
+"<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this "
+"optimizer attempts to minimize the number of hits to the database. Here, "
+"however, we simply store the starting value for the \"next group\" into the "
+"database structure rather than a sequential value in combination with an in-"
+"memory grouping algorithm. Here, <literal>increment_size</literal> refers to "
+"the values coming from the database."
+msgstr ""
+"<literal>pooled</literal>:和 <literal>hilo</literal> 一样,这个 optimizer 试"
+"图最小化对数据库的访问。然而,我们只是简单地把“下一组”的起始值而不是把序列值"
+"和分组算法的组合存入到数据库结构里。在这里,<literal>increment_size</"
+"literal> 表示数据库里的值。"
+#. Tag: title
+#: basic_mapping.xml:1441
+#, fuzzy, no-c-format
+msgid "Partial identifier generation"
+msgstr "增强的标识符生成器"
+
#. Tag: para
+#: basic_mapping.xml:1443
#, no-c-format
-msgid "<literal>pooled</literal>: as with the case of <literal>hilo</literal>, this optimizer attempts to minimize the number of hits to the database. Here, however, we simply store the starting value for the \"next group\" into the database structure rather than a sequential value in combination with an in-memory grouping algorithm. Here, <literal>increment_size</literal> refers to the values coming from the database."
-msgstr "<literal>pooled</literal>:和 <literal>hilo</literal> 一样,这个 optimizer 试图最小化对数据库的访问。然而,我们只是简单地把“下一组”的起始值而不是把序列值和分组算法的组合存入到数据库结构里。在这里,<literal>increment_size</literal> 表示数据库里的值。"
+msgid ""
+"Hibernate supports the automatic generation of some of the identifier "
+"properties. Simply use the <classname>@GeneratedValue</classname> annotation "
+"on one or several id properties."
+msgstr ""
+#. Tag: para
+#: basic_mapping.xml:1449
+#, no-c-format
+msgid ""
+"The Hibernate team has always felt such a construct as fundamentally wrong. "
+"Try hard to fix your data model before using this feature."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1454
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class CustomerInventory implements Serializable {\n"
+" @Id\n"
+" @TableGenerator(name = \"inventory\",\n"
+" table = \"U_SEQUENCES\",\n"
+" pkColumnName = \"S_ID\",\n"
+" valueColumnName = \"S_NEXTNUM\",\n"
+" pkColumnValue = \"inventory\",\n"
+" allocationSize = 1000)\n"
+" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
+"\")\n"
+" Integer id;\n"
+"\n"
+"\n"
+" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
+" Customer customer;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @Id\n"
+" private int id;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1456
+#, no-c-format
+msgid ""
+"You can also generate properties inside an <classname>@EmbeddedId</"
+"classname> class."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:1462
#, no-c-format
-msgid "composite-id"
-msgstr "composite-id"
+msgid "Optimistic locking properties (optional)"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1464
#, no-c-format
-msgid "A table with a composite key can be mapped with multiple properties of the class as identifier properties. The <literal><composite-id></literal> element accepts <literal><key-property></literal> property mappings and <literal><key-many-to-one></literal> mappings as child elements."
-msgstr "如果表使用联合主键,你可以映射类的多个属性为标识符属性。<literal><composite-id></literal> 元素接受 <literal><key-property></literal> 属性映射和 <literal><key-many-to-one></literal> 属性映射作为子元素。 "
+msgid ""
+"When using long transactions or conversations that span several database "
+"transactions, it is useful to store versioning data to ensure that if the "
+"same entity is updated by two conversations, the last to commit changes will "
+"be informed and not override the other conversation's work. It guarantees "
+"some isolation while still allowing for good scalability and works "
+"particularly well in read-often write-sometimes situations."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1472
#, no-c-format
-msgid "The persistent class <emphasis>must</emphasis> override <literal>equals()</literal> and <literal>hashCode()</literal> to implement composite identifier equality. It must also implement <literal>Serializable</literal>."
-msgstr "你的持久化类<emphasis>必须</emphasis>覆盖 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法,来实现组合的标识符的相等判断。实现 <literal>Serializable</literal> 接口也是必须的。"
+msgid "You can use two approaches: a dedicated version number or a timestamp."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1475
#, no-c-format
-msgid "Unfortunately, this approach means that a persistent object is its own identifier. There is no convenient \"handle\" other than the object itself. You must instantiate an instance of the persistent class itself and populate its identifier properties before you can <literal>load()</literal> the persistent state associated with a composite key. We call this approach an <emphasis>embedded</emphasis> composite identifier, and discourage it for serious applications."
-msgstr "不幸的是,这种组合关键字的方法意味着一个持久化类是它自己的标识。除了对象自己之外,没有什么方便的“把手”可用。你必须初始化持久化类的实例,填充它的标识符属性,再 <literal>load()</literal> 组合关键字关联的持久状态。我们把这种方法称为 <emphasis>embedded(嵌入式)</emphasis>的组合标识符,在重要的应用中不鼓励使用这种用法。 "
+msgid ""
+"A version or timestamp property should never be null for a detached "
+"instance. Hibernate will detect any instance with a null version or "
+"timestamp as transient, irrespective of what other <literal>unsaved-value</"
+"literal> strategies are specified. <emphasis>Declaring a nullable version or "
+"timestamp property is an easy way to avoid problems with transitive "
+"reattachment in Hibernate. It is especially useful for people using assigned "
+"identifiers or composite keys</emphasis>."
+msgstr ""
+"一个脱管(detached)实例的 version 或 timestamp 属性不能为空(null),因为 "
+"Hibernate 不管 <literal>unsaved-value</literal> 被指定为何种策略,它将任何属"
+"性为空的 version 或 timestamp 实例看作为瞬时(transient)实例。 <emphasis>避"
+"免 Hibernate 中的传递重附(transitive reattachment)问题的一个简单方法是 定义"
+"一个不能为空的 version 或 timestamp 属性,特别是在人们使用程序分配的标识符"
+"(assigned identifiers) 或复合主键时非常有用</emphasis>。"
+#. Tag: title
+#: basic_mapping.xml:1485
+#, no-c-format
+msgid "Version number"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1487
#, no-c-format
-msgid "A second approach is what we call a <emphasis>mapped</emphasis> composite identifier, where the identifier properties named inside the <literal><composite-id></literal> element are duplicated on both the persistent class and a separate identifier class."
-msgstr "第二种方法我们称为 <emphasis>mapped(映射式)</emphasis>组合标识符(mapped composite identifier),<literal><composite-id></literal> 元素中列出的标识属性不但在持久化类出现,还形成一个独立的标识符类。"
+msgid ""
+"You can add optimistic locking capability to an entity using the "
+"<literal>@Version</literal> annotation:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1490
+#, 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
+#: basic_mapping.xml:1492
#, no-c-format
-msgid "In this example, both the composite identifier class, <literal>MedicareId</literal>, and the entity class itself have properties named <literal>medicareNumber</literal> and <literal>dependent</literal>. The identifier class must override <literal>equals()</literal> and <literal>hashCode()</literal> and implement <literal>Serializable</literal>. The main disadvantage of this approach is code duplication."
-msgstr "在这个例子中,组合标识符类 <literal>MedicareId</literal> 和实体类都含有 <literal>medicareNumber</literal> 和 <literal>dependent</literal> 属性。标识符类必须重载 <literal>equals()</literal> 和 <literal>hashCode()</literal> 并且实现 <literal>Serializable</literal> 接口。这种方法的缺点是出现了明显的代码重复。"
+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
+#: basic_mapping.xml:1497
#, no-c-format
-msgid "The following attributes are used to specify a mapped composite identifier:"
-msgstr "下面列出的属性是用来指定一个映射式组合标识符的:"
+msgid ""
+"The version column may be a numeric. Hibernate supports any kind of type "
+"provided that you define and implement the appropriate "
+"<classname>UserVersionType</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1501
#, no-c-format
-msgid "<literal>mapped</literal> (optional - defaults to <literal>false</literal>): indicates that a mapped composite identifier is used, and that the contained property mappings refer to both the entity class and the composite identifier class."
-msgstr "<literal>mapped</literal>(可选,默认为 <literal>false</literal>):指明使用一个映射式组合标识符,其包含的属性映射同时在实体类和组合标识符类中出现。 "
+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>LockModeType."
+"OPTIMISTIC_FORCE_INCREMENT</literal> or <literal>LockModeType."
+"PESSIMISTIC_FORCE_INCREMENT</literal>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1507
#, no-c-format
-msgid "<literal>class</literal> (optional - but required for a mapped composite identifier): the class used as a composite identifier."
-msgstr "<literal>class</literal>(可选,但对映射式组合标识符必须指定):作为组合标识符类使用的类名。"
+msgid ""
+"If the version number is generated by the database (via a trigger for "
+"example), make sure to use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1511
#, no-c-format
-msgid "We will describe a third, even more convenient approach, where the composite identifier is implemented as a component class in <xref linkend=\"components-compositeid\" />. The attributes described below apply only to this alternative approach:"
-msgstr "在 <xref linkend=\"components-compositeid\"/> 一节中,我们会描述第三种方式,那就是把组合标识符实现为一个组件(component)类,这是更方便的方法。下面的属性仅对第三种方法有效: "
+msgid "To declare a version property in hbm.xml, use:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1530
+#, fuzzy, no-c-format
+msgid ""
+"<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+msgstr ""
+"<![CDATA[<version\n"
+" column=\"version_column\"\n"
+" name=\"propertyName\"\n"
+" type=\"typename\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|negative|undefined\"\n"
+" generated=\"never|always\"\n"
+" insert=\"true|false\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>]]>"
+
#. Tag: para
+#: basic_mapping.xml:1534
#, no-c-format
-msgid "<literal>name</literal> (optional - required for this approach): a property of component type that holds the composite identifier. Please see chapter 9 for more information."
-msgstr "<literal>name</literal>(可选,但对这种方法而言必须):包含此组件标识符的组件类型的名字(参阅第 9 章)。"
+msgid ""
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the column holding the version number."
+msgstr ""
+"<literal>column</literal>(可选 — 默认为属性名):指定持有版本号的字段名。 "
#. Tag: para
+#: basic_mapping.xml:1540
#, no-c-format
-msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses for accessing the property value."
-msgstr "<literal>access</literal>(可选 — 默认为 <literal>property</literal>):Hibernate 用来访问属性值的策略。 "
+msgid ""
+"<literal>name</literal>: the name of a property of the persistent class."
+msgstr "<literal>name</literal>:持久化类的属性名。 "
#. Tag: para
+#: basic_mapping.xml:1545
#, no-c-format
-msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the component class used as a composite identifier. Please see the next section for more information."
-msgstr "<literal>class</literal>(可选 — 默认会用反射来自动判定属性类型 ):用来作为组合标识符的组件类的类名(参阅下一节)。 "
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>integer</literal>): "
+"the type of the version number."
+msgstr ""
+"<literal>type</literal>(可选 — 默认是 <literal>integer</literal>):版本号的"
+"类型。 "
#. Tag: para
+#: basic_mapping.xml:1551
#, no-c-format
-msgid "The third approach, an <emphasis>identifier component</emphasis>, is recommended for almost all applications."
-msgstr "第三种方式,被称为 <emphasis>identifier component(标识符组件)</emphasis>是我们对几乎所有应用都推荐使用的方式。 "
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses to access the property value."
+msgstr ""
+"<literal>access</literal>(可选 — 默认为 <literal>property</literal>):"
+"Hibernate 用来访问属性值的策略。 "
+#. Tag: para
+#: basic_mapping.xml:1557
+#, no-c-format
+msgid ""
+"<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</"
+"literal>): a version property value that indicates that an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session. <literal>Undefined</literal> "
+"specifies that the identifier property value should be used."
+msgstr ""
+"<literal>unsaved-value</literal>(可选 — 默认是 <literal>undefined</"
+"literal>):用于标明某个实例时刚刚被实例化的(尚未保存)版本属性值,依靠这个"
+"值就可以把这种情况 和已经在先前的 session 中保存或装载的脱管(detached)实例"
+"区分开来。(<literal>undefined</literal> 指明应被使用的标识属性值。) "
+
+#. Tag: para
+#: basic_mapping.xml:1567
+#, no-c-format
+msgid ""
+"<literal>generated</literal> (optional - defaults to <literal>never</"
+"literal>): specifies that this version property value is generated by the "
+"database. See the discussion of <link linkend=\"mapping-generated"
+"\">generated properties</link> for more information."
+msgstr ""
+"<literal>generated</literal>(可选 — 默认是 <literal>never</literal>):表明"
+"此版本属性值是否实际上是由数据库生成的。请参阅 <link linkend=\"mapping-"
+"generated\">generated properties</link> 部分的讨论。 "
+
+#. Tag: para
+#: basic_mapping.xml:1575
+#, no-c-format
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"specifies whether the version column should be included in SQL insert "
+"statements. It can be set to <literal>false</literal> if the database column "
+"is defined with a default value of <literal>0</literal>."
+msgstr ""
+"<literal>insert</literal>(可选 — 默认是 <literal>true</literal>):表明此版"
+"本列应该包含在 SQL 插入语句中。只有当数据库字段有默认值 <literal>0</literal> "
+"的时候,才可以设置为 <literal>false</literal>。 "
+
#. Tag: title
+#: basic_mapping.xml:1586
+#, fuzzy, no-c-format
+msgid "Timestamp"
+msgstr "timestamp(可选) "
+
+#. Tag: para
+#: basic_mapping.xml:1588
+#, fuzzy, no-c-format
+msgid ""
+"Alternatively, you can use a timestamp. Timestamps are a less safe "
+"implementation of optimistic locking. However, sometimes the application "
+"might use the timestamps in other ways."
+msgstr ""
+"可选的 <literal><timestamp></literal> 元素指明了表中包含时间戳数据。这"
+"用来作为版本的替代。时间戳本质上是一种对乐观锁定的一种不是特别安全的实现。当"
+"然,有时候应用程序可能在其他方面使用时间戳。 "
+
+#. Tag: para
+#: basic_mapping.xml:1592
#, no-c-format
-msgid "Discriminator"
-msgstr "鉴别器(discriminator) "
+msgid ""
+"Simply mark a property of type <classname>Date</classname> or "
+"<classname>Calendar</classname> as <classname>@Version</classname>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1596
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" public Date getLastUpdate() { ... }\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1598
#, no-c-format
-msgid "The <literal><discriminator></literal> element is required for polymorphic persistence using the table-per-class-hierarchy mapping strategy. It declares a discriminator column of the table. The discriminator column contains marker values that tell the persistence layer what subclass to instantiate for a particular row. A restricted set of types can be used: <literal>string</literal>, <literal>character</literal>, <literal>integer</literal>, <literal>byte</literal>, <literal>short</literal>, <literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</literal>."
-msgstr "在\"一棵对象继承树对应一个表\"的策略中,<literal><discriminator></literal> 元素是必需的,它定义了表的鉴别器字段。鉴别器字段包含标志值,用于告知持久化层应该为某个特定的行创建哪一个子类的实例。如下这些受到限制的类型可以使用:<literal>string</literal>、<literal>character</literal>、<literal>integer</literal>、<literal>byte</literal>、<literal>short</literal>、<literal>boolean</literal>、<literal>yes_no</literal>、<literal>true_false</literal>。"
+msgid ""
+"Like version numbers, the timestamp can be generated by the database instead "
+"of Hibernate. To do that, use <code>@org.hibernate.annotations.Generated"
+"(GenerationTime.ALWAYS).</code>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1602
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><timestamp></literal> element:"
+msgstr "例如,如果我们有如下的 <literal><properties></literal> 映射:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1620
+#, fuzzy, no-c-format
+msgid ""
+"<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>"
+msgstr ""
+"<![CDATA[<timestamp\n"
+" column=\"timestamp_column\"\n"
+" name=\"propertyName\"\n"
+" access=\"field|property|ClassName\"\n"
+" unsaved-value=\"null|undefined\"\n"
+" source=\"vm|db\"\n"
+" generated=\"never|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+"/>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:1624
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to <literal>class</literal>): the name of the discriminator column."
-msgstr "<literal>column</literal>(可选 — 默认为 <literal>class</literal>)discriminator 器字段的名字。"
+msgid ""
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of a column holding the timestamp."
+msgstr ""
+"<literal>column</literal>(可选 — 默认为属性名):存有时间戳的字段名。 "
#. Tag: para
+#: basic_mapping.xml:1630
#, no-c-format
-msgid "<literal>type</literal> (optional - defaults to <literal>string</literal>): a name that indicates the Hibernate type"
-msgstr "<literal>type</literal>(可选 — 默认为 <literal>string</literal>)一个 Hibernate 字段类型的名字 "
+msgid ""
+"<literal>name</literal>: the name of a JavaBeans style property of Java type "
+"<literal>Date</literal> or <literal>Timestamp</literal> of the persistent "
+"class."
+msgstr ""
+"<literal>name</literal>:在持久化类中的 JavaBeans 风格的属性名,其 Java 类型"
+"是 <literal>Date</literal> 或者 <literal>Timestamp</literal> 的。 "
#. Tag: para
+#: basic_mapping.xml:1636 basic_mapping.xml:2163 basic_mapping.xml:2380
+#: basic_mapping.xml:3226 basic_mapping.xml:3420 basic_mapping.xml:3593
#, no-c-format
-msgid "<literal>force</literal> (optional - defaults to <literal>false</literal>): \"forces\" Hibernate to specify the allowed discriminator values, even when retrieving all instances of the root class."
-msgstr "<literal>force(强制)</literal>(可选 — 默认为 <literal>false</literal>)\"强制\" Hibernate 指定允许的鉴别器值,即使当取得的所有实例都是根类的。 "
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the property value."
+msgstr ""
+"<literal>access</literal>(可选 — 默认为 <literal>property</literal>):"
+"Hibernate 用来访问属性值的策略。 "
#. Tag: para
+#: basic_mapping.xml:1642
#, no-c-format
-msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>): set this to <literal>false</literal> if your discriminator column is also part of a mapped composite identifier. It tells Hibernate not to include the column in SQL <literal>INSERTs</literal>."
-msgstr "<literal>insert</literal>(可选 - 默认为<literal>true</literal>)如果你的鉴别器字段也是映射为复合标识(composite identifier)的一部分,则需将这个值设为 <literal>false</literal>。(告诉 Hibernate 在做 SQL <literal>INSERT</literal> 时不包含该列) "
+msgid ""
+"<literal>unsaved-value</literal> (optional - defaults to <literal>null</"
+"literal>): a version property value that indicates that an instance is newly "
+"instantiated (unsaved), distinguishing it from detached instances that were "
+"saved or loaded in a previous session. <literal>Undefined</literal> "
+"specifies that the identifier property value should be used."
+msgstr ""
+"<literal>unsaved-value</literal>(可选 — 默认是 <literal>null</literal>):用"
+"于标明某个实例时刚刚被实例化的(尚未保存)版本属性值,依靠这个值就可以把这种"
+"情况和已经在先前的 session 中保存或装载的脱管(detached)实例区分开来。"
+"(<literal>undefined</literal> 指明使用标识属性值进行这种判断。) "
#. Tag: para
+#: basic_mapping.xml:1652
#, no-c-format
-msgid "<literal>formula</literal> (optional): an arbitrary SQL expression that is executed when a type has to be evaluated. It allows content-based discrimination."
-msgstr "<literal>formula</literal>(可选)一个 SQL 表达式,在类型判断(判断是父类还是具体子类 — 译注)时执行。可用于基于内容的鉴别器。 "
+msgid ""
+"<literal>source</literal> (optional - defaults to <literal>vm</literal>): "
+"Where should Hibernate retrieve the timestamp value from? From the database, "
+"or from the current JVM? Database-based timestamps incur an overhead because "
+"Hibernate must hit the database in order to determine the \"next value\". It "
+"is safer to use in clustered environments. Not all <literal>Dialects</"
+"literal> are known to support the retrieval of the database's current "
+"timestamp. Others may also be unsafe for usage in locking due to lack of "
+"precision (Oracle 8, for example)."
+msgstr ""
+"<literal>source</literal>(可选 — 默认是 <literal>vm</literal>):Hibernate "
+"如何才能获取到时间戳的值呢?从数据库,还是当前 JVM?从数据库获取会带来一些负"
+"担,因为 Hibernate 必须访问数据库来获得“下一个值”,但是在集群环境中会更安全"
+"些。还要注意,并不是所有的 <literal>Dialect(方言)</literal>都支持获得数据库"
+"的当前时间戳的,而支持的数据库中又有一部分因为精度不足,用于锁定是不安全的"
+"(例如 Oracle 8)。 "
#. Tag: para
+#: basic_mapping.xml:1665
#, no-c-format
-msgid "Actual values of the discriminator column are specified by the <literal>discriminator-value</literal> attribute of the <literal><class></literal> and <literal><subclass></literal> elements."
-msgstr "鉴别器字段的实际值是根据 <literal><class></literal> 和 <literal><subclass></literal> 元素中的 <literal>discriminator-value</literal> 属性得来的。"
+msgid ""
+"<literal>generated</literal> (optional - defaults to <literal>never</"
+"literal>): specifies that this timestamp property value is actually "
+"generated by the database. See the discussion of <link linkend=\"mapping-"
+"generated\">generated properties</link> for more information."
+msgstr ""
+"<literal>generated</literal>(可选 - 默认是 <literal>never</literal>):指出"
+"时间戳值是否实际上是由数据库生成的。请参阅 <link linkend=\"mapping-generated"
+"\">generated properties</link> 的讨论。 "
+#. Tag: title
+#: basic_mapping.xml:1675
+#, no-c-format
+msgid "Note"
+msgstr "注意"
+
#. Tag: para
+#: basic_mapping.xml:1677
#, no-c-format
-msgid "The <literal>force</literal> attribute is only useful if the table contains rows with \"extra\" discriminator values that are not mapped to a persistent class. This will not usually be the case."
-msgstr "<literal>force</literal> 属性仅仅在这种情况下有用的:表中包含没有被映射到持久化类的附加辨别器值。这种情况不会经常遇到。 "
+msgid ""
+"<literal><Timestamp></literal> is equivalent to <literal><version "
+"type=\"timestamp\"></literal>. And <literal><timestamp source=\"db"
+"\"></literal> is equivalent to <literal><version type=\"dbtimestamp"
+"\"></literal>"
+msgstr ""
+"注意,<literal><timestamp></literal> 和 <literal><version type="
+"\"timestamp\"></literal> 是等价的。并且 <literal><timestamp source=\"db"
+"\"></literal> 和 <literal><version type=\"dbtimestamp\"></literal> "
+"是等价的。 "
+#. Tag: title
+#: basic_mapping.xml:1686
+#, no-c-format
+msgid "Property"
+msgstr "Property"
+
#. Tag: para
+#: basic_mapping.xml:1688
#, no-c-format
-msgid "The <literal>formula</literal> attribute allows you to declare an arbitrary SQL expression that will be used to evaluate the type of a row. For example:"
-msgstr "使用 <literal>formula</literal> 属性你可以定义一个 SQL 表达式,用来判断一行数据的类型。"
+msgid ""
+"You need to decide which property needs to be made persistent in a given "
+"entity. This differs slightly between the annotation driven metadata and the "
+"hbm.xml files."
+msgstr ""
#. Tag: title
+#: basic_mapping.xml:1693
#, no-c-format
-msgid "Version (optional)"
-msgstr "版本(version)(可选) "
+msgid "Property mapping with annotations"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1695
#, no-c-format
-msgid "The <literal><version></literal> element is optional and indicates that the table contains versioned data. This is particularly useful if you plan to use <emphasis>long transactions</emphasis>. See below for more information:"
-msgstr "<literal><version></literal> 元素是可选的,表明表中包含附带版本信息的数据。这在你准备使用<emphasis> 长事务(long transactions)</emphasis>的时候特别有用。下面是更多信息:"
+msgid ""
+"In the annotations world, every non static non transient property (field or "
+"method depending on the access type) of an entity 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."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1702
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of the column holding the version number."
-msgstr "<literal>column</literal>(可选 — 默认为属性名):指定持有版本号的字段名。 "
+msgid ""
+"The <literal>@Basic</literal> annotation allows you to declare the fetching "
+"strategy for a property. If set to <literal>LAZY</literal>, specifies that "
+"this property should be fetched lazily when the instance variable is first "
+"accessed. It requires build-time bytecode instrumentation, if your classes "
+"are not instrumented, property level lazy loading is silently ignored. The "
+"default is <literal>EAGER</literal>. You can also mark a property as not "
+"optional thanks to the <classname>@Basic.optional</classname> attribute. "
+"This will ensure that the underlying column are not nullable (if possible). "
+"Note that a better approach is to use the <classname>@NotNull</classname> "
+"annotation of the Bean Validation specification."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1715
#, no-c-format
-msgid "<literal>name</literal>: the name of a property of the persistent class."
-msgstr "<literal>name</literal>:持久化类的属性名。 "
+msgid "Let's look at a few examples:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1717
+#, 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"
+"@Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property \n"
+"\n"
+"@Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1719
#, no-c-format
-msgid "<literal>type</literal> (optional - defaults to <literal>integer</literal>): the type of the version number."
-msgstr "<literal>type</literal>(可选 — 默认是 <literal>integer</literal>):版本号的类型。 "
+msgid ""
+"<literal>counter</literal>, a transient field, and <literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and will be "
+"ignored by the Hibernate. <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). The recommended alternative is to "
+"use the projection capability of JP-QL (Java Persistence Query Language) or "
+"Criteria queries."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1732
#, no-c-format
-msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses to access the property value."
-msgstr "<literal>access</literal>(可选 — 默认为 <literal>property</literal>):Hibernate 用来访问属性值的策略。 "
+msgid ""
+"JPA support property mapping of all basic types supported by Hibernate (all "
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations supports 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 overridden through the <literal>@Enumerated</literal> "
+"annotation as shown in the <literal>note</literal> property example."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1742
#, no-c-format
-msgid "<literal>unsaved-value</literal> (optional - defaults to <literal>undefined</literal>): a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. <literal>Undefined</literal> specifies that the identifier property value should be used."
-msgstr "<literal>unsaved-value</literal>(可选 — 默认是 <literal>undefined</literal>):用于标明某个实例时刚刚被实例化的(尚未保存)版本属性值,依靠这个值就可以把这种情况 和已经在先前的 session 中保存或装载的脱管(detached)实例区分开来。(<literal>undefined</literal> 指明应被使用的标识属性值。) "
+msgid ""
+"In plain Java APIs, the temporal precision of time 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
+#: basic_mapping.xml:1750
#, no-c-format
-msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this version property value is generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
-msgstr "<literal>generated</literal>(可选 — 默认是 <literal>never</literal>):表明此版本属性值是否实际上是由数据库生成的。请参阅 <link linkend=\"mapping-generated\">generated properties</link> 部分的讨论。 "
+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 <classname>Serializable</classname> type "
+"will be persisted in a Blob."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:1759
+#, 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
+#: basic_mapping.xml:1761
#, no-c-format
-msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>): specifies whether the version column should be included in SQL insert statements. It can be set to <literal>false</literal> if the database column is defined with a default value of <literal>0</literal>."
-msgstr "<literal>insert</literal>(可选 — 默认是 <literal>true</literal>):表明此版本列应该包含在 SQL 插入语句中。只有当数据库字段有默认值 <literal>0</literal> 的时候,才可以设置为 <literal>false</literal>。 "
+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
+#: basic_mapping.xml:1768
+#, no-c-format
+msgid "Type"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:1770
#, no-c-format
-msgid "Version numbers can be of Hibernate type <literal>long</literal>, <literal>integer</literal>, <literal>short</literal>, <literal>timestamp</literal> or <literal>calendar</literal>."
-msgstr "版本号必须是以下类型:<literal>long</literal>、<literal>integer</literal>、<literal>short</literal>、<literal>timestamp</literal> 或者 <literal>calendar</literal>。"
+msgid ""
+"You can also manually specify a type using the <literal>@org.hibernate."
+"annotations.Type</literal> and some parameters if needed. <classname>@Type."
+"type</classname> could be:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1777 basic_mapping.xml:2209
#, no-c-format
-msgid "A version or timestamp property should never be null for a detached instance. Hibernate will detect any instance with a null version or timestamp as transient, irrespective of what other <literal>unsaved-value</literal> strategies are specified. <emphasis>Declaring a nullable version or timestamp property is an easy way to avoid problems with transitive reattachment in Hibernate. It is especially useful for people using assigned identifiers or composite keys</emphasis>."
-msgstr "一个脱管(detached)实例的 version 或 timestamp 属性不能为空(null),因为 Hibernate 不管 <literal>unsaved-value</literal> 被指定为何种策略,它将任何属性为空的 version 或 timestamp 实例看作为瞬时(transient)实例。 <emphasis>避免 Hibernate 中的传递重附(transitive reattachment)问题的一个简单方法是 定义一个不能为空的 version 或 timestamp 属性,特别是在人们使用程序分配的标识符(assigned identifiers) 或复合主键时非常有用</emphasis>。"
+msgid ""
+"The name of a Hibernate basic type: <literal>integer, string, character, "
+"date, timestamp, float, binary, serializable, object, blob</literal> etc."
+msgstr ""
+"Hibernate 基本类型名(比如:<literal>integer, string, character,date, "
+"timestamp, float, binary, serializable, object, blob</literal>)。 "
+#. Tag: para
+#: basic_mapping.xml:1783 basic_mapping.xml:2215
+#, no-c-format
+msgid ""
+"The name of a Java class with a default basic type: <literal>int, float, "
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal> etc."
+msgstr ""
+"一个 Java 类的名字,这个类属于一种默认基础类型(比如:<literal>int, float,"
+"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
+"literal>)。 "
+
+#. Tag: para
+#: basic_mapping.xml:1789 basic_mapping.xml:2221
+#, no-c-format
+msgid "The name of a serializable Java class."
+msgstr "一个可以序列化的 Java 类的名字。"
+
+#. Tag: para
+#: basic_mapping.xml:1793 basic_mapping.xml:2225
+#, no-c-format
+msgid ""
+"The class name of a custom type: <literal>com.illflow.type.MyCustomType</"
+"literal> etc."
+msgstr ""
+"一个自定义类型的类的名字。(比如:<literal>com.illflow.type.MyCustomType</"
+"literal>)。 "
+
+#. Tag: para
+#: basic_mapping.xml:1798
+#, fuzzy, no-c-format
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4."
+msgstr ""
+"如果你没有指定类型,Hibernarte 会使用反射来得到这个名字的属性,以此来猜测正确"
+"的 Hibernate 类型。Hibernate 会按照规则 2,3,4 的顺序对属性读取器(getter方"
+"法)的返回类进行解释。然而,这还不够。 在某些情况下你仍然需要 <literal>type</"
+"literal> 属性。(比如,为了区别<literal>Hibernate.DATE</literal> 和"
+"<literal>Hibernate.TIMESTAMP</literal>,或者为了指定一个自定义类型。) "
+
+#. Tag: para
+#: basic_mapping.xml:1803
+#, no-c-format
+msgid ""
+"<literal>@org.hibernate.annotations.TypeDef</literal> and <literal>@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 global for the session factory (even when "
+"defined at the class level). If the type is used on a single entity, you can "
+"place the definition on the entity itself. Otherwise, it is recommended to "
+"place the definition at the package level. In the example below, when "
+"Hibernate encounters a property of class <literal>PhoneNumer</literal>, it "
+"delegates the persistence strategy to the custom mapping type "
+"<literal>PhoneNumberType</literal>. However, properties belonging to other "
+"classes, too, can delegate their persistence strategy to "
+"<literal>PhoneNumberType</literal>, by explicitly using the <literal>@Type</"
+"literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1819
+#, 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
+#: basic_mapping.xml:1824
+#, no-c-format
+msgid ""
+"@TypeDef(\n"
+" name = \"phoneNumber\",\n"
+" defaultForType = PhoneNumber.class,\n"
+" typeClass = PhoneNumberType.class\n"
+")\n"
+"\n"
+"@Entity\n"
+"public class ContactDetails {\n"
+" [...]\n"
+" private PhoneNumber localPhoneNumber;\n"
+" @Type(type=\"phoneNumber\")\n"
+" private OverseasPhoneNumber overseasPhoneNumber;\n"
+" [...]\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1826
+#, no-c-format
+msgid ""
+"The following example shows the usage of the <literal>parameters</literal> "
+"attribute to customize the TypeDef."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1830
+#, 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
+#: basic_mapping.xml:1832
+#, 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
+#: basic_mapping.xml:1836
+#, no-c-format
+msgid ""
+"@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
+#: basic_mapping.xml:1840
#, no-c-format
-msgid "Timestamp (optional)"
-msgstr "timestamp(可选) "
+msgid "Access type"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1842
#, no-c-format
-msgid "The optional <literal><timestamp></literal> element indicates that the table contains timestamped data. This provides an alternative to versioning. Timestamps are a less safe implementation of optimistic locking. However, sometimes the application might use the timestamps in other ways."
-msgstr "可选的 <literal><timestamp></literal> 元素指明了表中包含时间戳数据。这用来作为版本的替代。时间戳本质上是一种对乐观锁定的一种不是特别安全的实现。当然,有时候应用程序可能在其他方面使用时间戳。 "
+msgid ""
+"By default the access type of a class hierarchy is defined by the position "
+"of the <classname>@Id</classname> or <classname>@EmbeddedId</classname> "
+"annotations. If these annotations are on a field, then only fields are "
+"considered for persistence and the state is accessed via the field. If there "
+"annotations are on a getter, then only the getters are considered for "
+"persistence and the state is accessed via the getter/setter. That works well "
+"in practice and is the recommended approach."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1850
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of a column holding the timestamp."
-msgstr "<literal>column</literal>(可选 — 默认为属性名):存有时间戳的字段名。 "
+msgid ""
+"The placement of annotations within a class hierarchy has to be consistent "
+"(either field or on property) to be able to determine the default access "
+"type. It is recommended to stick to one single annotation placement strategy "
+"throughout your whole application."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1857
#, no-c-format
-msgid "<literal>name</literal>: the name of a JavaBeans style property of Java type <literal>Date</literal> or <literal>Timestamp</literal> of the persistent class."
-msgstr "<literal>name</literal>:在持久化类中的 JavaBeans 风格的属性名,其 Java 类型是 <literal>Date</literal> 或者 <literal>Timestamp</literal> 的。 "
+msgid "However in some situations, you need to:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1861
#, no-c-format
-msgid "<literal>unsaved-value</literal> (optional - defaults to <literal>null</literal>): a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. <literal>Undefined</literal> specifies that the identifier property value should be used."
-msgstr "<literal>unsaved-value</literal>(可选 — 默认是 <literal>null</literal>):用于标明某个实例时刚刚被实例化的(尚未保存)版本属性值,依靠这个值就可以把这种情况和已经在先前的 session 中保存或装载的脱管(detached)实例区分开来。(<literal>undefined</literal> 指明使用标识属性值进行这种判断。) "
+msgid "force the access type of the entity hierarchy"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1865
#, no-c-format
-msgid "<literal>source</literal> (optional - defaults to <literal>vm</literal>): Where should Hibernate retrieve the timestamp value from? From the database, or from the current JVM? Database-based timestamps incur an overhead because Hibernate must hit the database in order to determine the \"next value\". It is safer to use in clustered environments. Not all <literal>Dialects</literal> are known to support the retrieval of the database's current timestamp. Others may also be unsafe for usage in locking due to lack of precision (Oracle 8, for example)."
-msgstr "<literal>source</literal>(可选 — 默认是 <literal>vm</literal>):Hibernate 如何才能获取到时间戳的值呢?从数据库,还是当前 JVM?从数据库获取会带来一些负担,因为 Hibernate 必须访问数据库来获得“下一个值”,但是在集群环境中会更安全些。还要注意,并不是所有的 <literal>Dialect(方言)</literal>都支持获得数据库的当前时间戳的,而支持的数据库中又有一部分因为精度不足,用于锁定是不安全的(例如 Oracle 8)。 "
+msgid "override the access type of a specific entity in the class hierarchy"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1870
#, no-c-format
-msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this timestamp property value is actually generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
-msgstr "<literal>generated</literal>(可选 - 默认是 <literal>never</literal>):指出时间戳值是否实际上是由数据库生成的。请参阅 <link linkend=\"mapping-generated\">generated properties</link> 的讨论。 "
+msgid "override the access type of an embeddable type"
+msgstr ""
+#. Tag: para
+#: basic_mapping.xml:1874
+#, no-c-format
+msgid ""
+"The best use case is an embeddable class used by several entities that might "
+"not use the same access type. In this case it is better to force the access "
+"type at the embeddable class level."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1879
+#, no-c-format
+msgid ""
+"To force the access type on a given class, use the <classname>@Access</"
+"classname> annotation as showed below:"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" @Embedded private Address address;\n"
+" public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class User {\n"
+" private Long id;\n"
+" @Id public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+"\n"
+" private Address address;\n"
+" @Embedded public Address getAddress() { return address; }\n"
+" public void setAddress() { this.address = address; }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"@Access(AcessType.PROPERTY)\n"
+"public class Address {\n"
+" private String street1;\n"
+" public String getStreet1() { return street1; }\n"
+" public void setStreet1() { this.street1 = street1; }\n"
+"\n"
+" private hashCode; //not persistent\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1884
+#, no-c-format
+msgid ""
+"You can also override the access type of a single property while keeping the "
+"other properties standard."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:1887
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Order {\n"
+" @Id private Long id;\n"
+" public Long getId() { return id; }\n"
+" public void setId(Long id) { this.id = id; }\n"
+" @Transient private String userId;\n"
+" @Transient private String orderId;\n"
+"\n"
+" @Access(AccessType.PROPERTY)\n"
+" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
+" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1889
+#, no-c-format
+msgid ""
+"In this example, the default access type is <classname>FIELD</classname> "
+"except for the <literal>orderNumber</literal> property. Note that the "
+"corresponding field, if any must be marked as <classname>@Transient</"
+"classname> or <code>transient</code>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:1896
#, no-c-format
-msgid "Note"
-msgstr "注意"
+msgid "@org.hibernate.annotations.AccessType"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1898
#, no-c-format
-msgid "<literal><Timestamp></literal> is equivalent to <literal><version type=\"timestamp\"></literal>. And <literal><timestamp source=\"db\"></literal> is equivalent to <literal><version type=\"dbtimestamp\"></literal>"
-msgstr "注意,<literal><timestamp></literal> 和 <literal><version type=\"timestamp\"></literal> 是等价的。并且 <literal><timestamp source=\"db\"></literal> 和 <literal><version type=\"dbtimestamp\"></literal> 是等价的。 "
+msgid ""
+"The annotation <classname>@org.hibernate.annotations.AccessType</classname> "
+"should be considered deprecated for FIELD and PROPERTY access. It is still "
+"useful however if you need to use a custom access type."
+msgstr ""
#. Tag: title
+#: basic_mapping.xml:1907
#, no-c-format
-msgid "Property"
-msgstr "Property"
+msgid "Optimistic lock"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:1909
#, no-c-format
-msgid "The <literal><property></literal> element declares a persistent JavaBean style property of the class."
-msgstr "<literal><property></literal> 元素为类定义了一个持久化的、JavaBean 风格的属性。 "
+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
+#: basic_mapping.xml:1914
#, no-c-format
-msgid "<literal>name</literal>: the name of the property, with an initial lowercase letter."
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:1919
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1921
+#, 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 JPA specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1929
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:1933
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "<literal>assigned</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1937
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "<literal>string</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1941
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "<literal>hilo</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:1945
+#, fuzzy, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "<literal>serializable</literal>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:1949
+#, 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
+#: basic_mapping.xml:1951
+#, 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
+#: basic_mapping.xml:1956
+#, 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
+#: basic_mapping.xml:1983
+#, 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
+#: basic_mapping.xml:1987
+#, fuzzy, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the property "
+"name)"
+msgstr "<literal>name</literal>(可选):标识属性的名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:1992
+#, fuzzy, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal>(可选):使用 DDL 为该字段添加唯一的约束。同样,允"
+"许它作为 <literal>property-ref</literal> 引用的目标。 "
+
+#. Tag: para
+#: basic_mapping.xml:1997
+#, fuzzy, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable (default "
+"true)."
+msgstr "<literal>name</literal>(可选):标识属性的名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:2002
+#, fuzzy, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column will be "
+"part of the insert statement (default true)"
+msgstr "<literal>name</literal>(可选):标识属性的名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:2008
+#, fuzzy, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will be "
+"part of the update statement (default true)"
+msgstr "<literal>catalog</literal>(可选):数据库 catalog 的名称。 "
+
+#. Tag: para
+#: basic_mapping.xml:2014
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL "
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2020
+#, fuzzy, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default "
+"primary table)"
+msgstr "<literal>catalog</literal>(可选):数据库 catalog 的名称。 "
+
+#. Tag: para
+#: basic_mapping.xml:2025
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional): column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2030
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional): column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2035
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional): column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2043
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2045
+#, 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
+#: basic_mapping.xml:2051
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2053
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2058
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2060
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2063
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2068
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2073
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>Serializable</"
+"classname>, it is mapped as <classname>@Basic</classname> in a column "
+"holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2080
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is <classname>java.sql.Clob</"
+"classname> or <classname>java.sql.Blob</classname>, it is mapped as "
+"<classname>@Lob</classname> with the appropriate <classname>LobType</"
+"classname>"
+msgstr ""
+
+#. Tag: title
+#: basic_mapping.xml:2091
+#, no-c-format
+msgid "Property mapping with hbm.xml"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2093
+#, no-c-format
+msgid ""
+"The <literal><property></literal> element declares a persistent "
+"JavaBean style property of the class."
+msgstr ""
+"<literal><property></literal> 元素为类定义了一个持久化的、JavaBean 风格"
+"的属性。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2125
+#, fuzzy, no-c-format
+msgid ""
+"<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>"
+msgstr ""
+"<![CDATA[<property\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" type=\"typename\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" generated=\"never|insert|always\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+"/>]]>"
+
+#. Tag: para
+#: basic_mapping.xml:2129
+#, no-c-format
+msgid ""
+"<literal>name</literal>: the name of the property, with an initial lowercase "
+"letter."
msgstr "<literal>name</literal>:属性的名字,以小写字母开头。"
#. Tag: para
+#: basic_mapping.xml:2134
#, no-c-format
-msgid "<literal>column</literal> (optional - defaults to the property name): the name of the mapped database table column. This can also be specified by nested <literal><column></literal> element(s)."
-msgstr "<literal>column</literal>(可选 — 默认为属性名字):对应的数据库字段名。 也可以通过嵌套的 <literal><column></literal> 元素指定。 "
+msgid ""
+"<literal>column</literal> (optional - defaults to the property name): the "
+"name of the mapped database table column. This can also be specified by "
+"nested <literal><column></literal> element(s)."
+msgstr ""
+"<literal>column</literal>(可选 — 默认为属性名字):对应的数据库字段名。 也可"
+"以通过嵌套的 <literal><column></literal> 元素指定。 "
#. Tag: para
+#: basic_mapping.xml:2146
#, no-c-format
-msgid "<literal>update, insert</literal> (optional - defaults to <literal>true</literal>): specifies that the mapped columns should be included in SQL <literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. Setting both to <literal>false</literal> allows a pure \"derived\" property whose value is initialized from some other property that maps to the same column(s), or by a trigger or other application."
-msgstr "<literal>update, insert</literal>(可选 — 默认为 <literal>true</literal>): 表明用于 <literal>UPDATE</literal> 和/或 <literal>INSERT</literal> 的 SQL 语句中是否包含这个被映射了的字段。这二者如果都设置为 <literal>false</literal> 则表明这是一个“外源性(derived)”的属性,它的值来源于映射到同一个(或多个) 字段的某些其他属性,或者通过一个 trigger(触发器)或其他程序生成。 "
+msgid ""
+"<literal>update, insert</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that the mapped columns should be included in SQL "
+"<literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. "
+"Setting both to <literal>false</literal> allows a pure \"derived\" property "
+"whose value is initialized from some other property that maps to the same "
+"column(s), or by a trigger or other application."
+msgstr ""
+"<literal>update, insert</literal>(可选 — 默认为 <literal>true</literal>): "
+"表明用于 <literal>UPDATE</literal> 和/或 <literal>INSERT</literal> 的 SQL 语"
+"句中是否包含这个被映射了的字段。这二者如果都设置为 <literal>false</literal> "
+"则表明这是一个“外源性(derived)”的属性,它的值来源于映射到同一个(或多个) "
+"字段的某些其他属性,或者通过一个 trigger(触发器)或其他程序生成。 "
#. Tag: para
+#: basic_mapping.xml:2156
#, no-c-format
-msgid "<literal>formula</literal> (optional): an SQL expression that defines the value for a <emphasis>computed</emphasis> property. Computed properties do not have a column mapping of their own."
-msgstr "<literal>formula</literal>(可选):一个 SQL 表达式,定义了这个<emphasis>计算 (computed)</emphasis> 属性的值。计算属性没有和它对应的数据库字段。"
+msgid ""
+"<literal>formula</literal> (optional): an SQL expression that defines the "
+"value for a <emphasis>computed</emphasis> property. Computed properties do "
+"not have a column mapping of their own."
+msgstr ""
+"<literal>formula</literal>(可选):一个 SQL 表达式,定义了这个<emphasis>计"
+"算 (computed)</emphasis> 属性的值。计算属性没有和它对应的数据库字段。"
#. Tag: para
+#: basic_mapping.xml:2169
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>false</literal>): specifies that this property should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation."
-msgstr "<literal>lazy</literal>(可选 — 默认为 <literal>false</literal>):指定 指定实例变量第一次被访问时,这个属性是否延迟抓取(fetched lazily)( 需要运行时字节码增强)。 "
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this property should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal>(可选 — 默认为 <literal>false</literal>):指定 指定"
+"实例变量第一次被访问时,这个属性是否延迟抓取(fetched lazily)( 需要运行时字"
+"节码增强)。 "
#. Tag: para
+#: basic_mapping.xml:2176
#, no-c-format
-msgid "<literal>unique</literal> (optional): enables the DDL generation of a unique constraint for the columns. Also, allow this to be the target of a <literal>property-ref</literal>."
-msgstr "<literal>unique</literal>(可选):使用 DDL 为该字段添加唯一的约束。同样,允许它作为 <literal>property-ref</literal> 引用的目标。 "
+msgid ""
+"<literal>unique</literal> (optional): enables the DDL generation of a unique "
+"constraint for the columns. Also, allow this to be the target of a "
+"<literal>property-ref</literal>."
+msgstr ""
+"<literal>unique</literal>(可选):使用 DDL 为该字段添加唯一的约束。同样,允"
+"许它作为 <literal>property-ref</literal> 引用的目标。 "
#. Tag: para
+#: basic_mapping.xml:2183
#, no-c-format
-msgid "<literal>not-null</literal> (optional): enables the DDL generation of a nullability constraint for the columns."
-msgstr "<literal>not-null</literal>(可选):使用 DDL 为该字段添加可否为空(nullability)的约束。 "
+msgid ""
+"<literal>not-null</literal> (optional): enables the DDL generation of a "
+"nullability constraint for the columns."
+msgstr ""
+"<literal>not-null</literal>(可选):使用 DDL 为该字段添加可否为空"
+"(nullability)的约束。 "
#. Tag: para
+#: basic_mapping.xml:2188 basic_mapping.xml:3246
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this property do or do not require acquisition of the optimistic lock. In other words, it determines if a version increment should occur when this property is dirty."
-msgstr "<literal>optimistic-lock</literal>(可选 — 默认为 <literal>true</literal>):指定这个属性在做更新时是否需要获得乐观锁定(optimistic lock)。换句话说,它决定这个属性发生脏数据时版本(version)的值是否增长。 "
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property do or do not require "
+"acquisition of the optimistic lock. In other words, it determines if a "
+"version increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal>(可选 — 默认为 <literal>true</literal>):"
+"指定这个属性在做更新时是否需要获得乐观锁定(optimistic lock)。换句话说,它决"
+"定这个属性发生脏数据时版本(version)的值是否增长。 "
#. Tag: para
+#: basic_mapping.xml:2196
#, no-c-format
-msgid "<literal>generated</literal> (optional - defaults to <literal>never</literal>): specifies that this property value is actually generated by the database. See the discussion of <link linkend=\"mapping-generated\">generated properties</link> for more information."
-msgstr "<literal>generated</literal>(可选 — 默认为 <literal>never</literal>):表明此属性值是否实际上是由数据库生成的。请参阅 <link linkend=\"mapping-generated\">generated properties</link> 的讨论。 "
+msgid ""
+"<literal>generated</literal> (optional - defaults to <literal>never</"
+"literal>): specifies that this property value is actually generated by the "
+"database. See the discussion of <link linkend=\"mapping-generated"
+"\">generated properties</link> for more information."
+msgstr ""
+"<literal>generated</literal>(可选 — 默认为 <literal>never</literal>):表明"
+"此属性值是否实际上是由数据库生成的。请参阅 <link linkend=\"mapping-generated"
+"\">generated properties</link> 的讨论。 "
#. Tag: para
+#: basic_mapping.xml:2205
#, no-c-format
msgid "<emphasis>typename</emphasis> could be:"
msgstr "<emphasis>typename</emphasis> 可以是如下几种:"
#. Tag: para
+#: basic_mapping.xml:2230
#, no-c-format
-msgid "The name of a Hibernate basic type: <literal>integer, string, character, date, timestamp, float, binary, serializable, object, blob</literal> etc."
-msgstr "Hibernate 基本类型名(比如:<literal>integer, string, character,date, timestamp, float, binary, serializable, object, blob</literal>)。 "
+msgid ""
+"If you do not specify a type, Hibernate will use reflection upon the named "
+"property and guess the correct Hibernate type. Hibernate will attempt to "
+"interpret the name of the return class of the property getter using, in "
+"order, rules 2, 3, and 4. In certain cases you will need the <literal>type</"
+"literal> attribute. For example, to distinguish between <literal>Hibernate."
+"DATE</literal> and <literal>Hibernate.TIMESTAMP</literal>, or to specify a "
+"custom type."
+msgstr ""
+"如果你没有指定类型,Hibernarte 会使用反射来得到这个名字的属性,以此来猜测正确"
+"的 Hibernate 类型。Hibernate 会按照规则 2,3,4 的顺序对属性读取器(getter方"
+"法)的返回类进行解释。然而,这还不够。 在某些情况下你仍然需要 <literal>type</"
+"literal> 属性。(比如,为了区别<literal>Hibernate.DATE</literal> 和"
+"<literal>Hibernate.TIMESTAMP</literal>,或者为了指定一个自定义类型。) "
#. Tag: para
+#: basic_mapping.xml:2239
#, no-c-format
-msgid "The name of a Java class with a default basic type: <literal>int, float, char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</literal> etc."
-msgstr "一个 Java 类的名字,这个类属于一种默认基础类型(比如:<literal>int, float,char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</literal>)。 "
+msgid ""
+"The <literal>access</literal> attribute allows you to control how Hibernate "
+"accesses the property at runtime. By default, Hibernate will call the "
+"property get/set pair. If you specify <literal>access=\"field\"</literal>, "
+"Hibernate will bypass the get/set pair and access the field directly using "
+"reflection. You can specify your own strategy for property access by naming "
+"a class that implements the interface <literal>org.hibernate.property."
+"PropertyAccessor</literal>."
+msgstr ""
+"<literal>access</literal> 属性用来让你控制 Hibernate 如何在运行时访问属性。在"
+"默认情况下,Hibernate 会使用属性的 get/set 方法对(pair)。如果你指明 "
+"<literal>access=\"field\"</literal>,Hibernate 会忽略 get/set 方法对,直接使"
+"用反射来访问成员变量。你也可以指定你自己的策略,这就需要你自己实现 "
+"<literal>org.hibernate.property.PropertyAccessor</literal> 接口,再在 access "
+"中设置你自定义策略类的名字。 "
#. Tag: para
+#: basic_mapping.xml:2248
#, no-c-format
-msgid "The name of a serializable Java class."
-msgstr "一个可以序列化的 Java 类的名字。"
+msgid ""
+"A powerful feature is derived properties. These properties are by definition "
+"read-only. The property value is computed at load time. You declare the "
+"computation as an SQL expression. This then translates to a <literal>SELECT</"
+"literal> clause subquery in the SQL query that loads an instance:"
+msgstr ""
+"衍生属性(derive propertie)是一个特别强大的特征。这些属性应该定义为只读,属"
+"性值在装载时计算生成。 你用一个 SQL 表达式生成计算的结果,它会在这个实例转载"
+"时翻译成一个 SQL 查询的 <literal>SELECT</literal> 子查询语句。 "
+#. Tag: programlisting
+#: basic_mapping.xml:2254
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+msgstr ""
+"<property name=\"totalPrice\"\n"
+" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
+"p\n"
+" WHERE li.productId = p.productId\n"
+" AND li.customerId = customerId\n"
+" AND li.orderNumber = orderNumber )\"/>"
+
#. Tag: para
+#: basic_mapping.xml:2256
#, no-c-format
-msgid "The class name of a custom type: <literal>com.illflow.type.MyCustomType</literal> etc."
-msgstr "一个自定义类型的类的名字。(比如:<literal>com.illflow.type.MyCustomType</literal>)。 "
+msgid ""
+"You can reference the entity table by not declaring an alias on a particular "
+"column. This would be <literal>customerId</literal> in the given example. "
+"You can also use the nested <literal><formula></literal> mapping "
+"element if you do not want to use the attribute."
+msgstr ""
+"注意,你可以使用实体自己的表,而不用为这个特别的列定义别名(上面例子中的 "
+"<literal>customerId</literal>)。同时注意,如果你不喜欢使用属性, 你可以使用"
+"嵌套的 <literal><formula></literal> 映射元素。 "
+#. Tag: title
+#: basic_mapping.xml:2265
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2267
+#, fuzzy, no-c-format
+msgid ""
+"Embeddable objects (or components) are objects whose properties are mapped "
+"to the same table as the owning entity's table. Components can, in turn, "
+"declare their own properties, components or collections"
+msgstr ""
+"<literal><component></literal> 元素把子对象的一些元素与父类对应的表的一"
+"些字段映射起来。然后组件可以定义它们自己的属性、组件或者集合。参见后面"
+"的“Components”一章。 "
+
+#. Tag: para
+#: basic_mapping.xml:2272
#, no-c-format
-msgid "If you do not specify a type, Hibernate will use reflection upon the named property and guess the correct Hibernate type. Hibernate will attempt to interpret the name of the return class of the property getter using, in order, rules 2, 3, and 4. In certain cases you will need the <literal>type</literal> attribute. For example, to distinguish between <literal>Hibernate.DATE</literal> and <literal>Hibernate.TIMESTAMP</literal>, or to specify a custom type."
-msgstr "如果你没有指定类型,Hibernarte 会使用反射来得到这个名字的属性,以此来猜测正确的 Hibernate 类型。Hibernate 会按照规则 2,3,4 的顺序对属性读取器(getter方法)的返回类进行解释。然而,这还不够。 在某些情况下你仍然需要 <literal>type</literal> 属性。(比如,为了区别<literal>Hibernate.DATE</literal> 和<literal>Hibernate.TIMESTAMP</literal>,或者为了指定一个自定义类型。) "
+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
+#: basic_mapping.xml:2280
+#, 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
+#: basic_mapping.xml:2282
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2284
+#, 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
+#: basic_mapping.xml:2286
#, no-c-format
-msgid "The <literal>access</literal> attribute allows you to control how Hibernate accesses the property at runtime. By default, Hibernate will call the property get/set pair. If you specify <literal>access=\"field\"</literal>, Hibernate will bypass the get/set pair and access the field directly using reflection. You can specify your own strategy for property access by naming a class that implements the interface <literal>org.hibernate.property.PropertyAccessor</literal>."
-msgstr "<literal>access</literal> 属性用来让你控制 Hibernate 如何在运行时访问属性。在默认情况下,Hibernate 会使用属性的 get/set 方法对(pair)。如果你指明 <literal>access=\"field\"</literal>,Hibernate 会忽略 get/set 方法对,直接使用反射来访问成员变量。你也可以指定你自己的策略,这就需要你自己实现 <literal>org.hibernate.property.PropertyAccessor</literal> 接口,再在 access 中设置你自定义策略类的名字。 "
+msgid ""
+"An embeddable object inherits the access type of its owning entity (note "
+"that you can override that using the <literal>@Access</literal> annotation)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2290
#, no-c-format
-msgid "A powerful feature is derived properties. These properties are by definition read-only. The property value is computed at load time. You declare the computation as an SQL expression. This then translates to a <literal>SELECT</literal> clause subquery in the SQL query that loads an instance:"
-msgstr "衍生属性(derive propertie)是一个特别强大的特征。这些属性应该定义为只读,属性值在装载时计算生成。 你用一个 SQL 表达式生成计算的结果,它会在这个实例转载时翻译成一个 SQL 查询的 <literal>SELECT</literal> 子查询语句。 "
+msgid ""
+"The <literal>Person</literal> entity 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 JPA defaults. Overriding columns of embedded "
+"objects of embedded objects is through dotted expressions."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2305
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column = @Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
+"(name=\"nat_Iso2\") ),\n"
+" @AttributeOverride(name=\"nationality.name\", column = @Column"
+"(name=\"nat_CountryName\") )\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2307
#, no-c-format
-msgid "You can reference the entity table by not declaring an alias on a particular column. This would be <literal>customerId</literal> in the given example. You can also use the nested <literal><formula></literal> mapping element if you do not want to use the attribute."
-msgstr "注意,你可以使用实体自己的表,而不用为这个特别的列定义别名(上面例子中的 <literal>customerId</literal>)。同时注意,如果你不喜欢使用属性, 你可以使用嵌套的 <literal><formula></literal> 映射元素。 "
+msgid ""
+"Hibernate Annotations supports something that is not explicitly supported by "
+"the JPA 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: title
+#. Tag: para
+#: basic_mapping.xml:2313
#, no-c-format
-msgid "Many-to-one"
-msgstr "多对一(many-to-one) "
+msgid ""
+"You can also use association annotations in an embeddable object (ie "
+"<literal>@OneToOne</literal>, <classname>@ManyToOne</classname>, "
+"<classname>@OneToMany</classname> or <literal>@ManyToMany</literal>). To "
+"override the association columns you can use <literal>@AssociationOverride</"
+"literal>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2319
#, no-c-format
-msgid "An ordinary association to another persistent class is declared using a <literal>many-to-one</literal> element. The relational model is a many-to-one association; a foreign key in one table is referencing the primary key column(s) of the target table."
-msgstr "通过 <literal>many-to-one</literal> 元素,可以定义一种常见的与另一个持久化类的关联。这种关系模型是多对一关联(实际上是一个对象引用-译注):这个表的一个外键引用目标表的主键字段。 "
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work as several embedded objects "
+"would share the same set of columns. In plain JPA, you need to override at "
+"least one set of columns. Hibernate, however, allows you to enhance the "
+"default naming mechanism through the <classname>NamingStrategy</classname> "
+"interface. You can write a strategy that prevent name clashing in such a "
+"situation. <classname>DefaultComponentSafeNamingStrategy</classname> is an "
+"example of this."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2329
#, no-c-format
+msgid ""
+"If a property of the embedded object points back to the owning entity, "
+"annotate it with the <classname>@Parent</classname> annotation. Hibernate "
+"will make sure this property is properly loaded with the entity reference."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2334
+#, no-c-format
+msgid "In XML, use the <literal><component></literal> element."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2356
+#, fuzzy, no-c-format
+msgid ""
+"<component\n"
+" name=\"propertyName\"\n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+msgstr ""
+"<component \n"
+" name=\"propertyName\" \n"
+" class=\"className\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" access=\"field|property|ClassName\"\n"
+" lazy=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+">\n"
+" \n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</component>"
+
+#. Tag: para
+#: basic_mapping.xml:2360 basic_mapping.xml:3181 basic_mapping.xml:3381
+#, no-c-format
msgid "<literal>name</literal>: the name of the property."
msgstr "<literal>name</literal>:属性名。"
#. Tag: para
+#: basic_mapping.xml:2364
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the foreign key column. This can also be specified by nested <literal><column></literal> element(s)."
-msgstr "<literal>column</literal>(可选):外键字段的名称。也可以通过嵌套的 <literal><column></literal> 指定。 "
+msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the component (child) class."
+msgstr ""
+"<literal>class</literal>(可选 — 默认为通过反射得到的属性类型):组件(子)类"
+"的名字。 "
#. Tag: para
+#: basic_mapping.xml:2370 basic_mapping.xml:3641
#, no-c-format
-msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the name of the associated class."
-msgstr "<literal>class</literal>(可选 — 默认是通过反射得到的属性类型):被关联的类的名字。 "
+msgid ""
+"<literal>insert</literal>: do the mapped columns appear in SQL "
+"<literal>INSERTs</literal>?"
+msgstr ""
+"<literal>insert</literal>:被映射的字段是否出现在 SQL 的 <literal>INSERT</"
+"literal> 语句中? "
#. Tag: para
+#: basic_mapping.xml:2375 basic_mapping.xml:3646
#, no-c-format
-msgid "<literal>cascade</literal> (optional): specifies which operations should be cascaded from the parent object to the associated object."
-msgstr "<literal>cascade(级联)</literal>(可选)表明操作是否从父对象级联到被关联的对象。 "
+msgid ""
+"<literal>update</literal>: do the mapped columns appear in SQL "
+"<literal>UPDATEs</literal>?"
+msgstr ""
+"<literal>update</literal>:被映射的字段是否出现在 SQL 的 <literal>UPDATE</"
+"literal> 语句中? "
#. Tag: para
+#: basic_mapping.xml:2386
#, no-c-format
-msgid "<literal>fetch</literal> (optional - defaults to <literal>select</literal>): chooses between outer-join fetching or sequential select fetching."
-msgstr "<literal>fetch</literal>(可选 — 默认为 <literal>select</literal>):在外连接抓取(outer-join fetching)和序列选择抓取(sequential select fetching)两者中选择其一。 "
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that this component should be fetched lazily when the instance "
+"variable is first accessed. It requires build-time bytecode instrumentation."
+msgstr ""
+"<literal>lazy</literal>(可选 — 默认是 <literal>false</literal>):表明此组件"
+"应在实例变量第一次被访问的时候延迟加载(需要编译时字节码装置器)。"
#. Tag: para
+#: basic_mapping.xml:2393
#, no-c-format
-msgid "<literal>update, insert</literal> (optional - defaults to <literal>true</literal>): specifies that the mapped columns should be included in SQL <literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. Setting both to <literal>false</literal> allows a pure \"derived\" association whose value is initialized from another property that maps to the same column(s), or by a trigger or other application."
-msgstr "<literal>update, insert</literal>(可选 — 默认为 <literal>true</literal>)指定对应的字段是否包含在用于 <literal>UPDATE</literal> 和/或 <literal>INSERT</literal> 的 SQL 语句中。如果二者都是<literal>false</literal>,则这是一个纯粹的 “外源性(derived)”关联,它的值是通过映射到同一个(或多个)字段的某些其他属性得到 或者通过 trigger(触发器)、或其他程序生成。 "
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this component either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal>(可选 — 默认是 <literal>true</literal>):"
+"表明更新此组件是否需要获取乐观锁。换句话说,当这个属性变脏时,是否增加版本号"
+"(Version)。"
#. Tag: para
+#: basic_mapping.xml:2401 basic_mapping.xml:3659
#, no-c-format
-msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to this foreign key. If not specified, the primary key of the associated class is used."
-msgstr "<literal>property-ref</literal>:(可选)被关联到此外键的类中的对应属性的名字。如果没有指定,被关联类的主键将被使用。 "
+msgid ""
+"<literal>unique</literal> (optional - defaults to <literal>false</literal>): "
+"specifies that a unique constraint exists upon all mapped columns of the "
+"component."
+msgstr ""
+"<literal>unique</literal>(可选 — 默认是 <literal>false</literal>):表明组件"
+"映射的所有字段上都有唯一性约束。"
#. Tag: para
+#: basic_mapping.xml:2408
#, no-c-format
-msgid "<literal>unique</literal> (optional): enables the DDL generation of a unique constraint for the foreign-key column. By allowing this to be the target of a <literal>property-ref</literal>, you can make the association multiplicity one-to-one."
-msgstr "<literal>unique</literal>(可选):使用 DDL 为外键字段生成一个唯一约束。此外, 这也可以用作 <literal>property-ref</literal> 的目标属性。这使关联同时具有一对一的效果。 "
+msgid ""
+"The child <literal><property></literal> tags map properties of the "
+"child class to table columns."
+msgstr ""
+"其 <literal><property></literal> 子标签为子类的一些属性与表字段之间建立"
+"映射。"
#. Tag: para
+#: basic_mapping.xml:2411
#, no-c-format
-msgid "<literal>not-null</literal> (optional): enables the DDL generation of a nullability constraint for the foreign key columns."
-msgstr "<literal>not-null</literal>(可选):使用 DDL 为外键字段生成一个非空约束。 "
+msgid ""
+"The <literal><component></literal> element allows a <literal><"
+"parent></literal> subelement that maps a property of the component class "
+"as a reference back to the containing entity."
+msgstr ""
+"<literal><component></literal> 元素允许加入一个 <literal><parent>"
+"</literal> 子元素,在组件类内部就可以有一个指向其容器的实体的反向引用。"
#. Tag: para
+#: basic_mapping.xml:2415
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><dynamic-component></literal> element allows a "
+"<literal>Map</literal> to be mapped as a component, where the property names "
+"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
+"more information. This feature is not supported in annotations."
+msgstr ""
+"<literal><dynamic-component></literal> 元素允许把一个 <literal>Map</"
+"literal> 映射为组件,其属性名对应 map 的键值。参见 <xref linkend="
+"\"components-dynamic\"/>。 "
+
+#. Tag: title
+#: basic_mapping.xml:2423
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): by default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed. This requires build-time bytecode instrumentation. <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched."
-msgstr "<literal>lazy</literal>(可选 — 默认为 <literal>proxy</literal>):默认情况下,单点关联是经过代理的。<literal>lazy=\"no-proxy\"</literal> 指定此属性应该在实例变量第一次被访问时应该延迟抓取(fetche lazily)(需要运行时字节码的增强)。<literal>lazy=\"false\"</literal> 指定此关联总是被预先抓取。 "
+msgid "Inheritance strategy"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2425
#, no-c-format
-msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how foreign keys that reference missing rows will be handled. <literal>ignore</literal> will treat a missing row as a null association."
-msgstr "<literal>not-found</literal>(可选 - 默认为<literal>exception</literal>):指定如何处理引用缺失行的外键:<literal>ignore</literal> 会把缺失的行作为一个空关联处理。 "
+msgid ""
+"Java is a language supporting polymorphism: a class can inherit from "
+"another. Several strategies are possible to persist a class hierarchy:"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2431
#, no-c-format
-msgid "<literal>entity-name</literal> (optional): the entity name of the associated class."
-msgstr "<literal>entity-name</literal>(可选):被关联的类的实体名。 "
+msgid ""
+"Single table per class hierarchy strategy: a single table hosts all the "
+"instances of a class hierarchy"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2436
#, no-c-format
-msgid "<literal>formula</literal> (optional): an SQL expression that defines the value for a <emphasis>computed</emphasis> foreign key."
-msgstr "<literal>formula</literal>(可选):SQL 表达式,用于定义 <emphasis>computed(计算出的)</emphasis>外键值。"
+msgid ""
+"Joined subclass strategy: one table per class and subclass is present and "
+"each table persist the properties specific to a given subclass. The state of "
+"the entity is then stored in its corresponding class table and all its "
+"superclasses"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2443
#, no-c-format
-msgid "Setting a value of the <literal>cascade</literal> attribute to any meaningful value other than <literal>none</literal> will propagate certain operations to the associated object. The meaningful values are divided into three categories. First, basic operations, which include: <literal>persist, merge, delete, save-update, evict, replicate, lock and refresh</literal>; second, special values: <literal>delete-orphan</literal>; and third,<literal>all</literal> comma-separated combinations of operation names: <literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\" /> for a full explanation. Note that single valued, many-to-one and one-to-one, associations do not support orphan delete."
-msgstr "<literal>cascade</literal> 属性设置为除了<literal>none</literal> 以外任何有意义的值,它将把特定的操作传递到关联对象中。这个值就代表着 Hibernate 基本操作的名称,<literal>persist, merge, delete, save-update, evict, replicate, lock, refresh</literal>,以及特别的值 <literal>delete-orphan</literal> 和 <literal>all</literal>,并且可以用逗号分隔符来组合这些操作,例如,<literal>cascade=\"persist,merge,evict\"</literal> 或 <literal>cascade=\"all,delete-orphan\"</literal>。更全面的解释请参考 <xref linkend=\"objectstate-transitive\"/>。注意,单值关联(many-to-one 和 one-to-one 关联)不支持删除孤儿(orphan delete,删除不再被引用的值)。 "
+msgid ""
+"Table per class strategy: one table per concrete class and subclass is "
+"present and each table persist the properties of the class and its "
+"superclasses. The state of the entity is then stored entirely in the "
+"dedicated table for its class."
+msgstr ""
+#. Tag: title
+#: basic_mapping.xml:2451
+#, no-c-format
+msgid "Single table per class hierarchy strategy"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2453
#, no-c-format
-msgid "Here is an example of a typical <literal>many-to-one</literal> declaration:"
-msgstr "一个典型的简单 <literal>many-to-one</literal> 定义例子: "
+msgid ""
+"With this approach the properties of all the subclasses in a given mapped "
+"class hierarchy are stored in a single table."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2456
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass declares its own persistent properties and subclasses. Version "
+"and id properties are assumed to be inherited from the root class. Each "
+"subclass in a hierarchy must define a unique discriminator value. If this is "
+"not specified, the fully qualified Java class name is used."
+msgstr ""
+"每个子类都应该定义它自己的持久化属性和子类。<literal><version></"
+"literal> 和 <literal><id></literal> 属性可以从根父类继承下来。在一棵继"
+"承树上的每个子类都必须定义一个唯一的 <literal>discriminator-value</literal>。"
+"如果没有指定,就会使用 Java 类的全限定名。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2462 basic_mapping.xml:2540
#, no-c-format
-msgid "The <literal>property-ref</literal> attribute should only be used for mapping legacy data where a foreign key refers to a unique key of the associated table other than the primary key. This is a complicated and confusing relational model. For example, if the <literal>Product</literal> class had a unique serial number that is not the primary key. The <literal>unique</literal> attribute controls Hibernate's DDL generation with the SchemaExport tool."
-msgstr "<literal>property-ref</literal> 属性只应该用来对付遗留下来的数据库系统,可能有外键指向对方关联表的是个非主键字段(但是应该是一个惟一关键字)的情况下。这是一种十分丑陋的关系模型。比如说,假设 <literal>Product</literal> 类有一个惟一的序列号,它并不是主键。(<literal>unique</literal> 属性控制 Hibernate 通过 SchemaExport 工具进行的 DDL 生成。) "
+msgid ""
+"@Entity\n"
+"@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
+#: basic_mapping.xml:2464
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
+"<literal><subclass></literal> declaration is used. For example:"
+msgstr ""
+"最后,多态持久化需要为父类的每个子类都进行定义。对于“每一棵类继承树对应一个"
+"表”的策略来说,就需要使用 <literal><subclass></literal> 定义。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2479
+#, fuzzy, no-c-format
+msgid ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+msgstr ""
+"<subclass\n"
+" name=\"ClassName\"\n"
+" discriminator-value=\"discriminator_value\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" extends=\"SuperclassName\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2483 basic_mapping.xml:2656 basic_mapping.xml:2720
#, no-c-format
-msgid "Then the mapping for <literal>OrderItem</literal> might use:"
-msgstr "那么关于 <literal>OrderItem</literal> 的映射可能是:"
+msgid ""
+"<literal>name</literal>: the fully qualified class name of the subclass."
+msgstr "<literal>name</literal>:子类的全限定名。 "
#. Tag: para
+#: basic_mapping.xml:2488
#, no-c-format
-msgid "This is not encouraged, however."
-msgstr "当然,我们决不鼓励这种用法。 "
+msgid ""
+"<literal>discriminator-value</literal> (optional - defaults to the class "
+"name): a value that distinguishes individual subclasses."
+msgstr ""
+"<literal>discriminator-value(辨别标志)</literal>(可选 — 默认为类名):一个"
+"用于区分每个独立的子类的值。 "
#. Tag: para
+#: basic_mapping.xml:2494
#, no-c-format
-msgid "If the referenced unique key comprises multiple properties of the associated entity, you should map the referenced properties inside a named <literal><properties></literal> element."
-msgstr "如果被引用的唯一主键由关联实体的多个属性组成,你应该在名称为 <literal><properties></literal> 的元素 里面映射所有关联的属性。"
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface used for "
+"lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal>(可选):指定一个类或者接口,在延迟装载时作为代理使"
+"用。 "
#. Tag: para
+#: basic_mapping.xml:2499
#, no-c-format
-msgid "If the referenced unique key is the property of a component, you can specify a property path:"
-msgstr "假若被引用的唯一主键是组件的属性,你可以指定属性路径: "
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal>(可选,默认是 <literal>true</literal>):设置为 "
+"<literal>lazy=\"false\"</literal> 禁止使用延迟装载。 "
+#. Tag: para
+#: basic_mapping.xml:2507 basic_mapping.xml:2685 basic_mapping.xml:2746
+#, fuzzy, no-c-format
+msgid ""
+"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
+">."
+msgstr "更多关于继承映射的信息,参考 <xref linkend=\"inheritance\"/>。 "
+
#. Tag: title
+#: basic_mapping.xml:2511
#, no-c-format
-msgid "One-to-one"
-msgstr "一对一 "
+msgid "Discriminator"
+msgstr "鉴别器(discriminator) "
#. Tag: para
+#: basic_mapping.xml:2513
+#, fuzzy, no-c-format
+msgid ""
+"Discriminators are required for polymorphic persistence using the table-per-"
+"class-hierarchy mapping strategy. It declares a discriminator column of the "
+"table. The discriminator column contains marker values that tell the "
+"persistence layer what subclass to instantiate for a particular row. A "
+"restricted set of types can be used: <literal>string</literal>, "
+"<literal>character</literal>, <literal>integer</literal>, <literal>byte</"
+"literal>, <literal>short</literal>, <literal>boolean</literal>, "
+"<literal>yes_no</literal>, <literal>true_false</literal>."
+msgstr ""
+"在\"一棵对象继承树对应一个表\"的策略中,<literal><discriminator></"
+"literal> 元素是必需的,它定义了表的鉴别器字段。鉴别器字段包含标志值,用于告知"
+"持久化层应该为某个特定的行创建哪一个子类的实例。如下这些受到限制的类型可以使"
+"用:<literal>string</literal>、<literal>character</literal>、"
+"<literal>integer</literal>、<literal>byte</literal>、<literal>short</"
+"literal>、<literal>boolean</literal>、<literal>yes_no</literal>、"
+"<literal>true_false</literal>。"
+
+#. Tag: para
+#: basic_mapping.xml:2523
#, no-c-format
-msgid "A one-to-one association to another persistent class is declared using a <literal>one-to-one</literal> element."
-msgstr "持久化对象之间一对一的关联关系是通过 <literal>one-to-one</literal> 元素定义的。"
+msgid ""
+"Use the <classname>@DiscriminatorColumn</classname> to define the "
+"discriminator column as well as the discriminator type. Alternatively, you "
+"can also use <classname>@DiscriminatorFormula</classname> to express in SQL "
+"what would be in a virtual discriminator column. This is particularly handy "
+"when the discriminator value can be extracted from one or more columns of "
+"the table. Both <classname>@DiscriminatorColumn</classname> and "
+"<classname>@DiscriminatorFormula</classname> are to be set on the root "
+"entity (once per persisted hierarchy)."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2534
#, no-c-format
-msgid "<literal>constrained</literal> (optional): specifies that a foreign key constraint on the primary key of the mapped table and references the table of the associated class. This option affects the order in which <literal>save()</literal> and <literal>delete()</literal> are cascaded, and determines whether the association can be proxied. It is also used by the schema export tool."
-msgstr "<literal>constrained(约束)</literal>(可选)表明该类对应的表对应的数据库表,和被关联的对象所对应的数据库表之间,通过一个外键引用对主键进行约束。这个选项影响 <literal>save()</literal> 和 <literal>delete()</literal> 在级联执行时的先后顺序以及决定该关联能否被委托(也在 schema export tool 中被使用)。 "
+msgid ""
+"Finally, use <classname>@DiscriminatorValue</classname> on each class of the "
+"hierarchy to specify the value stored in the discriminator column for a "
+"given entity. If you do not set <classname>@DiscriminatorValue</classname> "
+"on a class, the fully qualified class name is used."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2542
#, no-c-format
-msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to the primary key of this class. If not specified, the primary key of the associated class is used."
-msgstr "<literal>property-ref</literal>:(可选)指定关联类的属性名,这个属性将会和本类的主键相对应。如果没有指定,会使用对方关联类的主键。 "
+msgid ""
+"In hbm.xml, the <literal><discriminator></literal> element is used to "
+"define the discriminator column or formula:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2559
+#, fuzzy, no-c-format
+msgid ""
+"<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>"
+msgstr ""
+"<![CDATA[<discriminator\n"
+" column=\"discriminator_column\"\n"
+" type=\"discriminator_type\"\n"
+" force=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" formula=\"arbitrary sql expression\"\n"
+"/>]]>"
+
#. Tag: para
+#: basic_mapping.xml:2563
#, no-c-format
-msgid "<literal>formula</literal> (optional): almost all one-to-one associations map to the primary key of the owning entity. If this is not the case, you can specify another column, columns or expression to join on using an SQL formula. See <literal>org.hibernate.test.onetooneformula</literal> for an example."
-msgstr "<literal>formula </literal>(可选):绝大多数一对一的关联都指向其实体的主键。在一些少见的情况中,你可能会指向其他的一个或多个字段,或者是一个表达式,这些情况下,你可以用一个 SQL 公式来表示。(可以在 org.hibernate.test.onetooneformula 找到例子) "
+msgid ""
+"<literal>column</literal> (optional - defaults to <literal>class</literal>): "
+"the name of the discriminator column."
+msgstr ""
+"<literal>column</literal>(可选 — 默认为 <literal>class</literal>)"
+"discriminator 器字段的名字。"
#. Tag: para
+#: basic_mapping.xml:2569
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): by default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation. <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched. <emphasis>Note that if <literal>constrained=\"false\"</literal>, proxying is impossible and Hibernate will eagerly fetch the association</emphasis>."
-msgstr "<literal>lazy</literal>(可选 — 默认为 <literal>proxy</literal>):默认情况下,单点关联是经过代理的。<literal>lazy=\"no-proxy\"</literal>指定此属性应该在实例变量第一次被访问时应该延迟抓取(fetche lazily)(需要运行时字节码的增强)。 <literal>lazy=\"false\"</literal>指定此关联总是被预先抓取。<emphasis>注意,如果<literal>constrained=\"false\"</literal>, 不可能使用代理,Hibernate会采取预先抓取</emphasis>。"
+msgid ""
+"<literal>type</literal> (optional - defaults to <literal>string</literal>): "
+"a name that indicates the Hibernate type"
+msgstr ""
+"<literal>type</literal>(可选 — 默认为 <literal>string</literal>)一个 "
+"Hibernate 字段类型的名字 "
#. Tag: para
+#: basic_mapping.xml:2575
#, no-c-format
-msgid "There are two varieties of one-to-one associations:"
-msgstr "有两种不同的一对一关联: "
+msgid ""
+"<literal>force</literal> (optional - defaults to <literal>false</literal>): "
+"\"forces\" Hibernate to specify the allowed discriminator values, even when "
+"retrieving all instances of the root class."
+msgstr ""
+"<literal>force(强制)</literal>(可选 — 默认为 <literal>false</literal>)\"强"
+"制\" Hibernate 指定允许的鉴别器值,即使当取得的所有实例都是根类的。 "
#. Tag: para
+#: basic_mapping.xml:2582
#, no-c-format
-msgid "primary key associations"
-msgstr "主键关联"
+msgid ""
+"<literal>insert</literal> (optional - defaults to <literal>true</literal>): "
+"set this to <literal>false</literal> if your discriminator column is also "
+"part of a mapped composite identifier. It tells Hibernate not to include the "
+"column in SQL <literal>INSERTs</literal>."
+msgstr ""
+"<literal>insert</literal>(可选 - 默认为<literal>true</literal>)如果你的鉴别"
+"器字段也是映射为复合标识(composite identifier)的一部分,则需将这个值设为 "
+"<literal>false</literal>。(告诉 Hibernate 在做 SQL <literal>INSERT</"
+"literal> 时不包含该列) "
#. Tag: para
+#: basic_mapping.xml:2590
#, no-c-format
-msgid "unique foreign key associations"
-msgstr "惟一外键关联"
+msgid ""
+"<literal>formula</literal> (optional): an arbitrary SQL expression that is "
+"executed when a type has to be evaluated. It allows content-based "
+"discrimination."
+msgstr ""
+"<literal>formula</literal>(可选)一个 SQL 表达式,在类型判断(判断是父类还是"
+"具体子类 — 译注)时执行。可用于基于内容的鉴别器。 "
#. Tag: para
+#: basic_mapping.xml:2597
#, no-c-format
-msgid "Primary key associations do not need an extra table column. If two rows are related by the association, then the two table rows share the same primary key value. To relate two objects by a primary key association, ensure that they are assigned the same identifier value."
-msgstr "主键关联不需要额外的表字段;如果两行是通过这种一对一关系相关联的,那么这两行就共享同样的主关键字值。所以如果你希望两个对象通过主键一对一关联,你必须确认它们被赋予同样的标识值。"
+msgid ""
+"Actual values of the discriminator column are specified by the "
+"<literal>discriminator-value</literal> attribute of the <literal><"
+"class></literal> and <literal><subclass></literal> elements."
+msgstr ""
+"鉴别器字段的实际值是根据 <literal><class></literal> 和 <literal><"
+"subclass></literal> 元素中的 <literal>discriminator-value</literal> 属性得"
+"来的。"
#. Tag: para
+#: basic_mapping.xml:2602
#, no-c-format
-msgid "For a primary key association, add the following mappings to <literal>Employee</literal> and <literal>Person</literal> respectively:"
-msgstr "比如说,对下面的 <literal>Employee</literal> 和 <literal>Person</literal> 进行主键一对一关联:"
+msgid ""
+"The <literal>force</literal> attribute is only useful if the table contains "
+"rows with \"extra\" discriminator values that are not mapped to a persistent "
+"class. This will not usually be the case."
+msgstr ""
+"<literal>force</literal> 属性仅仅在这种情况下有用的:表中包含没有被映射到持久"
+"化类的附加辨别器值。这种情况不会经常遇到。 "
#. Tag: para
+#: basic_mapping.xml:2607
#, no-c-format
-msgid "Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE tables are equal. You use a special Hibernate identifier generation strategy called <literal>foreign</literal>:"
-msgstr "现在我们必须确保 PERSON 和 EMPLOYEE 中相关的字段是相等的。我们使用一个被成为 <literal>foreign</literal> 的特殊的 hibernate 标识符生成策略: "
+msgid ""
+"The <literal>formula</literal> attribute allows you to declare an arbitrary "
+"SQL expression that will be used to evaluate the type of a row. For example:"
+msgstr ""
+"使用 <literal>formula</literal> 属性你可以定义一个 SQL 表达式,用来判断一行数"
+"据的类型。"
+#. Tag: programlisting
+#: basic_mapping.xml:2611
+#, fuzzy, no-c-format
+msgid ""
+"<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>"
+msgstr ""
+"<![CDATA[<discriminator\n"
+" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
+" type=\"integer\"/>]]>"
+
+#. Tag: title
+#: basic_mapping.xml:2616
+#, fuzzy, no-c-format
+msgid "Joined subclass strategy"
+msgstr "连接的子类(joined-subclass) "
+
#. Tag: para
+#: basic_mapping.xml:2618
+#, fuzzy, no-c-format
+msgid ""
+"Each subclass can also be mapped to its own table. This is called the table-"
+"per-subclass mapping strategy. An inherited state is retrieved by joining "
+"with the table of the superclass. A discriminator column is not required for "
+"this mapping strategy. Each subclass must, however, declare a table column "
+"holding the object identifier. The primary key of this table is also a "
+"foreign key to the superclass table and described by the "
+"<classname>@PrimaryKeyJoinColumn</classname>s or the <literal><key></"
+"literal> element."
+msgstr ""
+"此外,每个子类可能被映射到他自己的表中(每个子类一个表的策略)。被继承的状态"
+"通过和超类的表关联得到。我们使用 <literal><joined-subclass></literal> "
+"元素。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2628
#, no-c-format
-msgid "A newly saved instance of <literal>Person</literal> is assigned the same primary key value as the <literal>Employee</literal> instance referred with the <literal>employee</literal> property of that <literal>Person</literal>."
-msgstr "一个刚刚保存的 <literal>Person</literal> 实例被赋予和该 <literal>Person</literal> 的 <literal>employee</literal> 属性所指向的 <literal>Employee</literal> 实例同样的关键字值。 "
+msgid ""
+"@Entity @Table(name=\"CATS\")\n"
+"@Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Cat implements Serializable { \n"
+" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
+" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
+" String getId() { return id; }\n"
+"\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
+"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
+"public class DomesticCat extends Cat { \n"
+" public String getName() { return name; }\n"
+"}"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2631
#, no-c-format
-msgid "Alternatively, a foreign key with a unique constraint, from <literal>Employee</literal> to <literal>Person</literal>, can be expressed as:"
-msgstr "另一种方式是一个外键和一个惟一关键字对应,上面的 <literal>Employee</literal> 和 <literal>Person</literal> 的例子,如果使用这种关联方式,可以表达成: "
+msgid ""
+"The table name still defaults to the non qualified class name. Also if "
+"<classname>@PrimaryKeyJoinColumn</classname> is not set, the primary key / "
+"foreign key columns are assumed to have the same names as the primary key "
+"columns of the primary table of the superclass."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2638
+#, fuzzy, no-c-format
+msgid ""
+"In hbm.xml, use the <literal><joined-subclass></literal> element. For "
+"example:"
+msgstr "你可以使用 <literal>class</literal> 元素来定义一个持久化类。例如:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:2652
+#, fuzzy, no-c-format
+msgid ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+msgstr ""
+"<joined-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <key .... >\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</joined-subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2661 basic_mapping.xml:2725
#, no-c-format
-msgid "This association can be made bidirectional by adding the following to the <literal>Person</literal> mapping:"
-msgstr "如果在 <literal>Person</literal> 的映射加入下面几句,这种关联就是双向的: "
+msgid "<literal>table</literal>: the name of the subclass table."
+msgstr "<literal>table</literal>:子类的表名。"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:2666 basic_mapping.xml:2730
#, no-c-format
-msgid "Natural-id"
-msgstr "自然 ID(natural-id) "
+msgid ""
+"<literal>proxy</literal> (optional): specifies a class or interface to use "
+"for lazy initializing proxies."
+msgstr ""
+"<literal>proxy</literal>(可选):指定一个类或者接口,在延迟装载时作为代理使"
+"用。 "
#. Tag: para
+#: basic_mapping.xml:2671 basic_mapping.xml:2735
#, no-c-format
-msgid "Although we recommend the use of surrogate keys as primary keys, you should try to identify natural keys for all entities. A natural key is a property or combination of properties that is unique and non-null. It is also immutable. Map the properties of the natural key inside the <literal><natural-id></literal> element. Hibernate will generate the necessary unique key and nullability constraints and, as a result, your mapping will be more self-documenting."
-msgstr "我们建议使用代用键(键值不具备实际意义)作为主键,我们仍然应该尝试为所有的实体采用自然的键值作为(附加——译者注)标示。自然键(natural key)是单个或组合属性,他们必须唯一且非空。如果它还是不可变的那就更理想了。在 <literal><natural-id></literal> 元素中列出自然键的属性。Hibernate 会帮你生成必须的唯一键值和非空约束,你的映射会更加的明显易懂(原文是 self-documenting,自我注解)。 "
+msgid ""
+"<literal>lazy</literal> (optional, defaults to <literal>true</literal>): "
+"setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
+msgstr ""
+"<literal>lazy</literal>(可选,默认是 <literal>true</literal>):设置为 "
+"<literal>lazy=\"false\"</literal> 禁止使用延迟装载。 "
#. Tag: para
+#: basic_mapping.xml:2679
#, no-c-format
-msgid "It is recommended that you implement <literal>equals()</literal> and <literal>hashCode()</literal> to compare the natural key properties of the entity."
-msgstr "我们强烈建议你实现 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法,来比较实体的自然键属性。 "
+msgid ""
+"Use the <literal><key></literal> element to declare the primary key / "
+"foreign key column. The mapping at the start of the chapter would then be re-"
+"written as:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2683
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"eg\">\n"
+"\n"
+" <class name=\"Cat\" table=\"CATS\">\n"
+" <id name=\"id\" column=\"uid\" type=\"long\">\n"
+" <generator class=\"hilo\"/>\n"
+" </id>\n"
+" <property name=\"birthdate\" type=\"date\"/>\n"
+" <property name=\"color\" not-null=\"true\"/>\n"
+" <property name=\"sex\" not-null=\"true\"/>\n"
+" <property name=\"weight\"/>\n"
+" <many-to-one name=\"mate\"/>\n"
+" <set name=\"kittens\">\n"
+" <key column=\"MOTHER\"/>\n"
+" <one-to-many class=\"Cat\"/>\n"
+" </set>\n"
+" <joined-subclass name=\"DomesticCat\" table="
+"\"DOMESTIC_CATS\">\n"
+" <key column=\"CAT\"/>\n"
+" <property name=\"name\" type=\"string\"/>\n"
+" </joined-subclass>\n"
+" </class>\n"
+"\n"
+" <class name=\"eg.Dog\">\n"
+" <!-- mapping for Dog could go here -->\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
+#. Tag: title
+#: basic_mapping.xml:2690
+#, no-c-format
+msgid "Table per class strategy"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2692
+#, fuzzy, no-c-format
+msgid ""
+"A third option is to map only the concrete classes of an inheritance "
+"hierarchy to tables. This is called the table-per-concrete-class strategy. "
+"Each table defines all persistent states of the class, including the "
+"inherited state. In Hibernate, it is not necessary to explicitly map such "
+"inheritance hierarchies. You can map each class as a separate entity root. "
+"However, if you wish use polymorphic associations (e.g. an association to "
+"the superclass of your hierarchy), you need to use the union subclass "
+"mapping."
+msgstr ""
+"第三种选择是仅仅映射类继承树中具体类部分到表中(每个具体类一张表的策略)。其"
+"中,每张表定义了类的所有持久化状态,包括继承的状态。在 Hibernate 中,并不需要"
+"完全显式地映射这样的继承树。你可以简单地使用单独的 <literal><class></"
+"literal> 定义映射每个类。然而,如果你想使用多态关联(例如,一个对类继承树中超"
+"类的关联),你需要使用 <literal><union-subclass></literal> 映射。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2701
#, no-c-format
-msgid "This mapping is not intended for use with entities that have natural primary keys."
-msgstr "这一映射不是为了把自然键作为主键而准备的。 "
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable { ... }"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2703
#, no-c-format
-msgid "<literal>mutable</literal> (optional - defaults to <literal>false</literal>): by default, natural identifier properties are assumed to be immutable (constant)."
-msgstr "<literal>mutable</literal>(可选,默认为 <literal>false</literal>):默认情况下,自然标识属性被假定为不可变的(常量)。 "
+msgid "Or in hbm.xml:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2716
+#, fuzzy, no-c-format
+msgid ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+msgstr ""
+"<union-subclass\n"
+" name=\"ClassName\"\n"
+" table=\"tablename\"\n"
+" proxy=\"ProxyInterface\"\n"
+" lazy=\"true|false\"\n"
+" dynamic-update=\"true|false\"\n"
+" dynamic-insert=\"true|false\"\n"
+" schema=\"schema\"\n"
+" catalog=\"catalog\"\n"
+" extends=\"SuperclassName\"\n"
+" abstract=\"true|false\"\n"
+" persister=\"ClassName\"\n"
+" subselect=\"SQL expression\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\">\n"
+"\n"
+" <property .... />\n"
+" .....\n"
+"</union-subclass>"
+
+#. Tag: para
+#: basic_mapping.xml:2743
+#, no-c-format
+msgid ""
+"No discriminator column or key column is required for this mapping strategy."
+msgstr "这种映射策略不需要指定辨别标志(discriminator)字段。"
+
#. Tag: title
+#: basic_mapping.xml:2751
#, no-c-format
-msgid "Component and dynamic-component"
-msgstr "组件(component)和动态组件(dynamic-component) "
+msgid "Inherit properties from superclasses"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2753
#, no-c-format
-msgid "The <literal><component></literal> element maps properties of a child object to columns of the table of a parent class. Components can, in turn, declare their own properties, components or collections. See the \"Component\" examples below:"
-msgstr "<literal><component></literal> 元素把子对象的一些元素与父类对应的表的一些字段映射起来。然后组件可以定义它们自己的属性、组件或者集合。参见后面的“Components”一章。 "
+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>@MappedSuperclass</literal>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2758
+#, 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
+#: basic_mapping.xml:2760
#, no-c-format
-msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): the name of the component (child) class."
-msgstr "<literal>class</literal>(可选 — 默认为通过反射得到的属性类型):组件(子)类的名字。 "
+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
+#: basic_mapping.xml:2768
#, no-c-format
-msgid "<literal>insert</literal>: do the mapped columns appear in SQL <literal>INSERTs</literal>?"
-msgstr "<literal>insert</literal>:被映射的字段是否出现在 SQL 的 <literal>INSERT</literal> 语句中? "
+msgid ""
+"Properties from superclasses not mapped as <literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2773
#, no-c-format
-msgid "<literal>update</literal>: do the mapped columns appear in SQL <literal>UPDATEs</literal>?"
-msgstr "<literal>update</literal>:被映射的字段是否出现在 SQL 的 <literal>UPDATE</literal> 语句中? "
+msgid ""
+"The default access type (field or methods) is used, unless you use the "
+"<literal>@Access</literal> annotation."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2778
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>false</literal>): specifies that this component should be fetched lazily when the instance variable is first accessed. It requires build-time bytecode instrumentation."
-msgstr "<literal>lazy</literal>(可选 — 默认是 <literal>false</literal>):表明此组件应在实例变量第一次被访问的时候延迟加载(需要编译时字节码装置器)。"
+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
+#: basic_mapping.xml:2786
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this component either do or do not require acquisition of the optimistic lock. It determines if a version increment should occur when this property is dirty."
-msgstr "<literal>optimistic-lock</literal>(可选 — 默认是 <literal>true</literal>):表明更新此组件是否需要获取乐观锁。换句话说,当这个属性变脏时,是否增加版本号(Version)。"
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal> in the "
+"middle of the mapped inheritance hierarchy."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2792
#, no-c-format
-msgid "<literal>unique</literal> (optional - defaults to <literal>false</literal>): specifies that a unique constraint exists upon all mapped columns of the component."
-msgstr "<literal>unique</literal>(可选 — 默认是 <literal>false</literal>):表明组件映射的所有字段上都有唯一性约束。"
+msgid ""
+"Any class in the hierarchy non annotated with <literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2797
#, no-c-format
-msgid "The child <literal><property></literal> tags map properties of the child class to table columns."
-msgstr "其 <literal><property></literal> 子标签为子类的一些属性与表字段之间建立映射。"
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal> annotation."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2801
+#, 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( \n"
+" name=\"propulsion\", \n"
+" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
+")\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2803
#, no-c-format
-msgid "The <literal><component></literal> element allows a <literal><parent></literal> subelement that maps a property of the component class as a reference back to the containing entity."
-msgstr "<literal><component></literal> 元素允许加入一个 <literal><parent></literal> 子元素,在组件类内部就可以有一个指向其容器的实体的反向引用。"
+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
+#: basic_mapping.xml:2809
#, no-c-format
-msgid "The <literal><dynamic-component></literal> element allows a <literal>Map</literal> to be mapped as a component, where the property names refer to keys of the map. See <xref linkend=\"components-dynamic\" /> for more information."
-msgstr "<literal><dynamic-component></literal> 元素允许把一个 <literal>Map</literal> 映射为组件,其属性名对应 map 的键值。参见 <xref linkend=\"components-dynamic\"/>。 "
+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: para
+#: basic_mapping.xml:2815
+#, no-c-format
+msgid ""
+"In hbm.xml, simply map the properties of the superclass in the <literal><"
+"class></literal> element of the entity that needs to inherit them."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:2821
#, no-c-format
-msgid "Properties"
-msgstr "属性(Properties)"
+msgid "Mapping one entity to several tables"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2823
#, no-c-format
-msgid "The <literal><properties></literal> element allows the definition of a named, logical grouping of the properties of a class. The most important use of the construct is that it allows a combination of properties to be the target of a <literal>property-ref</literal>. It is also a convenient way to define a multi-column unique constraint. For example:"
-msgstr "<literal><properties></literal> 元素允许定义一个命名的逻辑分组(grouping)包含一个类中的多个属性。这个元素最重要的用处是允许多个属性的组合作为 <literal>property-ref</literal> 的目标(target)。这也是定义多字段唯一约束的一种方便途径。例如:"
+msgid ""
+"While not recommended for a fresh schema, some legacy databases force your "
+"to map a single entity on several tables."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2826
#, no-c-format
-msgid "<literal>name</literal>: the logical name of the grouping. It is <emphasis>not</emphasis> an actual property name."
-msgstr "<literal>name</literal>:分组的逻辑名称 — <emphasis>不是</emphasis> 实际属性的名称。 "
+msgid ""
+"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>@JoinColumn</literal>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:2832
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:2834
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to these properties either do or do not require acquisition of the optimistic lock. It determines if a version increment should occur when these properties are dirty."
-msgstr "<literal>optimistic-lock</literal>(可选 — 默认是 <literal>true</literal>):表明更新此组件是否需要获取乐观锁。换句话说,当这个属性变脏时,是否增加版本号(Version)。"
+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
+#: basic_mapping.xml:2844
#, no-c-format
-msgid "For example, if we have the following <literal><properties></literal> mapping:"
+msgid ""
+"There is also additional tuning accessible via the <classname>@org.hibernate."
+"annotations.Table</classname> annotation:"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2850
+#, fuzzy, 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 <classname>SELECT</classname> 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>(可选 — 默认是 <literal>join</literal>):如果设置为"
+"默认值 <literal>join</literal>,Hibernate 将使用一个内连接来得到这个类或其超"
+"类定义的 <literal><join></literal>,而使用一个外连接来得到其子类定义的 "
+"<literal><join></literal>。如果设置为 <literal>select</literal>,则 "
+"Hibernate 将为子类定义的 <literal><join></literal> 使用顺序选择。这仅在"
+"一行数据表示一个子类的对象的时候才会发生。对这个类和其超类定义的 "
+"<literal><join></literal>,依然会使用内连接得到。 "
+
+#. Tag: para
+#: basic_mapping.xml:2862
+#, fuzzy, 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>(可选 — 默认是 <literal>false</literal>):如果打"
+"开,Hibernate 不会插入或者更新此连接定义的属性。 "
+
+#. Tag: para
+#: basic_mapping.xml:2868
+#, fuzzy, 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>(可选 — 默认是 <literal>false</literal>):如果打"
+"开,Hibernate 只会在此连接定义的属性非空时插入一行数据,并且总是使用一个外连"
+"接来得到这些属性。 "
+
+#. Tag: para
+#: basic_mapping.xml:2875
+#, 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
+#: basic_mapping.xml:2880
+#, no-c-format
+msgid ""
+"Make sure to use the secondary table name in the <methodname>appliesto</"
+"methodname> property"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:2883
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"@SecondaryTable(name=\"Cat1\")\n"
+"@org.hibernate.annotations.Table(\n"
+" appliesTo=\"Cat1\",\n"
+" fetch=FetchMode.SELECT,\n"
+" optional=true)\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"
+" @Column(table=\"Cat1\")\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" @Column(table=\"Cat2\")\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:2885
+#, fuzzy, no-c-format
+msgid "In hbm.xml, use the <literal><join></literal> element."
msgstr "例如,如果我们有如下的 <literal><properties></literal> 映射:"
+#. Tag: programlisting
+#: basic_mapping.xml:2903
+#, fuzzy, no-c-format
+msgid ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+"\n"
+" <key ... />\n"
+"\n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+msgstr ""
+"<join\n"
+" table=\"tablename\"\n"
+" schema=\"owner\"\n"
+" catalog=\"catalog\"\n"
+" fetch=\"join|select\"\n"
+" inverse=\"true|false\"\n"
+" optional=\"true|false\">\n"
+" \n"
+" <key ... />\n"
+" \n"
+" <property ... />\n"
+" ...\n"
+"</join>"
+
#. Tag: para
+#: basic_mapping.xml:2907
#, no-c-format
-msgid "You might have some legacy data association that refers to this unique key of the <literal>Person</literal> table, instead of to the primary key:"
-msgstr "然后,我们可能有一些遗留的数据关联,引用 <literal>Person</literal> 表的这个唯一键,而不是主键:"
+msgid "<literal>table</literal>: the name of the joined table."
+msgstr "<literal>table</literal>:被连接表的名称。 "
#. Tag: para
+#: basic_mapping.xml:2924
#, no-c-format
-msgid "The use of this outside the context of mapping legacy data is not recommended."
-msgstr "我们并不推荐这样使用,除非在映射遗留数据的情况下。 "
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>join</literal>): "
+"if set to <literal>join</literal>, the default, Hibernate will use an inner "
+"join to retrieve a <literal><join></literal> defined by a class or its "
+"superclasses. It will use an outer join for a <literal><join></"
+"literal> defined by a subclass. If set to <literal>select</literal> then "
+"Hibernate will use a sequential select for a <literal><join></literal> "
+"defined on a subclass. This will be issued only if a row represents an "
+"instance of the subclass. Inner joins will still be used to retrieve a "
+"<literal><join></literal> defined by the class and its superclasses."
+msgstr ""
+"<literal>fetch</literal>(可选 — 默认是 <literal>join</literal>):如果设置为"
+"默认值 <literal>join</literal>,Hibernate 将使用一个内连接来得到这个类或其超"
+"类定义的 <literal><join></literal>,而使用一个外连接来得到其子类定义的 "
+"<literal><join></literal>。如果设置为 <literal>select</literal>,则 "
+"Hibernate 将为子类定义的 <literal><join></literal> 使用顺序选择。这仅在"
+"一行数据表示一个子类的对象的时候才会发生。对这个类和其超类定义的 "
+"<literal><join></literal>,依然会使用内连接得到。 "
+#. Tag: para
+#: basic_mapping.xml:2939
+#, no-c-format
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will not insert or update the properties "
+"defined by this join."
+msgstr ""
+"<literal>inverse</literal>(可选 — 默认是 <literal>false</literal>):如果打"
+"开,Hibernate 不会插入或者更新此连接定义的属性。 "
+
+#. Tag: para
+#: basic_mapping.xml:2945
+#, no-c-format
+msgid ""
+"<literal>optional</literal> (optional - defaults to <literal>false</"
+"literal>): if enabled, Hibernate will insert a row only if the properties "
+"defined by this join are non-null. It will always use an outer join to "
+"retrieve the properties."
+msgstr ""
+"<literal>optional</literal>(可选 — 默认是 <literal>false</literal>):如果打"
+"开,Hibernate 只会在此连接定义的属性非空时插入一行数据,并且总是使用一个外连"
+"接来得到这些属性。 "
+
+#. Tag: para
+#: basic_mapping.xml:2953
+#, no-c-format
+msgid ""
+"For example, address information for a person can be mapped to a separate "
+"table while preserving value type semantics for all properties:"
+msgstr ""
+"例如,一个人(person)的地址(address)信息可以被映射到单独的表中(并保留所有"
+"属性的值类型语义): "
+
+#. Tag: programlisting
+#: basic_mapping.xml:2957
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+msgstr ""
+"<class name=\"Person\"\n"
+" table=\"PERSON\">\n"
+"\n"
+" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
+"\n"
+" <join table=\"ADDRESS\">\n"
+" <key column=\"ADDRESS_ID\"/>\n"
+" <property name=\"address\"/>\n"
+" <property name=\"zip\"/>\n"
+" <property name=\"country\"/>\n"
+" </join>\n"
+" ..."
+
+#. Tag: para
+#: basic_mapping.xml:2959
+#, no-c-format
+msgid ""
+"This feature is often only useful for legacy data models. We recommend fewer "
+"tables than classes and a fine-grained domain model. However, it is useful "
+"for switching between inheritance mapping strategies in a single hierarchy, "
+"as explained later."
+msgstr ""
+"此特性常常对遗留数据模型有用,我们推荐表个数比类个数少,以及细粒度的领域模"
+"型。然而,在单独的继承树上切换继承映射策略是有用的,后面会解释这点。 "
+
#. Tag: title
+#: basic_mapping.xml:2967
#, no-c-format
-msgid "Subclass"
-msgstr "子类(subclass) "
+msgid "Mapping one to one and one to many associations"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2969
#, no-c-format
-msgid "Polymorphic persistence requires the declaration of each subclass of the root persistent class. For the table-per-class-hierarchy mapping strategy, the <literal><subclass></literal> declaration is used. For example:"
-msgstr "最后,多态持久化需要为父类的每个子类都进行定义。对于“每一棵类继承树对应一个表”的策略来说,就需要使用 <literal><subclass></literal> 定义。 "
+msgid ""
+"To link one entity to an other, you need to map the association property as "
+"a to one association. In the relational model, you can either use a foreign "
+"key or an association table, or (a bit less common) share the same primary "
+"key value between the two entities."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2974
#, no-c-format
-msgid "<literal>name</literal>: the fully qualified class name of the subclass."
-msgstr "<literal>name</literal>:子类的全限定名。 "
+msgid ""
+"To mark an association, use either <classname>@ManyToOne</classname> or "
+"<classname>@OnetoOne</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2978
#, no-c-format
-msgid "<literal>discriminator-value</literal> (optional - defaults to the class name): a value that distinguishes individual subclasses."
-msgstr "<literal>discriminator-value(辨别标志)</literal>(可选 — 默认为类名):一个用于区分每个独立的子类的值。 "
+msgid ""
+"<literal>@ManyToOne</literal> and <classname>@OneToOne</classname> have 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: para
+#: basic_mapping.xml:2985
#, no-c-format
-msgid "<literal>proxy</literal> (optional): specifies a class or interface used for lazy initializing proxies."
-msgstr "<literal>proxy</literal>(可选):指定一个类或者接口,在延迟装载时作为代理使用。 "
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than nothing will propagate certain operations to the "
+"associated object. The meaningful values are divided into three categories."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2992
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>true</literal>): setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
-msgstr "<literal>lazy</literal>(可选,默认是 <literal>true</literal>):设置为 <literal>lazy=\"false\"</literal> 禁止使用延迟装载。 "
+msgid ""
+"basic operations, which include: <literal>persist, merge, delete, save-"
+"update, evict, replicate, lock and refresh</literal>;"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:2998
+#, fuzzy, no-c-format
+msgid ""
+"special values: <literal>delete-orphan</literal> or <literal>all</literal> ;"
+msgstr ""
+"注意这里关联是如何用 <literal>entity-name</literal> 来代替 <literal>class</"
+"literal> 的。 "
+
+#. Tag: para
+#: basic_mapping.xml:3003
#, no-c-format
-msgid "Each subclass declares its own persistent properties and subclasses. <literal><version></literal> and <literal><id></literal> properties are assumed to be inherited from the root class. Each subclass in a hierarchy must define a unique <literal>discriminator-value</literal>. If this is not specified, the fully qualified Java class name is used."
-msgstr "每个子类都应该定义它自己的持久化属性和子类。<literal><version></literal> 和 <literal><id></literal> 属性可以从根父类继承下来。在一棵继承树上的每个子类都必须定义一个唯一的 <literal>discriminator-value</literal>。如果没有指定,就会使用 Java 类的全限定名。 "
+msgid ""
+"comma-separated combinations of operation names: <literal>cascade=\"persist,"
+"merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. "
+"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
+"that single valued many-to-one associations do not support orphan delete."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3012
#, no-c-format
-msgid "For information about inheritance mappings see <xref linkend=\"inheritance\" />."
-msgstr "更多关于继承映射的信息,参考 <xref linkend=\"inheritance\"/>。 "
+msgid ""
+"By default, single point associations are eagerly fetched in JPA 2. You can "
+"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
+"LAZY) </classname>in which case Hibernate will proxy the association and "
+"load it when the state of the associated entity is reached. You can force "
+"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)</"
+"classname>. In this case, the property is fetched lazily when the instance "
+"variable is first accessed. This requires build-time bytecode "
+"instrumentation. lazy=\"false\" specifies that the association will always "
+"be eagerly fetched."
+msgstr ""
+#. Tag: para
+#: basic_mapping.xml:3022
+#, no-c-format
+msgid ""
+"With the default JPA options, single-ended associations are loaded with a "
+"subsequent select if set to <literal>LAZY</literal>, or a SQL JOIN is used "
+"for <literal>EAGER</literal> associations. You can however adjust the "
+"fetching strategy, ie how data is fetched by using <literal>@Fetch</"
+"literal>. <literal>FetchMode</literal> can be <literal>SELECT</literal> (a "
+"select is triggered when the association needs to be loaded) 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: title
+#: basic_mapping.xml:3034
+#, fuzzy, no-c-format
+msgid "Using a foreign key or an association table"
+msgstr "惟一外键关联"
+
+#. Tag: para
+#: basic_mapping.xml:3036
+#, fuzzy, no-c-format
+msgid "An ordinary association to another persistent class is declared using a"
+msgstr ""
+"持久化对象之间一对一的关联关系是通过 <literal>one-to-one</literal> 元素定义"
+"的。"
+
+#. Tag: para
+#: basic_mapping.xml:3041
#, no-c-format
-msgid "Joined-subclass"
-msgstr "连接的子类(joined-subclass) "
+msgid ""
+"<classname>@ManyToOne</classname> if several entities can point to the the "
+"target entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3046
#, no-c-format
-msgid "Each subclass can also be mapped to its own table. This is called the table-per-subclass mapping strategy. An inherited state is retrieved by joining with the table of the superclass. To do this you use the <literal><joined-subclass></literal> element. For example:"
-msgstr "此外,每个子类可能被映射到他自己的表中(每个子类一个表的策略)。被继承的状态通过和超类的表关联得到。我们使用 <literal><joined-subclass></literal> 元素。 "
+msgid ""
+"<classname>@OneToOne</classname> if only a single entity can point to the "
+"the target entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3051
#, no-c-format
-msgid "<literal>table</literal>: the name of the subclass table."
-msgstr "<literal>table</literal>:子类的表名。"
+msgid ""
+"and a foreign key in one table is referencing the primary key column(s) of "
+"the target table."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3054
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3056
#, no-c-format
-msgid "<literal>proxy</literal> (optional): specifies a class or interface to use for lazy initializing proxies."
-msgstr "<literal>proxy</literal>(可选):指定一个类或者接口,在延迟装载时作为代理使用。 "
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default value"
+"(s) is 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: programlisting
+#: basic_mapping.xml:3064
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"targetEntity=CompanyImpl.class )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3066
#, no-c-format
-msgid "<literal>lazy</literal> (optional, defaults to <literal>true</literal>): setting <literal>lazy=\"false\"</literal> disables the use of lazy fetching."
-msgstr "<literal>lazy</literal>(可选,默认是 <literal>true</literal>):设置为 <literal>lazy=\"false\"</literal> 禁止使用延迟装载。 "
+msgid ""
+"You can also map a 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>@JoinTable.joinColumns</literal>) and a a foreign key referencing "
+"the target entity table (through <literal>@JoinTable.inverseJoinColumns</"
+"literal>)."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3074
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" @JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3077
#, no-c-format
-msgid "A discriminator column is not required for this mapping strategy. Each subclass must, however, declare a table column holding the object identifier using the <literal><key></literal> element. The mapping at the start of the chapter would then be re-written as:"
-msgstr "这种映射策略不需要指定辨别标志(discriminator)字段。但是,每一个子类都必须使用 <literal><key></literal> 元素指定一个表字段来持有对象的标识符。本章开始的映射可以被用如下方式重写: "
+msgid ""
+"You can use a SQL fragment to simulate a physical join column using the "
+"<classname>@JoinColumnOrFormula</classname> / "
+"<classname>@JoinColumnOrformulas</classname> annotations (just like you can "
+"use a SQL fragment to simulate a property column via the "
+"<classname>@Formula</classname> annotation)."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3083
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" @ManyToOne\n"
+" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
+" public Person getOwner() {\n"
+" return person;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3086
+#, no-c-format
+msgid ""
+"You can mark an association as mandatory by using the "
+"<literal>optional=false</literal> attribute. We recommend to use Bean "
+"Validation's <classname>@NotNull</classname> annotation as a better "
+"alternative however. As a consequence, the foreign key column(s) will be "
+"marked as not nullable (if possible)."
+msgstr ""
+
+#. Tag: para
+#: basic_mapping.xml:3092
+#, no-c-format
+msgid ""
+"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. 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."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3100
#, no-c-format
-msgid "Union-subclass"
-msgstr "联合子类(union-subclass) "
+msgid "@NotFound annotation"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3102
+#, 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
+#: basic_mapping.xml:3105
#, no-c-format
-msgid "A third option is to map only the concrete classes of an inheritance hierarchy to tables. This is called the table-per-concrete-class strategy. Each table defines all persistent states of the class, including the inherited state. In Hibernate, it is not necessary to explicitly map such inheritance hierarchies. You can map each class with a separate <literal><class></literal> declaration. However, if you wish use polymorphic associations (e.g. an association to the superclass of your hierarchy), you need to use the <literal><union-subclass></literal> mapping. For example:"
-msgstr "第三种选择是仅仅映射类继承树中具体类部分到表中(每个具体类一张表的策略)。其中,每张表定义了类的所有持久化状态,包括继承的状态。在 Hibernate 中,并不需要完全显式地映射这样的继承树。你可以简单地使用单独的 <literal><class></literal> 定义映射每个类。然而,如果你想使用多态关联(例如,一个对类继承树中超类的关联),你需要使用 <literal><union-subclass></literal> 映射。 "
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when "
+"a given entity is deleted. In this case Hibernate generates a cascade delete "
+"constraint at the database level."
+msgstr ""
+#. Tag: title
+#: basic_mapping.xml:3110
+#, no-c-format
+msgid "@OnDelete annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3112
+#, 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
+#: basic_mapping.xml:3115
#, no-c-format
-msgid "No discriminator column or key column is required for this mapping strategy."
-msgstr "这种映射策略不需要指定辨别标志(discriminator)字段。"
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name using "
+"<literal>@ForeignKey</literal>."
+msgstr ""
#. Tag: title
+#: basic_mapping.xml:3120
+#, fuzzy, no-c-format
+msgid "@ForeignKey annotation"
+msgstr "惟一外键关联"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3122
#, no-c-format
-msgid "Join"
-msgstr "连接(join) "
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @ForeignKey(name=\"FK_PARENT\")\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3125
#, no-c-format
-msgid "Using the <literal><join></literal> element, it is possible to map properties of one class to several tables that have a one-to-one relationship. For example:"
-msgstr "使用 <literal><join></literal> 元素,假若在表之间存在一对一关联,可以将一个类的属性映射到多张表中。 "
+msgid ""
+"Sometimes, you want to link one entity to an other not by the target entity "
+"primary key but by a different unique key. You can achieve that by "
+"referencing the unique key column(s) in <methodname>@JoinColumn."
+"referenceColumnName</methodname>."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3130 basic_mapping.xml:3682
+#, no-c-format
+msgid ""
+"@Entity\n"
+"class Person {\n"
+" @Id Integer personNumber;\n"
+" String firstName;\n"
+" @Column(name=\"I\")\n"
+" String initial;\n"
+" String lastName;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"class Home {\n"
+" @ManyToOne\n"
+" @JoinColumns({\n"
+" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
+" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
+" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
+" })\n"
+" Person owner\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3132
#, no-c-format
-msgid "<literal>table</literal>: the name of the joined table."
-msgstr "<literal>table</literal>:被连接表的名称。 "
+msgid ""
+"This is not encouraged however and should be reserved to legacy mappings."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3135
#, no-c-format
-msgid "<literal>fetch</literal> (optional - defaults to <literal>join</literal>): if set to <literal>join</literal>, the default, Hibernate will use an inner join to retrieve a <literal><join></literal> defined by a class or its superclasses. It will use an outer join for a <literal><join></literal> defined by a subclass. If set to <literal>select</literal> then Hibernate will use a sequential select for a <literal><join></literal> defined on a subclass. This will be issued only if a row represents an instance of the subclass. Inner joins will still be used to retrieve a <literal><join></literal> defined by the class and its superclasses."
-msgstr "<literal>fetch</literal>(可选 — 默认是 <literal>join</literal>):如果设置为默认值 <literal>join</literal>,Hibernate 将使用一个内连接来得到这个类或其超类定义的 <literal><join></literal>,而使用一个外连接来得到其子类定义的 <literal><join></literal>。如果设置为 <literal>select</literal>,则 Hibernate 将为子类定义的 <literal><join></literal> 使用顺序选择。这仅在一行数据表示一个子类的对象的时候才会发生。对这个类和其超类定义的 <literal><join></literal>,依然会使用内连接得到。 "
+msgid ""
+"In hbm.xml, mapping an association is similar. The main difference is that a "
+"<classname>@OneToOne</classname> is mapped as <literal><many-to-one "
+"unique=\"true\"/></literal>, let's dive into the subject."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3177
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+"<many-to-one\n"
+" name=\"propertyName\"\n"
+" column=\"column_name\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" fetch=\"join|select\"\n"
+" update=\"true|false\"\n"
+" insert=\"true|false\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" unique=\"true|false\"\n"
+" not-null=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" formula=\"arbitrary SQL expression\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" index=\"index_name\"\n"
+" unique_key=\"unique_key_id\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:3185 basic_mapping.xml:3868
#, no-c-format
-msgid "<literal>inverse</literal> (optional - defaults to <literal>false</literal>): if enabled, Hibernate will not insert or update the properties defined by this join."
-msgstr "<literal>inverse</literal>(可选 — 默认是 <literal>false</literal>):如果打开,Hibernate 不会插入或者更新此连接定义的属性。 "
+msgid ""
+"<literal>column</literal> (optional): the name of the foreign key column. "
+"This can also be specified by nested <literal><column></literal> "
+"element(s)."
+msgstr ""
+"<literal>column</literal>(可选):外键字段的名称。也可以通过嵌套的 "
+"<literal><column></literal> 指定。 "
#. Tag: para
+#: basic_mapping.xml:3191 basic_mapping.xml:3385
#, no-c-format
-msgid "<literal>optional</literal> (optional - defaults to <literal>false</literal>): if enabled, Hibernate will insert a row only if the properties defined by this join are non-null. It will always use an outer join to retrieve the properties."
-msgstr "<literal>optional</literal>(可选 — 默认是 <literal>false</literal>):如果打开,Hibernate 只会在此连接定义的属性非空时插入一行数据,并且总是使用一个外连接来得到这些属性。 "
+msgid ""
+"<literal>class</literal> (optional - defaults to the property type "
+"determined by reflection): the name of the associated class."
+msgstr ""
+"<literal>class</literal>(可选 — 默认是通过反射得到的属性类型):被关联的类的"
+"名字。 "
#. Tag: para
+#: basic_mapping.xml:3197 basic_mapping.xml:3391
#, no-c-format
-msgid "For example, address information for a person can be mapped to a separate table while preserving value type semantics for all properties:"
-msgstr "例如,一个人(person)的地址(address)信息可以被映射到单独的表中(并保留所有属性的值类型语义): "
+msgid ""
+"<literal>cascade</literal> (optional): specifies which operations should be "
+"cascaded from the parent object to the associated object."
+msgstr ""
+"<literal>cascade(级联)</literal>(可选)表明操作是否从父对象级联到被关联的"
+"对象。 "
#. Tag: para
+#: basic_mapping.xml:3203 basic_mapping.xml:3407
#, no-c-format
-msgid "This feature is often only useful for legacy data models. We recommend fewer tables than classes and a fine-grained domain model. However, it is useful for switching between inheritance mapping strategies in a single hierarchy, as explained later."
-msgstr "此特性常常对遗留数据模型有用,我们推荐表个数比类个数少,以及细粒度的领域模型。然而,在单独的继承树上切换继承映射策略是有用的,后面会解释这点。 "
+msgid ""
+"<literal>fetch</literal> (optional - defaults to <literal>select</literal>): "
+"chooses between outer-join fetching or sequential select fetching."
+msgstr ""
+"<literal>fetch</literal>(可选 — 默认为 <literal>select</literal>):在外连接"
+"抓取(outer-join fetching)和序列选择抓取(sequential select fetching)两者中"
+"选择其一。 "
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3209
#, no-c-format
-msgid "Key"
-msgstr "Key"
+msgid ""
+"<literal>update, insert</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that the mapped columns should be included in SQL "
+"<literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. "
+"Setting both to <literal>false</literal> allows a pure \"derived\" "
+"association whose value is initialized from another property that maps to "
+"the same column(s), or by a trigger or other application."
+msgstr ""
+"<literal>update, insert</literal>(可选 — 默认为 <literal>true</literal>)指"
+"定对应的字段是否包含在用于 <literal>UPDATE</literal> 和/或 <literal>INSERT</"
+"literal> 的 SQL 语句中。如果二者都是<literal>false</literal>,则这是一个纯粹"
+"的 “外源性(derived)”关联,它的值是通过映射到同一个(或多个)字段的某些其他"
+"属性得到 或者通过 trigger(触发器)、或其他程序生成。 "
#. Tag: para
+#: basic_mapping.xml:3219
#, no-c-format
-msgid "The <literal><key></literal> element has featured a few times within this guide. It appears anywhere the parent mapping element defines a join to a new table that references the primary key of the original table. It also defines the foreign key in the joined table:"
-msgstr "我们目前已经见到过 <literal><key></literal> 元素多次了。这个元素在父映射元素定义了对新表的连接,并且在被连接表中定义了一个外键引用原表的主键的情况下经常使用。 "
+msgid ""
+"<literal>property-ref</literal> (optional): the name of a property of the "
+"associated class that is joined to this foreign key. If not specified, the "
+"primary key of the associated class is used."
+msgstr ""
+"<literal>property-ref</literal>:(可选)被关联到此外键的类中的对应属性的名"
+"字。如果没有指定,被关联类的主键将被使用。 "
#. Tag: para
+#: basic_mapping.xml:3232
#, no-c-format
-msgid "<literal>on-delete</literal> (optional - defaults to <literal>noaction</literal>): specifies whether the foreign key constraint has database-level cascade delete enabled."
-msgstr "<literal>on-delete</literal>(可选,默认是 <literal>noaction</literal>):表明外键关联是否打开数据库级别的级联删除。 "
+msgid ""
+"<literal>unique</literal> (optional): enables the DDL generation of a unique "
+"constraint for the foreign-key column. By allowing this to be the target of "
+"a <literal>property-ref</literal>, you can make the association multiplicity "
+"one-to-one."
+msgstr ""
+"<literal>unique</literal>(可选):使用 DDL 为外键字段生成一个唯一约束。此"
+"外, 这也可以用作 <literal>property-ref</literal> 的目标属性。这使关联同时具"
+"有一对一的效果。 "
#. Tag: para
+#: basic_mapping.xml:3240
#, no-c-format
-msgid "<literal>property-ref</literal> (optional): specifies that the foreign key refers to columns that are not the primary key of the original table. It is provided for legacy data."
-msgstr "<literal>property-ref</literal>(可选):表明外键引用的字段不是原表的主键(提供给遗留数据)。 "
+msgid ""
+"<literal>not-null</literal> (optional): enables the DDL generation of a "
+"nullability constraint for the foreign key columns."
+msgstr ""
+"<literal>not-null</literal>(可选):使用 DDL 为外键字段生成一个非空约束。 "
#. Tag: para
+#: basic_mapping.xml:3254
#, no-c-format
-msgid "<literal>not-null</literal> (optional): specifies that the foreign key columns are not nullable. This is implied whenever the foreign key is also part of the primary key."
-msgstr "<literal>not-null</literal>(可选):表明外键的字段不可为空(这意味着无论何时外键都是主键的一部分)。 "
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
+"by default, single point associations are proxied. <literal>lazy=\"no-proxy"
+"\"</literal> specifies that the property should be fetched lazily when the "
+"instance variable is first accessed. This requires build-time bytecode "
+"instrumentation. <literal>lazy=\"false\"</literal> specifies that the "
+"association will always be eagerly fetched."
+msgstr ""
+"<literal>lazy</literal>(可选 — 默认为 <literal>proxy</literal>):默认情况"
+"下,单点关联是经过代理的。<literal>lazy=\"no-proxy\"</literal> 指定此属性应该"
+"在实例变量第一次被访问时应该延迟抓取(fetche lazily)(需要运行时字节码的增"
+"强)。<literal>lazy=\"false\"</literal> 指定此关联总是被预先抓取。 "
#. Tag: para
+#: basic_mapping.xml:3264
#, no-c-format
-msgid "<literal>update</literal> (optional): specifies that the foreign key should never be updated. This is implied whenever the foreign key is also part of the primary key."
-msgstr "<literal>update</literal>(可选):表明外键决不应该被更新(这意味着无论何时外键都是主键的一部分)。 "
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how foreign keys that reference missing rows will be "
+"handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal>(可选 - 默认为<literal>exception</literal>):指"
+"定如何处理引用缺失行的外键:<literal>ignore</literal> 会把缺失的行作为一个空"
+"关联处理。 "
#. Tag: para
+#: basic_mapping.xml:3272 basic_mapping.xml:3448
#, no-c-format
-msgid "<literal>unique</literal> (optional): specifies that the foreign key should have a unique constraint. This is implied whenever the foreign key is also the primary key."
-msgstr "<literal>unique</literal>(可选):表明外键应有唯一性约束(这意味着无论何时外键都是主键的一部分)。 "
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class."
+msgstr "<literal>entity-name</literal>(可选):被关联的类的实体名。 "
#. Tag: para
+#: basic_mapping.xml:3277
#, no-c-format
-msgid "For systems where delete performance is important, we recommend that all keys should be defined <literal>on-delete=\"cascade\"</literal>. Hibernate uses a database-level <literal>ON CASCADE DELETE</literal> constraint, instead of many individual <literal>DELETE</literal> statements. Be aware that this feature bypasses Hibernate's usual optimistic locking strategy for versioned data."
-msgstr "对那些看重删除性能的系统,我们推荐所有的键都应该定义为 <literal>on-delete=\"cascade\"</literal>,这样 Hibernate 将使用数据库级的 <literal>ON CASCADE DELETE</literal> 约束,而不是多个 <literal>DELETE</literal> 语句。注意,这个特性会绕过 Hibernate 通常对版本数据(versioned data)采用的乐观锁策略。 "
+msgid ""
+"<literal>formula</literal> (optional): an SQL expression that defines the "
+"value for a <emphasis>computed</emphasis> foreign key."
+msgstr ""
+"<literal>formula</literal>(可选):SQL 表达式,用于定义 <emphasis>computed"
+"(计算出的)</emphasis>外键值。"
#. Tag: para
+#: basic_mapping.xml:3284
+#, fuzzy, no-c-format
+msgid ""
+"Setting a value of the <literal>cascade</literal> attribute to any "
+"meaningful value other than <literal>none</literal> will propagate certain "
+"operations to the associated object. The meaningful values are divided into "
+"three categories. First, basic operations, which include: <literal>persist, "
+"merge, delete, save-update, evict, replicate, lock and refresh</literal>; "
+"second, special values: <literal>delete-orphan</literal>; and third,"
+"<literal>all</literal> comma-separated combinations of operation names: "
+"<literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,"
+"delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> "
+"for a full explanation. Note that single valued, many-to-one and one-to-one, "
+"associations do not support orphan delete."
+msgstr ""
+"<literal>cascade</literal> 属性设置为除了<literal>none</literal> 以外任何有意"
+"义的值,它将把特定的操作传递到关联对象中。这个值就代表着 Hibernate 基本操作的"
+"名称,<literal>persist, merge, delete, save-update, evict, replicate, lock, "
+"refresh</literal>,以及特别的值 <literal>delete-orphan</literal> 和 "
+"<literal>all</literal>,并且可以用逗号分隔符来组合这些操作,例如,"
+"<literal>cascade=\"persist,merge,evict\"</literal> 或 <literal>cascade="
+"\"all,delete-orphan\"</literal>。更全面的解释请参考 <xref linkend="
+"\"objectstate-transitive\"/>。注意,单值关联(many-to-one 和 one-to-one 关"
+"联)不支持删除孤儿(orphan delete,删除不再被引用的值)。 "
+
+#. Tag: para
+#: basic_mapping.xml:3298
#, no-c-format
-msgid "The <literal>not-null</literal> and <literal>update</literal> attributes are useful when mapping a unidirectional one-to-many association. If you map a unidirectional one-to-many association to a non-nullable foreign key, you <emphasis>must</emphasis> declare the key column using <literal><key not-null=\"true\"></literal>."
-msgstr "<literal>not-null</literal> 和 <literal>update</literal> 属性在映射单向一对多关联的时候有用。如果你映射一个单向一对多关联到非空的(non-nullable)外键,你<emphasis>必须</emphasis> 用 <literal><key not-null=\"true\"></literal> 定义此键字段。 "
+msgid ""
+"Here is an example of a typical <literal>many-to-one</literal> declaration:"
+msgstr "一个典型的简单 <literal>many-to-one</literal> 定义例子: "
+#. Tag: programlisting
+#: basic_mapping.xml:3301
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+msgstr ""
+"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3303
+#, no-c-format
+msgid ""
+"The <literal>property-ref</literal> attribute should only be used for "
+"mapping legacy data where a foreign key refers to a unique key of the "
+"associated table other than the primary key. This is a complicated and "
+"confusing relational model. For example, if the <literal>Product</literal> "
+"class had a unique serial number that is not the primary key. The "
+"<literal>unique</literal> attribute controls Hibernate's DDL generation with "
+"the SchemaExport tool."
+msgstr ""
+"<literal>property-ref</literal> 属性只应该用来对付遗留下来的数据库系统,可能"
+"有外键指向对方关联表的是个非主键字段(但是应该是一个惟一关键字)的情况下。这"
+"是一种十分丑陋的关系模型。比如说,假设 <literal>Product</literal> 类有一个惟"
+"一的序列号,它并不是主键。(<literal>unique</literal> 属性控制 Hibernate 通"
+"过 SchemaExport 工具进行的 DDL 生成。) "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3311
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+msgstr ""
+"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
+"\"SERIAL_NUMBER\"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3313
+#, no-c-format
+msgid "Then the mapping for <literal>OrderItem</literal> might use:"
+msgstr "那么关于 <literal>OrderItem</literal> 的映射可能是:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3316
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+msgstr ""
+"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
+"\"PRODUCT_SERIAL_NUMBER\"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3318
+#, no-c-format
+msgid "This is not encouraged, however."
+msgstr "当然,我们决不鼓励这种用法。 "
+
+#. Tag: para
+#: basic_mapping.xml:3320
+#, no-c-format
+msgid ""
+"If the referenced unique key comprises multiple properties of the associated "
+"entity, you should map the referenced properties inside a named <literal><"
+"properties></literal> element."
+msgstr ""
+"如果被引用的唯一主键由关联实体的多个属性组成,你应该在名称为 <literal><"
+"properties></literal> 的元素 里面映射所有关联的属性。"
+
+#. Tag: para
+#: basic_mapping.xml:3324
+#, no-c-format
+msgid ""
+"If the referenced unique key is the property of a component, you can specify "
+"a property path:"
+msgstr "假若被引用的唯一主键是组件的属性,你可以指定属性路径: "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3327
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+msgstr ""
+"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
+"\"OWNER_SSN\"/>"
+
#. Tag: title
+#: basic_mapping.xml:3331
#, no-c-format
-msgid "Column and formula elements"
-msgstr "字段和规则元素(column and formula elements) "
+msgid "Sharing the primary key with the associated entity"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3333
#, no-c-format
-msgid "Mapping elements which accept a <literal>column</literal> attribute will alternatively accept a <literal><column></literal> subelement. Likewise, <literal><formula></literal> is an alternative to the <literal>formula</literal> attribute. For example:"
-msgstr "任何接受 <literal>column</literal> 属性的映射元素都可以选择接受 <literal><column></literal> 子元素。同样的,<literal>formula</literal> 子元素也可以替换 <literal><formula></literal> 属性。 "
+msgid ""
+"The second approach is to ensure an entity and its associated entity share "
+"the same primary key. In this case the primary key column is also a foreign "
+"key and there is no extra column. These associations are always one to one."
+msgstr ""
+#. Tag: title
+#: basic_mapping.xml:3339
+#, fuzzy, no-c-format
+msgid "One to One association"
+msgstr "惟一外键关联"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3341
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @MapsId\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"} \n"
+"\n"
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3345
#, no-c-format
-msgid "Most of the attributes on <literal>column</literal> provide a means of tailoring the DDL during automatic schema generation. The <literal>read</literal> and <literal>write</literal> attributes allow you to specify custom SQL that Hibernate will use to access the column's value. For more on this, see the discussion of <link linkend=\"mapping-column-read-and-write\">column read and write expressions</link>."
-msgstr "<literal>column</literal> 上的大多数属性都提供了在自动模式生成过程中对 DDL 进行裁剪的方法。<literal>read</literal> 和 <literal>write</literal> 属性允许你指定 Hibernate 用于访问字段值的自定义的 SQL。关于更多的内容,请参考 <link linkend=\"mapping-column-read-and-write\">column read and write expressions</link>。"
+msgid ""
+"Many people got confused by these primary key based one to one associations. "
+"They can only be lazily loaded if Hibernate knows that the other side of the "
+"association is always present. To indicate to Hibernate that it is the case, "
+"use <classname>@OneToOne(optional=false)</classname>."
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3352
#, no-c-format
-msgid "The <literal>column</literal> and <literal>formula</literal> elements can even be combined within the same property or association mapping to express, for example, exotic join conditions."
-msgstr "<literal>column</literal> 和 <literal>formula</literal> 属性甚至可以在同一个属性或关联映射中被合并来表达,例如,一些奇异的连接条件。"
+msgid "In hbm.xml, use the following mapping."
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3377
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+msgstr ""
+"<one-to-one\n"
+" name=\"propertyName\"\n"
+" class=\"ClassName\"\n"
+" cascade=\"cascade_style\"\n"
+" constrained=\"true|false\"\n"
+" fetch=\"join|select\"\n"
+" property-ref=\"propertyNameFromAssociatedClass\"\n"
+" access=\"field|property|ClassName\"\n"
+" formula=\"any SQL expression\"\n"
+" lazy=\"proxy|no-proxy|false\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
+" embed-xml=\"true|false\"\n"
+" foreign-key=\"foreign_key_name\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3397
+#, no-c-format
+msgid ""
+"<literal>constrained</literal> (optional): specifies that a foreign key "
+"constraint on the primary key of the mapped table and references the table "
+"of the associated class. This option affects the order in which <literal>save"
+"()</literal> and <literal>delete()</literal> are cascaded, and determines "
+"whether the association can be proxied. It is also used by the schema export "
+"tool."
+msgstr ""
+"<literal>constrained(约束)</literal>(可选)表明该类对应的表对应的数据库"
+"表,和被关联的对象所对应的数据库表之间,通过一个外键引用对主键进行约束。这个"
+"选项影响 <literal>save()</literal> 和 <literal>delete()</literal> 在级联执行"
+"时的先后顺序以及决定该关联能否被委托(也在 schema export tool 中被使用)。 "
+
+#. Tag: para
+#: basic_mapping.xml:3413
+#, no-c-format
+msgid ""
+"<literal>property-ref</literal> (optional): the name of a property of the "
+"associated class that is joined to the primary key of this class. If not "
+"specified, the primary key of the associated class is used."
+msgstr ""
+"<literal>property-ref</literal>:(可选)指定关联类的属性名,这个属性将会和本"
+"类的主键相对应。如果没有指定,会使用对方关联类的主键。 "
+
+#. Tag: para
+#: basic_mapping.xml:3426
+#, no-c-format
+msgid ""
+"<literal>formula</literal> (optional): almost all one-to-one associations "
+"map to the primary key of the owning entity. If this is not the case, you "
+"can specify another column, columns or expression to join on using an SQL "
+"formula. See <literal>org.hibernate.test.onetooneformula</literal> for an "
+"example."
+msgstr ""
+"<literal>formula </literal>(可选):绝大多数一对一的关联都指向其实体的主键。"
+"在一些少见的情况中,你可能会指向其他的一个或多个字段,或者是一个表达式,这些"
+"情况下,你可以用一个 SQL 公式来表示。(可以在 org.hibernate.test."
+"onetooneformula 找到例子) "
+
+#. Tag: para
+#: basic_mapping.xml:3435
+#, no-c-format
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): "
+"by default, single point associations are proxied. <literal>lazy=\"no-proxy"
+"\"</literal> specifies that the property should be fetched lazily when the "
+"instance variable is first accessed. It requires build-time bytecode "
+"instrumentation. <literal>lazy=\"false\"</literal> specifies that the "
+"association will always be eagerly fetched. <emphasis>Note that if "
+"<literal>constrained=\"false\"</literal>, proxying is impossible and "
+"Hibernate will eagerly fetch the association</emphasis>."
+msgstr ""
+"<literal>lazy</literal>(可选 — 默认为 <literal>proxy</literal>):默认情况"
+"下,单点关联是经过代理的。<literal>lazy=\"no-proxy\"</literal>指定此属性应该"
+"在实例变量第一次被访问时应该延迟抓取(fetche lazily)(需要运行时字节码的增"
+"强)。 <literal>lazy=\"false\"</literal>指定此关联总是被预先抓取。<emphasis>"
+"注意,如果<literal>constrained=\"false\"</literal>, 不可能使用代理,Hibernate"
+"会采取预先抓取</emphasis>。"
+
+#. Tag: para
+#: basic_mapping.xml:3454
+#, no-c-format
+msgid ""
+"Primary key associations do not need an extra table column. If two rows are "
+"related by the association, then the two table rows share the same primary "
+"key value. To relate two objects by a primary key association, ensure that "
+"they are assigned the same identifier value."
+msgstr ""
+"主键关联不需要额外的表字段;如果两行是通过这种一对一关系相关联的,那么这两行"
+"就共享同样的主关键字值。所以如果你希望两个对象通过主键一对一关联,你必须确认"
+"它们被赋予同样的标识值。"
+
+#. Tag: para
+#: basic_mapping.xml:3460
+#, no-c-format
+msgid ""
+"For a primary key association, add the following mappings to "
+"<literal>Employee</literal> and <literal>Person</literal> respectively:"
+msgstr ""
+"比如说,对下面的 <literal>Employee</literal> 和 <literal>Person</literal> 进"
+"行主键一对一关联:"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3464
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" class=\"Person\"/>"
+msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3466
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+msgstr ""
+"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3468
+#, no-c-format
+msgid ""
+"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
+"tables are equal. You use a special Hibernate identifier generation strategy "
+"called <literal>foreign</literal>:"
+msgstr ""
+"现在我们必须确保 PERSON 和 EMPLOYEE 中相关的字段是相等的。我们使用一个被成为 "
+"<literal>foreign</literal> 的特殊的 hibernate 标识符生成策略: "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3472
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">employee</param>\n"
+" </generator>\n"
+" </id>\n"
+" ...\n"
+" <one-to-one name=\"employee\"\n"
+" class=\"Employee\"\n"
+" constrained=\"true\"/>\n"
+"</class>"
+
+#. Tag: para
+#: basic_mapping.xml:3474
+#, no-c-format
+msgid ""
+"A newly saved instance of <literal>Person</literal> is assigned the same "
+"primary key value as the <literal>Employee</literal> instance referred with "
+"the <literal>employee</literal> property of that <literal>Person</literal>."
+msgstr ""
+"一个刚刚保存的 <literal>Person</literal> 实例被赋予和该 <literal>Person</"
+"literal> 的 <literal>employee</literal> 属性所指向的 <literal>Employee</"
+"literal> 实例同样的关键字值。 "
+
#. Tag: title
+#: basic_mapping.xml:3482
#, no-c-format
-msgid "Import"
-msgstr "引用(import) "
+msgid "Natural-id"
+msgstr "自然 ID(natural-id) "
#. Tag: para
+#: basic_mapping.xml:3484
+#, fuzzy, no-c-format
+msgid ""
+"Although we recommend the use of surrogate keys as primary keys, you should "
+"try to identify natural keys for all entities. A natural key is a property "
+"or combination of properties that is unique and non-null. It is also "
+"immutable. Map the properties of the natural key as <classname>@NaturalId</"
+"classname> or map them inside the <literal><natural-id></literal> "
+"element. Hibernate will generate the necessary unique key and nullability "
+"constraints and, as a result, your mapping will be more self-documenting."
+msgstr ""
+"我们建议使用代用键(键值不具备实际意义)作为主键,我们仍然应该尝试为所有的实"
+"体采用自然的键值作为(附加——译者注)标示。自然键(natural key)是单个或组合属"
+"性,他们必须唯一且非空。如果它还是不可变的那就更理想了。在 <literal><"
+"natural-id></literal> 元素中列出自然键的属性。Hibernate 会帮你生成必须的唯"
+"一键值和非空约束,你的映射会更加的明显易懂(原文是 self-documenting,自我注"
+"解)。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3493
#, no-c-format
-msgid "If your application has two persistent classes with the same name, and you do not want to specify the fully qualified package name in Hibernate queries, classes can be \"imported\" explicitly, rather than relying upon <literal>auto-import=\"true\"</literal>. You can also import classes and interfaces that are not explicitly mapped:"
-msgstr "假设你的应用程序有两个同样名字的持久化类,但是你不想在 Hibernate 查询中使用他们的全限定名。除了依赖 <literal>auto-import=\"true\"</literal> 以外,类也可以被显式地“import(引用)”。你甚至可以引用没有被明确映射的类和接口。 "
+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
+#: basic_mapping.xml:3495
#, no-c-format
-msgid "<literal>class</literal>: the fully qualified class name of any Java class."
-msgstr "<literal>class</literal>:任何 Java 类的全限定名。 "
+msgid "Or in XML,"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3497
+#, fuzzy, no-c-format
+msgid ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+msgstr ""
+"<natural-id mutable=\"true|false\"/>\n"
+" <property ... />\n"
+" <many-to-one ... />\n"
+" ......\n"
+"</natural-id>"
+
#. Tag: para
+#: basic_mapping.xml:3499
#, no-c-format
-msgid "<literal>rename</literal> (optional - defaults to the unqualified class name): a name that can be used in the query language."
-msgstr "<literal>rename</literal>(可选 — 默认为类的全限定名):在查询语句中可以使用的名字。 "
+msgid ""
+"It is recommended that you implement <literal>equals()</literal> and "
+"<literal>hashCode()</literal> to compare the natural key properties of the "
+"entity."
+msgstr ""
+"我们强烈建议你实现 <literal>equals()</literal> 和 <literal>hashCode()</"
+"literal> 方法,来比较实体的自然键属性。 "
+#. Tag: para
+#: basic_mapping.xml:3503
+#, no-c-format
+msgid ""
+"This mapping is not intended for use with entities that have natural primary "
+"keys."
+msgstr "这一映射不是为了把自然键作为主键而准备的。 "
+
+#. Tag: para
+#: basic_mapping.xml:3508
+#, no-c-format
+msgid ""
+"<literal>mutable</literal> (optional - defaults to <literal>false</"
+"literal>): by default, natural identifier properties are assumed to be "
+"immutable (constant)."
+msgstr ""
+"<literal>mutable</literal>(可选,默认为 <literal>false</literal>):默认情况"
+"下,自然标识属性被假定为不可变的(常量)。 "
+
#. Tag: title
+#: basic_mapping.xml:3516
+#, fuzzy, no-c-format
+msgid "<title>Any</title>"
+msgstr "<title>any</title>"
+
+#. Tag: para
+#: basic_mapping.xml:3518
+#, fuzzy, no-c-format
+msgid ""
+"There is one more type of property mapping. The <classname>@Any</classname> "
+"mapping defines a polymorphic association to classes from multiple tables. "
+"This type of mapping requires more than one column. The first column "
+"contains the type of the associated entity. The remaining columns contain "
+"the identifier. It is impossible to specify a foreign key constraint for "
+"this kind of association. This is not the usual way of mapping polymorphic "
+"associations and you should use this only in special cases. For example, for "
+"audit logs, user session data, etc."
+msgstr ""
+"这是属性映射的又一种类型。<literal><any></literal> 映射元素定义了一种从"
+"多个表到类的多态关联。这种类型的映射常常需要多于一个字段。第一个字段持有被关"
+"联实体的类型,其他的字段持有标识符。对这种类型的关联来说,不可能指定一个外键"
+"约束,所以这当然不是映射(多态)关联的通常的方式。你只应该在非常特殊的情况下"
+"使用它(比如,审计 log,用户会话数据等等)。 "
+
+#. Tag: para
+#: basic_mapping.xml:3528
+#, fuzzy, no-c-format
+msgid ""
+"The <classname>@Any</classname> 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. The <literal>metaType</"
+"literal> attribute allows the application to specify a custom type that maps "
+"database column values to persistent classes that have identifier properties "
+"of the type specified by <literal>idType</literal>. You must specify the "
+"mapping from values of the <literal>metaType</literal> to class names."
+msgstr ""
+"<literal>meta-type</literal> 属性使得应用程序能指定一个将数据库字段的值映射到"
+"持久化类的自定义类型。这个持久化类包含有用 <literal>id-type</literal> 指定的"
+"标识符属性。你必须指定从 meta-type 的值到类名的映射。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3538
#, no-c-format
-msgid "Any"
-msgstr "Any"
+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
+#: basic_mapping.xml:3540
#, no-c-format
-msgid "There is one more type of property mapping. The <literal><any></literal> mapping element defines a polymorphic association to classes from multiple tables. This type of mapping requires more than one column. The first column contains the type of the associated entity. The remaining columns contain the identifier. It is impossible to specify a foreign key constraint for this kind of association. This is not the usual way of mapping polymorphic associations and you should use this only in special cases. For example, for audit logs, user session data, etc."
-msgstr "这是属性映射的又一种类型。<literal><any></literal> 映射元素定义了一种从多个表到类的多态关联。这种类型的映射常常需要多于一个字段。第一个字段持有被关联实体的类型,其他的字段持有标识符。对这种类型的关联来说,不可能指定一个外键约束,所以这当然不是映射(多态)关联的通常的方式。你只应该在非常特殊的情况下使用它(比如,审计 log,用户会话数据等等)。 "
+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
+#: basic_mapping.xml:3544
+#, 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: para
+#: basic_mapping.xml:3546
#, no-c-format
-msgid "The <literal>meta-type</literal> attribute allows the application to specify a custom type that maps database column values to persistent classes that have identifier properties of the type specified by <literal>id-type</literal>. You must specify the mapping from values of the meta-type to class names."
-msgstr "<literal>meta-type</literal> 属性使得应用程序能指定一个将数据库字段的值映射到持久化类的自定义类型。这个持久化类包含有用 <literal>id-type</literal> 指定的标识符属性。你必须指定从 meta-type 的值到类名的映射。 "
+msgid "The hbm.xml equivalent is:"
+msgstr ""
+#. Tag: programlisting
+#: basic_mapping.xml:3548
+#, fuzzy, no-c-format
+msgid ""
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
+msgstr ""
+"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
+" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
+" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
+" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
+" <column name=\"table_name\"/>\n"
+" <column name=\"id\"/>\n"
+"</any>"
+
#. Tag: para
+#: basic_mapping.xml:3551
#, no-c-format
+msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
+msgstr ""
+
+#. Tag: programlisting
+#: basic_mapping.xml:3570
+#, fuzzy, no-c-format
+msgid ""
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
+msgstr ""
+"<any\n"
+" name=\"propertyName\"\n"
+" id-type=\"idtypename\"\n"
+" meta-type=\"metatypename\"\n"
+" cascade=\"cascade_style\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+">\n"
+" <meta-value ... />\n"
+" <meta-value ... />\n"
+" .....\n"
+" <column .... />\n"
+" <column .... />\n"
+" .....\n"
+"</any>"
+
+#. Tag: para
+#: basic_mapping.xml:3574
+#, no-c-format
msgid "<literal>name</literal>: the property name."
msgstr "<literal>name</literal>:属性名"
#. Tag: para
+#: basic_mapping.xml:3578
#, no-c-format
msgid "<literal>id-type</literal>: the identifier type."
msgstr "<literal>id-type</literal>:标识符类型"
#. Tag: para
+#: basic_mapping.xml:3582
#, no-c-format
-msgid "<literal>meta-type</literal> (optional - defaults to <literal>string</literal>): any type that is allowed for a discriminator mapping."
-msgstr "<literal>meta-type</literal>(可选 -默认是 <literal>string</literal>):允许辨别标志(discriminator)映射的任何类型。 "
+msgid ""
+"<literal>meta-type</literal> (optional - defaults to <literal>string</"
+"literal>): any type that is allowed for a discriminator mapping."
+msgstr ""
+"<literal>meta-type</literal>(可选 -默认是 <literal>string</literal>):允许"
+"辨别标志(discriminator)映射的任何类型。 "
#. Tag: para
+#: basic_mapping.xml:3588
#, no-c-format
-msgid "<literal>cascade</literal> (optional- defaults to <literal>none</literal>): the cascade style."
-msgstr "<literal>cascade</literal>(可选 — 默认是<literal>none</literal>):级联的类型。"
+msgid ""
+"<literal>cascade</literal> (optional- defaults to <literal>none</literal>): "
+"the cascade style."
+msgstr ""
+"<literal>cascade</literal>(可选 — 默认是<literal>none</literal>):级联的类"
+"型。"
#. Tag: para
+#: basic_mapping.xml:3599
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that updates to this property either do or do not require acquisition of the optimistic lock. It defines whether a version increment should occur if this property is dirty."
-msgstr "<literal>optimistic-lock</literal>(可选 — 默认是 <literal>true</literal>):表明更新此组件是否需要获取乐观锁。换句话说,当这个属性变脏时,是否增加版本号(Version)。"
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to this property either do or do not "
+"require acquisition of the optimistic lock. It defines whether a version "
+"increment should occur if this property is dirty."
+msgstr ""
+"<literal>optimistic-lock</literal>(可选 — 默认是 <literal>true</literal>):"
+"表明更新此组件是否需要获取乐观锁。换句话说,当这个属性变脏时,是否增加版本号"
+"(Version)。"
#. Tag: title
+#: basic_mapping.xml:3610
#, no-c-format
-msgid "Hibernate types"
-msgstr "Hibernate 的类型 "
+msgid "Properties"
+msgstr "属性(Properties)"
-#. Tag: title
+#. Tag: para
+#: basic_mapping.xml:3612
#, no-c-format
-msgid "Entities and values"
-msgstr "实体(Entities)和值(values)"
+msgid ""
+"The <literal><properties></literal> element allows the definition of a "
+"named, logical grouping of the properties of a class. The most important use "
+"of the construct is that it allows a combination of properties to be the "
+"target of a <literal>property-ref</literal>. It is also a convenient way to "
+"define a multi-column unique constraint. For example:"
+msgstr ""
+"<literal><properties></literal> 元素允许定义一个命名的逻辑分组"
+"(grouping)包含一个类中的多个属性。这个元素最重要的用处是允许多个属性的组合"
+"作为 <literal>property-ref</literal> 的目标(target)。这也是定义多字段唯一约"
+"束的一种方便途径。例如:"
+#. Tag: programlisting
+#: basic_mapping.xml:3632
+#, fuzzy, no-c-format
+msgid ""
+"<properties\n"
+" name=\"logicalName\"\n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+"\n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+msgstr ""
+"<properties \n"
+" name=\"logicalName\" \n"
+" insert=\"true|false\"\n"
+" update=\"true|false\"\n"
+" optimistic-lock=\"true|false\"\n"
+" unique=\"true|false\"\n"
+">\n"
+" \n"
+" <property ...../>\n"
+" <many-to-one .... />\n"
+" ........\n"
+"</properties>"
+
#. Tag: para
+#: basic_mapping.xml:3636
#, no-c-format
-msgid "In relation to the persistence service, Java language-level objects are classified into two groups:"
-msgstr "和持久化服务相比,Java 级别的对象分为两个组别:"
+msgid ""
+"<literal>name</literal>: the logical name of the grouping. It is "
+"<emphasis>not</emphasis> an actual property name."
+msgstr ""
+"<literal>name</literal>:分组的逻辑名称 — <emphasis>不是</emphasis> 实际属性"
+"的名称。 "
#. Tag: para
+#: basic_mapping.xml:3651
#, no-c-format
-msgid "An <emphasis>entity</emphasis> exists independently of any other objects holding references to the entity. Contrast this with the usual Java model, where an unreferenced object is garbage collected. Entities must be explicitly saved and deleted. Saves and deletions, however, can be <emphasis>cascaded</emphasis> from a parent entity to its children. This is different from the ODMG model of object persistence by reachability and corresponds more closely to how application objects are usually used in large systems. Entities support circular and shared references. They can also be versioned."
-msgstr "<emphasis>实体entity</emphasis> 独立于任何持有实体引用的对象。与通常的 Java 模型相比,不再被引用的对象会被当作垃圾收集掉。实体必须被显式的保存和删除(除非保存和删除是从父实体向子实体引发的<emphasis>级联</emphasis>)。这和 ODMG 模型中关于对象通过可触及保持持久性有一些不同 — 比较起来更加接近应用程序对象通常在一个大系统中的使用方法。实体支持循环引用和交叉引用,它们也可以加上版本信息。 "
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that updates to these properties either do or do not "
+"require acquisition of the optimistic lock. It determines if a version "
+"increment should occur when these properties are dirty."
+msgstr ""
+"<literal>optimistic-lock</literal>(可选 — 默认是 <literal>true</literal>):"
+"表明更新此组件是否需要获取乐观锁。换句话说,当这个属性变脏时,是否增加版本号"
+"(Version)。"
#. Tag: para
+#: basic_mapping.xml:3666
#, no-c-format
-msgid "An entity's persistent state consists of references to other entities and instances of <emphasis>value</emphasis> types. Values are primitives: collections (not what is inside a collection), components and certain immutable objects. Unlike entities, values in particular collections and components, <emphasis>are</emphasis> persisted and deleted by reachability. Since value objects and primitives are persisted and deleted along with their containing entity, they cannot be independently versioned. Values have no independent identity, so they cannot be shared by two entities or collections."
-msgstr "一个实体的持久状态包含指向其他实体和<emphasis>值</emphasis>类型实例的引用。值可以是原始类型,集合(不是集合中的对象),组件或者特定的不可变对象。与实体不同,值(特别是集合和组件)是通过可触及性来进行持久化和删除的。因为值对象(和原始类型数据)是随着包含他们的实体而被持久化和删除的,他们不能被独立的加上版本信息。值没有独立的标识,所以他们不能被两个实体或者集合共享。 "
+msgid ""
+"For example, if we have the following <literal><properties></literal> "
+"mapping:"
+msgstr "例如,如果我们有如下的 <literal><properties></literal> 映射:"
+#. Tag: programlisting
+#: basic_mapping.xml:3669
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+"\n"
+" ...\n"
+" <properties name=\"name\"\n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"personNumber\"/>\n"
+" ...\n"
+" <properties name=\"name\" \n"
+" unique=\"true\" update=\"false\">\n"
+" <property name=\"firstName\"/>\n"
+" <property name=\"initial\"/>\n"
+" <property name=\"lastName\"/>\n"
+" </properties>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:3671
#, no-c-format
-msgid "Until now, we have been using the term \"persistent class\" to refer to entities. We will continue to do that. Not all user-defined classes with a persistent state, however, are entities. A <emphasis>component</emphasis> is a user-defined class with value semantics. A Java property of type <literal>java.lang.String</literal> also has value semantics. Given this definition, all types (classes) provided by the JDK have value type semantics in Java, while user-defined types can be mapped with entity or value type semantics. This decision is up to the application developer. An entity class in a domain model will normally have shared references to a single instance of that class, while composition or aggregation usually translates to a value type."
-msgstr "直到现在,我们都一直使用术语“持久类”(persistent class)来代表实体。我们仍然会这么做。然而严格说来,不是所有的用户自定义的,带有持久化状态的类都是实体。<emphasis>组件</emphasis>就是用户自定义类,却是值语义的。<literal>java.lang.String</literal> 类型的 java 属性也是值语义的。给了这个定义以后,我们可以说所有 JDK 提供的类型(类)都是值类型的语义,而用于自定义类型可能被映射为实体类型或值类型语义。采用哪种类型的语义取决于开发人员。在领域模型中,寻找实体类的一个好线索是共享引用指向这个类的单一实例,而组合或聚合通常被转化为值类型。 "
+msgid ""
+"You might have some legacy data association that refers to this unique key "
+"of the <literal>Person</literal> table, instead of to the primary key:"
+msgstr ""
+"然后,我们可能有一些遗留的数据关联,引用 <literal>Person</literal> 表的这个唯"
+"一键,而不是主键:"
+#. Tag: programlisting
+#: basic_mapping.xml:3675
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"owner\"\n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+msgstr ""
+"<many-to-one name=\"person\" \n"
+" class=\"Person\" property-ref=\"name\">\n"
+" <column name=\"firstName\"/>\n"
+" <column name=\"initial\"/>\n"
+" <column name=\"lastName\"/>\n"
+"</many-to-one>"
+
#. Tag: para
+#: basic_mapping.xml:3678
#, no-c-format
-msgid "We will revisit both concepts throughout this reference guide."
-msgstr "我们会在本文档中重复碰到这两个概念。 "
+msgid ""
+"When using annotations as a mapping strategy, such construct is not "
+"necessary as the binding between a column and its related column on the "
+"associated table is done directly"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:3685
#, no-c-format
-msgid "The challenge is to map the Java type system, and the developers' definition of entities and value types, to the SQL/database type system. The bridge between both systems is provided by Hibernate. For entities, <literal><class></literal>, <literal><subclass></literal> and so on are used. For value types we use <literal><property></literal>, <literal><component></literal>etc., that usually have a <literal>type</literal> attribute. The value of this attribute is the name of a Hibernate <emphasis>mapping type</emphasis>. Hibernate provides a range of mappings for standard JDK value types out of the box. You can write your own mapping types and implement your own custom conversion strategies."
-msgstr "挑战在于将 java 类型系统(和开发者定义的实体和值类型)映射到 SQL/数据库类型系统。Hibernate 提供了连接两个系统之间的桥梁:对于实体类型,我们使用 <literal><class></literal>,<literal><subclass></literal> 等等。对于值类型,我们使用 <literal><property></literal>,<literal><component></literal> 及其他,通常跟随着 <literal>type</literal> 属性。这个属性的值是Hibernate 的<emphasis>映射类型</emphasis>的名字。Hibernate 提供了许多现成的映射(标准的 JDK 值类型)。你也可以编写自己的映射类型并实现自定义的变换策略,随后我们会看到这点。 "
+msgid ""
+"The use of this outside the context of mapping legacy data is not "
+"recommended."
+msgstr "我们并不推荐这样使用,除非在映射遗留数据的情况下。 "
+#. Tag: title
+#: basic_mapping.xml:3690
+#, no-c-format
+msgid "Some hbm.xml specificities"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3692
#, no-c-format
-msgid "With the exception of collections, all built-in Hibernate types support null semantics."
-msgstr "所有的 Hibernate 内建类型,除了 collections 以外,都支持空(null)语义。 "
+msgid ""
+"The hbm.xml structure has some specificities naturally not present when "
+"using annotations, let's describe them briefly."
+msgstr ""
#. Tag: title
+#: basic_mapping.xml:3696
#, no-c-format
-msgid "Basic value types"
-msgstr "基本值类型"
+msgid "Doctype"
+msgstr "Doctype"
#. Tag: para
+#: basic_mapping.xml:3698
#, no-c-format
-msgid "The built-in <emphasis>basic mapping types</emphasis> can be roughly categorized into the following:"
-msgstr "内置的 <emphasis>basic mapping types</emphasis> 可以大致地分类为:"
+msgid ""
+"All XML mappings should declare the doctype shown. The actual DTD can be "
+"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
+"hibernate </literal>, or in <literal>hibernate3.jar</literal>. Hibernate "
+"will always look for the DTD in its classpath first. If you experience "
+"lookups of the DTD using an Internet connection, check the DTD declaration "
+"against the contents of your classpath."
+msgstr ""
+"所有的 XML 映射都需要定义如上所示的 doctype。DTD 可以从上述 URL 中获取,也可"
+"以从 <literal>hibernate-x.x.x/src/org/hibernate </literal> 目录中、或 "
+"<literal>hibernate.jar</literal> 文件中找到。Hibernate 总是会首先在它的 "
+"classptah 中搜索 DTD 文件。如果你发现它是通过连接 Internet 查找 DTD 文件,就"
+"对照你的 classpath 目录检查 XML 文件里的 DTD 声明。"
-#. Tag: term
+#. Tag: title
+#: basic_mapping.xml:3707
#, no-c-format
-msgid "<literal>integer, long, short, float, double, character, byte, boolean, yes_no, true_false</literal>"
-msgstr "<literal>integer, long, short, float, double, character, byte, boolean, yes_no, true_false</literal>"
+msgid "EntityResolver"
+msgstr "EntityResolver"
#. Tag: para
+#: basic_mapping.xml:3709
#, no-c-format
-msgid "Type mappings from Java primitives or wrapper classes to appropriate (vendor-specific) SQL column types. <literal>boolean, yes_no</literal> and <literal>true_false</literal> are all alternative encodings for a Java <literal>boolean</literal> or <literal>java.lang.Boolean</literal>."
-msgstr "这些类型都对应 Java 的原始类型或者其封装类,来符合(特定厂商的)SQL 字段类型。<literal>boolean, yes_no</literal> 和 <literal>true_false</literal> 都是 Java 中 <literal>boolean</literal> 或者 <literal>java.lang.Boolean</literal> 的另外说法。"
+msgid ""
+"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
+"is by registering a custom <literal>org.xml.sax.EntityResolver</literal> "
+"implementation with the SAXReader it uses to read in the xml files. This "
+"custom <literal>EntityResolver</literal> recognizes two different systemId "
+"namespaces:"
+msgstr ""
+"Hibernate 首先试图在其 classpath 中解析 DTD。这是依靠在系统中注册的 "
+"<literal>org.xml.sax.EntityResolver</literal> 的一个具体实现,SAXReader 依靠"
+"它来读取 xml 文件。这个自定义的 <literal>EntityResolver</literal> 能辨认两种"
+"不同的 systenId 命名空间:"
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3718
#, no-c-format
-msgid "<literal>string</literal>"
-msgstr "<literal>string</literal>"
+msgid ""
+"a <literal>hibernate namespace</literal> is recognized whenever the resolver "
+"encounters a systemId starting with <literal>http://hibernate.sourceforge."
+"net/</literal>. The resolver attempts to resolve these entities via the "
+"classloader which loaded the Hibernate classes."
+msgstr ""
+"若 resolver 遇到了一个以 <literal>http://hibernate.sourceforge.net/</"
+"literal> 为开头的 systemId,它会辨认出是 <literal>hibernate namespace</"
+"literal>,resolver 就试图通过加载 Hibernate 类的 classloader 来查找这些实"
+"体。 "
#. Tag: para
+#: basic_mapping.xml:3726
#, no-c-format
-msgid "A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>)."
-msgstr "从 <literal>java.lang.String</literal> 到 <literal>VARCHAR</literal>(或者 Oracle 的 <literal>VARCHAR2</literal>)的映射。"
+msgid ""
+"a <literal>user namespace</literal> is recognized whenever the resolver "
+"encounters a systemId using a <literal>classpath://</literal> URL protocol. "
+"The resolver will attempt to resolve these entities via (1) the current "
+"thread context classloader and (2) the classloader which loaded the "
+"Hibernate classes."
+msgstr ""
+"若 resolver 遇到了一个使用 <literal>classpath://</literal> URL 协议的 "
+"systemId,它会辨认出这是 <literal>user namespace</literal>,resolver 试图通过"
+"(1) 当前线程上下文的 classloader 和(2) 加载 Hibernate class 的 classloader "
+"来查找这些实体。"
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3735
#, no-c-format
-msgid "<literal>date, time, timestamp</literal>"
-msgstr "<literal>date, time, timestamp</literal>"
+msgid "The following is an example of utilizing user namespacing:"
+msgstr "下面是一个使用用户命名空间(user namespace)的例子:"
+#. Tag: programlisting
+#: basic_mapping.xml:3738
+#, no-c-format
+msgid ""
+"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
+" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
+msgstr ""
+
#. Tag: para
+#: basic_mapping.xml:3740
#, no-c-format
-msgid "Type mappings from <literal>java.util.Date</literal> and its subclasses to SQL types <literal>DATE</literal>, <literal>TIME</literal> and <literal>TIMESTAMP</literal> (or equivalent)."
-msgstr "从 <literal>java.util.Date</literal> 和其子类到 SQL 类型 <literal>DATE</literal>,<literal>TIME</literal> 和 <literal>TIMESTAMP</literal>(或等价类型)的映射。"
+msgid ""
+"Where <literal>types.xml</literal> is a resource in the <literal>your."
+"domain</literal> package and contains a custom <link linkend=\"mapping-types-"
+"custom\">typedef</link>."
+msgstr ""
+"这里的 <literal>types.xml</literal> 是 <literal>your.domain</literal> 包中的"
+"一个资源,它包含了一个自定义的 <link linkend=\"mapping-types-custom"
+"\">typedef</link>。 "
-#. Tag: term
+#. Tag: title
+#: basic_mapping.xml:3747
#, no-c-format
-msgid "<literal>calendar, calendar_date</literal>"
-msgstr "<literal>calendar, calendar_date</literal>"
+msgid "Hibernate-mapping"
+msgstr "Hibernate-mapping"
#. Tag: para
+#: basic_mapping.xml:3749
#, no-c-format
-msgid "Type mappings from <literal>java.util.Calendar</literal> to SQL types <literal>TIMESTAMP</literal> and <literal>DATE</literal> (or equivalent)."
-msgstr "从 <literal>java.util.Calendar</literal> 到 SQL 类型 <literal>TIMESTAMP</literal> 和 <literal>DATE</literal>(或等价类型)的映射。"
+msgid ""
+"This element has several optional attributes. The <literal>schema</literal> "
+"and <literal>catalog</literal> attributes specify that tables referred to in "
+"this mapping belong to the named schema and/or catalog. If they are "
+"specified, tablenames will be qualified by the given schema and catalog "
+"names. If they are missing, tablenames will be unqualified. The "
+"<literal>default-cascade</literal> attribute specifies what cascade style "
+"should be assumed for properties and collections that do not specify a "
+"<literal>cascade</literal> attribute. By default, the <literal>auto-import</"
+"literal> attribute allows you to use unqualified class names in the query "
+"language."
+msgstr ""
+"这个元素包括一些可选的属性。<literal>schema</literal> 和 <literal>catalog</"
+"literal> 属性, 指明了这个映射所连接(refer)的表所在的 schema 和/或 catalog "
+"名称。假若指定了这个属性,表名会加上所指定的 schema 和 catalog 的名字扩展为全"
+"限定名。假若没有指定,表名就不会使用全限定名。<literal>default-cascade</"
+"literal> 指定了未明确注明 <literal>cascade</literal> 属性的 Java 属性和 集合"
+"类 Hibernate 会采取什么样的默认级联风格。<literal>auto-import</literal> 属性"
+"默认让我们在查询语言中可以使用非全限定名的类名。"
-#. Tag: term
+#. Tag: programlisting
+#: basic_mapping.xml:3778
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />"
+msgstr ""
+"<![CDATA[<hibernate-mapping\n"
+" schema=\"schemaName\"\n"
+" catalog=\"catalogName\"\n"
+" default-cascade=\"cascade_style\"\n"
+" default-access=\"field|property|ClassName\"\n"
+" default-lazy=\"true|false\"\n"
+" auto-import=\"true|false\"\n"
+" package=\"package.name\"\n"
+" />]]>"
+
+#. Tag: para
+#: basic_mapping.xml:3782
#, no-c-format
-msgid "<literal>big_decimal, big_integer</literal>"
-msgstr "<literal>big_decimal, big_integer</literal>"
+msgid "<literal>schema</literal> (optional): the name of a database schema."
+msgstr "<literal>schema</literal>(可选):数据库 schema 的名称。"
#. Tag: para
+#: basic_mapping.xml:3787
#, no-c-format
-msgid "Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java.math.BigInteger</literal> to <literal>NUMERIC</literal> (or Oracle <literal>NUMBER</literal>)."
-msgstr "从 <literal>java.math.BigDecimal</literal> 和 <literal>java.math.BigInteger</literal> 到 <literal>NUMERIC</literal>(或者 Oracle 的 <literal>NUMBER</literal>类型)的映射。"
+msgid "<literal>catalog</literal> (optional): the name of a database catalog."
+msgstr "<literal>catalog</literal>(可选):数据库 catalog 的名称。 "
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3792
#, no-c-format
-msgid "<literal>locale, timezone, currency</literal>"
-msgstr "<literal>locale, timezone, currency</literal>"
+msgid ""
+"<literal>default-cascade</literal> (optional - defaults to <literal>none</"
+"literal>): a default cascade style."
+msgstr ""
+"<literal>default-cascade</literal>(可选 — 默认为 <literal>none</literal>):"
+"默认的级联风格。 "
#. Tag: para
+#: basic_mapping.xml:3797
#, no-c-format
-msgid "Type mappings from <literal>java.util.Locale</literal>, <literal>java.util.TimeZone</literal> and <literal>java.util.Currency</literal> to <literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>). Instances of <literal>Locale</literal> and <literal>Currency</literal> are mapped to their ISO codes. Instances of <literal>TimeZone</literal> are mapped to their <literal>ID</literal>."
-msgstr "从 <literal>java.util.Locale</literal>,<literal>java.util.TimeZone</literal> 和 <literal>java.util.Currency</literal> 到 <literal>VARCHAR</literal>(或者 Oracle 的 <literal>VARCHAR2</literal> 类型)的映射。<literal>Locale</literal> 和 <literal>Currency</literal> 的实例被映射为它们的 ISO 代码。<literal>TimeZone</literal> 的实例被影射为它的 <literal>ID</literal>。"
+msgid ""
+"<literal>default-access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate should use for accessing all properties. "
+"It can be a custom implementation of <literal>PropertyAccessor</literal>."
+msgstr ""
+"<literal>default-access</literal>(可选 — 默认为 <literal>property</"
+"literal>):Hibernate 用来访问所有属性的策略。可以通过实现 "
+"<literal>PropertyAccessor</literal> 接口自定义。 "
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3804
#, no-c-format
-msgid "<literal>class</literal>"
-msgstr "<literal>class</literal>"
+msgid ""
+"<literal>default-lazy</literal> (optional - defaults to <literal>true</"
+"literal>): the default value for unspecified <literal>lazy</literal> "
+"attributes of class and collection mappings."
+msgstr ""
+"<literal>default-lazy</literal>(可选 — 默认为 <literal>true</literal>):指"
+"定了未明确注明 <literal>lazy</literal> 属性的 Java 属性和集合类,Hibernate 会"
+"采取什么样的默认加载风格。 "
#. Tag: para
+#: basic_mapping.xml:3811
#, no-c-format
-msgid "A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>). A <literal>Class</literal> is mapped to its fully qualified name."
-msgstr "从 <literal>java.lang.Class</literal> 到 <literal>VARCHAR</literal>(或者 Oracle 的 <literal>VARCHAR2</literal> 类型)的映射。<literal>Class</literal> 被映射为它的全限定名。"
+msgid ""
+"<literal>auto-import</literal> (optional - defaults to <literal>true</"
+"literal>): specifies whether we can use unqualified class names of classes "
+"in this mapping in the query language."
+msgstr ""
+"<literal>auto-import</literal>(可选 — 默认为 <literal>true</literal>):指定"
+"我们是否可以在查询语言中使用非全限定的类名(仅限于本映射文件中的类)。 "
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3818
#, no-c-format
-msgid "<literal>binary</literal>"
-msgstr "<literal>binary</literal>"
+msgid ""
+"<literal>package</literal> (optional): specifies a package prefix to use for "
+"unqualified class names in the mapping document."
+msgstr ""
+"<literal>package</literal>(可选):指定一个包前缀,如果在映射文档中没有指定"
+"全限定的类名,就使用这个作为包名。 "
#. Tag: para
+#: basic_mapping.xml:3825
#, no-c-format
-msgid "Maps byte arrays to an appropriate SQL binary type."
-msgstr "把字节数组(byte arrays)映射为对应的 SQL 二进制类型。"
+msgid ""
+"If you have two persistent classes with the same unqualified name, you "
+"should set <literal>auto-import=\"false\"</literal>. An exception will "
+"result if you attempt to assign two classes to the same \"imported\" name."
+msgstr ""
+"假若你有两个持久化类,它们的非全限定名是一样的(就是两个类的名字一样,所在的"
+"包不一样 — 译者注),你应该设置 <literal>auto-import=\"false\"</literal>。如"
+"果你把一个“导入过”的名字同时对应两个类,Hibernate 会抛出一个异常。"
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3830
#, no-c-format
-msgid "<literal>text</literal>"
-msgstr "<literal>text</literal>"
+msgid ""
+"The <literal>hibernate-mapping</literal> element allows you to nest several "
+"persistent <literal><class></literal> mappings, as shown above. It is, "
+"however, good practice (and expected by some tools) to map only a single "
+"persistent class, or a single class hierarchy, in one mapping file and name "
+"it after the persistent superclass. For example, <literal>Cat.hbm.xml</"
+"literal>, <literal>Dog.hbm.xml</literal>, or if using inheritance, "
+"<literal>Animal.hbm.xml</literal>."
+msgstr ""
+"注意 <literal>hibernate-mapping</literal> 元素允许你嵌套多个如上所示的 "
+"<literal><class></literal> 映射。但是最好的做法(也许一些工具需要的)是"
+"一个持久化类(或一个类的继承层次)对应一个映射文件,并以持久化的超类名称命"
+"名,例如:<literal>Cat.hbm.xml</literal>、<literal>Dog.hbm.xml</literal>,或"
+"者如果使用继承,<literal>Animal.hbm.xml</literal>。"
+#. Tag: title
+#: basic_mapping.xml:3841
+#, fuzzy, no-c-format
+msgid "<title>Key</title>"
+msgstr "<title>键(key)</title>"
+
#. Tag: para
+#: basic_mapping.xml:3843
+#, fuzzy, no-c-format
+msgid ""
+"The <literal><key></literal> element is featured a few times within "
+"this guide. It appears anywhere the parent mapping element defines a join to "
+"a new table that references the primary key of the original table. It also "
+"defines the foreign key in the joined table:"
+msgstr ""
+"我们目前已经见到过 <literal><key></literal> 元素多次了。这个元素在父映"
+"射元素定义了对新表的连接,并且在被连接表中定义了一个外键引用原表的主键的情况"
+"下经常使用。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:3864
+#, fuzzy, no-c-format
+msgid ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+msgstr ""
+"<key\n"
+" column=\"columnname\"\n"
+" on-delete=\"noaction|cascade\"\n"
+" property-ref=\"propertyName\"\n"
+" not-null=\"true|false\"\n"
+" update=\"true|false\"\n"
+" unique=\"true|false\"\n"
+"/>"
+
+#. Tag: para
+#: basic_mapping.xml:3874
#, no-c-format
-msgid "Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</literal> type."
-msgstr "把长 Java 字符串映射为 SQL 的 <literal>CLOB</literal> 或者 <literal>TEXT</literal> 类型。"
+msgid ""
+"<literal>on-delete</literal> (optional - defaults to <literal>noaction</"
+"literal>): specifies whether the foreign key constraint has database-level "
+"cascade delete enabled."
+msgstr ""
+"<literal>on-delete</literal>(可选,默认是 <literal>noaction</literal>):表"
+"明外键关联是否打开数据库级别的级联删除。 "
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3880
#, no-c-format
-msgid "<literal>serializable</literal>"
-msgstr "<literal>serializable</literal>"
+msgid ""
+"<literal>property-ref</literal> (optional): specifies that the foreign key "
+"refers to columns that are not the primary key of the original table. It is "
+"provided for legacy data."
+msgstr ""
+"<literal>property-ref</literal>(可选):表明外键引用的字段不是原表的主键(提"
+"供给遗留数据)。 "
#. Tag: para
+#: basic_mapping.xml:3886
#, no-c-format
-msgid "Maps serializable Java types to an appropriate SQL binary type. You can also indicate the Hibernate type <literal>serializable</literal> with the name of a serializable Java class or interface that does not default to a basic type."
-msgstr "把可序列化的 Java 类型映射到对应的 SQL 二进制类型。你也可以为一个并非默认为基本类型的可序列化 Java 类或者接口指定 Hibernate 类型 <literal>serializable</literal>。 "
+msgid ""
+"<literal>not-null</literal> (optional): specifies that the foreign key "
+"columns are not nullable. This is implied whenever the foreign key is also "
+"part of the primary key."
+msgstr ""
+"<literal>not-null</literal>(可选):表明外键的字段不可为空(这意味着无论何时"
+"外键都是主键的一部分)。 "
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3892
#, no-c-format
-msgid "<literal>clob, blob</literal>"
-msgstr "<literal>clob, blob</literal>"
+msgid ""
+"<literal>update</literal> (optional): specifies that the foreign key should "
+"never be updated. This is implied whenever the foreign key is also part of "
+"the primary key."
+msgstr ""
+"<literal>update</literal>(可选):表明外键决不应该被更新(这意味着无论何时外"
+"键都是主键的一部分)。 "
#. Tag: para
+#: basic_mapping.xml:3898
#, no-c-format
-msgid "Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and <literal>java.sql.Blob</literal>. These types can be inconvenient for some applications, since the blob or clob object cannot be reused outside of a transaction. Driver support is patchy and inconsistent."
-msgstr "JDBC 类 <literal>java.sql.Clob</literal> 和 <literal>java.sql.Blob</literal>的映射。某些程序可能不适合使用这个类型,因为 blob 和 clob 对象可能在一个事务之外是无法重用的。(而且, 驱动程序对这种类型的支持充满着补丁和前后矛盾。) "
+msgid ""
+"<literal>unique</literal> (optional): specifies that the foreign key should "
+"have a unique constraint. This is implied whenever the foreign key is also "
+"the primary key."
+msgstr ""
+"<literal>unique</literal>(可选):表明外键应有唯一性约束(这意味着无论何时外"
+"键都是主键的一部分)。 "
-#. Tag: term
+#. Tag: para
+#: basic_mapping.xml:3905
#, no-c-format
-msgid "<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, imm_serializable, imm_binary</literal>"
-msgstr "<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, imm_serializable, imm_binary</literal>"
+msgid ""
+"For systems where delete performance is important, we recommend that all "
+"keys should be defined <literal>on-delete=\"cascade\"</literal>. Hibernate "
+"uses a database-level <literal>ON CASCADE DELETE</literal> constraint, "
+"instead of many individual <literal>DELETE</literal> statements. Be aware "
+"that this feature bypasses Hibernate's usual optimistic locking strategy for "
+"versioned data."
+msgstr ""
+"对那些看重删除性能的系统,我们推荐所有的键都应该定义为 <literal>on-delete="
+"\"cascade\"</literal>,这样 Hibernate 将使用数据库级的 <literal>ON CASCADE "
+"DELETE</literal> 约束,而不是多个 <literal>DELETE</literal> 语句。注意,这个"
+"特性会绕过 Hibernate 通常对版本数据(versioned data)采用的乐观锁策略。 "
#. Tag: para
+#: basic_mapping.xml:3913
#, no-c-format
-msgid "Type mappings for what are considered mutable Java types. This is where Hibernate makes certain optimizations appropriate only for immutable Java types, and the application treats the object as immutable. For example, you should not call <literal>Date.setTime()</literal> for an instance mapped as <literal>imm_timestamp</literal>. To change the value of the property, and have that change made persistent, the application must assign a new, nonidentical, object to the property."
-msgstr "一般来说,映射类型被假定为是可变的 Java 类型,只有对不可变 Java 类型,Hibernate 会采取特定的优化措施,应用程序会把这些对象作为不可变对象处理。比如,你不应该对作为 <literal>imm_timestamp</literal> 映射的 Date 执行 <literal>Date.setTime()</literal>。要改变属性的值,并且保存这一改变,应用程序必须对这一属性重新设置一个新的(不一样的)对象。 "
+msgid ""
+"The <literal>not-null</literal> and <literal>update</literal> attributes are "
+"useful when mapping a unidirectional one-to-many association. If you map a "
+"unidirectional one-to-many association to a non-nullable foreign key, you "
+"<emphasis>must</emphasis> declare the key column using <literal><key not-"
+"null=\"true\"></literal>."
+msgstr ""
+"<literal>not-null</literal> 和 <literal>update</literal> 属性在映射单向一对多"
+"关联的时候有用。如果你映射一个单向一对多关联到非空的(non-nullable)外键,你"
+"<emphasis>必须</emphasis> 用 <literal><key not-null=\"true\"></"
+"literal> 定义此键字段。 "
+#. Tag: title
+#: basic_mapping.xml:3922
+#, no-c-format
+msgid "Import"
+msgstr "引用(import) "
+
#. Tag: para
+#: basic_mapping.xml:3924
#, no-c-format
-msgid "Unique identifiers of entities and collections can be of any basic type except <literal>binary</literal>, <literal>blob</literal> and <literal>clob</literal>. Composite identifiers are also allowed. See below for more information."
-msgstr "实体及其集合的唯一标识可以是除了 <literal>binary</literal>、 <literal>blob</literal> 和 <literal>clob</literal> 之外的任何基础类型。(联合标识也是允许的,后面会说到。)"
+msgid ""
+"If your application has two persistent classes with the same name, and you "
+"do not want to specify the fully qualified package name in Hibernate "
+"queries, classes can be \"imported\" explicitly, rather than relying upon "
+"<literal>auto-import=\"true\"</literal>. You can also import classes and "
+"interfaces that are not explicitly mapped:"
+msgstr ""
+"假设你的应用程序有两个同样名字的持久化类,但是你不想在 Hibernate 查询中使用他"
+"们的全限定名。除了依赖 <literal>auto-import=\"true\"</literal> 以外,类也可以"
+"被显式地“import(引用)”。你甚至可以引用没有被明确映射的类和接口。 "
+#. Tag: programlisting
+#: basic_mapping.xml:3930
+#, fuzzy, no-c-format
+msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3939
+#, fuzzy, no-c-format
+msgid ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+msgstr ""
+"<import\n"
+" class=\"ClassName\"\n"
+" rename=\"ShortName\"\n"
+"/>"
+
#. Tag: para
+#: basic_mapping.xml:3943
#, no-c-format
-msgid "The basic value types have corresponding <literal>Type</literal> constants defined on <literal>org.hibernate.Hibernate</literal>. For example, <literal>Hibernate.STRING</literal> represents the <literal>string</literal> type."
-msgstr "在 <literal>org.hibernate.Hibernate</literal> 中,定义了基础类型对应的 <literal>Type</literal> 常量。比如,<literal>Hibernate.STRING</literal> 代表 <literal>string</literal> 类型。"
+msgid ""
+"<literal>class</literal>: the fully qualified class name of any Java class."
+msgstr "<literal>class</literal>:任何 Java 类的全限定名。 "
+#. Tag: para
+#: basic_mapping.xml:3948
+#, no-c-format
+msgid ""
+"<literal>rename</literal> (optional - defaults to the unqualified class "
+"name): a name that can be used in the query language."
+msgstr ""
+"<literal>rename</literal>(可选 — 默认为类的全限定名):在查询语句中可以使用"
+"的名字。 "
+
+#. Tag: para
+#: basic_mapping.xml:3956
+#, no-c-format
+msgid "This feature is unique to hbm.xml and is not supported in annotations."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:3962
#, no-c-format
-msgid "Custom value types"
-msgstr "自定义值类型"
+msgid "Column and formula elements"
+msgstr "字段和规则元素(column and formula elements) "
#. Tag: para
+#: basic_mapping.xml:3964
#, no-c-format
-msgid "It is relatively easy for developers to create their own value types. For example, you might want to persist properties of type <literal>java.lang.BigInteger</literal> to <literal>VARCHAR</literal> columns. Hibernate does not provide a built-in type for this. Custom types are not limited to mapping a property, or collection element, to a single table column. So, for example, you might have a Java property <literal>getName()</literal>/<literal>setName()</literal> of type <literal>java.lang.String</literal> that is persisted to the columns <literal>FIRST_NAME</literal>, <literal>INITIAL</literal>, <literal>SURNAME</literal>."
-msgstr "开发者创建属于他们自己的值类型也是很容易的。比如说,你可能希望持久化 <literal>java.lang.BigInteger</literal> 类型的属性,持久化成为 <literal>VARCHAR</literal> 字段。Hibernate没有内置这样一种类型。自定义类型能够映射一个属性(或集合元素)到不止一个数据库表字段。比如说,你可能有这样的 Java 属性:<literal>getName()</literal>/<literal>setName()</literal>,这是 <literal>java.lang.String</literal> 类型的,对应的持久化到三个字段:<literal>FIRST_NAME</literal>,<literal>INITIAL</literal>,<literal>SURNAME</literal>。 "
+msgid ""
+"Mapping elements which accept a <literal>column</literal> attribute will "
+"alternatively accept a <literal><column></literal> subelement. "
+"Likewise, <literal><formula></literal> is an alternative to the "
+"<literal>formula</literal> attribute. For example:"
+msgstr ""
+"任何接受 <literal>column</literal> 属性的映射元素都可以选择接受 <literal><"
+"column></literal> 子元素。同样的,<literal>formula</literal> 子元素也可以"
+"替换 <literal><formula></literal> 属性。 "
+#. Tag: programlisting
+#: basic_mapping.xml:3970
+#, fuzzy, no-c-format
+msgid ""
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"\n"
+" read=\"SQL expression\"\n"
+" write=\"SQL expression\"/>"
+msgstr ""
+"<column\n"
+" name=\"column_name\"\n"
+" length=\"N\"\n"
+" precision=\"N\"\n"
+" scale=\"N\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" unique-key=\"multicolumn_unique_key_name\"\n"
+" index=\"index_name\"\n"
+" sql-type=\"sql_type_name\"\n"
+" check=\"SQL expression\"\n"
+" default=\"SQL expression\"/>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:3972
+#, fuzzy, no-c-format
+msgid "<formula>SQL expression</formula>"
+msgstr "<formula>SQL expression</formula>"
+
#. Tag: para
+#: basic_mapping.xml:3974
#, no-c-format
-msgid "To implement a custom type, implement either <literal>org.hibernate.UserType</literal> or <literal>org.hibernate.CompositeUserType</literal> and declare properties using the fully qualified classname of the type. View <literal>org.hibernate.test.DoubleStringType</literal> to see the kind of things that are possible."
-msgstr "要实现一个自定义类型,可以实现 <literal>org.hibernate.UserType</literal> 或 <literal>org.hibernate.CompositeUserType</literal> 中的任一个,并且使用类型的 Java 全限定类名来定义属性。请查看 <literal>org.hibernate.test.DoubleStringType</literal> 这个例子,看看它是怎么做的。 "
+msgid ""
+"Most of the attributes on <literal>column</literal> provide a means of "
+"tailoring the DDL during automatic schema generation. The <literal>read</"
+"literal> and <literal>write</literal> attributes allow you to specify custom "
+"SQL that Hibernate will use to access the column's value. For more on this, "
+"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
+"read and write expressions</link>."
+msgstr ""
+"<literal>column</literal> 上的大多数属性都提供了在自动模式生成过程中对 DDL 进"
+"行裁剪的方法。<literal>read</literal> 和 <literal>write</literal> 属性允许你"
+"指定 Hibernate 用于访问字段值的自定义的 SQL。关于更多的内容,请参考 <link "
+"linkend=\"mapping-column-read-and-write\">column read and write expressions</"
+"link>。"
#. Tag: para
+#: basic_mapping.xml:3982
#, no-c-format
-msgid "Notice the use of <literal><column></literal> tags to map a property to multiple columns."
-msgstr "注意使用 <literal><column></literal> 标签来把一个属性映射到多个字段的做法。"
+msgid ""
+"The <literal>column</literal> and <literal>formula</literal> elements can "
+"even be combined within the same property or association mapping to express, "
+"for example, exotic join conditions."
+msgstr ""
+"<literal>column</literal> 和 <literal>formula</literal> 属性甚至可以在同一个"
+"属性或关联映射中被合并来表达,例如,一些奇异的连接条件。"
+#. Tag: programlisting
+#: basic_mapping.xml:3986
+#, fuzzy, no-c-format
+msgid ""
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
+msgstr ""
+"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
+" insert=\"false\" update=\"false\">\n"
+" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
+" <formula>'MAILING'</formula>\n"
+"</many-to-one>"
+
+#. Tag: title
+#: basic_mapping.xml:3992
+#, no-c-format
+msgid "Hibernate types"
+msgstr "Hibernate 的类型 "
+
+#. Tag: title
+#: basic_mapping.xml:3995
+#, no-c-format
+msgid "Entities and values"
+msgstr "实体(Entities)和值(values)"
+
#. Tag: para
+#: basic_mapping.xml:3997
#, no-c-format
-msgid "The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</literal>, <literal>UserCollectionType</literal>, and <literal>UserVersionType</literal> interfaces provide support for more specialized uses."
-msgstr "<literal>CompositeUserType</literal>,<literal>EnhancedUserType</literal>,<literal>UserCollectionType</literal> 和 <literal>UserVersionType</literal> 接口为更特殊的使用方式提供支持。"
+msgid ""
+"In relation to the persistence service, Java language-level objects are "
+"classified into two groups:"
+msgstr "和持久化服务相比,Java 级别的对象分为两个组别:"
#. Tag: para
+#: basic_mapping.xml:4000
#, no-c-format
-msgid "You can even supply parameters to a <literal>UserType</literal> in the mapping file. To do this, your <literal>UserType</literal> must implement the <literal>org.hibernate.usertype.ParameterizedType</literal> interface. To supply parameters to your custom type, you can use the <literal><type></literal> element in your mapping files."
-msgstr "你甚至可以在一个映射文件中提供参数给一个 <literal>UserType</literal>。 为了这样做,你的 <literal>UserType</literal> 必须实现 <literal>org.hibernate.usertype.ParameterizedType</literal> 接口。为了给自定义类型提供参数,你可以在映射文件中使用 <literal><type></literal> 元素。 "
+msgid ""
+"An <emphasis>entity</emphasis> exists independently of any other objects "
+"holding references to the entity. Contrast this with the usual Java model, "
+"where an unreferenced object is garbage collected. Entities must be "
+"explicitly saved and deleted. Saves and deletions, however, can be "
+"<emphasis>cascaded</emphasis> from a parent entity to its children. This is "
+"different from the ODMG model of object persistence by reachability and "
+"corresponds more closely to how application objects are usually used in "
+"large systems. Entities support circular and shared references. They can "
+"also be versioned."
+msgstr ""
+"<emphasis>实体entity</emphasis> 独立于任何持有实体引用的对象。与通常的 Java "
+"模型相比,不再被引用的对象会被当作垃圾收集掉。实体必须被显式的保存和删除(除"
+"非保存和删除是从父实体向子实体引发的<emphasis>级联</emphasis>)。这和 ODMG 模"
+"型中关于对象通过可触及保持持久性有一些不同 — 比较起来更加接近应用程序对象通常"
+"在一个大系统中的使用方法。实体支持循环引用和交叉引用,它们也可以加上版本信"
+"息。 "
#. Tag: para
+#: basic_mapping.xml:4010
#, no-c-format
-msgid "The <literal>UserType</literal> can now retrieve the value for the parameter named <literal>default</literal> from the <literal>Properties</literal> object passed to it."
-msgstr "现在,<literal>UserType</literal> 可以从传入的 <literal>Properties</literal> 对象中得到 <literal>default</literal> 参数的值。"
+msgid ""
+"An entity's persistent state consists of references to other entities and "
+"instances of <emphasis>value</emphasis> types. Values are primitives: "
+"collections (not what is inside a collection), components and certain "
+"immutable objects. Unlike entities, values in particular collections and "
+"components, <emphasis>are</emphasis> persisted and deleted by reachability. "
+"Since value objects and primitives are persisted and deleted along with "
+"their containing entity, they cannot be independently versioned. Values have "
+"no independent identity, so they cannot be shared by two entities or "
+"collections."
+msgstr ""
+"一个实体的持久状态包含指向其他实体和<emphasis>值</emphasis>类型实例的引用。值"
+"可以是原始类型,集合(不是集合中的对象),组件或者特定的不可变对象。与实体不"
+"同,值(特别是集合和组件)是通过可触及性来进行持久化和删除的。因为值对象(和"
+"原始类型数据)是随着包含他们的实体而被持久化和删除的,他们不能被独立的加上版"
+"本信息。值没有独立的标识,所以他们不能被两个实体或者集合共享。 "
#. Tag: para
+#: basic_mapping.xml:4020
#, no-c-format
-msgid "If you regularly use a certain <literal>UserType</literal>, it is useful to define a shorter name for it. You can do this using the <literal><typedef></literal> element. Typedefs assign a name to a custom type, and can also contain a list of default parameter values if the type is parameterized."
-msgstr "如果你非常频繁地使用某一 <literal>UserType</literal>,可以为他定义一个简称。这可以通过使用 <literal><typedef></literal> 元素来实现。Typedefs 为一自定义类型赋予一个名称,并且如果此类型是参数化的,还可以包含一系列默认的参数值。 "
+msgid ""
+"Until now, we have been using the term \"persistent class\" to refer to "
+"entities. We will continue to do that. Not all user-defined classes with a "
+"persistent state, however, are entities. A <emphasis>component</emphasis> is "
+"a user-defined class with value semantics. A Java property of type "
+"<literal>java.lang.String</literal> also has value semantics. Given this "
+"definition, all types (classes) provided by the JDK have value type "
+"semantics in Java, while user-defined types can be mapped with entity or "
+"value type semantics. This decision is up to the application developer. An "
+"entity class in a domain model will normally have shared references to a "
+"single instance of that class, while composition or aggregation usually "
+"translates to a value type."
+msgstr ""
+"直到现在,我们都一直使用术语“持久类”(persistent class)来代表实体。我们仍然"
+"会这么做。然而严格说来,不是所有的用户自定义的,带有持久化状态的类都是实体。"
+"<emphasis>组件</emphasis>就是用户自定义类,却是值语义的。<literal>java.lang."
+"String</literal> 类型的 java 属性也是值语义的。给了这个定义以后,我们可以说所"
+"有 JDK 提供的类型(类)都是值类型的语义,而用于自定义类型可能被映射为实体类型"
+"或值类型语义。采用哪种类型的语义取决于开发人员。在领域模型中,寻找实体类的一"
+"个好线索是共享引用指向这个类的单一实例,而组合或聚合通常被转化为值类型。 "
#. Tag: para
+#: basic_mapping.xml:4033
#, no-c-format
-msgid "It is also possible to override the parameters supplied in a typedef on a case-by-case basis by using type parameters on the property mapping."
-msgstr "也可以根据具体案例通过属性映射中的类型参数覆盖在 typedef 中提供的参数。"
+msgid "We will revisit both concepts throughout this reference guide."
+msgstr "我们会在本文档中重复碰到这两个概念。 "
#. Tag: para
+#: basic_mapping.xml:4036
#, no-c-format
-msgid "Even though Hibernate's rich range of built-in types and support for components means you will rarely need to use a custom type, it is considered good practice to use custom types for non-entity classes that occur frequently in your application. For example, a <literal>MonetaryAmount</literal> class is a good candidate for a <literal>CompositeUserType</literal>, even though it could be mapped as a component. One reason for this is abstraction. With a custom type, your mapping documents would be protected against changes to the way monetary values are represented."
-msgstr "尽管 Hibernate 内建的丰富的类型和对组件的支持意味着你可能很少 <emphasis>需要</emphasis>使用自定义类型。不过,为那些在你的应用中经常出现的(非实体)类使用自定义类型也是一个好方法。例如,一个 <literal>MonetaryAmount</literal> 类使用 <literal>CompositeUserType</literal> 来映射是不错的选择,虽然他可以很容易地被映射成组件。这样做的动机之一是抽象。使用自定义类型,以后假若你改变表示金额的方法时,它可以保证映射文件不需要修改。 "
+msgid ""
+"The challenge is to map the Java type system, and the developers' definition "
+"of entities and value types, to the SQL/database type system. The bridge "
+"between both systems is provided by Hibernate. For entities, <literal><"
+"class></literal>, <literal><subclass></literal> and so on are used. "
+"For value types we use <literal><property></literal>, <literal><"
+"component></literal>etc., that usually have a <literal>type</literal> "
+"attribute. The value of this attribute is the name of a Hibernate "
+"<emphasis>mapping type</emphasis>. Hibernate provides a range of mappings "
+"for standard JDK value types out of the box. You can write your own mapping "
+"types and implement your own custom conversion strategies."
+msgstr ""
+"挑战在于将 java 类型系统(和开发者定义的实体和值类型)映射到 SQL/数据库类型系"
+"统。Hibernate 提供了连接两个系统之间的桥梁:对于实体类型,我们使用 "
+"<literal><class></literal>,<literal><subclass></literal> 等等。"
+"对于值类型,我们使用 <literal><property></literal>,<literal><"
+"component></literal> 及其他,通常跟随着 <literal>type</literal> 属性。这个"
+"属性的值是Hibernate 的<emphasis>映射类型</emphasis>的名字。Hibernate 提供了许"
+"多现成的映射(标准的 JDK 值类型)。你也可以编写自己的映射类型并实现自定义的变"
+"换策略,随后我们会看到这点。 "
+#. Tag: para
+#: basic_mapping.xml:4049
+#, no-c-format
+msgid ""
+"With the exception of collections, all built-in Hibernate types support null "
+"semantics."
+msgstr ""
+"所有的 Hibernate 内建类型,除了 collections 以外,都支持空(null)语义。 "
+
#. Tag: title
+#: basic_mapping.xml:4054
#, no-c-format
-msgid "Mapping a class more than once"
-msgstr "多次映射同一个类"
+msgid "Basic value types"
+msgstr "基本值类型"
#. Tag: para
+#: basic_mapping.xml:4056
#, no-c-format
-msgid "It is possible to provide more than one mapping for a particular persistent class. In this case, you must specify an <emphasis>entity name</emphasis> to disambiguate between instances of the two mapped entities. By default, the entity name is the same as the class name. Hibernate lets you specify the entity name when working with persistent objects, when writing queries, or when mapping associations to the named entity."
-msgstr "对特定的持久化类,映射多次是允许的。这种情形下,你必须指定 <emphasis>entity name</emphasis> 来区别不同映射实体的对象实例。(默认情况下,实体名字和类名是相同的。) Hibernate 在操作持久化对象、编写查询条件,或者把关联映射到指定实体时,允许你指定这个 entity name(实体名字)。 "
+msgid ""
+"The built-in <emphasis>basic mapping types</emphasis> can be roughly "
+"categorized into the following:"
+msgstr "内置的 <emphasis>basic mapping types</emphasis> 可以大致地分类为:"
+#. Tag: literal
+#: basic_mapping.xml:4059
+#, fuzzy, no-c-format
+msgid ""
+"integer, long, short, float, double, character, byte, boolean, yes_no, "
+"true_false"
+msgstr ""
+"<literal>integer, long, short, float, double, character, byte, boolean, "
+"yes_no, true_false</literal>"
+
#. Tag: para
+#: basic_mapping.xml:4063
#, no-c-format
-msgid "Associations are now specified using <literal>entity-name</literal> instead of <literal>class</literal>."
-msgstr "注意这里关联是如何用 <literal>entity-name</literal> 来代替 <literal>class</literal> 的。 "
+msgid ""
+"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
+"specific) SQL column types. <literal>boolean, yes_no</literal> and "
+"<literal>true_false</literal> are all alternative encodings for a Java "
+"<literal>boolean</literal> or <literal>java.lang.Boolean</literal>."
+msgstr ""
+"这些类型都对应 Java 的原始类型或者其封装类,来符合(特定厂商的)SQL 字段类"
+"型。<literal>boolean, yes_no</literal> 和 <literal>true_false</literal> 都是 "
+"Java 中 <literal>boolean</literal> 或者 <literal>java.lang.Boolean</literal> "
+"的另外说法。"
-#. Tag: title
+#. Tag: literal
+#: basic_mapping.xml:4073
#, no-c-format
-msgid "SQL quoted identifiers"
-msgstr "SQL 中引号包围的标识符"
+msgid "string"
+msgstr "string"
#. Tag: para
+#: basic_mapping.xml:4076
#, no-c-format
-msgid "You can force Hibernate to quote an identifier in the generated SQL by enclosing the table or column name in backticks in the mapping document. Hibernate will use the correct quotation style for the SQL <literal>Dialect</literal>. This is usually double quotes, but the SQL Server uses brackets and MySQL uses backticks."
-msgstr "你可通过在映射文档中使用反向引号(`)把表名或者字段名包围起来,以强制 Hibernate 在生成的 SQL 中把标识符用引号包围起来。Hibernate 会使用相应的 SQL<literal>Dialect</literal>(方言)来使用正确的引号风格(通常是双引号,但是在 SQL Server 中是括号,MySQL 中是反向引号)。 "
+msgid ""
+"A type mapping from <literal>java.lang.String</literal> to <literal>VARCHAR</"
+"literal> (or Oracle <literal>VARCHAR2</literal>)."
+msgstr ""
+"从 <literal>java.lang.String</literal> 到 <literal>VARCHAR</literal>(或者 "
+"Oracle 的 <literal>VARCHAR2</literal>)的映射。"
-#. Tag: title
+#. Tag: literal
+#: basic_mapping.xml:4083
+#, fuzzy, no-c-format
+msgid "date, time, timestamp"
+msgstr "<literal>date, time, timestamp</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:4086
#, no-c-format
-msgid "Metadata alternatives"
-msgstr "其他元数据(Metadata)"
+msgid ""
+"Type mappings from <literal>java.util.Date</literal> and its subclasses to "
+"SQL types <literal>DATE</literal>, <literal>TIME</literal> and "
+"<literal>TIMESTAMP</literal> (or equivalent)."
+msgstr ""
+"从 <literal>java.util.Date</literal> 和其子类到 SQL 类型 <literal>DATE</"
+"literal>,<literal>TIME</literal> 和 <literal>TIMESTAMP</literal>(或等价类"
+"型)的映射。"
+#. Tag: literal
+#: basic_mapping.xml:4094
+#, fuzzy, no-c-format
+msgid "calendar, calendar_date"
+msgstr "<literal>calendar, calendar_date</literal>"
+
#. Tag: para
+#: basic_mapping.xml:4097
#, no-c-format
-msgid "XML does not suit all users so there are some alternative ways to define O/R mapping metadata in Hibernate."
-msgstr "XML 并不适用于所有人, 因此有其他定义 Hibernate O/R 映射元数据(metadata)的方法。 "
+msgid ""
+"Type mappings from <literal>java.util.Calendar</literal> to SQL types "
+"<literal>TIMESTAMP</literal> and <literal>DATE</literal> (or equivalent)."
+msgstr ""
+"从 <literal>java.util.Calendar</literal> 到 SQL 类型 <literal>TIMESTAMP</"
+"literal> 和 <literal>DATE</literal>(或等价类型)的映射。"
+#. Tag: literal
+#: basic_mapping.xml:4104
+#, fuzzy, no-c-format
+msgid "big_decimal, big_integer"
+msgstr "<literal>big_decimal, big_integer</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:4107
+#, no-c-format
+msgid ""
+"Type mappings from <literal>java.math.BigDecimal</literal> and <literal>java."
+"math.BigInteger</literal> to <literal>NUMERIC</literal> (or Oracle "
+"<literal>NUMBER</literal>)."
+msgstr ""
+"从 <literal>java.math.BigDecimal</literal> 和 <literal>java.math.BigInteger</"
+"literal> 到 <literal>NUMERIC</literal>(或者 Oracle 的 <literal>NUMBER</"
+"literal>类型)的映射。"
+
+#. Tag: literal
+#: basic_mapping.xml:4115
+#, fuzzy, no-c-format
+msgid "locale, timezone, currency"
+msgstr "<literal>locale, timezone, currency</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:4118
+#, no-c-format
+msgid ""
+"Type mappings from <literal>java.util.Locale</literal>, <literal>java.util."
+"TimeZone</literal> and <literal>java.util.Currency</literal> to "
+"<literal>VARCHAR</literal> (or Oracle <literal>VARCHAR2</literal>). "
+"Instances of <literal>Locale</literal> and <literal>Currency</literal> are "
+"mapped to their ISO codes. Instances of <literal>TimeZone</literal> are "
+"mapped to their <literal>ID</literal>."
+msgstr ""
+"从 <literal>java.util.Locale</literal>,<literal>java.util.TimeZone</"
+"literal> 和 <literal>java.util.Currency</literal> 到 <literal>VARCHAR</"
+"literal>(或者 Oracle 的 <literal>VARCHAR2</literal> 类型)的映射。"
+"<literal>Locale</literal> 和 <literal>Currency</literal> 的实例被映射为它们"
+"的 ISO 代码。<literal>TimeZone</literal> 的实例被影射为它的 <literal>ID</"
+"literal>。"
+
+#. Tag: literal
+#: basic_mapping.xml:4131
+#, fuzzy, no-c-format
+msgid "class"
+msgstr "子类(subclass)"
+
+#. Tag: para
+#: basic_mapping.xml:4134
+#, no-c-format
+msgid ""
+"A type mapping from <literal>java.lang.Class</literal> to <literal>VARCHAR</"
+"literal> (or Oracle <literal>VARCHAR2</literal>). A <literal>Class</literal> "
+"is mapped to its fully qualified name."
+msgstr ""
+"从 <literal>java.lang.Class</literal> 到 <literal>VARCHAR</literal>(或者 "
+"Oracle 的 <literal>VARCHAR2</literal> 类型)的映射。<literal>Class</literal> "
+"被映射为它的全限定名。"
+
+#. Tag: literal
+#: basic_mapping.xml:4142
+#, no-c-format
+msgid "binary"
+msgstr "binary"
+
+#. Tag: para
+#: basic_mapping.xml:4145
+#, no-c-format
+msgid "Maps byte arrays to an appropriate SQL binary type."
+msgstr "把字节数组(byte arrays)映射为对应的 SQL 二进制类型。"
+
+#. Tag: literal
+#: basic_mapping.xml:4150
+#, no-c-format
+msgid "text"
+msgstr "text"
+
+#. Tag: para
+#: basic_mapping.xml:4153
+#, no-c-format
+msgid ""
+"Maps long Java strings to a SQL <literal>CLOB</literal> or <literal>TEXT</"
+"literal> type."
+msgstr ""
+"把长 Java 字符串映射为 SQL 的 <literal>CLOB</literal> 或者 <literal>TEXT</"
+"literal> 类型。"
+
+#. Tag: literal
+#: basic_mapping.xml:4159
+#, no-c-format
+msgid "serializable"
+msgstr "serializable"
+
+#. Tag: para
+#: basic_mapping.xml:4162
+#, no-c-format
+msgid ""
+"Maps serializable Java types to an appropriate SQL binary type. You can also "
+"indicate the Hibernate type <literal>serializable</literal> with the name of "
+"a serializable Java class or interface that does not default to a basic type."
+msgstr ""
+"把可序列化的 Java 类型映射到对应的 SQL 二进制类型。你也可以为一个并非默认为基"
+"本类型的可序列化 Java 类或者接口指定 Hibernate 类型 <literal>serializable</"
+"literal>。 "
+
+#. Tag: literal
+#: basic_mapping.xml:4171
+#, no-c-format
+msgid "clob, blob"
+msgstr "clob, blob"
+
+#. Tag: para
+#: basic_mapping.xml:4174
+#, no-c-format
+msgid ""
+"Type mappings for the JDBC classes <literal>java.sql.Clob</literal> and "
+"<literal>java.sql.Blob</literal>. These types can be inconvenient for some "
+"applications, since the blob or clob object cannot be reused outside of a "
+"transaction. Driver support is patchy and inconsistent."
+msgstr ""
+"JDBC 类 <literal>java.sql.Clob</literal> 和 <literal>java.sql.Blob</literal>"
+"的映射。某些程序可能不适合使用这个类型,因为 blob 和 clob 对象可能在一个事务"
+"之外是无法重用的。(而且, 驱动程序对这种类型的支持充满着补丁和前后矛盾。) "
+
+#. Tag: literal
+#: basic_mapping.xml:4184
+#, fuzzy, no-c-format
+msgid ""
+"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary"
+msgstr ""
+"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
+"imm_serializable, imm_binary</literal>"
+
+#. Tag: para
+#: basic_mapping.xml:4188
+#, no-c-format
+msgid ""
+"Type mappings for what are considered mutable Java types. This is where "
+"Hibernate makes certain optimizations appropriate only for immutable Java "
+"types, and the application treats the object as immutable. For example, you "
+"should not call <literal>Date.setTime()</literal> for an instance mapped as "
+"<literal>imm_timestamp</literal>. To change the value of the property, and "
+"have that change made persistent, the application must assign a new, "
+"nonidentical, object to the property."
+msgstr ""
+"一般来说,映射类型被假定为是可变的 Java 类型,只有对不可变 Java 类型,"
+"Hibernate 会采取特定的优化措施,应用程序会把这些对象作为不可变对象处理。比"
+"如,你不应该对作为 <literal>imm_timestamp</literal> 映射的 Date 执行 "
+"<literal>Date.setTime()</literal>。要改变属性的值,并且保存这一改变,应用程序"
+"必须对这一属性重新设置一个新的(不一样的)对象。 "
+
+#. Tag: para
+#: basic_mapping.xml:4200
+#, no-c-format
+msgid ""
+"Unique identifiers of entities and collections can be of any basic type "
+"except <literal>binary</literal>, <literal>blob</literal> and <literal>clob</"
+"literal>. Composite identifiers are also allowed. See below for more "
+"information."
+msgstr ""
+"实体及其集合的唯一标识可以是除了 <literal>binary</literal>、 <literal>blob</"
+"literal> 和 <literal>clob</literal> 之外的任何基础类型。(联合标识也是允许"
+"的,后面会说到。)"
+
+#. Tag: para
+#: basic_mapping.xml:4205
+#, no-c-format
+msgid ""
+"The basic value types have corresponding <literal>Type</literal> constants "
+"defined on <literal>org.hibernate.Hibernate</literal>. For example, "
+"<literal>Hibernate.STRING</literal> represents the <literal>string</literal> "
+"type."
+msgstr ""
+"在 <literal>org.hibernate.Hibernate</literal> 中,定义了基础类型对应的 "
+"<literal>Type</literal> 常量。比如,<literal>Hibernate.STRING</literal> 代表 "
+"<literal>string</literal> 类型。"
+
#. Tag: title
+#: basic_mapping.xml:4212
#, no-c-format
-msgid "Using XDoclet markup"
-msgstr "使用 XDoclet 标记"
+msgid "Custom value types"
+msgstr "自定义值类型"
#. Tag: para
+#: basic_mapping.xml:4214
#, no-c-format
-msgid "Many Hibernate users prefer to embed mapping information directly in sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not cover this approach in this reference guide since it is considered part of XDoclet. However, we include the following example of the <literal>Cat</literal> class with XDoclet mappings:"
-msgstr "很多 Hibernate 使用者更喜欢使用 XDoclet<literal>@hibernate.tags</literal> 将映射信息直接嵌入到源代码中。我们不会在本文档中涉及这个方法,因为严格说来,这属于 XDoclet 的一部分。然而,我们包含了如下使用 XDoclet 映射的 <literal>Cat</literal> 类的例子。 "
+msgid ""
+"It is relatively easy for developers to create their own value types. For "
+"example, you might want to persist properties of type <literal>java.lang."
+"BigInteger</literal> to <literal>VARCHAR</literal> columns. Hibernate does "
+"not provide a built-in type for this. Custom types are not limited to "
+"mapping a property, or collection element, to a single table column. So, for "
+"example, you might have a Java property <literal>getName()</literal>/"
+"<literal>setName()</literal> of type <literal>java.lang.String</literal> "
+"that is persisted to the columns <literal>FIRST_NAME</literal>, "
+"<literal>INITIAL</literal>, <literal>SURNAME</literal>."
+msgstr ""
+"开发者创建属于他们自己的值类型也是很容易的。比如说,你可能希望持久化 "
+"<literal>java.lang.BigInteger</literal> 类型的属性,持久化成为 "
+"<literal>VARCHAR</literal> 字段。Hibernate没有内置这样一种类型。自定义类型能"
+"够映射一个属性(或集合元素)到不止一个数据库表字段。比如说,你可能有这样的 "
+"Java 属性:<literal>getName()</literal>/<literal>setName()</literal>,这是 "
+"<literal>java.lang.String</literal> 类型的,对应的持久化到三个字段:"
+"<literal>FIRST_NAME</literal>,<literal>INITIAL</literal>,<literal>SURNAME</"
+"literal>。 "
#. Tag: para
+#: basic_mapping.xml:4225
#, no-c-format
-msgid "See the Hibernate website for more examples of XDoclet and Hibernate."
-msgstr "参考 Hibernate 网站更多的 Xdoclet 和 Hibernate 的例子。"
+msgid ""
+"To implement a custom type, implement either <literal>org.hibernate."
+"UserType</literal> or <literal>org.hibernate.CompositeUserType</literal> and "
+"declare properties using the fully qualified classname of the type. View "
+"<literal>org.hibernate.test.DoubleStringType</literal> to see the kind of "
+"things that are possible."
+msgstr ""
+"要实现一个自定义类型,可以实现 <literal>org.hibernate.UserType</literal> 或 "
+"<literal>org.hibernate.CompositeUserType</literal> 中的任一个,并且使用类型"
+"的 Java 全限定类名来定义属性。请查看 <literal>org.hibernate.test."
+"DoubleStringType</literal> 这个例子,看看它是怎么做的。 "
+#. Tag: programlisting
+#: basic_mapping.xml:4232
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+msgstr ""
+"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
+"\">\n"
+" <column name=\"first_string\"/>\n"
+" <column name=\"second_string\"/>\n"
+"</property>"
+
+#. Tag: para
+#: basic_mapping.xml:4234
+#, no-c-format
+msgid ""
+"Notice the use of <literal><column></literal> tags to map a property "
+"to multiple columns."
+msgstr ""
+"注意使用 <literal><column></literal> 标签来把一个属性映射到多个字段的做"
+"法。"
+
+#. Tag: para
+#: basic_mapping.xml:4237
+#, no-c-format
+msgid ""
+"The <literal>CompositeUserType</literal>, <literal>EnhancedUserType</"
+"literal>, <literal>UserCollectionType</literal>, and "
+"<literal>UserVersionType</literal> interfaces provide support for more "
+"specialized uses."
+msgstr ""
+"<literal>CompositeUserType</literal>,<literal>EnhancedUserType</literal>,"
+"<literal>UserCollectionType</literal> 和 <literal>UserVersionType</literal> "
+"接口为更特殊的使用方式提供支持。"
+
+#. Tag: para
+#: basic_mapping.xml:4243
+#, no-c-format
+msgid ""
+"You can even supply parameters to a <literal>UserType</literal> in the "
+"mapping file. To do this, your <literal>UserType</literal> must implement "
+"the <literal>org.hibernate.usertype.ParameterizedType</literal> interface. "
+"To supply parameters to your custom type, you can use the <literal><"
+"type></literal> element in your mapping files."
+msgstr ""
+"你甚至可以在一个映射文件中提供参数给一个 <literal>UserType</literal>。 为了这"
+"样做,你的 <literal>UserType</literal> 必须实现 <literal>org.hibernate."
+"usertype.ParameterizedType</literal> 接口。为了给自定义类型提供参数,你可以在"
+"映射文件中使用 <literal><type></literal> 元素。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:4250
+#, fuzzy, no-c-format
+msgid ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+msgstr ""
+"<property name=\"priority\">\n"
+" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
+" <param name=\"default\">0</param>\n"
+" </type>\n"
+"</property>"
+
+#. Tag: para
+#: basic_mapping.xml:4252
+#, no-c-format
+msgid ""
+"The <literal>UserType</literal> can now retrieve the value for the parameter "
+"named <literal>default</literal> from the <literal>Properties</literal> "
+"object passed to it."
+msgstr ""
+"现在,<literal>UserType</literal> 可以从传入的 <literal>Properties</literal> "
+"对象中得到 <literal>default</literal> 参数的值。"
+
+#. Tag: para
+#: basic_mapping.xml:4256
+#, no-c-format
+msgid ""
+"If you regularly use a certain <literal>UserType</literal>, it is useful to "
+"define a shorter name for it. You can do this using the <literal><"
+"typedef></literal> element. Typedefs assign a name to a custom type, and "
+"can also contain a list of default parameter values if the type is "
+"parameterized."
+msgstr ""
+"如果你非常频繁地使用某一 <literal>UserType</literal>,可以为他定义一个简称。"
+"这可以通过使用 <literal><typedef></literal> 元素来实现。Typedefs 为一自"
+"定义类型赋予一个名称,并且如果此类型是参数化的,还可以包含一系列默认的参数"
+"值。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:4262
+#, fuzzy, no-c-format
+msgid ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+msgstr ""
+"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
+"\"default_zero\">\n"
+" <param name=\"default\">0</param>\n"
+"</typedef>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:4264
+#, fuzzy, no-c-format
+msgid "<property name=\"priority\" type=\"default_zero\"/>"
+msgstr "<property name=\"priority\" type=\"default_zero\"/>"
+
+#. Tag: para
+#: basic_mapping.xml:4266
+#, no-c-format
+msgid ""
+"It is also possible to override the parameters supplied in a typedef on a "
+"case-by-case basis by using type parameters on the property mapping."
+msgstr ""
+"也可以根据具体案例通过属性映射中的类型参数覆盖在 typedef 中提供的参数。"
+
+#. Tag: para
+#: basic_mapping.xml:4270
+#, no-c-format
+msgid ""
+"Even though Hibernate's rich range of built-in types and support for "
+"components means you will rarely need to use a custom type, it is considered "
+"good practice to use custom types for non-entity classes that occur "
+"frequently in your application. For example, a <literal>MonetaryAmount</"
+"literal> class is a good candidate for a <literal>CompositeUserType</"
+"literal>, even though it could be mapped as a component. One reason for this "
+"is abstraction. With a custom type, your mapping documents would be "
+"protected against changes to the way monetary values are represented."
+msgstr ""
+"尽管 Hibernate 内建的丰富的类型和对组件的支持意味着你可能很少 <emphasis>需要"
+"</emphasis>使用自定义类型。不过,为那些在你的应用中经常出现的(非实体)类使用自"
+"定义类型也是一个好方法。例如,一个 <literal>MonetaryAmount</literal> 类使用 "
+"<literal>CompositeUserType</literal> 来映射是不错的选择,虽然他可以很容易地被"
+"映射成组件。这样做的动机之一是抽象。使用自定义类型,以后假若你改变表示金额的"
+"方法时,它可以保证映射文件不需要修改。 "
+
#. Tag: title
+#: basic_mapping.xml:4283
#, no-c-format
-msgid "Using JDK 5.0 Annotations"
-msgstr "使用 JDK 5.0 的注解(Annotation)"
+msgid "Mapping a class more than once"
+msgstr "多次映射同一个类"
#. Tag: para
+#: basic_mapping.xml:4285
#, no-c-format
-msgid "JDK 5.0 introduced XDoclet-style annotations at the language level that are type-safe and checked at compile time. This mechanism is more powerful than XDoclet annotations and better supported by tools and IDEs. IntelliJ IDEA, for example, supports auto-completion and syntax highlighting of JDK 5.0 annotations. The new revision of the EJB specification (JSR-220) uses JDK 5.0 annotations as the primary metadata mechanism for entity beans. Hibernate3 implements the <literal>EntityManager</literal> of JSR-220 (the persistence API). Support for mapping metadata is available via the <emphasis>Hibernate Annotations</emphasis> package as a separate download. Both EJB3 (JSR-220) and Hibernate3 metadata is supported."
-msgstr "JDK 5.0 在语言级别引入了 XDoclet 风格的标注,并且是类型安全的,在编译期进行检查。这一机制比 XDoclet 的注解更为强大,有更好的工具和 IDE 支持。例如,IntelliJ IDEA,支持 JDK 5.0 注解的自动完成和语法高亮 。EJB 规范的新修订版 (JSR-220) 使用 JDK 5.0 的注解作为entity beans的主要元数据(metadata)机制。Hibernate 3 实现了JSR-220(the persistence API) 的 <literal>EntityManager</literal>,支持通过 <emphasis>Hibernate Annotations</emphasis> 包定义映射元数据。这个包作为单独的部分下载,支持 EJB3(JSR-220) 和 Hibernate3 的元数据。 "
+msgid ""
+"It is possible to provide more than one mapping for a particular persistent "
+"class. In this case, you must specify an <emphasis>entity name</emphasis> to "
+"disambiguate between instances of the two mapped entities. By default, the "
+"entity name is the same as the class name. Hibernate lets you specify the "
+"entity name when working with persistent objects, when writing queries, or "
+"when mapping associations to the named entity."
+msgstr ""
+"对特定的持久化类,映射多次是允许的。这种情形下,你必须指定 <emphasis>entity "
+"name</emphasis> 来区别不同映射实体的对象实例。(默认情况下,实体名字和类名是"
+"相同的。) Hibernate 在操作持久化对象、编写查询条件,或者把关联映射到指定实体"
+"时,允许你指定这个 entity name(实体名字)。 "
+#. Tag: programlisting
+#: basic_mapping.xml:4293
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Contract\" table=\"Contracts\"\n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\"\n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\"\n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\"\n"
+" column=\"currentContractId\"\n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Contract\" table=\"Contracts\" \n"
+" entity-name=\"CurrentContract\">\n"
+" ...\n"
+" <set name=\"history\" inverse=\"true\" \n"
+" order-by=\"effectiveEndDate desc\">\n"
+" <key column=\"currentContractId\"/>\n"
+" <one-to-many entity-name=\"HistoricalContract\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Contract\" table=\"ContractHistory\" \n"
+" entity-name=\"HistoricalContract\">\n"
+" ...\n"
+" <many-to-one name=\"currentContract\" \n"
+" column=\"currentContractId\" \n"
+" entity-name=\"CurrentContract\"/>\n"
+"</class>"
+
#. Tag: para
+#: basic_mapping.xml:4295
#, no-c-format
-msgid "This is an example of a POJO class annotated as an EJB entity bean:"
-msgstr "这是一个被注解为 EJB entity bean 的 POJO 类的例子"
+msgid ""
+"Associations are now specified using <literal>entity-name</literal> instead "
+"of <literal>class</literal>."
+msgstr ""
+"注意这里关联是如何用 <literal>entity-name</literal> 来代替 <literal>class</"
+"literal> 的。 "
#. Tag: para
+#: basic_mapping.xml:4299 basic_mapping.xml:4379 basic_mapping.xml:4414
#, no-c-format
-msgid "Support for JDK 5.0 Annotations (and JSR-220) is currently under development. Please refer to the Hibernate Annotations module for more details."
-msgstr "注意:对 JDK 5.0 注解(和 JSR-220)支持的工作仍然在进行中,并未完成。更多细节请参阅 Hibernate Annotations 模块。 "
+msgid "This feature is not supported in Annotations"
+msgstr ""
#. Tag: title
+#: basic_mapping.xml:4304
#, no-c-format
+msgid "SQL quoted identifiers"
+msgstr "SQL 中引号包围的标识符"
+
+#. Tag: para
+#: basic_mapping.xml:4306
+#, no-c-format
+msgid ""
+"You can force Hibernate to quote an identifier in the generated SQL by "
+"enclosing the table or column name in backticks in the mapping document. "
+"Hibernate will use the correct quotation style for the SQL <literal>Dialect</"
+"literal>. This is usually double quotes, but the SQL Server uses brackets "
+"and MySQL uses backticks."
+msgstr ""
+"你可通过在映射文档中使用反向引号(`)把表名或者字段名包围起来,以强制 "
+"Hibernate 在生成的 SQL 中把标识符用引号包围起来。Hibernate 会使用相应的 "
+"SQL<literal>Dialect</literal>(方言)来使用正确的引号风格(通常是双引号,但是"
+"在 SQL Server 中是括号,MySQL 中是反向引号)。 "
+
+#. Tag: programlisting
+#: basic_mapping.xml:4312
+#, fuzzy, no-c-format
+msgid ""
+"@Entity @Table(name=\"`Line Item`\")\n"
+"class LineItem {\n"
+" @id @Column(name=\"`Item Id`\") Integer id;\n"
+" @Column(name=\"`Item #`\") int itemNumber\n"
+"}\n"
+"\n"
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
+msgstr ""
+"<class name=\"LineItem\" table=\"`Line Item`\">\n"
+" <id name=\"id\" column=\"`Item Id`\"/><generator class="
+"\"assigned\"/></id>\n"
+" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
+" ...\n"
+"</class>"
+
+#. Tag: title
+#: basic_mapping.xml:4316
+#, no-c-format
msgid "Generated properties"
msgstr "数据库生成属性(Generated Properties) "
#. Tag: para
+#: basic_mapping.xml:4318
#, no-c-format
-msgid "Generated properties are properties that have their values generated by the database. Typically, Hibernate applications needed to <literal>refresh</literal> objects that contain any properties for which the database was generating values. Marking properties as generated, however, lets the application delegate this responsibility to Hibernate. When Hibernate issues an SQL INSERT or UPDATE for an entity that has defined generated properties, it immediately issues a select afterwards to retrieve the generated values."
-msgstr "Generated properties 指的是其值由数据库生成的属性。一般来说,如果对象有任何属性由数据库生成值,Hibernate 应用程序需要进行<literal>刷新(refresh)</literal>。但如果把属性标明为 generated,就可以转由 Hibernate 来负责这个动作。实际上。对定义了 generated properties 的实体,每当 Hibernate 执行一条 SQL INSERT 或者 UPDATE 语句,会立刻执行一条 select 来获得生成的值。 "
+msgid ""
+"Generated properties are properties that have their values generated by the "
+"database. Typically, Hibernate applications needed to <literal>refresh</"
+"literal> objects that contain any properties for which the database was "
+"generating values. Marking properties as generated, however, lets the "
+"application delegate this responsibility to Hibernate. When Hibernate issues "
+"an SQL INSERT or UPDATE for an entity that has defined generated properties, "
+"it immediately issues a select afterwards to retrieve the generated values."
+msgstr ""
+"Generated properties 指的是其值由数据库生成的属性。一般来说,如果对象有任何属"
+"性由数据库生成值,Hibernate 应用程序需要进行<literal>刷新(refresh)</"
+"literal>。但如果把属性标明为 generated,就可以转由 Hibernate 来负责这个动作。"
+"实际上。对定义了 generated properties 的实体,每当 Hibernate 执行一条 SQL "
+"INSERT 或者 UPDATE 语句,会立刻执行一条 select 来获得生成的值。 "
#. Tag: para
+#: basic_mapping.xml:4327
#, no-c-format
-msgid "Properties marked as generated must additionally be non-insertable and non-updateable. Only <link linkend=\"mapping-declaration-version\">versions</link>, <link linkend=\"mapping-declaration-timestamp\">timestamps</link>, and <link linkend=\"mapping-declaration-property\">simple properties</link>, can be marked as generated."
-msgstr "被标明为 generated 的属性还必须是 non-insertable 和 non-updateable 的。只有 <link linkend=\"mapping-declaration-version\">versions</link>、<link linkend=\"mapping-declaration-timestamp\">timestamps</link> 和 <link linkend=\"mapping-declaration-property\">simple properties</link> 可以被标明为 generated。 "
+msgid ""
+"Properties marked as generated must additionally be non-insertable and non-"
+"updateable. Only <link linkend=\"mapping-declaration-version\">versions</"
+"link>, <link linkend=\"mapping-declaration-timestamp\">timestamps</link>, "
+"and <link linkend=\"mapping-declaration-property\">simple properties</link>, "
+"can be marked as generated."
+msgstr ""
+"被标明为 generated 的属性还必须是 non-insertable 和 non-updateable 的。只有 "
+"<link linkend=\"mapping-declaration-version\">versions</link>、<link linkend="
+"\"mapping-declaration-timestamp\">timestamps</link> 和 <link linkend="
+"\"mapping-declaration-property\">simple properties</link> 可以被标明为 "
+"generated。 "
#. Tag: para
+#: basic_mapping.xml:4334
#, no-c-format
-msgid "<literal>never</literal> (the default): the given property value is not generated within the database."
+msgid ""
+"<literal>never</literal> (the default): the given property value is not "
+"generated within the database."
msgstr "<literal>never</literal>(默认)标明此属性值不是从数据库中生成。 "
#. Tag: para
+#: basic_mapping.xml:4337
#, no-c-format
-msgid "<literal>insert</literal>: the given property value is generated on insert, but is not regenerated on subsequent updates. Properties like created-date fall into this category. Even though <link linkend=\"mapping-declaration-version\">version</link> and <link linkend=\"mapping-declaration-timestamp\">timestamp</link> properties can be marked as generated, this option is not available."
-msgstr "<literal>insert</literal> — 标明此属性值在 insert 的时候生成,但是不会在随后的 update 时重新生成。比如说创建日期就归属于这类。注意虽然 <link linkend=\"mapping-declaration-version\">version</link> 和 <link linkend=\"mapping-declaration-timestamp\">timestamp</link> 属性可以被标注为 generated,但是不适用这个选项。"
+msgid ""
+"<literal>insert</literal>: the given property value is generated on insert, "
+"but is not regenerated on subsequent updates. Properties like created-date "
+"fall into this category. Even though <link linkend=\"mapping-declaration-"
+"version\">version</link> and <link linkend=\"mapping-declaration-timestamp"
+"\">timestamp</link> properties can be marked as generated, this option is "
+"not available."
+msgstr ""
+"<literal>insert</literal> — 标明此属性值在 insert 的时候生成,但是不会在随后"
+"的 update 时重新生成。比如说创建日期就归属于这类。注意虽然 <link linkend="
+"\"mapping-declaration-version\">version</link> 和 <link linkend=\"mapping-"
+"declaration-timestamp\">timestamp</link> 属性可以被标注为 generated,但是不适"
+"用这个选项。"
#. Tag: para
+#: basic_mapping.xml:4344
#, no-c-format
-msgid "<literal>always</literal>: the property value is generated both on insert and on update."
-msgstr "<literal>always</literal> — 标明此属性值在 insert 和 update 时都会被生成。 "
+msgid ""
+"<literal>always</literal>: the property value is generated both on insert "
+"and on update."
+msgstr ""
+"<literal>always</literal> — 标明此属性值在 insert 和 update 时都会被生成。 "
+#. Tag: para
+#: basic_mapping.xml:4347
+#, no-c-format
+msgid "To mark a property as generated, use <classname>@Generated</classname>."
+msgstr ""
+
#. Tag: title
+#: basic_mapping.xml:4352
#, no-c-format
msgid "Column read and write expressions"
msgstr "字段的读写表达式"
#. Tag: para
+#: basic_mapping.xml:4354
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate allows you to customize the SQL it uses to read and write the "
+"values of columns mapped to <link linkend=\"mapping-declaration-property"
+"\">simple properties</link>. For example, if your database provides a set of "
+"data encryption functions, you can invoke them for individual columns like "
+"this:"
+msgstr ""
+"Hibernate 允许你自定义 SQL 以读写映射<link linkend=\"mapping-declaration-"
+"property\">简单属性</link>的字段值。例如,如果你的数据库提供了一套数据加密方"
+"法,你可以在单个字段上调用它们:<programlisting role=\"XML\"><property "
+"name=\"creditCardNumber\"> <column name=\"credit_card_num\" read="
+"\"decrypt(credit_card_num)\" write=\"encrypt(?)\"/> </property></"
+"programlisting>"
+
+#. Tag: programlisting
+#: basic_mapping.xml:4359
#, no-c-format
-msgid "Hibernate allows you to customize the SQL it uses to read and write the values of columns mapped to <link linkend=\"mapping-declaration-property\">simple properties</link>. For example, if your database provides a set of data encryption functions, you can invoke them for individual columns like this: <programlisting role=\"XML\"><property name=\"creditCardNumber\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" write=\"encrypt(?)\"/> </property></programlisting>"
-msgstr "Hibernate 允许你自定义 SQL 以读写映射<link linkend=\"mapping-declaration-property\">简单属性</link>的字段值。例如,如果你的数据库提供了一套数据加密方法,你可以在单个字段上调用它们:<programlisting role=\"XML\"><property name=\"creditCardNumber\"> <column name=\"credit_card_num\" read=\"decrypt(credit_card_num)\" write=\"encrypt(?)\"/> </property></programlisting>"
+msgid ""
+"<property name=\"creditCardNumber\">\n"
+" <column \n"
+" name=\"credit_card_num\"\n"
+" read=\"decrypt(credit_card_num)\"\n"
+" write=\"encrypt(?)\"/>\n"
+"</property>"
+msgstr ""
#. Tag: para
+#: basic_mapping.xml:4361
#, no-c-format
-msgid "Hibernate applies the custom expressions automatically whenever the property is referenced in a query. This functionality is similar to a derived-property <literal>formula</literal> with two differences:"
-msgstr "每当属性在查询里被引用时,Hibernate 都自动应用自定义的表达式。这种功能和 derived-property <literal>formula</literal> 相似,但有两个不同的地方:"
+msgid ""
+"Hibernate applies the custom expressions automatically whenever the property "
+"is referenced in a query. This functionality is similar to a derived-"
+"property <literal>formula</literal> with two differences:"
+msgstr ""
+"每当属性在查询里被引用时,Hibernate 都自动应用自定义的表达式。这种功能和 "
+"derived-property <literal>formula</literal> 相似,但有两个不同的地方:"
#. Tag: para
+#: basic_mapping.xml:4366
#, no-c-format
-msgid "The property is backed by one or more columns that are exported as part of automatic schema generation."
+msgid ""
+"The property is backed by one or more columns that are exported as part of "
+"automatic schema generation."
msgstr "属性由一个或多个属性组成,它作为自动模式生成的一部分导出。"
#. Tag: para
+#: basic_mapping.xml:4371
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr "属性是可读写的,非只读的。"
#. Tag: para
+#: basic_mapping.xml:4375
#, no-c-format
-msgid "The <literal>write</literal> expression, if specified, must contain exactly one '?' placeholder for the value."
-msgstr "如果指定了 <literal>write</literal> 表达式,它必须只包含一个“?”占位符。"
+msgid ""
+"The <literal>write</literal> expression, if specified, must contain exactly "
+"one '?' placeholder for the value."
+msgstr ""
+"如果指定了 <literal>write</literal> 表达式,它必须只包含一个“?”占位符。"
#. Tag: title
+#: basic_mapping.xml:4384
#, no-c-format
msgid "Auxiliary database objects"
msgstr "辅助数据库对象(Auxiliary Database Objects) "
#. Tag: para
+#: basic_mapping.xml:4386
#, no-c-format
-msgid "Auxiliary database objects allow for the CREATE and DROP of arbitrary database objects. In conjunction with Hibernate's schema evolution tools, they have the ability to fully define a user schema within the Hibernate mapping files. Although designed specifically for creating and dropping things like triggers or stored procedures, any SQL command that can be run via a <literal>java.sql.Statement.execute()</literal> method is valid (for example, ALTERs, INSERTS, etc.). There are essentially two modes for defining auxiliary database objects:"
-msgstr "允许 CREATE 和 DROP 任意数据库对象,与 Hibernate 的 schema 交互工具组合起来,可以提供在 Hibernate 映射文件中完全定义用户 schema 的能力。虽然这是为创建和销毁 trigger(触发器)或stored procedure(存储过程)等特别设计的,实际上任何可以在 <literal>java.sql.Statement.execute()</literal> 方法中执行的 SQL 命令都可以在此使用(比如ALTER, INSERT,等等)。本质上有两种模式来定义辅助数据库对象... "
+msgid ""
+"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
+"database objects. In conjunction with Hibernate's schema evolution tools, "
+"they have the ability to fully define a user schema within the Hibernate "
+"mapping files. Although designed specifically for creating and dropping "
+"things like triggers or stored procedures, any SQL command that can be run "
+"via a <literal>java.sql.Statement.execute()</literal> method is valid (for "
+"example, ALTERs, INSERTS, etc.). There are essentially two modes for "
+"defining auxiliary database objects:"
+msgstr ""
+"允许 CREATE 和 DROP 任意数据库对象,与 Hibernate 的 schema 交互工具组合起来,"
+"可以提供在 Hibernate 映射文件中完全定义用户 schema 的能力。虽然这是为创建和销"
+"毁 trigger(触发器)或stored procedure(存储过程)等特别设计的,实际上任何可"
+"以在 <literal>java.sql.Statement.execute()</literal> 方法中执行的 SQL 命令都"
+"可以在此使用(比如ALTER, INSERT,等等)。本质上有两种模式来定义辅助数据库对"
+"象... "
#. Tag: para
+#: basic_mapping.xml:4396
#, no-c-format
-msgid "The first mode is to explicitly list the CREATE and DROP commands in the mapping file:"
+msgid ""
+"The first mode is to explicitly list the CREATE and DROP commands in the "
+"mapping file:"
msgstr "第一种模式是在映射文件中显式声明 CREATE 和 DROP 命令: "
+#. Tag: programlisting
+#: basic_mapping.xml:4399
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <create>CREATE TRIGGER my_trigger ...</create>\n"
+" <drop>DROP TRIGGER my_trigger</drop>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:4401
#, no-c-format
-msgid "The second mode is to supply a custom class that constructs the CREATE and DROP commands. This custom class must implement the <literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal> interface."
-msgstr "第二种模式是提供一个类,这个类知道如何组织 CREATE 和 DROP 命令。这个特别类必须实现 <literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal> 接口。 "
+msgid ""
+"The second mode is to supply a custom class that constructs the CREATE and "
+"DROP commands. This custom class must implement the <literal>org.hibernate."
+"mapping.AuxiliaryDatabaseObject</literal> interface."
+msgstr ""
+"第二种模式是提供一个类,这个类知道如何组织 CREATE 和 DROP 命令。这个特别类必"
+"须实现 <literal>org.hibernate.mapping.AuxiliaryDatabaseObject</literal> 接"
+"口。 "
+#. Tag: programlisting
+#: basic_mapping.xml:4406
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: basic_mapping.xml:4408
#, no-c-format
-msgid "Additionally, these database objects can be optionally scoped so that they only apply when certain dialects are used."
+msgid ""
+"Additionally, these database objects can be optionally scoped so that they "
+"only apply when certain dialects are used."
msgstr "还有,这些数据库对象可以特别指定为仅在特定的方言中才使用。 "
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\"\n"
-#~ " table=\"cats\"\n"
-#~ " discriminator-value=\"C\">\n"
-#~ "\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <discriminator column=\"subclass\"\n"
-#~ " type=\"character\"/>\n"
-#~ "\n"
-#~ " <property name=\"weight\"/>\n"
-#~ "\n"
-#~ " <property name=\"birthdate\"\n"
-#~ " type=\"date\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"color\"\n"
-#~ " type=\"eg.types.ColorUserType\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"sex\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"litterId\"\n"
-#~ " column=\"litterId\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"mother\"\n"
-#~ " column=\"mother_id\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <set name=\"kittens\"\n"
-#~ " inverse=\"true\"\n"
-#~ " order-by=\"litter_id\">\n"
-#~ " <key column=\"mother_id\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ " <subclass name=\"DomesticCat\"\n"
-#~ " discriminator-value=\"D\">\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " </subclass>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\"\n"
-#~ " table=\"cats\"\n"
-#~ " discriminator-value=\"C\">\n"
-#~ "\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <discriminator column=\"subclass\"\n"
-#~ " type=\"character\"/>\n"
-#~ "\n"
-#~ " <property name=\"weight\"/>\n"
-#~ "\n"
-#~ " <property name=\"birthdate\"\n"
-#~ " type=\"date\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"color\"\n"
-#~ " type=\"eg.types.ColorUserType\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"sex\"\n"
-#~ " not-null=\"true\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <property name=\"litterId\"\n"
-#~ " column=\"litterId\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"mother\"\n"
-#~ " column=\"mother_id\"\n"
-#~ " update=\"false\"/>\n"
-#~ "\n"
-#~ " <set name=\"kittens\"\n"
-#~ " inverse=\"true\"\n"
-#~ " order-by=\"litter_id\">\n"
-#~ " <key column=\"mother_id\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ " <subclass name=\"DomesticCat\"\n"
-#~ " discriminator-value=\"D\">\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " </subclass>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
+#. Tag: programlisting
+#: basic_mapping.xml:4411
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
+">\n"
+" </database-object>\n"
+"</hibernate-mapping>"
+msgstr ""
+"<hibernate-mapping>\n"
+" ...\n"
+" <database-object>\n"
+" <definition class=\"MyTriggerDefinition\"/>\n"
+" <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
+">\n"
+" <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/>\n"
+" </database-object>\n"
+"</hibernate-mapping>"
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
-#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
-#~ "]>\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"your.domain\">\n"
-#~ " <class name=\"MyEntity\">\n"
-#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
-#~ " ...\n"
-#~ " </id>\n"
-#~ " <class>\n"
-#~ " &types;\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
-#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
-#~ "]>\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"your.domain\">\n"
-#~ " <class name=\"MyEntity\">\n"
-#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
-#~ " ...\n"
-#~ " </id>\n"
-#~ " <class>\n"
-#~ " &types;\n"
-#~ "</hibernate-mapping>]]>"
+#~ msgid "Class"
+#~ msgstr "类"
#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping\n"
-#~ " schema=\"schemaName\"\n"
-#~ " catalog=\"catalogName\"\n"
-#~ " default-cascade=\"cascade_style\"\n"
-#~ " default-access=\"field|property|ClassName\"\n"
-#~ " default-lazy=\"true|false\"\n"
-#~ " auto-import=\"true|false\"\n"
-#~ " package=\"package.name\"\n"
-#~ " />]]>"
+#~ "Use of <literal>select-before-update</literal> will usually decrease "
+#~ "performance. It is useful to prevent a database update trigger being "
+#~ "called unnecessarily if you reattach a graph of detached instances to a "
+#~ "<literal>Session</literal>."
#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping\n"
-#~ " schema=\"schemaName\"\n"
-#~ " catalog=\"catalogName\"\n"
-#~ " default-cascade=\"cascade_style\"\n"
-#~ " default-access=\"field|property|ClassName\"\n"
-#~ " default-lazy=\"true|false\"\n"
-#~ " auto-import=\"true|false\"\n"
-#~ " package=\"package.name\"\n"
-#~ " />]]>"
+#~ "使用 <literal>select-before-update</literal> 通常会降低性能。如果你重新连"
+#~ "接一个脱管(detached)对象实例 到一个 <literal>Session</literal> 中时,它"
+#~ "可以防止数据库不必要的触发 update。这就很有用了。"
-#~ msgid ""
-#~ "<![CDATA[<class\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tableName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " select-before-update=\"true|false\"\n"
-#~ " polymorphism=\"implicit|explicit\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " persister=\"PersisterClass\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " optimistic-lock=\"none|version|dirty|all\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " check=\"arbitrary sql check condition\"\n"
-#~ " rowid=\"rowid\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " node=\"element-name\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tableName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " select-before-update=\"true|false\"\n"
-#~ " polymorphism=\"implicit|explicit\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " persister=\"PersisterClass\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " optimistic-lock=\"none|version|dirty|all\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " check=\"arbitrary sql check condition\"\n"
-#~ " rowid=\"rowid\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " node=\"element-name\"\n"
-#~ "/>]]>"
+#~ msgid "id"
+#~ msgstr "id"
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Summary\">\n"
-#~ " <subselect>\n"
-#~ " select item.name, max(bid.amount), count(*)\n"
-#~ " from item\n"
-#~ " join bid on bid.item_id = item.id\n"
-#~ " group by item.name\n"
-#~ " </subselect>\n"
-#~ " <synchronize table=\"item\"/>\n"
-#~ " <synchronize table=\"bid\"/>\n"
-#~ " <id name=\"name\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Summary\">\n"
-#~ " <subselect>\n"
-#~ " select item.name, max(bid.amount), count(*)\n"
-#~ " from item\n"
-#~ " join bid on bid.item_id = item.id\n"
-#~ " group by item.name\n"
-#~ " </subselect>\n"
-#~ " <synchronize table=\"item\"/>\n"
-#~ " <synchronize table=\"bid\"/>\n"
-#~ " <id name=\"name\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
+#~ msgid "Generator"
+#~ msgstr "Generator"
-#~ msgid ""
-#~ "<![CDATA[<id\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " column=\"column_name\"\n"
-#~ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "\n"
-#~ " <generator class=\"generatorClass\"/>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<id\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " column=\"column_name\"\n"
-#~ " unsaved-value=\"null|any|none|undefined|id_value\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "\n"
-#~ " <generator class=\"generatorClass\"/>\n"
-#~ "</id>]]>"
+#~ msgid "<literal>increment</literal>"
+#~ msgstr "<literal>increment</literal>"
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
-#~ " <param name=\"table\">uid_table</param>\n"
-#~ " <param name=\"column\">next_hi_value_column</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
-#~ " <param name=\"table\">uid_table</param>\n"
-#~ " <param name=\"column\">next_hi_value_column</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ msgid "<literal>identity</literal>"
+#~ msgstr "<literal>identity</literal>"
-#~ msgid "increment"
-#~ msgstr "increment"
+#~ msgid "<literal>sequence</literal>"
+#~ msgstr "<literal>sequence</literal>"
-#~ msgid "identity"
-#~ msgstr "identity"
+#~ msgid "<literal>seqhilo</literal>"
+#~ msgstr "<literal>seqhilo</literal>"
-#~ msgid "sequence"
-#~ msgstr "sequence"
+#~ msgid "<literal>uuid</literal>"
+#~ msgstr "<literal>uuid</literal>"
-#~ msgid "hilo"
-#~ msgstr "hilo"
+#~ msgid ""
+#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
+#~ "are unique within a network (the IP address is used). The UUID is encoded "
+#~ "as a string of 32 hexadecimal digits in length."
+#~ msgstr ""
+#~ "用一个 128-bit 的 UUID 算法生成字符串类型的标识符,这在一个网络中是唯一的"
+#~ "(使用了 IP 地址)。UUID 被编码为一个 32 位 16 进制数字的字符串。 "
-#~ msgid "seqhilo"
-#~ msgstr "seqhilo"
+#~ msgid "<literal>guid</literal>"
+#~ msgstr "<literal>guid</literal>"
-#~ msgid "guid"
-#~ msgstr "guid"
+#~ msgid "<literal>native</literal>"
+#~ msgstr "<literal>native</literal>"
-#~ msgid "native"
-#~ msgstr "native"
+#~ msgid "<literal>select</literal>"
+#~ msgstr "<literal>select</literal>"
-#~ msgid "assigned"
-#~ msgstr "assigned"
+#~ msgid "<literal>foreign</literal>"
+#~ msgstr "<literal>foreign</literal>"
-#~ msgid "select"
-#~ msgstr "select"
-
-#~ msgid "foreign"
-#~ msgstr "foreign"
-
#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"hilo\">\n"
-#~ " <param name=\"table\">hi_value</param>\n"
-#~ " <param name=\"column\">next_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "<literal>optimizer</literal> (optional - defaults to <literal>none</"
+#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
+#~ "\" />"
#~ msgstr ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"hilo\">\n"
-#~ " <param name=\"table\">hi_value</param>\n"
-#~ " <param name=\"column\">next_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "<literal>optimizer</literal>(可选 — 默认是<literal>none</literal>):请参"
+#~ "考 <xref linkend=\"mapping-declaration-id-enhanced-optimizers\" />。"
-#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"seqhilo\">\n"
-#~ " <param name=\"sequence\">hi_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
-#~ " <generator class=\"seqhilo\">\n"
-#~ " <param name=\"sequence\">hi_value</param>\n"
-#~ " <param name=\"max_lo\">100</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ msgid "composite-id"
+#~ msgstr "composite-id"
#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"sequence\">\n"
-#~ " <param name=\"sequence\">person_id_sequence</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "A table with a composite key can be mapped with multiple properties of "
+#~ "the class as identifier properties. The <literal><composite-id></"
+#~ "literal> element accepts <literal><key-property></literal> property "
+#~ "mappings and <literal><key-many-to-one></literal> mappings as child "
+#~ "elements."
#~ msgstr ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"sequence\">\n"
-#~ " <param name=\"sequence\">person_id_sequence</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "如果表使用联合主键,你可以映射类的多个属性为标识符属性。<literal><"
+#~ "composite-id></literal> 元素接受 <literal><key-property></"
+#~ "literal> 属性映射和 <literal><key-many-to-one></literal> 属性映射作"
+#~ "为子元素。 "
#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value="
-#~ "\"0\">\n"
-#~ " <generator class=\"identity\"/>\n"
-#~ "</id>]]>"
+#~ "The persistent class <emphasis>must</emphasis> override <literal>equals()"
+#~ "</literal> and <literal>hashCode()</literal> to implement composite "
+#~ "identifier equality. It must also implement <literal>Serializable</"
+#~ "literal>."
#~ msgstr ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value="
-#~ "\"0\">\n"
-#~ " <generator class=\"identity\"/>\n"
-#~ "</id>]]>"
+#~ "你的持久化类<emphasis>必须</emphasis>覆盖 <literal>equals()</literal> 和 "
+#~ "<literal>hashCode()</literal> 方法,来实现组合的标识符的相等判断。实现 "
+#~ "<literal>Serializable</literal> 接口也是必须的。"
#~ msgid ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"select\">\n"
-#~ " <param name=\"key\">socialSecurityNumber</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "Unfortunately, this approach means that a persistent object is its own "
+#~ "identifier. There is no convenient \"handle\" other than the object "
+#~ "itself. You must instantiate an instance of the persistent class itself "
+#~ "and populate its identifier properties before you can <literal>load()</"
+#~ "literal> the persistent state associated with a composite key. We call "
+#~ "this approach an <emphasis>embedded</emphasis> composite identifier, and "
+#~ "discourage it for serious applications."
#~ msgstr ""
-#~ "<![CDATA[<id name=\"id\" type=\"long\" column=\"person_id\">\n"
-#~ " <generator class=\"select\">\n"
-#~ " <param name=\"key\">socialSecurityNumber</param>\n"
-#~ " </generator>\n"
-#~ "</id>]]>"
+#~ "不幸的是,这种组合关键字的方法意味着一个持久化类是它自己的标识。除了对象自"
+#~ "己之外,没有什么方便的“把手”可用。你必须初始化持久化类的实例,填充它的标识"
+#~ "符属性,再 <literal>load()</literal> 组合关键字关联的持久状态。我们把这种"
+#~ "方法称为 <emphasis>embedded(嵌入式)</emphasis>的组合标识符,在重要的应用"
+#~ "中不鼓励使用这种用法。 "
#~ msgid ""
-#~ "<![CDATA[<composite-id\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " mapped=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|.\"\n"
-#~ "\n"
-#~ " <key-property name=\"propertyName\" type=\"typename\" column="
-#~ "\"column_name\"/>\n"
-#~ " <key-many-to-one name=\"propertyName class=\"ClassName\" column="
-#~ "\"column_name\"/>\n"
-#~ " ......\n"
-#~ "</composite-id>]]>"
+#~ "A second approach is what we call a <emphasis>mapped</emphasis> composite "
+#~ "identifier, where the identifier properties named inside the <literal><"
+#~ "composite-id></literal> element are duplicated on both the persistent "
+#~ "class and a separate identifier class."
#~ msgstr ""
-#~ "<![CDATA[<composite-id\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " mapped=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\">\n"
-#~ " node=\"element-name|.\"\n"
-#~ "\n"
-#~ " <key-property name=\"propertyName\" type=\"typename\" column="
-#~ "\"column_name\"/>\n"
-#~ " <key-many-to-one name=\"propertyName class=\"ClassName\" column="
-#~ "\"column_name\"/>\n"
-#~ " ......\n"
-#~ "</composite-id>]]>"
+#~ "第二种方法我们称为 <emphasis>mapped(映射式)</emphasis>组合标识符"
+#~ "(mapped composite identifier),<literal><composite-id></literal> "
+#~ "元素中列出的标识属性不但在持久化类出现,还形成一个独立的标识符类。"
#~ msgid ""
-#~ "<![CDATA[<composite-id>\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
+#~ "In this example, both the composite identifier class, "
+#~ "<literal>MedicareId</literal>, and the entity class itself have "
+#~ "properties named <literal>medicareNumber</literal> and "
+#~ "<literal>dependent</literal>. The identifier class must override "
+#~ "<literal>equals()</literal> and <literal>hashCode()</literal> and "
+#~ "implement <literal>Serializable</literal>. The main disadvantage of this "
+#~ "approach is code duplication."
#~ msgstr ""
-#~ "<![CDATA[<composite-id>\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
+#~ "在这个例子中,组合标识符类 <literal>MedicareId</literal> 和实体类都含有 "
+#~ "<literal>medicareNumber</literal> 和 <literal>dependent</literal> 属性。标"
+#~ "识符类必须重载 <literal>equals()</literal> 和 <literal>hashCode()</"
+#~ "literal> 并且实现 <literal>Serializable</literal> 接口。这种方法的缺点是出"
+#~ "现了明显的代码重复。"
#~ msgid ""
-#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
-#~ " <key-property name=\"medicareNumber\"/>\n"
-#~ " <key-property name=\"dependent\"/>\n"
-#~ "</composite-id>]]>"
+#~ "The following attributes are used to specify a mapped composite "
+#~ "identifier:"
+#~ msgstr "下面列出的属性是用来指定一个映射式组合标识符的:"
#~ msgid ""
-#~ "<![CDATA[<discriminator\n"
-#~ " column=\"discriminator_column\"\n"
-#~ " type=\"discriminator_type\"\n"
-#~ " force=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary sql expression\"\n"
-#~ "/>]]>"
+#~ "<literal>mapped</literal> (optional - defaults to <literal>false</"
+#~ "literal>): indicates that a mapped composite identifier is used, and that "
+#~ "the contained property mappings refer to both the entity class and the "
+#~ "composite identifier class."
#~ msgstr ""
-#~ "<![CDATA[<discriminator\n"
-#~ " column=\"discriminator_column\"\n"
-#~ " type=\"discriminator_type\"\n"
-#~ " force=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary sql expression\"\n"
-#~ "/>]]>"
+#~ "<literal>mapped</literal>(可选,默认为 <literal>false</literal>):指明使"
+#~ "用一个映射式组合标识符,其包含的属性映射同时在实体类和组合标识符类中出"
+#~ "现。 "
#~ msgid ""
-#~ "<![CDATA[<discriminator\n"
-#~ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end"
-#~ "\"\n"
-#~ " type=\"integer\"/>]]>"
+#~ "<literal>class</literal> (optional - but required for a mapped composite "
+#~ "identifier): the class used as a composite identifier."
#~ msgstr ""
-#~ "<![CDATA[<discriminator\n"
-#~ " formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end"
-#~ "\"\n"
-#~ " type=\"integer\"/>]]>"
+#~ "<literal>class</literal>(可选,但对映射式组合标识符必须指定):作为组合标"
+#~ "识符类使用的类名。"
#~ msgid ""
-#~ "<![CDATA[<version\n"
-#~ " column=\"version_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|negative|undefined\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "We will describe a third, even more convenient approach, where the "
+#~ "composite identifier is implemented as a component class in <xref linkend="
+#~ "\"components-compositeid\" />. The attributes described below apply only "
+#~ "to this alternative approach:"
#~ msgstr ""
-#~ "<![CDATA[<version\n"
-#~ " column=\"version_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " type=\"typename\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|negative|undefined\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "在 <xref linkend=\"components-compositeid\"/> 一节中,我们会描述第三种方式,"
+#~ "那就是把组合标识符实现为一个组件(component)类,这是更方便的方法。下面的属"
+#~ "性仅对第三种方法有效: "
#~ msgid ""
-#~ "<![CDATA[<timestamp\n"
-#~ " column=\"timestamp_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|undefined\"\n"
-#~ " source=\"vm|db\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "<literal>name</literal> (optional - required for this approach): a "
+#~ "property of component type that holds the composite identifier. Please "
+#~ "see chapter 9 for more information."
#~ msgstr ""
-#~ "<![CDATA[<timestamp\n"
-#~ " column=\"timestamp_column\"\n"
-#~ " name=\"propertyName\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unsaved-value=\"null|undefined\"\n"
-#~ " source=\"vm|db\"\n"
-#~ " generated=\"never|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ "/>]]>"
+#~ "<literal>name</literal>(可选,但对这种方法而言必须):包含此组件标识符的组"
+#~ "件类型的名字(参阅第 9 章)。"
#~ msgid ""
-#~ "<![CDATA[<property\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " type=\"typename\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " generated=\"never|insert|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " length=\"L\"\n"
-#~ " precision=\"P\"\n"
-#~ " scale=\"S\"\n"
-#~ "/>]]>"
+#~ "<literal>class</literal> (optional - defaults to the property type "
+#~ "determined by reflection): the component class used as a composite "
+#~ "identifier. Please see the next section for more information."
#~ msgstr ""
-#~ "<![CDATA[<property\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " type=\"typename\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " generated=\"never|insert|always\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " length=\"L\"\n"
-#~ " precision=\"P\"\n"
-#~ " scale=\"S\"\n"
-#~ "/>]]>"
+#~ "<literal>class</literal>(可选 — 默认会用反射来自动判定属性类型 ):用来作"
+#~ "为组合标识符的组件类的类名(参阅下一节)。 "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "<property name=\"totalPrice\"\n"
-#~ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, "
-#~ "Product p\n"
-#~ " WHERE li.productId = p.productId\n"
-#~ " AND li.customerId = customerId\n"
-#~ " AND li.orderNumber = orderNumber )\"/>]]>"
+#~ "The third approach, an <emphasis>identifier component</emphasis>, is "
+#~ "recommended for almost all applications."
#~ msgstr ""
-#~ "<property name=\"totalPrice\"\n"
-#~ " formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, "
-#~ "Product p\n"
-#~ " WHERE li.productId = p.productId\n"
-#~ " AND li.customerId = customerId\n"
-#~ " AND li.orderNumber = orderNumber )\"/>"
+#~ "第三种方式,被称为 <emphasis>identifier component(标识符组件)</emphasis>"
+#~ "是我们对几乎所有应用都推荐使用的方式。 "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<many-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<many-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " column=\"column_name\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " update=\"true|false\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " formula=\"arbitrary SQL expression\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " index=\"index_name\"\n"
-#~ " unique_key=\"unique_key_id\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>"
+#~ msgid "Version (optional)"
+#~ msgstr "版本(version)(可选) "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"product\" class=\"Product\" column="
-#~ "\"PRODUCT_ID\"/>]]>"
+#~ "The <literal><version></literal> element is optional and indicates "
+#~ "that the table contains versioned data. This is particularly useful if "
+#~ "you plan to use <emphasis>long transactions</emphasis>. See below for "
+#~ "more information:"
#~ msgstr ""
-#~ "<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/"
-#~ ">"
+#~ "<literal><version></literal> 元素是可选的,表明表中包含附带版本信息"
+#~ "的数据。这在你准备使用<emphasis> 长事务(long transactions)</emphasis>的"
+#~ "时候特别有用。下面是更多信息:"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"serialNumber\" unique=\"true\" type=\"string\" "
-#~ "column=\"SERIAL_NUMBER\"/>]]>"
+#~ "Version numbers can be of Hibernate type <literal>long</literal>, "
+#~ "<literal>integer</literal>, <literal>short</literal>, <literal>timestamp</"
+#~ "literal> or <literal>calendar</literal>."
#~ msgstr ""
-#~ "<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
-#~ "\"SERIAL_NUMBER\"/>"
+#~ "版本号必须是以下类型:<literal>long</literal>、<literal>integer</"
+#~ "literal>、<literal>short</literal>、<literal>timestamp</literal> 或者 "
+#~ "<literal>calendar</literal>。"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"product\" property-ref=\"serialNumber\" "
-#~ "column=\"PRODUCT_SERIAL_NUMBER\"/>]]>"
-#~ msgstr ""
-#~ "<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
-#~ "\"PRODUCT_SERIAL_NUMBER\"/>"
+#~ msgid "Many-to-one"
+#~ msgstr "多对一(many-to-one) "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
-#~ "\"OWNER_SSN\"/>]]>"
+#~ "An ordinary association to another persistent class is declared using a "
+#~ "<literal>many-to-one</literal> element. The relational model is a many-to-"
+#~ "one association; a foreign key in one table is referencing the primary "
+#~ "key column(s) of the target table."
#~ msgstr ""
-#~ "<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
-#~ "\"OWNER_SSN\"/>"
+#~ "通过 <literal>many-to-one</literal> 元素,可以定义一种常见的与另一个持久化"
+#~ "类的关联。这种关系模型是多对一关联(实际上是一个对象引用-译注):这个表的"
+#~ "一个外键引用目标表的主键字段。 "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<one-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " constrained=\"true|false\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " formula=\"any SQL expression\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<one-to-one\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"ClassName\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " constrained=\"true|false\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " property-ref=\"propertyNameFromAssociatedClass\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " formula=\"any SQL expression\"\n"
-#~ " lazy=\"proxy|no-proxy|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name|@attribute-name|element/@attribute|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " foreign-key=\"foreign_key_name\"\n"
-#~ "/>"
+#~ msgid "One-to-one"
+#~ msgstr "一对一 "
-#, fuzzy
-#~ msgid "<![CDATA[<one-to-one name=\"person\" class=\"Person\"/>]]>"
-#~ msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
+#~ msgid "There are two varieties of one-to-one associations:"
+#~ msgstr "有两种不同的一对一关联: "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" constrained="
-#~ "\"true\"/>]]>"
-#~ msgstr ""
-#~ "<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/"
-#~ ">"
+#~ msgid "primary key associations"
+#~ msgstr "主键关联"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"foreign\">\n"
-#~ " <param name=\"property\">employee</param>\n"
-#~ " </generator>\n"
-#~ " </id>\n"
-#~ " ...\n"
-#~ " <one-to-one name=\"employee\"\n"
-#~ " class=\"Employee\"\n"
-#~ " constrained=\"true\"/>\n"
-#~ "</class>]]>"
+#~ "Alternatively, a foreign key with a unique constraint, from "
+#~ "<literal>Employee</literal> to <literal>Person</literal>, can be "
+#~ "expressed as:"
#~ msgstr ""
-#~ "<class name=\"person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"foreign\">\n"
-#~ " <param name=\"property\">employee</param>\n"
-#~ " </generator>\n"
-#~ " </id>\n"
-#~ " ...\n"
-#~ " <one-to-one name=\"employee\"\n"
-#~ " class=\"Employee\"\n"
-#~ " constrained=\"true\"/>\n"
-#~ "</class>"
+#~ "另一种方式是一个外键和一个惟一关键字对应,上面的 <literal>Employee</"
+#~ "literal> 和 <literal>Person</literal> 的例子,如果使用这种关联方式,可以"
+#~ "表达成: "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID"
-#~ "\" unique=\"true\"/>]]>"
+#~ "This association can be made bidirectional by adding the following to the "
+#~ "<literal>Person</literal> mapping:"
#~ msgstr ""
-#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
-#~ "unique=\"true\"/>"
+#~ "如果在 <literal>Person</literal> 的映射加入下面几句,这种关联就是双向的: "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" property-ref="
-#~ "\"person\"/>]]>"
-#~ msgstr ""
-#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
-#~ "\"/>"
+#~ msgid "Component and dynamic-component"
+#~ msgstr "组件(component)和动态组件(dynamic-component) "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<natural-id mutable=\"true|false\"/>\n"
-#~ " <property ... />\n"
-#~ " <many-to-one ... />\n"
-#~ " ......\n"
-#~ "</natural-id>]]>"
-#~ msgstr ""
-#~ "<natural-id mutable=\"true|false\"/>\n"
-#~ " <property ... />\n"
-#~ " <many-to-one ... />\n"
-#~ " ......\n"
-#~ "</natural-id>"
+#~ msgid "Subclass"
+#~ msgstr "子类(subclass) "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<component\n"
-#~ " name=\"propertyName\"\n"
-#~ " class=\"className\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</component>]]>"
+#~ "A discriminator column is not required for this mapping strategy. Each "
+#~ "subclass must, however, declare a table column holding the object "
+#~ "identifier using the <literal><key></literal> element. The mapping "
+#~ "at the start of the chapter would then be re-written as:"
#~ msgstr ""
-#~ "<component \n"
-#~ " name=\"propertyName\" \n"
-#~ " class=\"className\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ ">\n"
-#~ " \n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</component>"
+#~ "这种映射策略不需要指定辨别标志(discriminator)字段。但是,每一个子类都必"
+#~ "须使用 <literal><key></literal> 元素指定一个表字段来持有对象的标识"
+#~ "符。本章开始的映射可以被用如下方式重写: "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<properties\n"
-#~ " name=\"logicalName\"\n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</properties>]]>"
-#~ msgstr ""
-#~ "<properties \n"
-#~ " name=\"logicalName\" \n"
-#~ " insert=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ ">\n"
-#~ " \n"
-#~ " <property ...../>\n"
-#~ " <many-to-one .... />\n"
-#~ " ........\n"
-#~ "</properties>"
+#~ msgid "Union-subclass"
+#~ msgstr "联合子类(union-subclass) "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"personNumber\"/>\n"
-#~ "\n"
-#~ " ...\n"
-#~ " <properties name=\"name\"\n"
-#~ " unique=\"true\" update=\"false\">\n"
-#~ " <property name=\"firstName\"/>\n"
-#~ " <property name=\"initial\"/>\n"
-#~ " <property name=\"lastName\"/>\n"
-#~ " </properties>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"personNumber\"/>\n"
-#~ " ...\n"
-#~ " <properties name=\"name\" \n"
-#~ " unique=\"true\" update=\"false\">\n"
-#~ " <property name=\"firstName\"/>\n"
-#~ " <property name=\"initial\"/>\n"
-#~ " <property name=\"lastName\"/>\n"
-#~ " </properties>\n"
-#~ "</class>"
+#~ msgid "Join"
+#~ msgstr "连接(join) "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"person\"\n"
-#~ " class=\"Person\" property-ref=\"name\">\n"
-#~ " <column name=\"firstName\"/>\n"
-#~ " <column name=\"initial\"/>\n"
-#~ " <column name=\"lastName\"/>\n"
-#~ "</many-to-one>]]>"
+#~ "Using the <literal><join></literal> element, it is possible to map "
+#~ "properties of one class to several tables that have a one-to-one "
+#~ "relationship. For example:"
#~ msgstr ""
-#~ "<many-to-one name=\"person\" \n"
-#~ " class=\"Person\" property-ref=\"name\">\n"
-#~ " <column name=\"firstName\"/>\n"
-#~ " <column name=\"initial\"/>\n"
-#~ " <column name=\"lastName\"/>\n"
-#~ "</many-to-one>"
+#~ "使用 <literal><join></literal> 元素,假若在表之间存在一对一关联,可以"
+#~ "将一个类的属性映射到多张表中。 "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " extends=\"SuperclassName\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</subclass>]]>"
-#~ msgstr ""
-#~ "<subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " discriminator-value=\"discriminator_value\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " extends=\"SuperclassName\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</subclass>"
+#~ msgid "Key"
+#~ msgstr "Key"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<joined-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <key .... >\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</joined-subclass>]]>"
-#~ msgstr ""
-#~ "<joined-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <key .... >\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</joined-subclass>"
+#~ msgid "Any"
+#~ msgstr "Any"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" table=\"CATS\">\n"
-#~ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
-#~ " <generator class=\"hilo\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"birthdate\" type=\"date\"/>\n"
-#~ " <property name=\"color\" not-null=\"true\"/>\n"
-#~ " <property name=\"sex\" not-null=\"true\"/>\n"
-#~ " <property name=\"weight\"/>\n"
-#~ " <many-to-one name=\"mate\"/>\n"
-#~ " <set name=\"kittens\">\n"
-#~ " <key column=\"MOTHER\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ " <joined-subclass name=\"DomesticCat\" table="
-#~ "\"DOMESTIC_CATS\">\n"
-#~ " <key column=\"CAT\"/>\n"
-#~ " <property name=\"name\" type=\"string\"/>\n"
-#~ " </joined-subclass>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"eg.Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"eg\">\n"
-#~ "\n"
-#~ " <class name=\"Cat\" table=\"CATS\">\n"
-#~ " <id name=\"id\" column=\"uid\" type=\"long\">\n"
-#~ " <generator class=\"hilo\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"birthdate\" type=\"date\"/>\n"
-#~ " <property name=\"color\" not-null=\"true\"/>\n"
-#~ " <property name=\"sex\" not-null=\"true\"/>\n"
-#~ " <property name=\"weight\"/>\n"
-#~ " <many-to-one name=\"mate\"/>\n"
-#~ " <set name=\"kittens\">\n"
-#~ " <key column=\"MOTHER\"/>\n"
-#~ " <one-to-many class=\"Cat\"/>\n"
-#~ " </set>\n"
-#~ " <joined-subclass name=\"DomesticCat\" table="
-#~ "\"DOMESTIC_CATS\">\n"
-#~ " <key column=\"CAT\"/>\n"
-#~ " <property name=\"name\" type=\"string\"/>\n"
-#~ " </joined-subclass>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"eg.Dog\">\n"
-#~ " <!-- mapping for Dog could go here -->\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
+#~ msgid "<literal>class</literal>"
+#~ msgstr "<literal>class</literal>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<union-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</union-subclass>]]>"
-#~ msgstr ""
-#~ "<union-subclass\n"
-#~ " name=\"ClassName\"\n"
-#~ " table=\"tablename\"\n"
-#~ " proxy=\"ProxyInterface\"\n"
-#~ " lazy=\"true|false\"\n"
-#~ " dynamic-update=\"true|false\"\n"
-#~ " dynamic-insert=\"true|false\"\n"
-#~ " schema=\"schema\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " extends=\"SuperclassName\"\n"
-#~ " abstract=\"true|false\"\n"
-#~ " persister=\"ClassName\"\n"
-#~ " subselect=\"SQL expression\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\">\n"
-#~ "\n"
-#~ " <property .... />\n"
-#~ " .....\n"
-#~ "</union-subclass>"
+#~ msgid "<literal>binary</literal>"
+#~ msgstr "<literal>binary</literal>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<join\n"
-#~ " table=\"tablename\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " optional=\"true|false\">\n"
-#~ "\n"
-#~ " <key ... />\n"
-#~ "\n"
-#~ " <property ... />\n"
-#~ " ...\n"
-#~ "</join>]]>"
-#~ msgstr ""
-#~ "<join\n"
-#~ " table=\"tablename\"\n"
-#~ " schema=\"owner\"\n"
-#~ " catalog=\"catalog\"\n"
-#~ " fetch=\"join|select\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " optional=\"true|false\">\n"
-#~ " \n"
-#~ " <key ... />\n"
-#~ " \n"
-#~ " <property ... />\n"
-#~ " ...\n"
-#~ "</join>"
+#~ msgid "<literal>text</literal>"
+#~ msgstr "<literal>text</literal>"
-#, fuzzy
+#~ msgid "<literal>clob, blob</literal>"
+#~ msgstr "<literal>clob, blob</literal>"
+
#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\"\n"
-#~ " table=\"PERSON\">\n"
-#~ "\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
-#~ "\n"
-#~ " <join table=\"ADDRESS\">\n"
-#~ " <key column=\"ADDRESS_ID\"/>\n"
-#~ " <property name=\"address\"/>\n"
-#~ " <property name=\"zip\"/>\n"
-#~ " <property name=\"country\"/>\n"
-#~ " </join>\n"
-#~ " ...]]>"
+#~ "XML does not suit all users so there are some alternative ways to define "
+#~ "O/R mapping metadata in Hibernate."
#~ msgstr ""
-#~ "<class name=\"Person\"\n"
-#~ " table=\"PERSON\">\n"
-#~ "\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
-#~ "\n"
-#~ " <join table=\"ADDRESS\">\n"
-#~ " <key column=\"ADDRESS_ID\"/>\n"
-#~ " <property name=\"address\"/>\n"
-#~ " <property name=\"zip\"/>\n"
-#~ " <property name=\"country\"/>\n"
-#~ " </join>\n"
-#~ " ..."
+#~ "XML 并不适用于所有人, 因此有其他定义 Hibernate O/R 映射元数据(metadata)"
+#~ "的方法。 "
-#, fuzzy
-#~ msgid "<title>Key</title>"
-#~ msgstr "<title>键(key)</title>"
+#~ msgid "Using XDoclet markup"
+#~ msgstr "使用 XDoclet 标记"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<key\n"
-#~ " column=\"columnname\"\n"
-#~ " on-delete=\"noaction|cascade\"\n"
-#~ " property-ref=\"propertyName\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ "/>]]>"
+#~ "Many Hibernate users prefer to embed mapping information directly in "
+#~ "sourcecode using XDoclet <literal>@hibernate.tags</literal>. We do not "
+#~ "cover this approach in this reference guide since it is considered part "
+#~ "of XDoclet. However, we include the following example of the "
+#~ "<literal>Cat</literal> class with XDoclet mappings:"
#~ msgstr ""
-#~ "<key\n"
-#~ " column=\"columnname\"\n"
-#~ " on-delete=\"noaction|cascade\"\n"
-#~ " property-ref=\"propertyName\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " update=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ "/>"
+#~ "很多 Hibernate 使用者更喜欢使用 XDoclet<literal>@hibernate.tags</literal> "
+#~ "将映射信息直接嵌入到源代码中。我们不会在本文档中涉及这个方法,因为严格说"
+#~ "来,这属于 XDoclet 的一部分。然而,我们包含了如下使用 XDoclet 映射的 "
+#~ "<literal>Cat</literal> 类的例子。 "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<column\n"
-#~ " name=\"column_name\"\n"
-#~ " length=\"N\"\n"
-#~ " precision=\"N\"\n"
-#~ " scale=\"N\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " unique-key=\"multicolumn_unique_key_name\"\n"
-#~ " index=\"index_name\"\n"
-#~ " sql-type=\"sql_type_name\"\n"
-#~ " check=\"SQL expression\"\n"
-#~ " default=\"SQL expression\"/>]]>"
-#~ msgstr ""
-#~ "<column\n"
-#~ " name=\"column_name\"\n"
-#~ " length=\"N\"\n"
-#~ " precision=\"N\"\n"
-#~ " scale=\"N\"\n"
-#~ " not-null=\"true|false\"\n"
-#~ " unique=\"true|false\"\n"
-#~ " unique-key=\"multicolumn_unique_key_name\"\n"
-#~ " index=\"index_name\"\n"
-#~ " sql-type=\"sql_type_name\"\n"
-#~ " check=\"SQL expression\"\n"
-#~ " default=\"SQL expression\"/>"
+#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
+#~ msgstr "参考 Hibernate 网站更多的 Xdoclet 和 Hibernate 的例子。"
-#, fuzzy
-#~ msgid "<![CDATA[<formula>SQL expression</formula>]]>"
-#~ msgstr "<formula>SQL expression</formula>"
+#~ msgid "Using JDK 5.0 Annotations"
+#~ msgstr "使用 JDK 5.0 的注解(Annotation)"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"homeAddress\" class=\"Address\"\n"
-#~ " insert=\"false\" update=\"false\">\n"
-#~ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
-#~ " <formula>'MAILING'</formula>\n"
-#~ "</many-to-one>]]>"
+#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
+#~ "are type-safe and checked at compile time. This mechanism is more "
+#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
+#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
+#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
+#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
+#~ "mechanism for entity beans. Hibernate3 implements the "
+#~ "<literal>EntityManager</literal> of JSR-220 (the persistence API). "
+#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
+#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
+#~ "220) and Hibernate3 metadata is supported."
#~ msgstr ""
-#~ "<many-to-one name=\"homeAddress\" class=\"Address\"\n"
-#~ " insert=\"false\" update=\"false\">\n"
-#~ " <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
-#~ " <formula>'MAILING'</formula>\n"
-#~ "</many-to-one>"
+#~ "JDK 5.0 在语言级别引入了 XDoclet 风格的标注,并且是类型安全的,在编译期进"
+#~ "行检查。这一机制比 XDoclet 的注解更为强大,有更好的工具和 IDE 支持。例如,"
+#~ "IntelliJ IDEA,支持 JDK 5.0 注解的自动完成和语法高亮 。EJB 规范的新修订版 "
+#~ "(JSR-220) 使用 JDK 5.0 的注解作为entity beans的主要元数据(metadata)机"
+#~ "制。Hibernate 3 实现了JSR-220(the persistence API) 的 "
+#~ "<literal>EntityManager</literal>,支持通过 <emphasis>Hibernate "
+#~ "Annotations</emphasis> 包定义映射元数据。这个包作为单独的部分下载,支持 "
+#~ "EJB3(JSR-220) 和 Hibernate3 的元数据。 "
-#, fuzzy
-#~ msgid "<![CDATA[<import class=\"java.lang.Object\" rename=\"Universe\"/>]]>"
-#~ msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
+#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
+#~ msgstr "这是一个被注解为 EJB entity bean 的 POJO 类的例子"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<import\n"
-#~ " class=\"ClassName\"\n"
-#~ " rename=\"ShortName\"\n"
-#~ "/>]]>"
+#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
+#~ "development. Please refer to the Hibernate Annotations module for more "
+#~ "details."
#~ msgstr ""
-#~ "<import\n"
-#~ " class=\"ClassName\"\n"
-#~ " rename=\"ShortName\"\n"
-#~ "/>"
+#~ "注意:对 JDK 5.0 注解(和 JSR-220)支持的工作仍然在进行中,并未完成。更多细"
+#~ "节请参阅 Hibernate Annotations 模块。 "
-#, fuzzy
-#~ msgid "<title>Any</title>"
-#~ msgstr "<title>any</title>"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
-#~ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
-#~ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
-#~ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
-#~ " <column name=\"table_name\"/>\n"
-#~ " <column name=\"id\"/>\n"
-#~ "</any>]]>"
+#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
+#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
+#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
+#~ "]>\n"
+#~ "\n"
+#~ "<hibernate-mapping package=\"your.domain\">\n"
+#~ " <class name=\"MyEntity\">\n"
+#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
+#~ " ...\n"
+#~ " </id>\n"
+#~ " <class>\n"
+#~ " &types;\n"
+#~ "</hibernate-mapping>]]>"
#~ msgstr ""
-#~ "<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
-#~ " <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
-#~ " <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
-#~ " <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
-#~ " <column name=\"table_name\"/>\n"
-#~ " <column name=\"id\"/>\n"
-#~ "</any>"
+#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
+#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
+#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n"
+#~ " <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n"
+#~ "]>\n"
+#~ "\n"
+#~ "<hibernate-mapping package=\"your.domain\">\n"
+#~ " <class name=\"MyEntity\">\n"
+#~ " <id name=\"id\" type=\"my-custom-id-type\">\n"
+#~ " ...\n"
+#~ " </id>\n"
+#~ " <class>\n"
+#~ " &types;\n"
+#~ "</hibernate-mapping>]]>"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<any\n"
-#~ " name=\"propertyName\"\n"
-#~ " id-type=\"idtypename\"\n"
-#~ " meta-type=\"metatypename\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ ">\n"
-#~ " <meta-value ... />\n"
-#~ " <meta-value ... />\n"
-#~ " .....\n"
-#~ " <column .... />\n"
-#~ " <column .... />\n"
-#~ " .....\n"
-#~ "</any>]]>"
+#~ "<![CDATA[<composite-id>\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
#~ msgstr ""
-#~ "<any\n"
-#~ " name=\"propertyName\"\n"
-#~ " id-type=\"idtypename\"\n"
-#~ " meta-type=\"metatypename\"\n"
-#~ " cascade=\"cascade_style\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ ">\n"
-#~ " <meta-value ... />\n"
-#~ " <meta-value ... />\n"
-#~ " .....\n"
-#~ " <column .... />\n"
-#~ " <column .... />\n"
-#~ " .....\n"
-#~ "</any>"
+#~ "<![CDATA[<composite-id>\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
-#~ msgid "string"
-#~ msgstr "string"
-
-#, fuzzy
-#~ msgid "class"
-#~ msgstr "子类(subclass)"
-
-#~ msgid "binary"
-#~ msgstr "binary"
-
-#~ msgid "text"
-#~ msgstr "text"
-
-#~ msgid "serializable"
-#~ msgstr "serializable"
-
-#~ msgid "clob, blob"
-#~ msgstr "clob, blob"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"twoStrings\" type=\"org.hibernate.test."
-#~ "DoubleStringType\">\n"
-#~ " <column name=\"first_string\"/>\n"
-#~ " <column name=\"second_string\"/>\n"
-#~ "</property>]]>"
+#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
#~ msgstr ""
-#~ "<property name=\"twoStrings\" type=\"org.hibernate.test."
-#~ "DoubleStringType\">\n"
-#~ " <column name=\"first_string\"/>\n"
-#~ " <column name=\"second_string\"/>\n"
-#~ "</property>"
+#~ "<![CDATA[<composite-id class=\"MedicareId\" mapped=\"true\">\n"
+#~ " <key-property name=\"medicareNumber\"/>\n"
+#~ " <key-property name=\"dependent\"/>\n"
+#~ "</composite-id>]]>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<property name=\"priority\">\n"
-#~ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ " </type>\n"
-#~ "</property>]]>"
+#~ "<![CDATA[<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID"
+#~ "\" unique=\"true\"/>]]>"
#~ msgstr ""
-#~ "<property name=\"priority\">\n"
-#~ " <type name=\"com.mycompany.usertypes.DefaultValueIntegerType"
-#~ "\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ " </type>\n"
-#~ "</property>"
+#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
+#~ "unique=\"true\"/>"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType"
-#~ "\" name=\"default_zero\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ "</typedef>]]>"
+#~ "<![CDATA[<one-to-one name=\"employee\" class=\"Employee\" property-ref="
+#~ "\"person\"/>]]>"
#~ msgstr ""
-#~ "<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" "
-#~ "name=\"default_zero\">\n"
-#~ " <param name=\"default\">0</param>\n"
-#~ "</typedef>"
+#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
+#~ "\"/>"
#, fuzzy
-#~ msgid "<![CDATA[<property name=\"priority\" type=\"default_zero\"/>]]>"
-#~ msgstr "<property name=\"priority\" type=\"default_zero\"/>"
-
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<class name=\"Contract\" table=\"Contracts\"\n"
-#~ " entity-name=\"CurrentContract\">\n"
-#~ " ...\n"
-#~ " <set name=\"history\" inverse=\"true\"\n"
-#~ " order-by=\"effectiveEndDate desc\">\n"
-#~ " <key column=\"currentContractId\"/>\n"
-#~ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Contract\" table=\"ContractHistory\"\n"
-#~ " entity-name=\"HistoricalContract\">\n"
-#~ " ...\n"
-#~ " <many-to-one name=\"currentContract\"\n"
-#~ " column=\"currentContractId\"\n"
-#~ " entity-name=\"CurrentContract\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Contract\" table=\"Contracts\" \n"
-#~ " entity-name=\"CurrentContract\">\n"
-#~ " ...\n"
-#~ " <set name=\"history\" inverse=\"true\" \n"
-#~ " order-by=\"effectiveEndDate desc\">\n"
-#~ " <key column=\"currentContractId\"/>\n"
-#~ " <one-to-many entity-name=\"HistoricalContract\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Contract\" table=\"ContractHistory\" \n"
-#~ " entity-name=\"HistoricalContract\">\n"
-#~ " ...\n"
-#~ " <many-to-one name=\"currentContract\" \n"
-#~ " column=\"currentContractId\" \n"
-#~ " entity-name=\"CurrentContract\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"LineItem\" table=\"`Line Item`\">\n"
-#~ " <id name=\"id\" column=\"`Item Id`\"/><generator class=\"assigned\"/"
-#~ "></id>\n"
-#~ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
-#~ " ...\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"LineItem\" table=\"`Line Item`\">\n"
-#~ " <id name=\"id\" column=\"`Item Id`\"/><generator class="
-#~ "\"assigned\"/></id>\n"
-#~ " <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
-#~ " ...\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[package eg;\n"
#~ "import java.util.Set;\n"
#~ "import java.util.Date;\n"
@@ -3598,59 +9765,3 @@
#~ "\n"
#~ " // Getter/setter and business methods\n"
#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <create>CREATE TRIGGER my_trigger ...</create>\n"
-#~ " <drop>DROP TRIGGER my_trigger</drop>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <create>CREATE TRIGGER my_trigger ...</create>\n"
-#~ " <drop>DROP TRIGGER my_trigger</drop>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/>\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ " ...\n"
-#~ " <database-object>\n"
-#~ " <definition class=\"MyTriggerDefinition\"/>\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
-#~ ">\n"
-#~ " <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/"
-#~ ">\n"
-#~ " </database-object>\n"
-#~ "</hibernate-mapping>"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/collection_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/collection_mapping.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/collection_mapping.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 08:59+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -15,734 +15,3258 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: collection_mapping.xml:31
#, no-c-format
msgid "Collection mapping"
msgstr "集合映射(Collection mappings)"
#. Tag: title
+#: collection_mapping.xml:34
#, no-c-format
msgid "Persistent collections"
msgstr "持久化集合类(Persistent collections)"
#. Tag: para
+#: collection_mapping.xml:36
+#, fuzzy, no-c-format
+msgid ""
+"Naturally Hibernate also allows to persist collections. These persistent "
+"collections can contain almost any other Hibernate type, including: basic "
+"types, custom types, components and references to other entities. The "
+"distinction between value and reference semantics is in this context very "
+"important. An object in a collection might be handled with \"value\" "
+"semantics (its life cycle fully depends on the collection owner), or it "
+"might be a reference to another entity with its own life cycle. In the "
+"latter case, only the \"link\" between the two objects is considered to be a "
+"state held by the collection."
+msgstr ""
+"集合几乎可以包含任何其他的 Hibernate 类型,包括所有的基本类型、自定义类型、组"
+"件,当然还有对其他实体的引用。存在一个重要的区别:位于集合中的对象可能是根"
+"据“值”语义来操作(其声明周期完全依赖于集合持有者),或者它可能是指向另一个实"
+"体的引用,具有其自己的生命周期。在后者的情况下,被作为集合持有的状态考虑的,"
+"只有两个对象之间的“连接”。 "
+
+#. Tag: para
+#: collection_mapping.xml:46
+#, fuzzy, no-c-format
+msgid ""
+"As a requirement persistent collection-valued fields must be declared as an "
+"interface type (see <xref linkend=\"example.collection.mapping.annotations\"/"
+">). The actual interface might be <literal>java.util.Set</literal>, "
+"<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, "
+"<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, "
+"<literal>java.util.SortedMap</literal> or anything you like (\"anything you "
+"like\" means you will have to write an implementation of <literal>org."
+"hibernate.usertype.UserCollectionType</literal>)."
+msgstr ""
+"实际的接口可能是 <literal>java.util.Set</literal>、<literal>java.util."
+"Collection</literal>、<literal>java.util.List</literal>、<literal>java.util."
+"Map</literal>、<literal>java.util.SortedSet</literal>、<literal>java.util."
+"SortedMap</literal> 或者任何你喜欢的类型(\"任何你喜欢的类型\" 代表你需要编"
+"写 <literal>org.hibernate.usertype.UserCollectionType</literal> 的实现)。"
+
+#. Tag: para
+#: collection_mapping.xml:57
+#, fuzzy, no-c-format
+msgid ""
+"Notice how in <xref linkend=\"example.collection.mapping.annotations\"/> the "
+"instance variable <literal>parts</literal> was initialized with an instance "
+"of <literal>HashSet</literal>. This is the best way to initialize collection "
+"valued properties of newly instantiated (non-persistent) instances. When you "
+"make the instance persistent, by calling <literal>persist()</literal>, "
+"Hibernate will actually replace the <literal>HashSet</literal> with an "
+"instance of Hibernate's own implementation of <literal>Set</literal>. Be "
+"aware of the following error:"
+msgstr ""
+"注意我们是如何用一个 <literal>HashSet</literal> 实例来初始化实例变量的。这是"
+"用于初始化新创建(尚未持久化)的类实例中集合值属性的最佳方法。当你持久化这个"
+"实例时 — 比如通过调用 <literal>persist()</literal> — Hibernate 会自动把 "
+"<literal>HashSet</literal> 替换为 Hibernate 自己的 <literal>Set</literal> 实"
+"现。注意下面的错误:"
+
+#. Tag: title
+#: collection_mapping.xml:68
#, no-c-format
-msgid "Hibernate requires that persistent collection-valued fields be declared as an interface type. For example:"
-msgstr "(译者注:在阅读本章的时候,以后整个手册的阅读过程中,我们都会面临一个名词方面的问题,那就是“集合”。\"Collections\" 和 \"Set\" 在中文里对应都被翻译为“集合”,但是他们的含义很不一样。Collections 是一个超集,Set 是其中的一种。大部分情况下,本译稿中泛指的未加英文注明的“集合”,都应当理解为“Collections”。在有些二者同时出现,可能造成混淆的地方,我们用“集合类”来特指“Collecions”,“集合(Set)”来指 \"Set\",一般都会在后面的括号中给出英文。希望大家在阅读时联系上下文理解,不要造成误解。 与此同时,“元素”一词对应的英文“element”,也有两个不同的含义。其一为集合的元素,是内存中的一个变量;另一含义则是 XML 文档中的一个标签所代表的元素。也请注意区别。本章中,特别是后半部分是!
需要反复阅读才能理解清楚的。如果遇到任何疑问,请记住,英文版本的 reference 是惟一标准的参考资料。) Hibernate 要求持久化集合值字段必须声明为接口,例如:"
+msgid "Hibernate uses its own collection implementations"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:70
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!"
+msgstr ""
+"<![CDATA[Cat cat = new DomesticCat();\n"
+"Cat kitten = new DomesticCat();\n"
+"....\n"
+"Set kittens = new HashSet();\n"
+"kittens.add(kitten);\n"
+"cat.setKittens(kittens);\n"
+"session.persist(cat);\n"
+"kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
+"(HashSet) cat.getKittens(); // Error!]]>"
+
#. Tag: para
+#: collection_mapping.xml:73
#, no-c-format
-msgid "The actual interface might be <literal>java.util.Set</literal>, <literal>java.util.Collection</literal>, <literal>java.util.List</literal>, <literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, <literal>java.util.SortedMap</literal> or anything you like (\"anything you like\" means you will have to write an implementation of <literal>org.hibernate.usertype.UserCollectionType</literal>.)"
-msgstr "实际的接口可能是 <literal>java.util.Set</literal>、<literal>java.util.Collection</literal>、<literal>java.util.List</literal>、<literal>java.util.Map</literal>、<literal>java.util.SortedSet</literal>、<literal>java.util.SortedMap</literal> 或者任何你喜欢的类型(\"任何你喜欢的类型\" 代表你需要编写 <literal>org.hibernate.usertype.UserCollectionType</literal> 的实现)。"
+msgid ""
+"The persistent collections injected by Hibernate behave like "
+"<literal>HashMap</literal>, <literal>HashSet</literal>, <literal>TreeMap</"
+"literal>, <literal>TreeSet</literal> or <literal>ArrayList</literal>, "
+"depending on the interface type."
+msgstr ""
+"根据不同的接口类型,被 Hibernate 注射的持久化集合类的表现类似 "
+"<literal>HashMap</literal>、<literal>HashSet</literal>、<literal>TreeMap</"
+"literal>、<literal>TreeSet</literal> 或 <literal>ArrayList</literal>。"
#. Tag: para
+#: collection_mapping.xml:78
#, no-c-format
-msgid "Notice how the instance variable was initialized with an instance of <literal>HashSet</literal>. This is the best way to initialize collection valued properties of newly instantiated (non-persistent) instances. When you make the instance persistent, by calling <literal>persist()</literal> for example, Hibernate will actually replace the <literal>HashSet</literal> with an instance of Hibernate's own implementation of <literal>Set</literal>. Be aware of the following errors:"
-msgstr "注意我们是如何用一个 <literal>HashSet</literal> 实例来初始化实例变量的。这是用于初始化新创建(尚未持久化)的类实例中集合值属性的最佳方法。当你持久化这个实例时 — 比如通过调用 <literal>persist()</literal> — Hibernate 会自动把 <literal>HashSet</literal> 替换为 Hibernate 自己的 <literal>Set</literal> 实现。注意下面的错误:"
+msgid ""
+"Collections instances have the usual behavior of value types. They are "
+"automatically persisted when referenced by a persistent object and are "
+"automatically deleted when unreferenced. If a collection is passed from one "
+"persistent object to another, its elements might be moved from one table to "
+"another. Two entities cannot share a reference to the same collection "
+"instance. Due to the underlying relational model, collection-valued "
+"properties do not support null value semantics. Hibernate does not "
+"distinguish between a null collection reference and an empty collection."
+msgstr ""
+"集合类实例具有值类型的通常行为。当被持久化对象引用后,他们会自动被持久化,当"
+"不再被引用后,自动被删除。假若实例被从一个持久化对象传递到另一个,它的元素可"
+"能从一个表转移到另一个表。两个实体不能共享同一个集合类实例的引用。因为底层关"
+"系数据库模型的原因,集合值属性无法支持空值语义;Hibernate 对空的集合引用和空"
+"集合不加区别。 "
#. Tag: para
+#: collection_mapping.xml:89
+#, fuzzy, no-c-format
+msgid ""
+"Use persistent collections the same way you use ordinary Java collections. "
+"However, ensure you understand the semantics of bidirectional associations "
+"(see <xref linkend=\"collections-bidirectional\"/>)."
+msgstr ""
+"你不需要过多的为此担心。就如同你平时使用普通的 Java 集合类一样来使用持久化集"
+"合类。只是要确认你理解了双向关联的语义(后文将进行讨论)。"
+
+#. Tag: title
+#: collection_mapping.xml:97
+#, fuzzy, no-c-format
+msgid "How to map collections"
+msgstr "有序集合(Sorted collections)"
+
+#. Tag: para
+#: collection_mapping.xml:99
#, no-c-format
-msgid "The persistent collections injected by Hibernate behave like <literal>HashMap</literal>, <literal>HashSet</literal>, <literal>TreeMap</literal>, <literal>TreeSet</literal> or <literal>ArrayList</literal>, depending on the interface type."
-msgstr "根据不同的接口类型,被 Hibernate 注射的持久化集合类的表现类似 <literal>HashMap</literal>、<literal>HashSet</literal>、<literal>TreeMap</literal>、<literal>TreeSet</literal> 或 <literal>ArrayList</literal>。"
+msgid ""
+"Using annotations you can map <classname>Collection</classname>s, "
+"<classname>List</classname>s, <classname>Map</classname>s and "
+"<classname>Set</classname>s of associated entities using @OneToMany and "
+"@ManyToMany. For collections of a basic or embeddable type use "
+"@ElementCollection. In the simplest case a collection mapping looks like "
+"this:"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:107
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinColumn"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:109
+#, fuzzy, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinColumn(name=\"PART_ID\")\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+"<![CDATA[public class Product {\n"
+" private String serialNumber;\n"
+" private Set parts = new HashSet();\n"
+" \n"
+" public Set getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+"}]]>"
+
#. Tag: para
+#: collection_mapping.xml:112
#, no-c-format
-msgid "Collections instances have the usual behavior of value types. They are automatically persisted when referenced by a persistent object and are automatically deleted when unreferenced. If a collection is passed from one persistent object to another, its elements might be moved from one table to another. Two entities cannot share a reference to the same collection instance. Due to the underlying relational model, collection-valued properties do not support null value semantics. Hibernate does not distinguish between a null collection reference and an empty collection."
-msgstr "集合类实例具有值类型的通常行为。当被持久化对象引用后,他们会自动被持久化,当不再被引用后,自动被删除。假若实例被从一个持久化对象传递到另一个,它的元素可能从一个表转移到另一个表。两个实体不能共享同一个集合类实例的引用。因为底层关系数据库模型的原因,集合值属性无法支持空值语义;Hibernate 对空的集合引用和空集合不加区别。 "
+msgid ""
+"Product describes a unidirectional relationship with Part using the join "
+"column PART_ID. In this unidirectional one to many scenario you can also use "
+"a join table as seen in <xref linkend=\"example-one-to-many-with-join-table"
+"\"/>."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:118
+#, no-c-format
+msgid "Collection mapping using @OneToMany and @JoinTable"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:121
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Product {\n"
+"\n"
+" private String serialNumber;\n"
+" private Set<Part> parts = new HashSet<Part>();\n"
+"\n"
+" @Id\n"
+" public String getSerialNumber() { return serialNumber; }\n"
+" void setSerialNumber(String sn) { serialNumber = sn; }\n"
+" \n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"PRODUCT_PARTS\",\n"
+" joinColumns = @JoinColumn( name=\"PRODUCT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn( name=\"PART_ID\")\n"
+" )\n"
+" public Set<Part> getParts() { return parts; }\n"
+" void setParts(Set parts) { this.parts = parts; }\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Part {\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:124
#, no-c-format
-msgid "Use persistent collections the same way you use ordinary Java collections. However, please ensure you understand the semantics of bidirectional associations (these are discussed later)."
-msgstr "你不需要过多的为此担心。就如同你平时使用普通的 Java 集合类一样来使用持久化集合类。只是要确认你理解了双向关联的语义(后文将进行讨论)。"
+msgid ""
+"Without describing any physical mapping (no <classname>@JoinColumn</"
+"classname> or <classname>@JoinTable</classname>), a unidirectional one to "
+"many with join table is used. The table name is the concatenation of the "
+"owner table name, _, and the other side table name. The foreign key name(s) "
+"referencing the owner table is the concatenation of the owner table, _, 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, _, 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."
+msgstr ""
+#. Tag: para
+#: collection_mapping.xml:135
+#, fuzzy, no-c-format
+msgid ""
+"Lets have a look now how collections are mapped using Hibernate mapping "
+"files. In this case the first step is to chose the right mapping element. It "
+"depends on the type of interface. For example, a <literal><set></"
+"literal> element is used for mapping properties of type <literal>Set</"
+"literal>."
+msgstr ""
+"用于映射集合类的 Hibernate 映射元素取决于接口的类型。比如,<literal><"
+"set></literal> 元素用来映射 <literal>Set</literal> 类型的属性。 "
+
#. Tag: title
+#: collection_mapping.xml:142
#, no-c-format
-msgid "Collection mappings"
-msgstr "集合映射( Collection mappings )"
+msgid "Mapping a Set using <set>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:144
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Product\">\n"
+" <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
+" <set name=\"parts\">\n"
+" <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Part\"/>\n"
+" </set>\n"
+"</class>]]>"
+
#. Tag: para
+#: collection_mapping.xml:147
+#, fuzzy, no-c-format
+msgid ""
+"In <xref linkend=\"example.collections.set\"/> a <emphasis>one-to-many "
+"association</emphasis> links the <literal>Product</literal> and "
+"<literal>Part</literal> entities. This association requires the existence of "
+"a foreign key column and possibly an index column to the <literal>Part</"
+"literal> table. This mapping loses certain semantics of normal Java "
+"collections:"
+msgstr ""
+"一个从 <literal>Product</literal> 到 <literal>Part</literal> 的关联需要关键字"
+"字段,可能还有一个索引字段指向 <literal>Part</literal> 所对应的表。"
+"<literal><one-to-many></literal> 标记指明了一个一对多的关联。 "
+
+#. Tag: para
+#: collection_mapping.xml:156
#, no-c-format
-msgid "There are quite a range of mappings that can be generated for collections that cover many common relational models. We suggest you experiment with the schema generation tool so that you understand how various mapping declarations translate to database tables."
-msgstr "从集合类可以产生很大一部分映射,覆盖了很多常见的关系模型。我们建议你试验 schema 生成工具,来体会一下不同的映射声明是如何被翻译为数据库表的。 "
+msgid ""
+"An instance of the contained entity class cannot belong to more than one "
+"instance of the collection."
+msgstr "一个被包含的实体的实例只能被包含在一个集合的实例中。"
#. Tag: para
+#: collection_mapping.xml:161
#, no-c-format
-msgid "The Hibernate mapping element used for mapping a collection depends upon the type of interface. For example, a <literal><set></literal> element is used for mapping properties of type <literal>Set</literal>."
-msgstr "用于映射集合类的 Hibernate 映射元素取决于接口的类型。比如,<literal><set></literal> 元素用来映射 <literal>Set</literal> 类型的属性。 "
+msgid ""
+"An instance of the contained entity class cannot appear at more than one "
+"value of the collection index."
+msgstr "一个被包含的实体的实例只能对应于集合索引的一个值中。"
#. Tag: para
+#: collection_mapping.xml:166
#, no-c-format
-msgid "Apart from <literal><set></literal>, there is also <literal><list></literal>, <literal><map></literal>, <literal><bag></literal>, <literal><array></literal> and <literal><primitive-array></literal> mapping elements. The <literal><map></literal> element is representative:"
-msgstr "除了 <literal><set></literal>,还有<literal><list></literal>,<literal><map></literal>,<literal><bag></literal>,<literal><array></literal> 和 <literal><primitive-array></literal> 映射元素。<literal><map></literal> 具有代表性:"
+msgid ""
+"Looking closer at the used <literal><one-to-many></literal> tag we see "
+"that it has the following options."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:170
+#, no-c-format
+msgid "options of <one-to-many> element"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:181
+#, fuzzy, no-c-format
+msgid ""
+"<one-to-many\n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />"
+msgstr ""
+"<![CDATA[<one-to-many \n"
+" class=\"ClassName\"\n"
+" not-found=\"ignore|exception\"\n"
+" entity-name=\"EntityName\"\n"
+" node=\"element-name\"\n"
+" embed-xml=\"true|false\"\n"
+" />]]>"
+
#. Tag: para
+#: collection_mapping.xml:185
#, no-c-format
+msgid "<literal>class</literal> (required): the name of the associated class."
+msgstr "<literal>class</literal>(必需):被关联类的名称。 "
+
+#. Tag: para
+#: collection_mapping.xml:190
+#, no-c-format
+msgid ""
+"<literal>not-found</literal> (optional - defaults to <literal>exception</"
+"literal>): specifies how cached identifiers that reference missing rows will "
+"be handled. <literal>ignore</literal> will treat a missing row as a null "
+"association."
+msgstr ""
+"<literal>not-found</literal>(可选 - 默认为<literal>exception</literal>):指"
+"明若缓存的标示值关联的行缺失,该如何处理:<literal>ignore</literal> 会把缺失"
+"的行作为一个空关联处理。 "
+
+#. Tag: para
+#: collection_mapping.xml:198
+#, no-c-format
+msgid ""
+"<literal>entity-name</literal> (optional): the entity name of the associated "
+"class, as an alternative to <literal>class</literal>."
+msgstr ""
+"<literal>entity-name</literal>(可选):被关联的类的实体名,作为 "
+"<literal>class</literal> 的替代。 "
+
+#. Tag: para
+#: collection_mapping.xml:206
+#, no-c-format
+msgid ""
+"The <literal><one-to-many></literal> element does not need to declare "
+"any columns. Nor is it necessary to specify the <literal>table</literal> "
+"name anywhere."
+msgstr ""
+"注意:<literal><one-to-many></literal> 元素不需要定义任何字段。也不需要"
+"指定表名。 "
+
+#. Tag: para
+#: collection_mapping.xml:211
+#, fuzzy, no-c-format
+msgid ""
+"If the foreign key column of a <literal><one-to-many></literal> "
+"association is declared <literal>NOT NULL</literal>, you must declare the "
+"<literal><key></literal> mapping <literal>not-null=\"true\"</literal> "
+"or <emphasis>use a bidirectional association</emphasis> with the collection "
+"mapping marked <literal>inverse=\"true\"</literal>. See <xref linkend="
+"\"collections-bidirectional\"/>."
+msgstr ""
+"<emphasis>重要提示</emphasis>:如果<literal>一对多</literal>关联中的外键字段"
+"定义成 <literal>NOT NULL</literal>,你必须把 <literal><key></literal> "
+"映射声明为 <literal>not-null=\"true\"</literal>,或者使用<emphasis>双向关联</"
+"emphasis>,并且标明 <literal>inverse=\"true\"</literal>。参阅本章后面关于双向"
+"关联的讨论。 "
+
+#. Tag: para
+#: collection_mapping.xml:221
+#, fuzzy, no-c-format
+msgid ""
+"Apart from the <literal><set> </literal>tag as shown in <xref linkend="
+"\"example.collections.set\"/>, there is also <literal><list></"
+"literal>, <literal><map></literal>, <literal><bag></literal>, "
+"<literal><array></literal> and <literal><primitive-array></"
+"literal> mapping elements. The <literal><map></literal> element is "
+"representative:"
+msgstr ""
+"除了 <literal><set></literal>,还有<literal><list></literal>,"
+"<literal><map></literal>,<literal><bag></literal>,<literal><"
+"array></literal> 和 <literal><primitive-array></literal> 映射元素。"
+"<literal><map></literal> 具有代表性:"
+
+#. Tag: title
+#: collection_mapping.xml:229
+#, no-c-format
+msgid "Elements of the <map> mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:262
+#, fuzzy, no-c-format
+msgid ""
+"<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>"
+msgstr ""
+"<![CDATA[<map\n"
+" name=\"propertyName\"\n"
+" table=\"table_name\"\n"
+" schema=\"schema_name\"\n"
+" lazy=\"true|extra|false\"\n"
+" inverse=\"true|false\"\n"
+" cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n"
+" sort=\"unsorted|natural|comparatorClass\"\n"
+" order-by=\"column_name asc|desc\"\n"
+" where=\"arbitrary sql where condition\"\n"
+" fetch=\"join|select|subselect\"\n"
+" batch-size=\"N\"\n"
+" access=\"field|property|ClassName\"\n"
+" optimistic-lock=\"true|false\"\n"
+" mutable=\"true|false\"\n"
+" node=\"element-name|.\"\n"
+" embed-xml=\"true|false\"\n"
+">\n"
+"\n"
+" <key .... />\n"
+" <map-key .... />\n"
+" <element .... />\n"
+"</map>]]>"
+
+#. Tag: para
+#: collection_mapping.xml:266
+#, no-c-format
msgid "<literal>name</literal>: the collection property name"
msgstr "<literal>name</literal>:集合属性的名称"
#. Tag: para
+#: collection_mapping.xml:270
#, no-c-format
-msgid "<literal>table</literal> (optional - defaults to property name): the name of the collection table. It is not used for one-to-many associations."
-msgstr "<literal>table</literal>(可选——默认为属性的名称)这个集合表的名称(不能在一对多的关联关系中使用)。"
+msgid ""
+"<literal>table</literal> (optional - defaults to property name): the name of "
+"the collection table. It is not used for one-to-many associations."
+msgstr ""
+"<literal>table</literal>(可选——默认为属性的名称)这个集合表的名称(不能在一"
+"对多的关联关系中使用)。"
#. Tag: para
+#: collection_mapping.xml:276
#, no-c-format
-msgid "<literal>schema</literal> (optional): the name of a table schema to override the schema declared on the root element"
-msgstr "<literal>schema</literal>(可选):表的 schema 的名称,他将覆盖在根元素中定义的 schema"
+msgid ""
+"<literal>schema</literal> (optional): the name of a table schema to override "
+"the schema declared on the root element"
+msgstr ""
+"<literal>schema</literal>(可选):表的 schema 的名称,他将覆盖在根元素中定义"
+"的 schema"
#. Tag: para
+#: collection_mapping.xml:281
#, no-c-format
-msgid "<literal>lazy</literal> (optional - defaults to <literal>true</literal>): disables lazy fetching and specifies that the association is always eagerly fetched. It can also be used to enable \"extra-lazy\" fetching where most operations do not initialize the collection. This is suitable for large collections."
-msgstr "<literal>lazy</literal>(可选--默认为 true)可以用来关闭延迟加载(false):指定一直使用预先抓取,或者打开 \"extra-lazy\" 抓取,此时大多数操作不会初始化集合类(适用于非常大的集合)。"
+msgid ""
+"<literal>lazy</literal> (optional - defaults to <literal>true</literal>): "
+"disables lazy fetching and specifies that the association is always eagerly "
+"fetched. It can also be used to enable \"extra-lazy\" fetching where most "
+"operations do not initialize the collection. This is suitable for large "
+"collections."
+msgstr ""
+"<literal>lazy</literal>(可选--默认为 true)可以用来关闭延迟加载(false):指"
+"定一直使用预先抓取,或者打开 \"extra-lazy\" 抓取,此时大多数操作不会初始化集"
+"合类(适用于非常大的集合)。"
#. Tag: para
+#: collection_mapping.xml:290
#, no-c-format
-msgid "<literal>inverse</literal> (optional - defaults to <literal>false</literal>): marks this collection as the \"inverse\" end of a bidirectional association."
-msgstr "<literal>inverse</literal>(可选 — 默认为 <literal>false</literal>)标记这个集合作为双向关联关系中的方向一端。 "
+msgid ""
+"<literal>inverse</literal> (optional - defaults to <literal>false</"
+"literal>): marks this collection as the \"inverse\" end of a bidirectional "
+"association."
+msgstr ""
+"<literal>inverse</literal>(可选 — 默认为 <literal>false</literal>)标记这个"
+"集合作为双向关联关系中的方向一端。 "
#. Tag: para
+#: collection_mapping.xml:296
#, no-c-format
-msgid "<literal>cascade</literal> (optional - defaults to <literal>none</literal>): enables operations to cascade to child entities."
-msgstr "<literal>cascade</literal>(可选 — 默认为 <literal>none</literal>)让操作级联到子实体。"
+msgid ""
+"<literal>cascade</literal> (optional - defaults to <literal>none</literal>): "
+"enables operations to cascade to child entities."
+msgstr ""
+"<literal>cascade</literal>(可选 — 默认为 <literal>none</literal>)让操作级联"
+"到子实体。"
#. Tag: para
+#: collection_mapping.xml:302
#, no-c-format
-msgid "<literal>sort</literal> (optional): specifies a sorted collection with <literal>natural</literal> sort order or a given comparator class."
-msgstr "<literal>sort</literal>(可选)指定集合的排序顺序,其可以为自然的(<literal>natural</literal>)或者给定一个用来比较的类。 "
+msgid ""
+"<literal>sort</literal> (optional): specifies a sorted collection with "
+"<literal>natural</literal> sort order or a given comparator class."
+msgstr ""
+"<literal>sort</literal>(可选)指定集合的排序顺序,其可以为自然的"
+"(<literal>natural</literal>)或者给定一个用来比较的类。 "
#. Tag: para
+#: collection_mapping.xml:308
+#, fuzzy, no-c-format
+msgid ""
+"<literal>order-by</literal> (optional): specifies a table column or columns "
+"that define the iteration order of the <literal>Map</literal>, <literal>Set</"
+"literal> or bag, together with an optional <literal>asc</literal> or "
+"<literal>desc</literal>."
+msgstr ""
+"<literal>order-by</literal>(可选,仅用于 jdk1.4):指定表的字段(一个或几"
+"个)再加上 asc 或者 desc(可选),定义 Map、Set 和 Bag 的迭代顺序。"
+
+#. Tag: para
+#: collection_mapping.xml:316
#, no-c-format
-msgid "<literal>order-by</literal> (optional, JDK1.4 only): specifies a table column or columns that define the iteration order of the <literal>Map</literal>, <literal>Set</literal> or bag, together with an optional <literal>asc</literal> or <literal>desc</literal>."
-msgstr "<literal>order-by</literal>(可选,仅用于 jdk1.4):指定表的字段(一个或几个)再加上 asc 或者 desc(可选),定义 Map、Set 和 Bag 的迭代顺序。"
+msgid ""
+"<literal>where</literal> (optional): specifies an arbitrary SQL "
+"<literal>WHERE</literal> condition that is used when retrieving or removing "
+"the collection. This is useful if the collection needs to contain only a "
+"subset of the available data."
+msgstr ""
+"<literal>where</literal>(可选):指定任意的 SQL where 条件,该条件将在重新载"
+"入或者删除这个集合时使用(当集合中的数据仅仅是所有可用数据的一个子集时这个条"
+"件非常有用)。"
#. Tag: para
+#: collection_mapping.xml:324
#, no-c-format
-msgid "<literal>where</literal> (optional): specifies an arbitrary SQL <literal>WHERE</literal> condition that is used when retrieving or removing the collection. This is useful if the collection needs to contain only a subset of the available data."
-msgstr "<literal>where</literal>(可选):指定任意的 SQL where 条件,该条件将在重新载入或者删除这个集合时使用(当集合中的数据仅仅是所有可用数据的一个子集时这个条件非常有用)。"
+msgid ""
+"<literal>fetch</literal> (optional, defaults to <literal>select</literal>): "
+"chooses between outer-join fetching, fetching by sequential select, and "
+"fetching by sequential subselect."
+msgstr ""
+"<literal>fetch</literal>(可选,默认为 <literal>select</literal>):用于在外"
+"连接抓取、通过后续 select 抓取和通过后续 subselect 抓取之间选择。"
#. Tag: para
+#: collection_mapping.xml:331
#, no-c-format
-msgid "<literal>fetch</literal> (optional, defaults to <literal>select</literal>): chooses between outer-join fetching, fetching by sequential select, and fetching by sequential subselect."
-msgstr "<literal>fetch</literal>(可选,默认为 <literal>select</literal>):用于在外连接抓取、通过后续 select 抓取和通过后续 subselect 抓取之间选择。"
+msgid ""
+"<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): "
+"specifies a \"batch size\" for lazily fetching instances of this collection."
+msgstr ""
+"<literal>batch-size</literal>(可选,默认为 <literal>1</literal>):指定通过"
+"延迟加载取得集合实例的批处理块大小(\"batch size\")。"
#. Tag: para
+#: collection_mapping.xml:337
#, no-c-format
-msgid "<literal>batch-size</literal> (optional, defaults to <literal>1</literal>): specifies a \"batch size\" for lazily fetching instances of this collection."
-msgstr "<literal>batch-size</literal>(可选,默认为 <literal>1</literal>):指定通过延迟加载取得集合实例的批处理块大小(\"batch size\")。"
+msgid ""
+"<literal>access</literal> (optional - defaults to <literal>property</"
+"literal>): the strategy Hibernate uses for accessing the collection property "
+"value."
+msgstr ""
+"<literal>access</literal>(可选-默认为属性 property):Hibernate 取得集合属性"
+"值时使用的策略。"
#. Tag: para
+#: collection_mapping.xml:343
#, no-c-format
-msgid "<literal>access</literal> (optional - defaults to <literal>property</literal>): the strategy Hibernate uses for accessing the collection property value."
-msgstr "<literal>access</literal>(可选-默认为属性 property):Hibernate 取得集合属性值时使用的策略。"
+msgid ""
+"<literal>optimistic-lock</literal> (optional - defaults to <literal>true</"
+"literal>): specifies that changes to the state of the collection results in "
+"increments of the owning entity's version. For one-to-many associations you "
+"may want to disable this setting."
+msgstr ""
+"<literal>乐观锁</literal>(可选 - 默认为 <literal>true</literal>):对集合的"
+"状态的改变会是否导致其所属的实体的版本增长(对一对多关联来说,关闭这个属性常"
+"常是有理的)。"
#. Tag: para
+#: collection_mapping.xml:351
#, no-c-format
-msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): specifies that changes to the state of the collection results in increments of the owning entity's version. For one-to-many associations you may want to disable this setting."
-msgstr "<literal>乐观锁</literal>(可选 - 默认为 <literal>true</literal>):对集合的状态的改变会是否导致其所属的实体的版本增长(对一对多关联来说,关闭这个属性常常是有理的)。"
+msgid ""
+"<literal>mutable</literal> (optional - defaults to <literal>true</literal>): "
+"a value of <literal>false</literal> specifies that the elements of the "
+"collection never change. This allows for minor performance optimization in "
+"some cases."
+msgstr ""
+"<literal>mutable(可变)</literal>(可选 — 默认为 <literal>true</literal>):"
+"若值为 <literal>false</literal>,表明集合中的元素不会改变(在某些情况下可以进"
+"行一些小的性能优化)。 "
#. Tag: para
+#: collection_mapping.xml:360
#, no-c-format
-msgid "<literal>mutable</literal> (optional - defaults to <literal>true</literal>): a value of <literal>false</literal> specifies that the elements of the collection never change. This allows for minor performance optimization in some cases."
-msgstr "<literal>mutable(可变)</literal>(可选 — 默认为 <literal>true</literal>):若值为 <literal>false</literal>,表明集合中的元素不会改变(在某些情况下可以进行一些小的性能优化)。 "
+msgid ""
+"After exploring the basic mapping of collections in the preceding paragraphs "
+"we will now focus details like physical mapping considerations, indexed "
+"collections and collections of value types."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:365
#, no-c-format
msgid "Collection foreign keys"
msgstr "集合外键(Collection foreign keys)"
#. Tag: para
+#: collection_mapping.xml:367
+#, fuzzy, no-c-format
+msgid ""
+"On the database level collection instances are distinguished by the foreign "
+"key of the entity that owns the collection. This foreign key is referred to "
+"as the <emphasis>collection key column</emphasis>, or columns, of the "
+"collection table. The collection key column is mapped by the "
+"<literal>@JoinColumn</literal> annotation respectively the <literal><"
+"key></literal> XML element."
+msgstr ""
+"集合实例在数据库中依靠持有集合的实体的外键加以辨别。此外键作为<emphasis>集合"
+"关键字段(collection key column)</emphasis>(或多个字段)加以引用。集合关键"
+"字段通过 <literal><key></literal> 元素映射。 "
+
+#. Tag: para
+#: collection_mapping.xml:374
+#, fuzzy, no-c-format
+msgid ""
+"There can be a nullability constraint on the foreign key column. For most "
+"collections, this is implied. For unidirectional one-to-many associations, "
+"the foreign key column is nullable by default, so you may need to specify"
+msgstr ""
+"在外键字段上可能具有非空约束。对于大多数集合来说,这是隐含的。对单向一对多关"
+"联来说,外键字段默认是可以为空的,因此你可能需要指明 <literal>not-null=\"true"
+"\"</literal>。 "
+
+#. Tag: programlisting
+#: collection_mapping.xml:379
#, no-c-format
-msgid "Collection instances are distinguished in the database by the foreign key of the entity that owns the collection. This foreign key is referred to as the <emphasis>collection key column</emphasis>, or columns, of the collection table. The collection key column is mapped by the <literal><key></literal> element."
-msgstr "集合实例在数据库中依靠持有集合的实体的外键加以辨别。此外键作为<emphasis>集合关键字段(collection key column)</emphasis>(或多个字段)加以引用。集合关键字段通过 <literal><key></literal> 元素映射。 "
+msgid "@JoinColumn(nullable=false)"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:381
#, no-c-format
-msgid "There can be a nullability constraint on the foreign key column. For most collections, this is implied. For unidirectional one-to-many associations, the foreign key column is nullable by default, so you may need to specify <literal>not-null=\"true\"</literal>."
-msgstr "在外键字段上可能具有非空约束。对于大多数集合来说,这是隐含的。对单向一对多关联来说,外键字段默认是可以为空的,因此你可能需要指明 <literal>not-null=\"true\"</literal>。 "
+msgid "<para>or</para>"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:383
+#, fuzzy, no-c-format
+msgid "<key column=\"productSerialNumber\" not-null=\"true\"/>"
+msgstr "<![CDATA[<key column=\"productSerialNumber\" not-null=\"true\"/>]]>"
+
#. Tag: para
-#, no-c-format
-msgid "The foreign key constraint can use <literal>ON DELETE CASCADE</literal>."
+#: collection_mapping.xml:385
+#, fuzzy, no-c-format
+msgid ""
+"The foreign key constraint can use <literal>ON DELETE CASCADE</literal>. In "
+"XML this can be expressed via:"
msgstr "外键约束可以使用 <literal>ON DELETE CASCADE</literal>。 "
+#. Tag: programlisting
+#: collection_mapping.xml:388
+#, fuzzy, no-c-format
+msgid "<key column=\"productSerialNumber\" on-delete=\"cascade\"/>"
+msgstr ""
+"<![CDATA[<key column=\"productSerialNumber\" on-delete=\"cascade\"/>]]>"
+
#. Tag: para
+#: collection_mapping.xml:390
#, no-c-format
-msgid "See the previous chapter for a full definition of the <literal><key></literal> element."
-msgstr "对 <literal><key></literal> 元素的完整定义,请参阅前面的章节。"
+msgid ""
+"In annotations the Hibernate specific annotation @OnDelete has to be used."
+msgstr ""
-#. Tag: title
+#. Tag: programlisting
+#: collection_mapping.xml:393
#, no-c-format
-msgid "Collection elements"
-msgstr "集合元素(Collection elements)"
+msgid "@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:395
+#, fuzzy, no-c-format
+msgid ""
+"See <xref lang=\"\" linkend=\"section.key\"/> for more information about the "
+"<literal><key></literal> element."
+msgstr "对 <literal><key></literal> 元素的完整定义,请参阅前面的章节。"
+
+#. Tag: title
+#: collection_mapping.xml:400
#, no-c-format
-msgid "Collections can contain almost any other Hibernate type, including: basic types, custom types, components and references to other entities. This is an important distinction. An object in a collection might be handled with \"value\" semantics (its life cycle fully depends on the collection owner), or it might be a reference to another entity with its own life cycle. In the latter case, only the \"link\" between the two objects is considered to be a state held by the collection."
-msgstr "集合几乎可以包含任何其他的 Hibernate 类型,包括所有的基本类型、自定义类型、组件,当然还有对其他实体的引用。存在一个重要的区别:位于集合中的对象可能是根据“值”语义来操作(其声明周期完全依赖于集合持有者),或者它可能是指向另一个实体的引用,具有其自己的生命周期。在后者的情况下,被作为集合持有的状态考虑的,只有两个对象之间的“连接”。 "
+msgid "Indexed collections"
+msgstr "索引集合类(Indexed collections)"
#. Tag: para
+#: collection_mapping.xml:402
#, no-c-format
-msgid "The contained type is referred to as the <emphasis>collection element type</emphasis>. Collection elements are mapped by <literal><element></literal> or <literal><composite-element></literal>, or in the case of entity references, with <literal><one-to-many></literal> or <literal><many-to-many></literal>. The first two map elements with value semantics, the next two are used to map entity associations."
-msgstr "被包容的类型被称为<emphasis>集合元素类型(collection element type)</emphasis>。集合元素通过 <literal><element></literal> 或 <literal><composite-element></literal> 映射,或在其是实体引用的时候,通过 <literal><one-to-many></literal> 或 <literal><many-to-many></literal> 映射。前两种用于使用值语义映射元素,后两种用于映射实体关联。"
+msgid ""
+"In the following paragraphs we have a closer at the indexed collections "
+"<classname>List</classname> and <classname>Map</classname> how the their "
+"index can be mapped in Hibernate."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:407
#, no-c-format
-msgid "Indexed collections"
-msgstr "索引集合类(Indexed collections)"
+msgid "Lists"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:409
#, no-c-format
-msgid "All collection mappings, except those with set and bag semantics, need an <emphasis>index column</emphasis> in the collection table. An index column is a column that maps to an array index, or <literal>List</literal> index, or <literal>Map</literal> key. The index of a <literal>Map</literal> may be of any basic type, mapped with <literal><map-key></literal>. It can be an entity reference mapped with <literal><map-key-many-to-many></literal>, or it can be a composite type mapped with <literal><composite-map-key></literal>. The index of an array or list is always of type <literal>integer</literal> and is mapped using the <literal><list-index></literal> element. The mapped column contains sequential integers that are numbered from zero by default."
-msgstr "所有的集合映射,除了 set 和 bag 语义的以外,都需要指定一个集合表的<emphasis>索引字段(index column)</emphasis> — 用于对应到数组索引,或者 <literal>List</literal> 的索引,或者 <literal>Map</literal> 的关键字。通过 <literal><map-key></literal>,<literal>Map</literal> 的索引可以是任何基础类型;若通过 <literal><map-key-many-to-many></literal>,它也可以是一个实体引用;若通过 <literal><composite-map-key></literal>,它还可以是一个组合类型。数组或列表的索引必须是 <literal>integer</literal> 类型,并且使用 <literal><list-index></literal> 元素定义映射。被映射的字段包含有顺序排列的整数(默认从 0 开始)。 "
+msgid "Lists can be mapped in two different ways:"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:413
#, no-c-format
-msgid "<literal>column_name</literal> (required): the name of the column holding the collection index values."
-msgstr "<literal>column_name</literal>(必需):持有集合索引值的字段的名称。 "
+msgid "as ordered lists, where the order is not materialized in the database"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:418
#, no-c-format
-msgid "<literal>base</literal> (optional - defaults to <literal>0</literal>): the value of the index column that corresponds to the first element of the list or array."
-msgstr "<literal>base</literal>(可选 — 默认为 <literal>0</literal>)对应列表或队列的第一个元素的索引字段的值。"
+msgid "as indexed lists, where the order is materialized in the database"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:423
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the column holding the collection index values."
-msgstr "<literal>column</literal>(可选):持有集合索引值的字段的名称。"
+msgid ""
+"To order lists in memory, add <literal>@javax.persistence.OrderBy</literal> "
+"to your property. This annotation takes as parameter a list of comma "
+"separated properties (of the target entity) and orders the collection "
+"accordingly (eg <code>firstname asc, age desc</code>), if the string is "
+"empty, the collection will be ordered by the primary key of the target "
+"entity."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:432
+#, no-c-format
+msgid "Ordered lists using <classname>@OrderBy</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:434
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderBy(\"number\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:437
#, no-c-format
-msgid "<literal>formula</literal> (optional): a SQL formula used to evaluate the key of the map."
-msgstr "<literal>formula</literal>(可选):用于对表键求值的 SQL 公式。"
+msgid ""
+"To store the index value in a dedicated column, use the <classname>@javax."
+"persistence.OrderColumn</classname> annotation on your property. This "
+"annotations describes the column name and attributes of the column keeping "
+"the index value. This column is hosted on the table containing the "
+"association foreign key. If the column name is not specified, the default is "
+"the name of the referencing property, followed by underscore, followed by "
+"<literal>ORDER</literal> (in the following example, it would be "
+"<literal>orders_ORDER</literal>)."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:448
+#, no-c-format
+msgid "Explicit index column using <classname>@OrderColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:451
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @OrderColumn(name=\"orders_index\")\n"
+" public List<Order> getOrders() { return orders; }\n"
+" public void setOrders(List<Order> orders) { this.orders = "
+"orders; }\n"
+" private List<Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|--------------| |----------|\n"
+"| Order | | Customer |\n"
+"|--------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"| orders_order |\n"
+"|--------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:455
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the map keys."
-msgstr "<literal>type</literal>(必需):映射键的类型。 "
+msgid ""
+"We recommend you to convert <classname>the legacy @org.hibernate.annotations."
+"IndexColumn</classname> usages to <classname>@OrderColumn</classname> unless "
+"you are making use of the base property. The <literal>base</literal> "
+"property lets you define the index value of the first element (aka as base "
+"index). The usual value is <literal>0</literal> or <literal>1</literal>. The "
+"default is 0 like in Java."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:464
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the foreign key column for the collection index values."
-msgstr "<literal>column</literal>(可选):用于集合索引值的外键字段的名称。"
+msgid ""
+"Looking again at the Hibernate mapping file equivalent, the index of an "
+"array or list is always of type <literal>integer</literal> and is mapped "
+"using the <literal><list-index></literal> element. The mapped column "
+"contains sequential integers that are numbered from zero by default."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:471
+#, no-c-format
+msgid "index-list element for indexed collections in xml mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:481
+#, no-c-format
+msgid ""
+"<list-index\n"
+" column=\"column_name\"\n"
+" base=\"0|1|...\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:485
#, no-c-format
-msgid "<literal>formula</literal> (optional): a SQ formula used to evaluate the foreign key of the map key."
-msgstr "<literal>formula</literal>(可选):用于对映射键的外键求值的 SQL 公式。"
+msgid ""
+"<literal>column_name</literal> (required): the name of the column holding "
+"the collection index values."
+msgstr "<literal>column_name</literal>(必需):持有集合索引值的字段的名称。 "
#. Tag: para
+#: collection_mapping.xml:490
#, no-c-format
-msgid "<literal>class</literal> (required): the entity class used as the map key."
-msgstr "<literal>class</literal>(必需):用作映射键的实体类的名称。 "
+msgid ""
+"<literal>base</literal> (optional - defaults to <literal>0</literal>): the "
+"value of the index column that corresponds to the first element of the list "
+"or array."
+msgstr ""
+"<literal>base</literal>(可选 — 默认为 <literal>0</literal>)对应列表或队列的"
+"第一个元素的索引字段的值。"
#. Tag: para
+#: collection_mapping.xml:498
#, no-c-format
-msgid "If your table does not have an index column, and you still wish to use <literal>List</literal> as the property type, you can map the property as a Hibernate <emphasis><bag></emphasis>. A bag does not retain its order when it is retrieved from the database, but it can be optionally sorted or ordered."
-msgstr "假若你的表没有一个索引字段,当你仍然希望使用 <literal>List</literal> 作为属性类型,你应该把此属性映射为 Hibernate <emphasis><bag></emphasis>。从数据库中获取的时候,bag 不维护其顺序,但也可选择性的进行排序。 "
+msgid ""
+"If your table does not have an index column, and you still wish to use "
+"<literal>List</literal> as the property type, you can map the property as a "
+"Hibernate <emphasis><bag></emphasis>. A bag does not retain its order "
+"when it is retrieved from the database, but it can be optionally sorted or "
+"ordered."
+msgstr ""
+"假若你的表没有一个索引字段,当你仍然希望使用 <literal>List</literal> 作为属性"
+"类型,你应该把此属性映射为 Hibernate <emphasis><bag></emphasis>。从数据"
+"库中获取的时候,bag 不维护其顺序,但也可选择性的进行排序。 "
#. Tag: title
+#: collection_mapping.xml:506
#, no-c-format
-msgid "Collections of values and many-to-many associations"
-msgstr "值集合于多对多关联(Collections of values and many-to-many associations)"
+msgid "Maps"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:508
#, no-c-format
-msgid "Any collection of values or many-to-many associations requires a dedicated <emphasis>collection table</emphasis> with a foreign key column or columns, <emphasis>collection element column</emphasis> or columns, and possibly an index column or columns."
-msgstr "任何值集合或者多对多关联需要专用的具有一个或多个外键字段的 <emphasis>collection table</emphasis>、一个或多个 <emphasis>collection element column</emphasis>,以及还可能有一个或多个索引字段。 "
+msgid ""
+"The question with <classname>Map</classname>s is where the key value is "
+"stored. There are everal options. Maps can borrow their keys from one of the "
+"associated entity properties or have dedicated columns to store an explicit "
+"key."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:513
#, no-c-format
-msgid "For a collection of values use the <literal><element></literal> tag. For example:"
-msgstr "对于一个值集合,我们使用 <literal><element></literal> 标签。例如:"
+msgid ""
+"To use one of the target entity property as a key of the map, use "
+"<literal>@MapKey(name=\"myProperty\")</literal>, where <literal>myProperty</"
+"literal> is a property name in the target entity. When using "
+"<literal>@MapKey</literal> without the name attribuate, 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, "
+"because the map key 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."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:525
+#, no-c-format
+msgid ""
+"Use of target entity property as map key via <classname>@MapKey</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:528
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany(mappedBy=\"customer\")\n"
+" @MapKey(name=\"number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> order) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------|\n"
+"| Order | | Customer |\n"
+"|-------------| |----------|\n"
+"| id | | id |\n"
+"| number | |----------| \n"
+"| customer_id |\n"
+"|-------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:531
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the column holding the collection element values."
-msgstr "<literal>column</literal>(可选):持有集合元素值的字段的名称。"
+msgid ""
+"Alternatively the map key is mapped to a dedicated column or columns. In "
+"order to customize the mapping use one of the following annotations:"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:537
#, no-c-format
-msgid "<literal>formula</literal> (optional): an SQL formula used to evaluate the element."
-msgstr "<literal>formula</literal>(可选):用于对元素求值的 SQL 公式。"
+msgid ""
+"@<classname>MapKeyColumn</classname> if the map key is a basic type. If you "
+"don't specify the column name, the name of the property followed by "
+"underscore followed by <literal>KEY</literal> is used (for example "
+"<literal>orders_KEY</literal>)."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:544
#, no-c-format
-msgid "<literal>type</literal> (required): the type of the collection element."
-msgstr "<literal>type</literal>(必需):集合元素的类型。 "
+msgid ""
+"<classname>@MapKeyEnumerated</classname> / <classname>@MapKeyTemporal</"
+"classname> if the map key type is respectively an enum or a <classname>Date</"
+"classname>."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:550
#, no-c-format
-msgid "A <emphasis>many-to-many association</emphasis> is specified using the <literal><many-to-many></literal> element."
-msgstr "用 <literal><many-to-many></literal> 元素指定 <emphasis>many-to-many association</emphasis>。"
+msgid ""
+"<classname>@MapKeyJoinColumn</classname>/<classname>@MapKeyJoinColumns</"
+"classname> if the map key type is another entity."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:555
#, no-c-format
-msgid "<literal>column</literal> (optional): the name of the element foreign key column."
-msgstr "<literal>column</literal>(必需):元素外键字段的名称。 "
+msgid ""
+"<classname>@AttributeOverride</classname>/<classname>@AttributeOverrides</"
+"classname> when the map key is a embeddable object. Use <literal>key.</"
+"literal> as a prefix for your embeddable object property names."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:562
#, no-c-format
-msgid "<literal>formula</literal> (optional): an SQL formula used to evaluate the element foreign key value."
-msgstr "<literal>formula</literal>(可选):用于对元素外键值求值的 SQL 公式。"
+msgid ""
+"You can also use <classname>@MapKeyClass</classname> to define the type of "
+"the key if you don't use generics."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:566
+#, no-c-format
+msgid "Map key as basic type using <classname>@MapKeyColumn</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:569
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" @OneToMany @JoinTable(name=\"Cust_Order\")\n"
+" @MapKeyColumn(name=\"orders_number\")\n"
+" public Map<String,Order> getOrders() { return orders; }\n"
+" public void setOrders(Map<String,Order> orders) { this.orders = "
+"orders; }\n"
+" private Map<String,Order> orders;\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Order {\n"
+" @Id @GeneratedValue public Integer getId() { return id; }\n"
+" public void setId(Integer id) { this.id = id; }\n"
+" private Integer id;\n"
+"\n"
+" public String getNumber() { return number; }\n"
+" public void setNumber(String number) { this.number = number; }\n"
+" private String number;\n"
+"\n"
+" @ManyToOne\n"
+" public Customer getCustomer() { return customer; }\n"
+" public void setCustomer(Customer customer) { this.customer = customer; }\n"
+" private Customer number;\n"
+"}\n"
+"\n"
+"-- Table schema\n"
+"|-------------| |----------| |---------------|\n"
+"| Order | | Customer | | Cust_Order |\n"
+"|-------------| |----------| |---------------|\n"
+"| id | | id | | customer_id |\n"
+"| number | |----------| | order_id |\n"
+"| customer_id | | orders_number |\n"
+"|-------------| |---------------|"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:573
#, no-c-format
-msgid "<literal>class</literal> (required): the name of the associated class."
-msgstr "<literal>class</literal>(必需):被关联类的名称。 "
+msgid ""
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"MapKey</classname> / <classname>@org.hibernate.annotation.MapKeyManyToMany</"
+"classname> to the new standard approach described above"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files there exists equivalent concepts to the "
+"descibed annotations. You have to use <literal><map-key></literal>, "
+"<literal><map-key-many-to-many></literal> and <literal><composite-"
+"map-key></literal>. <literal><map-key></literal> is used for any "
+"basic type, <literal><map-key-many-to-many></literal> for an entity "
+"reference and <literal><composite-map-key></literal> for a composite "
+"type."
+msgstr ""
+"除了 <literal><set></literal>,还有<literal><list></literal>,"
+"<literal><map></literal>,<literal><bag></literal>,<literal><"
+"array></literal> 和 <literal><primitive-array></literal> 映射元素。"
+"<literal><map></literal> 具有代表性:"
+
+#. Tag: title
+#: collection_mapping.xml:590
#, no-c-format
-msgid "<literal>fetch</literal> (optional - defaults to <literal>join</literal>): enables outer-join or sequential select fetching for this association. This is a special case; for full eager fetching in a single <literal>SELECT</literal> of an entity and its many-to-many relationships to other entities, you would enable <literal>join</literal> fetching,not only of the collection itself, but also with this attribute on the <literal><many-to-many></literal> nested element."
-msgstr "<literal>fetch</literal>(可选 - 缺省为 <literal>join</literal>): 为这个关联启用外连接或序列性选择抓取。这是一个特例。对于在单个 <literal>SELECT</literal> 里进行完全的 eager fetching 以及使 <literal><many-to-many></literal> n用多对多关联,你可以启用 <literal>join</literal> fetching,这不仅是对于集合本身,也对 <literal><many-to-many></literal> 嵌套元素的属性。"
+msgid "map-key xml mapping element"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:601
+#, no-c-format
+msgid ""
+"<map-key\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"type_name\"\n"
+" node=\"@attribute-name\"\n"
+" length=\"N\"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:605
#, no-c-format
-msgid "<literal>unique</literal> (optional): enables the DDL generation of a unique constraint for the foreign-key column. This makes the association multiplicity effectively one-to-many."
-msgstr "<literal>unique</literal>(可选):未外键字段启用唯一约束的 DDL 生成。这使得关联一对多的多样性更为有效。"
+msgid ""
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection index values."
+msgstr "<literal>column</literal>(可选):持有集合索引值的字段的名称。"
#. Tag: para
+#: collection_mapping.xml:610
#, no-c-format
-msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how foreign keys that reference missing rows will be handled: <literal>ignore</literal> will treat a missing row as a null association."
-msgstr "<literal>not-found</literal>(可选 - 默认为 <literal>exception</literal>):指明若缓存的标示值关联的行缺失,该如何处理:<literal>ignore</literal> 会把缺失的行作为一个空关联处理。 "
+msgid ""
+"<literal>formula</literal> (optional): a SQL formula used to evaluate the "
+"key of the map."
+msgstr "<literal>formula</literal>(可选):用于对表键求值的 SQL 公式。"
#. Tag: para
+#: collection_mapping.xml:615
#, no-c-format
-msgid "<literal>entity-name</literal> (optional): the entity name of the associated class, as an alternative to <literal>class</literal>."
-msgstr "<literal>entity-name</literal>(可选):被关联的类的实体名,作为 <literal>class</literal> 的替代。 "
+msgid "<literal>type</literal> (required): the type of the map keys."
+msgstr "<literal>type</literal>(必需):映射键的类型。 "
+#. Tag: title
+#: collection_mapping.xml:623
+#, fuzzy, no-c-format
+msgid "map-key-many-to-many"
+msgstr "多对多(many-to-many)"
+
+#. Tag: programlisting
+#: collection_mapping.xml:634
+#, no-c-format
+msgid ""
+"<map-key-many-to-many\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" class=\"ClassName\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:638
#, no-c-format
-msgid "<literal>property-ref</literal> (optional): the name of a property of the associated class that is joined to this foreign key. If not specified, the primary key of the associated class is used."
-msgstr "<literal>property-ref</literal>(可选):连接至这个外键的关联类的属性名称。如果未指定,关联类的主键将被使用。"
+msgid ""
+"<literal>column</literal> (optional): the name of the foreign key column for "
+"the collection index values."
+msgstr "<literal>column</literal>(可选):用于集合索引值的外键字段的名称。"
#. Tag: para
+#: collection_mapping.xml:643
#, no-c-format
-msgid "Here are some examples."
-msgstr "下面是一些例子:"
+msgid ""
+"<literal>formula</literal> (optional): a SQ formula used to evaluate the "
+"foreign key of the map key."
+msgstr ""
+"<literal>formula</literal>(可选):用于对映射键的外键求值的 SQL 公式。"
#. Tag: para
+#: collection_mapping.xml:648
#, no-c-format
-msgid "A set of strings:"
-msgstr "一系列字符串:"
+msgid ""
+"<literal>class</literal> (required): the entity class used as the map key."
+msgstr "<literal>class</literal>(必需):用作映射键的实体类的名称。 "
+#. Tag: title
+#: collection_mapping.xml:658
+#, fuzzy, no-c-format
+msgid "Collections of basic types and embeddable objects"
+msgstr ""
+"值集合于多对多关联(Collections of values and many-to-many associations)"
+
#. Tag: para
+#: collection_mapping.xml:660
#, no-c-format
-msgid "A bag containing integers with an iteration order determined by the <literal>order-by</literal> attribute:"
-msgstr "包含一组整数的 bag(还设置了 <literal>order-by</literal> 参数指定了迭代的顺序): "
+msgid ""
+"In some situations you don't need to associate two entities but simply "
+"create a collection of basic types or embeddable objects. Use the "
+"<classname>@ElementCollection</classname> for this case."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:665
+#, no-c-format
+msgid ""
+"Collection of basic types mapped via <classname>@ElementCollection</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Nicknames\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @Column(name=\"nickname\")\n"
+" public Set<String> getNicknames() { ... } \n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:671
#, no-c-format
-msgid "An array of entities, in this case, a many-to-many association:"
-msgstr "一个实体数组,在这个案例中是一个多对多的关联(注意这里的实体是自动管理生命周期的对象(lifecycle objects),<literal>cascade=\"all\"</literal>): "
+msgid ""
+"The collection table holding the collection data is set using the "
+"<classname>@CollectionTable</classname> annotation. If omitted the "
+"collection table name defaults to the concatenation of the name of the "
+"containing entity and the name of the collection attribute, separated by an "
+"underscore. In our example, it would be <literal>User_nicknames</literal>."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:678
#, no-c-format
-msgid "A map from string indices to dates:"
-msgstr "一个 map,通过字符串的索引来指明日期:"
+msgid ""
+"The column holding the basic type is set using the <classname>@Column</"
+"classname> annotation. If omitted, the column name defaults to the property "
+"name: in our example, it would be <literal>nicknames</literal>."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:683
#, no-c-format
-msgid "A list of components (this is discussed in the next chapter):"
-msgstr "一个组件的列表:(将在下一章讨论)"
+msgid ""
+"But you are not limited to basic types, the collection type can be any "
+"embeddable object. To override the columns of the embeddable object in the "
+"collection table, use the <classname>@AttributeOverride</classname> "
+"annotation."
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:689
#, no-c-format
-msgid "One-to-many associations"
-msgstr "一对多关联(One-to-many Associations)"
+msgid "@ElementCollection for embeddable objects"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: collection_mapping.xml:691
#, no-c-format
-msgid "A <emphasis>one-to-many association</emphasis> links the tables of two classes via a foreign key with no intervening collection table. This mapping loses certain semantics of normal Java collections:"
-msgstr "<emphasis>一对多关联</emphasis><emphasis>通过外键</emphasis>连接两个类对应的表,而没有中间集合表。 这个关系模型失去了一些 Java 集合的语义:"
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" [...]\n"
+" public String getLastname() { ...}\n"
+"\n"
+" @ElementCollection\n"
+" @CollectionTable(name=\"Addresses\", joinColumns=@JoinColumn(name="
+"\"user_id\"))\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"street1\", column=@Column(name=\"fld_street"
+"\"))\n"
+" })\n"
+" public Set<Address> getAddresses() { ... } \n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" public String getStreet1() {...}\n"
+" [...]\n"
+"}"
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:694
#, no-c-format
-msgid "An instance of the contained entity class cannot belong to more than one instance of the collection."
-msgstr "一个被包含的实体的实例只能被包含在一个集合的实例中。"
+msgid "Such an embeddable object cannot contains a collection itself."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:698
#, no-c-format
-msgid "An instance of the contained entity class cannot appear at more than one value of the collection index."
-msgstr "一个被包含的实体的实例只能对应于集合索引的一个值中。"
+msgid ""
+"in <classname>@AttributeOverride</classname>, you must use the "
+"<literal>value.</literal> prefix to override properties of the embeddable "
+"object used in the map value and the <literal>key.</literal> prefix to "
+"override properties of the embeddable object used in the map key."
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:704
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class User {\n"
+" @ElementCollection\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name=\"key.street1\", column=@Column(name="
+"\"fld_street\")),\n"
+" @AttributeOverride(name=\"value.stars\", column=@Column(name=\"fld_note"
+"\"))\n"
+" })\n"
+" public Map<Address,Rating> getFavHomes() { ... }"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:708
#, no-c-format
-msgid "An association from <literal>Product</literal> to <literal>Part</literal> requires the existence of a foreign key column and possibly an index column to the <literal>Part</literal> table. A <literal><one-to-many></literal> tag indicates that this is a one-to-many association."
-msgstr "一个从 <literal>Product</literal> 到 <literal>Part</literal> 的关联需要关键字字段,可能还有一个索引字段指向 <literal>Part</literal> 所对应的表。<literal><one-to-many></literal> 标记指明了一个一对多的关联。 "
+msgid ""
+"We recommend you to migrate from <classname>@org.hibernate.annotations."
+"CollectionOfElements</classname> to the new <classname>@ElementCollection</"
+"classname> annotation."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:714
+#, fuzzy, no-c-format
+msgid ""
+"Using the mapping file approach a collection of values is mapped using the "
+"<literal><element></literal> tag. For example:"
+msgstr ""
+"对于一个值集合,我们使用 <literal><element></literal> 标签。例如:"
+
+#. Tag: title
+#: collection_mapping.xml:718
#, no-c-format
-msgid "<literal>not-found</literal> (optional - defaults to <literal>exception</literal>): specifies how cached identifiers that reference missing rows will be handled. <literal>ignore</literal> will treat a missing row as a null association."
-msgstr "<literal>not-found</literal>(可选 - 默认为<literal>exception</literal>):指明若缓存的标示值关联的行缺失,该如何处理:<literal>ignore</literal> 会把缺失的行作为一个空关联处理。 "
+msgid "<element> tag for collection values using mapping files"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:730
+#, no-c-format
+msgid ""
+"<element\n"
+" column=\"column_name\"\n"
+" formula=\"any SQL expression\"\n"
+" type=\"typename\"\n"
+" length=\"L\"\n"
+" precision=\"P\"\n"
+" scale=\"S\"\n"
+" not-null=\"true|false\"\n"
+" unique=\"true|false\"\n"
+" node=\"element-name\"\n"
+"/>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:734
#, no-c-format
-msgid "The <literal><one-to-many></literal> element does not need to declare any columns. Nor is it necessary to specify the <literal>table</literal> name anywhere."
-msgstr "注意:<literal><one-to-many></literal> 元素不需要定义任何字段。也不需要指定表名。 "
+msgid ""
+"<literal>column</literal> (optional): the name of the column holding the "
+"collection element values."
+msgstr "<literal>column</literal>(可选):持有集合元素值的字段的名称。"
#. Tag: para
+#: collection_mapping.xml:739
#, no-c-format
-msgid "If the foreign key column of a <literal><one-to-many></literal> association is declared <literal>NOT NULL</literal>, you must declare the <literal><key></literal> mapping <literal>not-null=\"true\"</literal> or <emphasis>use a bidirectional association</emphasis> with the collection mapping marked <literal>inverse=\"true\"</literal>. See the discussion of bidirectional associations later in this chapter for more information."
-msgstr "<emphasis>重要提示</emphasis>:如果<literal>一对多</literal>关联中的外键字段定义成 <literal>NOT NULL</literal>,你必须把 <literal><key></literal> 映射声明为 <literal>not-null=\"true\"</literal>,或者使用<emphasis>双向关联</emphasis>,并且标明 <literal>inverse=\"true\"</literal>。参阅本章后面关于双向关联的讨论。 "
+msgid ""
+"<literal>formula</literal> (optional): an SQL formula used to evaluate the "
+"element."
+msgstr "<literal>formula</literal>(可选):用于对元素求值的 SQL 公式。"
#. Tag: para
+#: collection_mapping.xml:744
#, no-c-format
-msgid "The following example shows a map of <literal>Part</literal> entities by name, where <literal>partName</literal> is a persistent property of <literal>Part</literal>. Notice the use of a formula-based index:"
-msgstr "下面的例子展示一个 <literal>Part</literal> 实体的 map,把 name 作为关键字。( <literal>partName</literal> 是 <literal>Part</literal> 的持久化属性)。注意其中的基于公式的索引的用法。 "
+msgid "<literal>type</literal> (required): the type of the collection element."
+msgstr "<literal>type</literal>(必需):集合元素的类型。 "
#. Tag: title
+#: collection_mapping.xml:754
#, no-c-format
msgid "Advanced collection mappings"
msgstr "高级集合映射(Advanced collection mappings)"
#. Tag: title
+#: collection_mapping.xml:757
#, no-c-format
msgid "Sorted collections"
msgstr "有序集合(Sorted collections)"
#. Tag: para
+#: collection_mapping.xml:759
#, no-c-format
-msgid "Hibernate supports collections implementing <literal>java.util.SortedMap</literal> and <literal>java.util.SortedSet</literal>. You must specify a comparator in the mapping file:"
-msgstr "Hibernate 支持实现 <literal>java.util.SortedMap</literal> 和 <literal>java.util.SortedSet</literal> 的集合。你必须在映射文件中指定一个比较器:"
+msgid ""
+"Hibernate supports collections implementing <literal>java.util.SortedMap</"
+"literal> and <literal>java.util.SortedSet</literal>. With annotations you "
+"declare a sort comparator using <literal>@Sort</literal>. You chose between "
+"the comparator types unsorted, natural or custom. If you want to use your "
+"own comparator implementation, you'll also have to specify 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: title
+#: collection_mapping.xml:770
+#, fuzzy, no-c-format
+msgid "Sorted collection with @Sort"
+msgstr "有序集合(Sorted collections)"
+
+#. Tag: programlisting
+#: collection_mapping.xml:772
+#, no-c-format
+msgid ""
+"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+"@JoinColumn(name=\"CUST_ID\")\n"
+"@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+"public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:775
#, no-c-format
-msgid "Allowed values of the <literal>sort</literal> attribute are <literal>unsorted</literal>, <literal>natural</literal> and the name of a class implementing <literal>java.util.Comparator</literal>."
-msgstr "<literal>sort</literal> 属性中允许的值包括 <literal>unsorted</literal>,<literal>natural</literal> 和某个实现了 <literal>java.util.Comparator</literal> 的类的名称。"
+msgid ""
+"Using Hibernate mapping files you specify a comparator in the mapping file "
+"with <literal><sort></literal>:"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:779
+#, fuzzy, no-c-format
+msgid "Sorted collection using xml mapping"
+msgstr "有序集合(Sorted collections)"
+
+#. Tag: programlisting
+#: collection_mapping.xml:781
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"aliases\"\n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>"
+msgstr ""
+"<![CDATA[<set name=\"aliases\" \n"
+" table=\"person_aliases\" \n"
+" sort=\"natural\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date\" type=\"date\"/>\n"
+"</map>]]>"
+
#. Tag: para
+#: collection_mapping.xml:784
#, no-c-format
-msgid "Sorted collections actually behave like <literal>java.util.TreeSet</literal> or <literal>java.util.TreeMap</literal>."
-msgstr "分类集合的行为事实上象 <literal>java.util.TreeSet</literal> 或者 <literal>java.util.TreeMap</literal>。"
+msgid ""
+"Allowed values of the <literal>sort</literal> attribute are "
+"<literal>unsorted</literal>, <literal>natural</literal> and the name of a "
+"class implementing <literal>java.util.Comparator</literal>."
+msgstr ""
+"<literal>sort</literal> 属性中允许的值包括 <literal>unsorted</literal>,"
+"<literal>natural</literal> 和某个实现了 <literal>java.util.Comparator</"
+"literal> 的类的名称。"
#. Tag: para
+#: collection_mapping.xml:789
#, no-c-format
-msgid "If you want the database itself to order the collection elements, use the <literal>order-by</literal> attribute of <literal>set</literal>, <literal>bag</literal> or <literal>map</literal> mappings. This solution is only available under JDK 1.4 or higher and is implemented using <literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>. This performs the ordering in the SQL query and not in the memory."
-msgstr "如果你希望数据库自己对集合元素排序,可以利用 <literal>set</literal>,<literal>bag</literal> 或者 <literal>map</literal> 映射中的 <literal>order-by</literal> 属性。这个解决方案只能在 jdk1.4 或者更高的 jdk 版本中才可以实现(通过 LinkedHashSet 或者 LinkedHashMap 实现)。它是在 SQL 查询中完成排序,而不是在内存中。 "
+msgid ""
+"Sorted collections actually behave like <literal>java.util.TreeSet</literal> "
+"or <literal>java.util.TreeMap</literal>."
+msgstr ""
+"分类集合的行为事实上象 <literal>java.util.TreeSet</literal> 或者 "
+"<literal>java.util.TreeMap</literal>。"
+#. Tag: para
+#: collection_mapping.xml:794
+#, fuzzy, no-c-format
+msgid ""
+"If you want the database itself to order the collection elements, use the "
+"<literal>order-by</literal> attribute of <literal>set</literal>, "
+"<literal>bag</literal> or <literal>map</literal> mappings. This solution is "
+"implemented using <literal>LinkedHashSet</literal> or "
+"<literal>LinkedHashMap</literal> and performs the ordering in the SQL query "
+"and not in the memory."
+msgstr ""
+"如果你希望数据库自己对集合元素排序,可以利用 <literal>set</literal>,"
+"<literal>bag</literal> 或者 <literal>map</literal> 映射中的 <literal>order-"
+"by</literal> 属性。这个解决方案只能在 jdk1.4 或者更高的 jdk 版本中才可以实现"
+"(通过 LinkedHashSet 或者 LinkedHashMap 实现)。它是在 SQL 查询中完成排序,而"
+"不是在内存中。 "
+
#. Tag: title
+#: collection_mapping.xml:802
#, no-c-format
+msgid "Sorting in database using order-by"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:804
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower(name) asc"
+"\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>"
+msgstr ""
+"<![CDATA[<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower"
+"(name) asc\">\n"
+" <key column=\"person\"/>\n"
+" <element column=\"name\" type=\"string\"/>\n"
+"</set>\n"
+"\n"
+"<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
+" <key column=\"year_id\"/>\n"
+" <map-key column=\"hol_name\" type=\"string\"/>\n"
+" <element column=\"hol_date type=\"date\"/>\n"
+"</map>]]>"
+
+#. Tag: title
+#: collection_mapping.xml:808
+#, no-c-format
msgid "Note"
msgstr "注意"
#. Tag: para
+#: collection_mapping.xml:810
#, no-c-format
-msgid "The value of the <literal>order-by</literal> attribute is an SQL ordering, not an HQL ordering."
-msgstr "注意:这个 <literal>order-by</literal> 属性的值是一个 SQL 排序子句而不是 HQL 的。"
+msgid ""
+"The value of the <literal>order-by</literal> attribute is an SQL ordering, "
+"not an HQL ordering."
+msgstr ""
+"注意:这个 <literal>order-by</literal> 属性的值是一个 SQL 排序子句而不是 HQL "
+"的。"
#. Tag: para
+#: collection_mapping.xml:814
#, no-c-format
-msgid "Associations can even be sorted by arbitrary criteria at runtime using a collection <literal>filter()</literal>:"
-msgstr "关联还可以在运行时使用集合 <literal>filter()</literal> 根据任意的条件来排序:"
+msgid ""
+"Associations can even be sorted by arbitrary criteria at runtime using a "
+"collection <literal>filter()</literal>:"
+msgstr ""
+"关联还可以在运行时使用集合 <literal>filter()</literal> 根据任意的条件来排序:"
#. Tag: title
+#: collection_mapping.xml:818
#, no-c-format
+msgid "Sorting via a query filter"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:820
+#, fuzzy, no-c-format
+msgid ""
+"sortedUsers = s.createFilter( group.getUsers(), \"order by this.name\" ).list"
+"();"
+msgstr ""
+"<![CDATA[sortedUsers = s.createFilter( group.getUsers(), \"order by this.name"
+"\" ).list();]]>"
+
+#. Tag: title
+#: collection_mapping.xml:825
+#, no-c-format
msgid "Bidirectional associations"
msgstr "双向关联(Bidirectional associations)"
#. Tag: para
+#: collection_mapping.xml:827
#, no-c-format
-msgid "A <emphasis>bidirectional association</emphasis> allows navigation from both \"ends\" of the association. Two kinds of bidirectional association are supported:"
-msgstr "<emphasis>双向关联</emphasis>允许通过关联的任一端访问另外一端。在 Hibernate 中,支持两种类型的双向关联: "
+msgid ""
+"A <emphasis>bidirectional association</emphasis> allows navigation from both "
+"\"ends\" of the association. Two kinds of bidirectional association are "
+"supported:"
+msgstr ""
+"<emphasis>双向关联</emphasis>允许通过关联的任一端访问另外一端。在 Hibernate "
+"中,支持两种类型的双向关联: "
#. Tag: term
+#: collection_mapping.xml:831
#, no-c-format
msgid "one-to-many"
msgstr "一对多(one-to-many)"
#. Tag: para
+#: collection_mapping.xml:834
#, no-c-format
msgid "set or bag valued at one end and single-valued at the other"
msgstr "Set 或者 bag 值在一端,单独值(非集合)在另外一端 "
#. Tag: term
+#: collection_mapping.xml:840
#, no-c-format
msgid "many-to-many"
msgstr "多对多(many-to-many)"
#. Tag: para
+#: collection_mapping.xml:843
#, no-c-format
msgid "set or bag valued at both ends"
msgstr "两端都是 set 或 bag 值"
#. Tag: para
+#: collection_mapping.xml:848
#, no-c-format
-msgid "You can specify a bidirectional many-to-many association by mapping two many-to-many associations to the same database table and declaring one end as <emphasis>inverse</emphasis>. You cannot select an indexed collection."
-msgstr "要建立一个双向的多对多关联,只需要映射两个 many-to-many 关联到同一个数据库表中,并再定义其中的一端为 <emphasis>inverse</emphasis>(使用哪一端要根据你的选择,但它不能是一个索引集合)。 "
+msgid ""
+"Often there exists a many to one association which is the owner side of a "
+"bidirectional relationship. The corresponding one to many association is in "
+"this case annotated by <literal>@OneToMany(mappedBy=...)</literal>"
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:854
+#, no-c-format
+msgid "Bidirectional one to many with many to one side as association owner"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:857
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:860
#, no-c-format
-msgid "Here is an example of a bidirectional many-to-many association that illustrates how each category can have many items and each item can be in many categories:"
-msgstr "这里有一个 many-to-many 的双向关联的例子;每一个 category 都可以有很多 items,每一个 items 可以属于很多 categories: "
+msgid ""
+"<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."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:865
#, no-c-format
-msgid "Changes made only to the inverse end of the association are <emphasis>not</emphasis> persisted. This means that Hibernate has two representations in memory for every bidirectional association: one link from A to B and another link from B to A. This is easier to understand if you think about the Java object model and how a many-to-many relationship in Javais created:"
-msgstr "如果只对关联的反向端进行了改变,这个改变<emphasis>不会</emphasis>被持久化。 这表示 Hibernate 为每个双向关联在内存中存在两次表现,一个从 A 连接到 B,另一个从 B 连接到 A。如果你回想一下 Java 对象模型,我们是如何在 Java 中创建多对多关系的,这可以让你更容易理解: "
+msgid ""
+"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 not optimized and will produce additional UPDATE "
+"statements."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:872
+#, fuzzy, no-c-format
+msgid "Bidirectional associtaion with one to many side as owner"
+msgstr "双向关联,涉及有序集合类"
+
+#. Tag: programlisting
+#: collection_mapping.xml:875
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:878
+#, fuzzy, no-c-format
+msgid ""
+"How does the mappping of a bidirectional mapping look like in Hibernate "
+"mapping xml? There you define a bidirectional one-to-many association by "
+"mapping a one-to-many association to the same table column(s) as a many-to-"
+"one association and declaring the many-valued end <literal>inverse=\"true\"</"
+"literal>."
+msgstr ""
+"要建立一个一对多的双向关联,你可以通过把一个一对多关联,作为一个多对一关联映"
+"射到到同一张表的字段上,并且在\"多\"的那一端定义 <literal>inverse=\"true\"</"
+"literal>。 "
+
+#. Tag: title
+#: collection_mapping.xml:885
#, no-c-format
-msgid "The non-inverse side is used to save the in-memory representation to the database."
-msgstr "非反向端用于把内存中的表示保存到数据库中。"
+msgid "Bidirectional one to many via Hibernate mapping files"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:887
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>]]>"
+
#. Tag: para
+#: collection_mapping.xml:890
#, no-c-format
-msgid "You can define a bidirectional one-to-many association by mapping a one-to-many association to the same table column(s) as a many-to-one association and declaring the many-valued end <literal>inverse=\"true\"</literal>."
-msgstr "要建立一个一对多的双向关联,你可以通过把一个一对多关联,作为一个多对一关联映射到到同一张表的字段上,并且在\"多\"的那一端定义 <literal>inverse=\"true\"</literal>。 "
+msgid ""
+"Mapping one end of an association with <literal>inverse=\"true\"</literal> "
+"does not affect the operation of cascades as these are orthogonal concepts."
+msgstr ""
+"在“一”这一端定义 <literal>inverse=\"true\"</literal> 不会影响级联操作,二者是"
+"正交的概念。"
#. Tag: para
+#: collection_mapping.xml:894
#, no-c-format
-msgid "Mapping one end of an association with <literal>inverse=\"true\"</literal> does not affect the operation of cascades as these are orthogonal concepts."
-msgstr "在“一”这一端定义 <literal>inverse=\"true\"</literal> 不会影响级联操作,二者是正交的概念。"
+msgid ""
+"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):"
+msgstr ""
#. Tag: title
+#: collection_mapping.xml:903
#, no-c-format
-msgid "Bidirectional associations with indexed collections"
-msgstr "双向关联,涉及有序集合类"
+msgid "Many to many association via @ManyToMany"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:905
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:907
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:910
#, no-c-format
-msgid "A bidirectional association where one end is represented as a <literal><list></literal> or <literal><map></literal>, requires special consideration. If there is a property of the child class that maps to the index column you can use <literal>inverse=\"true\"</literal> on the collection mapping:"
-msgstr "对于有一端是 <literal><list></literal> 或者 <literal><map></literal> 的双向关联,需要加以特别考虑。假若子类中的一个属性映射到索引字段,没问题,我们仍然可以在集合类映射上使用 <literal>inverse=\"true\"</literal>: "
+msgid ""
+"In this example <classname>@JoinTable</classname> defines a <literal>name</"
+"literal>, an array of join columns, 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\"). 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."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:919
#, no-c-format
-msgid "If there is no such property on the child class, the association cannot be considered truly bidirectional. That is, there is information available at one end of the association that is not available at the other end. In this case, you cannot map the collection <literal>inverse=\"true\"</literal>. Instead, you could use the following mapping:"
-msgstr "但是,假若子类中没有这样的属性存在,我们不能认为这个关联是真正的双向关联(信息不对称,在关联的一端有一些另外一端没有的信息)。在这种情况下,我们不能使用 <literal>inverse=\"true\"</literal>。我们需要这样用: "
+msgid ""
+"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."
+msgstr ""
+#. Tag: title
+#: collection_mapping.xml:932
+#, no-c-format
+msgid "Default values for <classname>@ManyToMany</classname> (uni-directional)"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:935
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:938
#, no-c-format
-msgid "Note that in this mapping, the collection-valued end of the association is responsible for updates to the foreign key."
-msgstr "注意在这个映射中,关联中集合类\"值\"一端负责来更新外键。"
+msgid ""
+"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."
+msgstr ""
+#. Tag: para
+#: collection_mapping.xml:943
+#, no-c-format
+msgid ""
+"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."
+msgstr ""
+
#. Tag: title
+#: collection_mapping.xml:955
#, no-c-format
-msgid "Ternary associations"
-msgstr "三重关联(Ternary associations)"
+msgid "Default values for <classname>@ManyToMany</classname> (bi-directional)"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:958
+#, no-c-format
+msgid ""
+"@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"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:961
#, no-c-format
-msgid "There are three possible approaches to mapping a ternary association. One approach is to use a <literal>Map</literal> with an association as its index:"
-msgstr "有三种可能的途径来映射一个三重关联。第一种是使用一个 <literal>Map</literal>,把一个关联作为其索引: "
+msgid ""
+"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."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:966
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files you can map a bidirectional many-to-many "
+"association by mapping two many-to-many associations to the same database "
+"table and declaring one end as <emphasis>inverse</emphasis>."
+msgstr ""
+"要建立一个双向的多对多关联,只需要映射两个 many-to-many 关联到同一个数据库表"
+"中,并再定义其中的一端为 <emphasis>inverse</emphasis>(使用哪一端要根据你的选"
+"择,但它不能是一个索引集合)。 "
+
+#. Tag: para
+#: collection_mapping.xml:970
#, no-c-format
-msgid "A second approach is to remodel the association as an entity class. This is the most common approach."
-msgstr "第二种方法是简单的把关联重新建模为一个实体类。这使我们最经常使用的方法。 "
+msgid "You cannot select an indexed collection."
+msgstr ""
#. Tag: para
+#: collection_mapping.xml:973
+#, fuzzy, no-c-format
+msgid ""
+"shows a bidirectional many-to-many association that illustrates how each "
+"category can have many items and each item can be in many categories:"
+msgstr ""
+"这里有一个 many-to-many 的双向关联的例子;每一个 category 都可以有很多 items,"
+"每一个 items 可以属于很多 categories: "
+
+#. Tag: title
+#: collection_mapping.xml:979
#, no-c-format
-msgid "A final alternative is to use composite elements, which will be discussed later."
-msgstr "最后一种选择是使用复合元素,我们会在后面讨论。"
+msgid "Many to many association using Hibernate mapping files"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:981
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true"
+"\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Category\">\n"
+" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
+" ...\n"
+" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
+" <key column=\"CATEGORY_ID\"/>\n"
+" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
+" </bag>\n"
+"</class>\n"
+"\n"
+"<class name=\"Item\">\n"
+" <id name=\"id\" column=\"ITEM_ID\"/>\n"
+" ...\n"
+"\n"
+" <!-- inverse end -->\n"
+" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"
+" <key column=\"ITEM_ID\"/>\n"
+" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
+" </bag>\n"
+"</class>]]>"
+
+#. Tag: para
+#: collection_mapping.xml:984
+#, no-c-format
+msgid ""
+"Changes made only to the inverse end of the association are <emphasis>not</"
+"emphasis> persisted. This means that Hibernate has two representations in "
+"memory for every bidirectional association: one link from A to B and another "
+"link from B to A. This is easier to understand if you think about the Java "
+"object model and how a many-to-many relationship in Javais created:"
+msgstr ""
+"如果只对关联的反向端进行了改变,这个改变<emphasis>不会</emphasis>被持久化。 "
+"这表示 Hibernate 为每个双向关联在内存中存在两次表现,一个从 A 连接到 B,另一"
+"个从 B 连接到 A。如果你回想一下 Java 对象模型,我们是如何在 Java 中创建多对多"
+"关系的,这可以让你更容易理解: "
+
#. Tag: title
+#: collection_mapping.xml:992
+#, fuzzy, no-c-format
+msgid "Effect of inverse vs. non-inverse side of many to many associations"
+msgstr ""
+"值集合于多对多关联(Collections of values and many-to-many associations)"
+
+#. Tag: programlisting
+#: collection_mapping.xml:995
+#, fuzzy, no-c-format
+msgid ""
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved"
+msgstr ""
+"<![CDATA[\n"
+"category.getItems().add(item); // The category now \"knows\" about "
+"the relationship\n"
+"item.getCategories().add(category); // The item now \"knows\" about the "
+"relationship\n"
+"\n"
+"session.persist(item); // The relationship won't be "
+"saved!\n"
+"session.persist(category); // The relationship will be saved]]>"
+
+#. Tag: para
+#: collection_mapping.xml:998
#, no-c-format
-msgid "<literal>Using an <idbag></literal>"
-msgstr "<literal>使用 an <idbag></literal> "
+msgid ""
+"The non-inverse side is used to save the in-memory representation to the "
+"database."
+msgstr "非反向端用于把内存中的表示保存到数据库中。"
+#. Tag: title
+#: collection_mapping.xml:1003
+#, no-c-format
+msgid "Bidirectional associations with indexed collections"
+msgstr "双向关联,涉及有序集合类"
+
#. Tag: para
+#: collection_mapping.xml:1005
+#, fuzzy, no-c-format
+msgid ""
+"There are some additional considerations for bidirectional mappings with "
+"indexed collections (where one end is represented as a <literal><list>"
+"</literal> or <literal><map></literal>) when using Hibernate mapping "
+"files. If there is a property of the child class that maps to the index "
+"column you can use <literal>inverse=\"true\"</literal> on the collection "
+"mapping:"
+msgstr ""
+"对于有一端是 <literal><list></literal> 或者 <literal><map></"
+"literal> 的双向关联,需要加以特别考虑。假若子类中的一个属性映射到索引字段,没"
+"问题,我们仍然可以在集合类映射上使用 <literal>inverse=\"true\"</literal>: "
+
+#. Tag: title
+#: collection_mapping.xml:1013
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection"
+msgstr "双向关联,涉及有序集合类"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1015
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <property name=\"name\" \n"
+" not-null=\"true\"/>\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+"</class>]]>"
+
+#. Tag: para
+#: collection_mapping.xml:1018
#, no-c-format
-msgid "The majority of the many-to-many associations and collections of values shown previously all map to tables with composite keys, even though it has been have suggested that entities should have synthetic identifiers (surrogate keys). A pure association table does not seem to benefit much from a surrogate key, although a collection of composite values <emphasis>might</emphasis>. It is for this reason that Hibernate provides a feature that allows you to map many-to-many associations and collections of values to a table with a surrogate key."
-msgstr "如果你完全信奉我们对于“联合主键(composite keys)是个坏东西”,和“实体应该使用(无机的)自己生成的代用标识符(surrogate keys)”的观点,也许你会感到有一些奇怪,我们目前为止展示的多对多关联和值集合都是映射成为带有联合主键的表的!现在,这一点非常值得争辩;看上去一个单纯的关联表并不能从代用标识符中获得什么好处(虽然使用组合值的集合<emphasis>可能</emphasis>会获得一点好处)。不过,Hibernate 提供了一个(一点点试验性质的)功能,让你把多对多关联和值集合应得到一个使用代用标识符的表去。 "
+msgid ""
+"If there is no such property on the child class, the association cannot be "
+"considered truly bidirectional. That is, there is information available at "
+"one end of the association that is not available at the other end. In this "
+"case, you cannot map the collection <literal>inverse=\"true\"</literal>. "
+"Instead, you could use the following mapping:"
+msgstr ""
+"但是,假若子类中没有这样的属性存在,我们不能认为这个关联是真正的双向关联(信"
+"息不对称,在关联的一端有一些另外一端没有的信息)。在这种情况下,我们不能使用 "
+"<literal>inverse=\"true\"</literal>。我们需要这样用: "
+#. Tag: title
+#: collection_mapping.xml:1026
+#, fuzzy, no-c-format
+msgid "Bidirectional association with indexed collection, but no index column"
+msgstr "双向关联,涉及有序集合类"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1029
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Parent\">\n"
+" <id name=\"id\" column=\"parent_id\"/>\n"
+" ....\n"
+" <map name=\"children\">\n"
+" <key column=\"parent_id\"\n"
+" not-null=\"true\"/>\n"
+" <map-key column=\"name\" \n"
+" type=\"string\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </map>\n"
+"</class>\n"
+"\n"
+"<class name=\"Child\">\n"
+" <id name=\"id\" column=\"child_id\"/>\n"
+" ....\n"
+" <many-to-one name=\"parent\" \n"
+" class=\"Parent\" \n"
+" column=\"parent_id\"\n"
+" insert=\"false\"\n"
+" update=\"false\"\n"
+" not-null=\"true\"/>\n"
+"</class>]]>"
+
#. Tag: para
+#: collection_mapping.xml:1032
#, no-c-format
-msgid "The <literal><idbag></literal> element lets you map a <literal>List</literal> (or <literal>Collection</literal>) with bag semantics. For example:"
-msgstr "<literal><idbag></literal> 属性让你使用 bag 语义来映射一个 <literal>List</literal> (或 <literal>Collection</literal>)。 "
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updates to the foreign key."
+msgstr "注意在这个映射中,关联中集合类\"值\"一端负责来更新外键。"
+#. Tag: title
+#: collection_mapping.xml:1037
+#, no-c-format
+msgid "Ternary associations"
+msgstr "三重关联(Ternary associations)"
+
#. Tag: para
+#: collection_mapping.xml:1039
#, no-c-format
-msgid "An <literal><idbag></literal> has a synthetic id generator, just like an entity class. A different surrogate key is assigned to each collection row. Hibernate does not, however, provide any mechanism for discovering the surrogate key value of a particular row."
-msgstr "你可以理解,<literal><idbag></literal> 人工的 id 生成器,就好像是实体类一样!集合的每一行都有一个不同的人造关键字。但是,Hibernate 没有提供任何机制来让你取得某个特定行的人造关键字。 "
+msgid ""
+"There are three possible approaches to mapping a ternary association. One "
+"approach is to use a <literal>Map</literal> with an association as its index:"
+msgstr ""
+"有三种可能的途径来映射一个三重关联。第一种是使用一个 <literal>Map</literal>,"
+"把一个关联作为其索引: "
+#. Tag: title
+#: collection_mapping.xml:1044
+#, fuzzy, no-c-format
+msgid "Ternary association mapping"
+msgstr "三重关联(Ternary associations)"
+
+#. Tag: programlisting
+#: collection_mapping.xml:1046
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Company {\n"
+" @Id \n"
+" int id;\n"
+" ...\n"
+" @OneToMany // unidirectional\n"
+" @MapKeyJoinColumn(name=\"employee_id\")\n"
+" Map<Employee, Contract> contracts;\n"
+"}\n"
+"\n"
+"// or\n"
+"\n"
+"<map name=\"contracts\">\n"
+" <key column=\"employer_id\" not-null=\"true\"/>\n"
+" <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
+" <one-to-many class=\"Contract\"/>\n"
+"</map>"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1049
+#, fuzzy, no-c-format
+msgid ""
+"A second approach is to remodel the association as an entity class. This is "
+"the most common approach. A final alternative is to use composite elements, "
+"which will be discussed later."
+msgstr ""
+"第二种方法是简单的把关联重新建模为一个实体类。这使我们最经常使用的方法。 "
+
+#. Tag: literal
+#: collection_mapping.xml:1055
+#, fuzzy, no-c-format
+msgid "Using an <idbag>"
+msgstr "<literal>使用 an <idbag></literal> "
+
+#. Tag: para
+#: collection_mapping.xml:1057
+#, fuzzy, no-c-format
+msgid ""
+"The majority of the many-to-many associations and collections of values "
+"shown previously all map to tables with composite keys, even though it has "
+"been suggested that entities should have synthetic identifiers (surrogate "
+"keys). A pure association table does not seem to benefit much from a "
+"surrogate key, although a collection of composite values <emphasis>might</"
+"emphasis>. For this reason Hibernate provides a feature that allows you to "
+"map many-to-many associations and collections of values to a table with a "
+"surrogate key."
+msgstr ""
+"如果你完全信奉我们对于“联合主键(composite keys)是个坏东西”,和“实体应该使用"
+"(无机的)自己生成的代用标识符(surrogate keys)”的观点,也许你会感到有一些奇"
+"怪,我们目前为止展示的多对多关联和值集合都是映射成为带有联合主键的表的!现"
+"在,这一点非常值得争辩;看上去一个单纯的关联表并不能从代用标识符中获得什么好"
+"处(虽然使用组合值的集合<emphasis>可能</emphasis>会获得一点好处)。不过,"
+"Hibernate 提供了一个(一点点试验性质的)功能,让你把多对多关联和值集合应得到"
+"一个使用代用标识符的表去。 "
+
+#. Tag: para
+#: collection_mapping.xml:1066
#, no-c-format
-msgid "The update performance of an <literal><idbag></literal> supersedes a regular <literal><bag></literal>. Hibernate can locate individual rows efficiently and update or delete them individually, similar to a list, map or set."
-msgstr "注意 <literal><idbag></literal> 的更新性能要比普通的 <literal><bag></literal> 高得多!Hibernate 可以有效的定位到不同的行,分别进行更新或删除工作,就如同处理一个 list,map 或者 set 一样。 "
+msgid ""
+"The <literal><idbag></literal> element lets you map a <literal>List</"
+"literal> (or <literal>Collection</literal>) with bag semantics. For example:"
+msgstr ""
+"<literal><idbag></literal> 属性让你使用 bag 语义来映射一个 "
+"<literal>List</literal> (或 <literal>Collection</literal>)。 "
+#. Tag: programlisting
+#: collection_mapping.xml:1070
+#, fuzzy, no-c-format
+msgid ""
+"<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/"
+">\n"
+"</idbag>"
+msgstr ""
+"<![CDATA[<idbag name=\"lovers\" table=\"LOVERS\">\n"
+" <collection-id column=\"ID\" type=\"long\">\n"
+" <generator class=\"sequence\"/>\n"
+" </collection-id>\n"
+" <key column=\"PERSON1\"/>\n"
+" <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/>\n"
+"</idbag>]]>"
+
#. Tag: para
+#: collection_mapping.xml:1072
#, no-c-format
-msgid "In the current implementation, the <literal>native</literal> identifier generation strategy is not supported for <literal><idbag></literal> collection identifiers."
-msgstr "在目前的实现中,还不支持使用 <literal>identity</literal> 标识符生成器策略来生成 <literal><idbag></literal> 集合的标识符。"
+msgid ""
+"An <literal><idbag></literal> has a synthetic id generator, just like "
+"an entity class. A different surrogate key is assigned to each collection "
+"row. Hibernate does not, however, provide any mechanism for discovering the "
+"surrogate key value of a particular row."
+msgstr ""
+"你可以理解,<literal><idbag></literal> 人工的 id 生成器,就好像是实体类"
+"一样!集合的每一行都有一个不同的人造关键字。但是,Hibernate 没有提供任何机制"
+"来让你取得某个特定行的人造关键字。 "
+#. Tag: para
+#: collection_mapping.xml:1077
+#, no-c-format
+msgid ""
+"The update performance of an <literal><idbag></literal> supersedes a "
+"regular <literal><bag></literal>. Hibernate can locate individual rows "
+"efficiently and update or delete them individually, similar to a list, map "
+"or set."
+msgstr ""
+"注意 <literal><idbag></literal> 的更新性能要比普通的 <literal><"
+"bag></literal> 高得多!Hibernate 可以有效的定位到不同的行,分别进行更新或"
+"删除工作,就如同处理一个 list,map 或者 set 一样。 "
+
+#. Tag: para
+#: collection_mapping.xml:1082
+#, no-c-format
+msgid ""
+"In the current implementation, the <literal>native</literal> identifier "
+"generation strategy is not supported for <literal><idbag></literal> "
+"collection identifiers."
+msgstr ""
+"在目前的实现中,还不支持使用 <literal>identity</literal> 标识符生成器策略来生"
+"成 <literal><idbag></literal> 集合的标识符。"
+
#. Tag: title
+#: collection_mapping.xml:1103
#, no-c-format
msgid "Collection examples"
msgstr "集合例子(Collection example)"
#. Tag: para
+#: collection_mapping.xml:1105
#, no-c-format
msgid "This section covers collection examples."
msgstr "集合例子(Collection example)。"
#. Tag: para
+#: collection_mapping.xml:1107
#, no-c-format
-msgid "The following class has a collection of <literal>Child</literal> instances:"
+msgid ""
+"The following class has a collection of <literal>Child</literal> instances:"
msgstr "下面的代码是用来添加一个新的 <literal>Child</literal>:"
+#. Tag: title
+#: collection_mapping.xml:1111
+#, no-c-format
+msgid ""
+"Example classes <classname>Parent</classname> and <classname>Child</"
+"classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1114
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" private long id;\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" private long id;\n"
+" private String name\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
#. Tag: para
+#: collection_mapping.xml:1117
#, no-c-format
-msgid "If each child has, at most, one parent, the most natural mapping is a one-to-many association:"
-msgstr "这个类有一个 <literal>Child</literal> 的实例集合。如果每一个子实例至多有一个父实例,那么最自然的映射是一个 one-to-many 的关联关系: "
+msgid ""
+"If each child has, at most, one parent, the most natural mapping is a one-to-"
+"many association:"
+msgstr ""
+"这个类有一个 <literal>Child</literal> 的实例集合。如果每一个子实例至多有一个"
+"父实例,那么最自然的映射是一个 one-to-many 的关联关系: "
+#. Tag: title
+#: collection_mapping.xml:1121
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1124
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1128
+#, no-c-format
+msgid ""
+"One to many unidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1131
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<![CDATA[<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: collection_mapping.xml:1134
#, no-c-format
msgid "This maps to the following table definitions:"
msgstr "在以下的表定义中反应了这个映射关系:"
+#. Tag: title
+#: collection_mapping.xml:1137
+#, no-c-format
+msgid ""
+"Table definitions for unidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1141
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+"<![CDATA[create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255), "
+"parent_id bigint )\n"
+"alter table child add constraint childfk0 (parent_id) references parent]]>"
+
#. Tag: para
+#: collection_mapping.xml:1144
#, no-c-format
-msgid "If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-many association:"
-msgstr "如果父亲是<emphasis>必须</emphasis>的,那么就可以使用双向 one-to-many 的关联了:"
+msgid ""
+"If the parent is <emphasis>required</emphasis>, use a bidirectional one-to-"
+"many association:"
+msgstr ""
+"如果父亲是<emphasis>必须</emphasis>的,那么就可以使用双向 one-to-many 的关联"
+"了:"
+#. Tag: title
+#: collection_mapping.xml:1148
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1151
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+" \n"
+" @ManyToOne\n"
+" private Parent parent;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1155
+#, no-c-format
+msgid ""
+"One to many bidirectional <classname>Parent-Child</classname> relationship "
+"using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1158
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
+"\" not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<![CDATA[<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" inverse=\"true\">\n"
+" <key column=\"parent_id\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id\" "
+"not-null=\"true\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: collection_mapping.xml:1161
#, no-c-format
msgid "Notice the <literal>NOT NULL</literal> constraint:"
msgstr "请注意 <literal>NOT NULL</literal> 的约束:"
+#. Tag: title
+#: collection_mapping.xml:1164
+#, no-c-format
+msgid ""
+"Table definitions for bidirectional <classname>Parent</classname>-"
+"<classname>Child</classname> relationship"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1168
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent"
+msgstr ""
+"<![CDATA[create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null\n"
+" primary key,\n"
+" name varchar(255),\n"
+" parent_id bigint not null )\n"
+"alter table child add constraint childfk0 (parent_id) references parent]]>"
+
#. Tag: para
+#: collection_mapping.xml:1171
+#, fuzzy, no-c-format
+msgid ""
+"Alternatively, if this association must be unidirectional you can enforce "
+"the <literal>NOT NULL</literal> constraint."
+msgstr ""
+"另外,如果你绝对坚持这个关联应该是单向的,你可以对 <literal><key></"
+"literal> 映射声明 <literal>NOT NULL</literal> 约束: "
+
+#. Tag: title
+#: collection_mapping.xml:1175
#, no-c-format
-msgid "Alternatively, if this association must be unidirectional you can declare the <literal>NOT NULL</literal> constraint on the <literal><key></literal> mapping:"
-msgstr "另外,如果你绝对坚持这个关联应该是单向的,你可以对 <literal><key></literal> 映射声明 <literal>NOT NULL</literal> 约束: "
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using annotations"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:1178
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @OneToMany(optional=false)\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1182
+#, no-c-format
+msgid ""
+"Enforcing NOT NULL constraint in unidirectional relation using mapping files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1185
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<![CDATA[<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\">\n"
+" <key column=\"parent_id\" not-null=\"true\"/>\n"
+" <one-to-many class=\"Child\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: collection_mapping.xml:1188
+#, fuzzy, no-c-format
+msgid ""
+"On the other hand, if a child has multiple parents, a many-to-many "
+"association is appropriate."
+msgstr ""
+"另外一方面,如果一个子实例可能有多个父实例,那么就应该使用 many-to-many 关"
+"联: "
+
+#. Tag: title
+#: collection_mapping.xml:1192
#, no-c-format
-msgid "On the other hand, if a child has multiple parents, a many-to-many association is appropriate:"
-msgstr "另外一方面,如果一个子实例可能有多个父实例,那么就应该使用 many-to-many 关联: "
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using "
+"annotations"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:1195
+#, no-c-format
+msgid ""
+"public class Parent {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" @ManyToMany\n"
+" private Set<Child> children;\n"
+"\n"
+" // getter/setter\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"public class Child {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" \n"
+" // getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: collection_mapping.xml:1199
+#, no-c-format
+msgid ""
+"Many to many <classname>Parent-Child</classname> relationship using mapping "
+"files"
+msgstr ""
+
+#. Tag: programlisting
+#: collection_mapping.xml:1202
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+msgstr ""
+"<![CDATA[<hibernate-mapping>\n"
+"\n"
+" <class name=\"Parent\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <set name=\"children\" table=\"childset\">\n"
+" <key column=\"parent_id\"/>\n"
+" <many-to-many class=\"Child\" column=\"child_id\"/>\n"
+" </set>\n"
+" </class>\n"
+"\n"
+" <class name=\"Child\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+" <property name=\"name\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: collection_mapping.xml:1205
#, no-c-format
msgid "Table definitions:"
msgstr "表定义:"
-#. Tag: para
+#. Tag: title
+#: collection_mapping.xml:1208
#, no-c-format
-msgid "For more examples and a complete explanation of a parent/child relationship mapping, see <xref linkend=\"example-parentchild\" /> for more information."
-msgstr "更多的例子,以及一个完整的父/子关系映射的排练,请参阅 <xref linkend=\"example-parentchild\" />。 "
+msgid "Table definitions for many to many releationship"
+msgstr ""
+#. Tag: programlisting
+#: collection_mapping.xml:1210
+#, fuzzy, no-c-format
+msgid ""
+"create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child"
+msgstr ""
+"<![CDATA[create table parent ( id bigint not null primary key )\n"
+"create table child ( id bigint not null primary key, name varchar(255) )\n"
+"create table childset ( parent_id bigint not null,\n"
+" child_id bigint not null,\n"
+" primary key ( parent_id, child_id ) )\n"
+"alter table childset add constraint childsetfk0 (parent_id) references "
+"parent\n"
+"alter table childset add constraint childsetfk1 (child_id) references child]]"
+">"
+
#. Tag: para
-#, no-c-format
-msgid "Even more complex association mappings are covered in the next chapter."
-msgstr "甚至可能出现更加复杂的关联映射,我们会在下一章中列出所有可能性。 "
+#: collection_mapping.xml:1213
+#, fuzzy, no-c-format
+msgid ""
+"For more examples and a complete explanation of a parent/child relationship "
+"mapping, see <xref linkend=\"example-parentchild\"/> for more information. "
+"Even more complex association mappings are covered in the next chapter."
+msgstr ""
+"更多的例子,以及一个完整的父/子关系映射的排练,请参阅 <xref linkend="
+"\"example-parentchild\" />。 "
#~ msgid ""
-#~ "<![CDATA[public class Product {\n"
-#~ " private String serialNumber;\n"
-#~ " private Set parts = new HashSet();\n"
-#~ " \n"
-#~ " public Set getParts() { return parts; }\n"
-#~ " void setParts(Set parts) { this.parts = parts; }\n"
-#~ " public String getSerialNumber() { return serialNumber; }\n"
-#~ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
-#~ "}]]>"
+#~ "Hibernate requires that persistent collection-valued fields be declared "
+#~ "as an interface type. For example:"
#~ msgstr ""
-#~ "<![CDATA[public class Product {\n"
-#~ " private String serialNumber;\n"
-#~ " private Set parts = new HashSet();\n"
-#~ " \n"
-#~ " public Set getParts() { return parts; }\n"
-#~ " void setParts(Set parts) { this.parts = parts; }\n"
-#~ " public String getSerialNumber() { return serialNumber; }\n"
-#~ " void setSerialNumber(String sn) { serialNumber = sn; }\n"
-#~ "}]]>"
+#~ "(译者注:在阅读本章的时候,以后整个手册的阅读过程中,我们都会面临一个名词"
+#~ "方面的问题,那就是“集合”。\"Collections\" 和 \"Set\" 在中文里对应都被翻译"
+#~ "为“集合”,但是他们的含义很不一样。Collections 是一个超集,Set 是其中的一"
+#~ "种。大部分情况下,本译稿中泛指的未加英文注明的“集合”,都应当理解"
+#~ "为“Collections”。在有些二者同时出现,可能造成混淆的地方,我们用“集合类”来"
+#~ "特指“Collecions”,“集合(Set)”来指 \"Set\",一般都会在后面的括号中给出英"
+#~ "文。希望大家在阅读时联系上下文理解,不要造成误解。 与此同时,“元素”一词对"
+#~ "应的英文“element”,也有两个不同的含义。其一为集合的元素,是内存中的一个变"
+#~ "量;另一含义则是 XML 文档中的一个标签所代表的元素。也请注意区别。本章中,"
+#~ "特别是后半部分是需要反复阅读才能理解清楚的。如果遇到任何疑问,请记住,英文"
+#~ "版本的 reference 是惟一标准的参考资料。) Hibernate 要求持久化集合值字段必"
+#~ "须声明为接口,例如:"
+#~ msgid "Collection mappings"
+#~ msgstr "集合映射( Collection mappings )"
+
#~ msgid ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "Cat kitten = new DomesticCat();\n"
-#~ "....\n"
-#~ "Set kittens = new HashSet();\n"
-#~ "kittens.add(kitten);\n"
-#~ "cat.setKittens(kittens);\n"
-#~ "session.persist(cat);\n"
-#~ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
-#~ "(HashSet) cat.getKittens(); // Error!]]>"
+#~ "There are quite a range of mappings that can be generated for collections "
+#~ "that cover many common relational models. We suggest you experiment with "
+#~ "the schema generation tool so that you understand how various mapping "
+#~ "declarations translate to database tables."
#~ msgstr ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "Cat kitten = new DomesticCat();\n"
-#~ "....\n"
-#~ "Set kittens = new HashSet();\n"
-#~ "kittens.add(kitten);\n"
-#~ "cat.setKittens(kittens);\n"
-#~ "session.persist(cat);\n"
-#~ "kittens = cat.getKittens(); // Okay, kittens collection is a Set\n"
-#~ "(HashSet) cat.getKittens(); // Error!]]>"
+#~ "从集合类可以产生很大一部分映射,覆盖了很多常见的关系模型。我们建议你试验 "
+#~ "schema 生成工具,来体会一下不同的映射声明是如何被翻译为数据库表的。 "
+#~ msgid "Collection elements"
+#~ msgstr "集合元素(Collection elements)"
+
#~ msgid ""
-#~ "<![CDATA[<class name=\"Product\">\n"
-#~ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
-#~ " <set name=\"parts\">\n"
-#~ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Part\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
+#~ "The contained type is referred to as the <emphasis>collection element "
+#~ "type</emphasis>. Collection elements are mapped by <literal><"
+#~ "element></literal> or <literal><composite-element></literal>, or "
+#~ "in the case of entity references, with <literal><one-to-many></"
+#~ "literal> or <literal><many-to-many></literal>. The first two map "
+#~ "elements with value semantics, the next two are used to map entity "
+#~ "associations."
#~ msgstr ""
-#~ "<![CDATA[<class name=\"Product\">\n"
-#~ " <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n"
-#~ " <set name=\"parts\">\n"
-#~ " <key column=\"productSerialNumber\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Part\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
+#~ "被包容的类型被称为<emphasis>集合元素类型(collection element type)</"
+#~ "emphasis>。集合元素通过 <literal><element></literal> 或 "
+#~ "<literal><composite-element></literal> 映射,或在其是实体引用的时"
+#~ "候,通过 <literal><one-to-many></literal> 或 <literal><many-to-"
+#~ "many></literal> 映射。前两种用于使用值语义映射元素,后两种用于映射实体"
+#~ "关联。"
#~ msgid ""
-#~ "<![CDATA[<map\n"
-#~ " name=\"propertyName\"\n"
-#~ " table=\"table_name\"\n"
-#~ " schema=\"schema_name\"\n"
-#~ " lazy=\"true|extra|false\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan"
-#~ "\"\n"
-#~ " sort=\"unsorted|natural|comparatorClass\"\n"
-#~ " order-by=\"column_name asc|desc\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " fetch=\"join|select|subselect\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <key .... />\n"
-#~ " <map-key .... />\n"
-#~ " <element .... />\n"
-#~ "</map>]]>"
+#~ "All collection mappings, except those with set and bag semantics, need an "
+#~ "<emphasis>index column</emphasis> in the collection table. An index "
+#~ "column is a column that maps to an array index, or <literal>List</"
+#~ "literal> index, or <literal>Map</literal> key. The index of a "
+#~ "<literal>Map</literal> may be of any basic type, mapped with <literal><"
+#~ "map-key></literal>. It can be an entity reference mapped with "
+#~ "<literal><map-key-many-to-many></literal>, or it can be a composite "
+#~ "type mapped with <literal><composite-map-key></literal>. The index "
+#~ "of an array or list is always of type <literal>integer</literal> and is "
+#~ "mapped using the <literal><list-index></literal> element. The "
+#~ "mapped column contains sequential integers that are numbered from zero by "
+#~ "default."
#~ msgstr ""
-#~ "<![CDATA[<map\n"
-#~ " name=\"propertyName\"\n"
-#~ " table=\"table_name\"\n"
-#~ " schema=\"schema_name\"\n"
-#~ " lazy=\"true|extra|false\"\n"
-#~ " inverse=\"true|false\"\n"
-#~ " cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan"
-#~ "\"\n"
-#~ " sort=\"unsorted|natural|comparatorClass\"\n"
-#~ " order-by=\"column_name asc|desc\"\n"
-#~ " where=\"arbitrary sql where condition\"\n"
-#~ " fetch=\"join|select|subselect\"\n"
-#~ " batch-size=\"N\"\n"
-#~ " access=\"field|property|ClassName\"\n"
-#~ " optimistic-lock=\"true|false\"\n"
-#~ " mutable=\"true|false\"\n"
-#~ " node=\"element-name|.\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ ">\n"
-#~ "\n"
-#~ " <key .... />\n"
-#~ " <map-key .... />\n"
-#~ " <element .... />\n"
-#~ "</map>]]>"
+#~ "所有的集合映射,除了 set 和 bag 语义的以外,都需要指定一个集合表的"
+#~ "<emphasis>索引字段(index column)</emphasis> — 用于对应到数组索引,或者 "
+#~ "<literal>List</literal> 的索引,或者 <literal>Map</literal> 的关键字。通"
+#~ "过 <literal><map-key></literal>,<literal>Map</literal> 的索引可以是"
+#~ "任何基础类型;若通过 <literal><map-key-many-to-many></literal>,它也"
+#~ "可以是一个实体引用;若通过 <literal><composite-map-key></literal>,"
+#~ "它还可以是一个组合类型。数组或列表的索引必须是 <literal>integer</literal> "
+#~ "类型,并且使用 <literal><list-index></literal> 元素定义映射。被映射"
+#~ "的字段包含有顺序排列的整数(默认从 0 开始)。 "
-#~ msgid "<![CDATA[<key column=\"productSerialNumber\" not-null=\"true\"/>]]>"
-#~ msgstr "<![CDATA[<key column=\"productSerialNumber\" not-null=\"true\"/>]]>"
+#~ msgid ""
+#~ "Any collection of values or many-to-many associations requires a "
+#~ "dedicated <emphasis>collection table</emphasis> with a foreign key column "
+#~ "or columns, <emphasis>collection element column</emphasis> or columns, "
+#~ "and possibly an index column or columns."
+#~ msgstr ""
+#~ "任何值集合或者多对多关联需要专用的具有一个或多个外键字段的 "
+#~ "<emphasis>collection table</emphasis>、一个或多个 <emphasis>collection "
+#~ "element column</emphasis>,以及还可能有一个或多个索引字段。 "
#~ msgid ""
-#~ "<![CDATA[<key column=\"productSerialNumber\" on-delete=\"cascade\"/>]]>"
+#~ "A <emphasis>many-to-many association</emphasis> is specified using the "
+#~ "<literal><many-to-many></literal> element."
#~ msgstr ""
-#~ "<![CDATA[<key column=\"productSerialNumber\" on-delete=\"cascade\"/>]]>"
+#~ "用 <literal><many-to-many></literal> 元素指定 <emphasis>many-to-"
+#~ "many association</emphasis>。"
#~ msgid ""
+#~ "<literal>column</literal> (optional): the name of the element foreign key "
+#~ "column."
+#~ msgstr "<literal>column</literal>(必需):元素外键字段的名称。 "
+
+#~ msgid ""
+#~ "<literal>formula</literal> (optional): an SQL formula used to evaluate "
+#~ "the element foreign key value."
+#~ msgstr ""
+#~ "<literal>formula</literal>(可选):用于对元素外键值求值的 SQL 公式。"
+
+#~ msgid ""
+#~ "<literal>fetch</literal> (optional - defaults to <literal>join</"
+#~ "literal>): enables outer-join or sequential select fetching for this "
+#~ "association. This is a special case; for full eager fetching in a single "
+#~ "<literal>SELECT</literal> of an entity and its many-to-many relationships "
+#~ "to other entities, you would enable <literal>join</literal> fetching,not "
+#~ "only of the collection itself, but also with this attribute on the "
+#~ "<literal><many-to-many></literal> nested element."
+#~ msgstr ""
+#~ "<literal>fetch</literal>(可选 - 缺省为 <literal>join</literal>): 为这个"
+#~ "关联启用外连接或序列性选择抓取。这是一个特例。对于在单个 <literal>SELECT</"
+#~ "literal> 里进行完全的 eager fetching 以及使 <literal><many-to-many>"
+#~ "</literal> n用多对多关联,你可以启用 <literal>join</literal> fetching,这"
+#~ "不仅是对于集合本身,也对 <literal><many-to-many></literal> 嵌套元素"
+#~ "的属性。"
+
+#~ msgid ""
+#~ "<literal>unique</literal> (optional): enables the DDL generation of a "
+#~ "unique constraint for the foreign-key column. This makes the association "
+#~ "multiplicity effectively one-to-many."
+#~ msgstr ""
+#~ "<literal>unique</literal>(可选):未外键字段启用唯一约束的 DDL 生成。这使"
+#~ "得关联一对多的多样性更为有效。"
+
+#~ msgid ""
+#~ "<literal>not-found</literal> (optional - defaults to <literal>exception</"
+#~ "literal>): specifies how foreign keys that reference missing rows will be "
+#~ "handled: <literal>ignore</literal> will treat a missing row as a null "
+#~ "association."
+#~ msgstr ""
+#~ "<literal>not-found</literal>(可选 - 默认为 <literal>exception</"
+#~ "literal>):指明若缓存的标示值关联的行缺失,该如何处理:<literal>ignore</"
+#~ "literal> 会把缺失的行作为一个空关联处理。 "
+
+#~ msgid ""
+#~ "<literal>property-ref</literal> (optional): the name of a property of the "
+#~ "associated class that is joined to this foreign key. If not specified, "
+#~ "the primary key of the associated class is used."
+#~ msgstr ""
+#~ "<literal>property-ref</literal>(可选):连接至这个外键的关联类的属性名"
+#~ "称。如果未指定,关联类的主键将被使用。"
+
+#~ msgid "Here are some examples."
+#~ msgstr "下面是一些例子:"
+
+#~ msgid "A set of strings:"
+#~ msgstr "一系列字符串:"
+
+#~ msgid ""
+#~ "A bag containing integers with an iteration order determined by the "
+#~ "<literal>order-by</literal> attribute:"
+#~ msgstr ""
+#~ "包含一组整数的 bag(还设置了 <literal>order-by</literal> 参数指定了迭代的"
+#~ "顺序): "
+
+#~ msgid "An array of entities, in this case, a many-to-many association:"
+#~ msgstr ""
+#~ "一个实体数组,在这个案例中是一个多对多的关联(注意这里的实体是自动管理生命"
+#~ "周期的对象(lifecycle objects),<literal>cascade=\"all\"</literal>): "
+
+#~ msgid "A map from string indices to dates:"
+#~ msgstr "一个 map,通过字符串的索引来指明日期:"
+
+#~ msgid "A list of components (this is discussed in the next chapter):"
+#~ msgstr "一个组件的列表:(将在下一章讨论)"
+
+#~ msgid "One-to-many associations"
+#~ msgstr "一对多关联(One-to-many Associations)"
+
+#~ msgid ""
+#~ "A <emphasis>one-to-many association</emphasis> links the tables of two "
+#~ "classes via a foreign key with no intervening collection table. This "
+#~ "mapping loses certain semantics of normal Java collections:"
+#~ msgstr ""
+#~ "<emphasis>一对多关联</emphasis><emphasis>通过外键</emphasis>连接两个类对应"
+#~ "的表,而没有中间集合表。 这个关系模型失去了一些 Java 集合的语义:"
+
+#~ msgid ""
+#~ "The following example shows a map of <literal>Part</literal> entities by "
+#~ "name, where <literal>partName</literal> is a persistent property of "
+#~ "<literal>Part</literal>. Notice the use of a formula-based index:"
+#~ msgstr ""
+#~ "下面的例子展示一个 <literal>Part</literal> 实体的 map,把 name 作为关键"
+#~ "字。( <literal>partName</literal> 是 <literal>Part</literal> 的持久化属"
+#~ "性)。注意其中的基于公式的索引的用法。 "
+
+#~ msgid ""
+#~ "Hibernate supports collections implementing <literal>java.util.SortedMap</"
+#~ "literal> and <literal>java.util.SortedSet</literal>. You must specify a "
+#~ "comparator in the mapping file:"
+#~ msgstr ""
+#~ "Hibernate 支持实现 <literal>java.util.SortedMap</literal> 和 "
+#~ "<literal>java.util.SortedSet</literal> 的集合。你必须在映射文件中指定一个"
+#~ "比较器:"
+
+#~ msgid ""
+#~ "A final alternative is to use composite elements, which will be discussed "
+#~ "later."
+#~ msgstr "最后一种选择是使用复合元素,我们会在后面讨论。"
+
+#~ msgid ""
+#~ "Even more complex association mappings are covered in the next chapter."
+#~ msgstr "甚至可能出现更加复杂的关联映射,我们会在下一章中列出所有可能性。 "
+
+#~ msgid ""
#~ "<programlistingco> <areaspec> <area id=\"index1\" coords=\"2 45\"/> <area "
#~ "id=\"index2\" coords=\"3 45\"/> </areaspec> <programlisting><![CDATA"
#~ "[<list-index \n"
@@ -1046,23 +3570,6 @@
#~ "</list>]]>"
#~ msgid ""
-#~ "<![CDATA[<one-to-many \n"
-#~ " class=\"ClassName\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " />]]>"
-#~ msgstr ""
-#~ "<![CDATA[<one-to-many \n"
-#~ " class=\"ClassName\"\n"
-#~ " not-found=\"ignore|exception\"\n"
-#~ " entity-name=\"EntityName\"\n"
-#~ " node=\"element-name\"\n"
-#~ " embed-xml=\"true|false\"\n"
-#~ " />]]>"
-
-#~ msgid ""
#~ "<![CDATA[<map name=\"parts\"\n"
#~ " cascade=\"all\">\n"
#~ " <key column=\"productId\" not-null=\"true\"/>\n"
@@ -1078,258 +3585,6 @@
#~ "</map>]]>"
#~ msgid ""
-#~ "<![CDATA[<set name=\"aliases\" \n"
-#~ " table=\"person_aliases\" \n"
-#~ " sort=\"natural\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date\" type=\"date\"/>\n"
-#~ "</map>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<set name=\"aliases\" \n"
-#~ " table=\"person_aliases\" \n"
-#~ " sort=\"natural\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date\" type=\"date\"/>\n"
-#~ "</map>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower"
-#~ "(name) asc\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date type=\"date\"/>\n"
-#~ "</map>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower"
-#~ "(name) asc\">\n"
-#~ " <key column=\"person\"/>\n"
-#~ " <element column=\"name\" type=\"string\"/>\n"
-#~ "</set>\n"
-#~ "\n"
-#~ "<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n"
-#~ " <key column=\"year_id\"/>\n"
-#~ " <map-key column=\"hol_name\" type=\"string\"/>\n"
-#~ " <element column=\"hol_date type=\"date\"/>\n"
-#~ "</map>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[sortedUsers = s.createFilter( group.getUsers(), \"order by this."
-#~ "name\" ).list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[sortedUsers = s.createFilter( group.getUsers(), \"order by this."
-#~ "name\" ).list();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Category\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
-#~ " <key column=\"CATEGORY_ID\"/>\n"
-#~ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Item\">\n"
-#~ " <id name=\"id\" column=\"ITEM_ID\"/>\n"
-#~ " ...\n"
-#~ "\n"
-#~ " <!-- inverse end -->\n"
-#~ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"
-#~ " <key column=\"ITEM_ID\"/>\n"
-#~ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Category\">\n"
-#~ " <id name=\"id\" column=\"CATEGORY_ID\"/>\n"
-#~ " ...\n"
-#~ " <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"
-#~ " <key column=\"CATEGORY_ID\"/>\n"
-#~ " <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Item\">\n"
-#~ " <id name=\"id\" column=\"ITEM_ID\"/>\n"
-#~ " ...\n"
-#~ "\n"
-#~ " <!-- inverse end -->\n"
-#~ " <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"
-#~ " <key column=\"ITEM_ID\"/>\n"
-#~ " <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"
-#~ " </bag>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "category.getItems().add(item); // The category now \"knows\" "
-#~ "about the relationship\n"
-#~ "item.getCategories().add(category); // The item now \"knows\" about "
-#~ "the relationship\n"
-#~ "\n"
-#~ "session.persist(item); // The relationship won't be "
-#~ "saved!\n"
-#~ "session.persist(category); // The relationship will be "
-#~ "saved]]>"
-#~ msgstr ""
-#~ "<![CDATA[\n"
-#~ "category.getItems().add(item); // The category now \"knows\" "
-#~ "about the relationship\n"
-#~ "item.getCategories().add(category); // The item now \"knows\" about "
-#~ "the relationship\n"
-#~ "\n"
-#~ "session.persist(item); // The relationship won't be "
-#~ "saved!\n"
-#~ "session.persist(category); // The relationship will be "
-#~ "saved]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <property name=\"name\" \n"
-#~ " not-null=\"true\"/>\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <property name=\"name\" \n"
-#~ " not-null=\"true\"/>\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\">\n"
-#~ " <key column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " insert=\"false\"\n"
-#~ " update=\"false\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Parent\">\n"
-#~ " <id name=\"id\" column=\"parent_id\"/>\n"
-#~ " ....\n"
-#~ " <map name=\"children\">\n"
-#~ " <key column=\"parent_id\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ " <map-key column=\"name\" \n"
-#~ " type=\"string\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </map>\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Child\">\n"
-#~ " <id name=\"id\" column=\"child_id\"/>\n"
-#~ " ....\n"
-#~ " <many-to-one name=\"parent\" \n"
-#~ " class=\"Parent\" \n"
-#~ " column=\"parent_id\"\n"
-#~ " insert=\"false\"\n"
-#~ " update=\"false\"\n"
-#~ " not-null=\"true\"/>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
#~ "<![CDATA[<map name=\"contracts\">\n"
#~ " <key column=\"employer_id\" not-null=\"true\"/>\n"
#~ " <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n"
@@ -1356,23 +3611,6 @@
#~ "</map>]]>"
#~ msgid ""
-#~ "<![CDATA[<idbag name=\"lovers\" table=\"LOVERS\">\n"
-#~ " <collection-id column=\"ID\" type=\"long\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </collection-id>\n"
-#~ " <key column=\"PERSON1\"/>\n"
-#~ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/>\n"
-#~ "</idbag>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<idbag name=\"lovers\" table=\"LOVERS\">\n"
-#~ " <collection-id column=\"ID\" type=\"long\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </collection-id>\n"
-#~ " <key column=\"PERSON1\"/>\n"
-#~ " <many-to-many column=\"PERSON2\" class=\"Person\" fetch=\"join\"/>\n"
-#~ "</idbag>]]>"
-
-#~ msgid ""
#~ "<![CDATA[package eg;\n"
#~ "import java.util.Set;\n"
#~ "\n"
@@ -1406,226 +3644,3 @@
#~ " ....\n"
#~ " ....\n"
#~ "}]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255), "
-#~ "parent_id bigint )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-#~ msgstr ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255), "
-#~ "parent_id bigint )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
-#~ "\" not-null=\"true\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" inverse=\"true\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " <many-to-one name=\"parent\" class=\"Parent\" column=\"parent_id"
-#~ "\" not-null=\"true\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null\n"
-#~ " primary key,\n"
-#~ " name varchar(255),\n"
-#~ " parent_id bigint not null )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-#~ msgstr ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null\n"
-#~ " primary key,\n"
-#~ " name varchar(255),\n"
-#~ " parent_id bigint not null )\n"
-#~ "alter table child add constraint childfk0 (parent_id) references parent]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\">\n"
-#~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
-#~ " <one-to-many class=\"Child\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" table=\"childset\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"Parent\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <set name=\"children\" table=\"childset\">\n"
-#~ " <key column=\"parent_id\"/>\n"
-#~ " <many-to-many class=\"Child\" column=\"child_id\"/>\n"
-#~ " </set>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ " <class name=\"Child\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255) )\n"
-#~ "create table childset ( parent_id bigint not null,\n"
-#~ " child_id bigint not null,\n"
-#~ " primary key ( parent_id, child_id ) )\n"
-#~ "alter table childset add constraint childsetfk0 (parent_id) references "
-#~ "parent\n"
-#~ "alter table childset add constraint childsetfk1 (child_id) references "
-#~ "child]]>"
-#~ msgstr ""
-#~ "<![CDATA[create table parent ( id bigint not null primary key )\n"
-#~ "create table child ( id bigint not null primary key, name varchar(255) )\n"
-#~ "create table childset ( parent_id bigint not null,\n"
-#~ " child_id bigint not null,\n"
-#~ " primary key ( parent_id, child_id ) )\n"
-#~ "alter table childset add constraint childsetfk0 (parent_id) references "
-#~ "parent\n"
-#~ "alter table childset add constraint childsetfk1 (child_id) references "
-#~ "child]]>"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/configuration.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/configuration.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/configuration.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 09:03+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -15,1965 +15,3282 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr "配置"
#. Tag: para
+#: configuration.xml:33
#, no-c-format
-msgid "Hibernate is designed to operate in many different environments and, as such, there is a broad range of configuration parameters. Fortunately, most have sensible default values and Hibernate is distributed with an example <literal>hibernate.properties</literal> file in <literal>etc/</literal> that displays the various options. Simply put the example file in your classpath and customize it to suit your needs."
-msgstr "由于 Hibernate 是为了能在各种不同环境下工作而设计的,因此存在着大量的配置参数。幸运的是多数配置参数都有比较直观的默认值,并有随 Hibernate 一同分发的配置样例 <literal>hibernate.properties</literal>(位于 <literal>etc/</literal>)来展示各种配置选项。所需做的仅仅是将这个样例文件复制到类路径(classpath)下并进行定制。"
+msgid ""
+"Hibernate is designed to operate in many different environments and, as "
+"such, there is a broad range of configuration parameters. Fortunately, most "
+"have sensible default values and Hibernate is distributed with an example "
+"<literal>hibernate.properties</literal> file in <literal>etc/</literal> that "
+"displays the various options. Simply put the example file in your classpath "
+"and customize it to suit your needs."
+msgstr ""
+"由于 Hibernate 是为了能在各种不同环境下工作而设计的,因此存在着大量的配置参"
+"数。幸运的是多数配置参数都有比较直观的默认值,并有随 Hibernate 一同分发的配置"
+"样例 <literal>hibernate.properties</literal>(位于 <literal>etc/</literal>)"
+"来展示各种配置选项。所需做的仅仅是将这个样例文件复制到类路径(classpath)下并"
+"进行定制。"
#. Tag: title
+#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr "可编程的配置方式"
#. Tag: para
+#: configuration.xml:43
#, no-c-format
-msgid "An instance of <classname>org.hibernate.cfg.Configuration</classname> represents an entire set of mappings of an application's Java types to an SQL database. The <classname>org.hibernate.cfg.Configuration</classname> is used to build an immutable <interfacename>org.hibernate.SessionFactory</interfacename>. The mappings are compiled from various XML mapping files."
-msgstr "<literal>org.hibernate.cfg.Configuration</literal> 实例代表了一个应用程序中 Java 类型到SQL数据库映射的完整集合。<classname>org.hibernate.cfg.Configuration</classname> 被用来构建一个(不可变的(immutable))<interfacename>org.hibernate.SessionFactory</interfacename>。映射定义则由不同的 XML 映射定义文件编译而来。"
+msgid ""
+"An instance of <classname>org.hibernate.cfg.Configuration</classname> "
+"represents an entire set of mappings of an application's Java types to an "
+"SQL database. The <classname>org.hibernate.cfg.Configuration</classname> is "
+"used to build an immutable <interfacename>org.hibernate.SessionFactory</"
+"interfacename>. The mappings are compiled from various XML mapping files."
+msgstr ""
+"<literal>org.hibernate.cfg.Configuration</literal> 实例代表了一个应用程序中 "
+"Java 类型到SQL数据库映射的完整集合。<classname>org.hibernate.cfg."
+"Configuration</classname> 被用来构建一个(不可变的(immutable))"
+"<interfacename>org.hibernate.SessionFactory</interfacename>。映射定义则由不同"
+"的 XML 映射定义文件编译而来。"
#. Tag: para
+#: configuration.xml:51
#, no-c-format
-msgid "You can obtain a <classname>org.hibernate.cfg.Configuration</classname> instance by instantiating it directly and specifying XML mapping documents. If the mapping files are in the classpath, use <literal>addResource()</literal>. For example:"
-msgstr "你可以直接实例化 <classname>org.hibernate.cfg.Configuration</classname> 来获取一个实例,并为它指定 XML 映射定义文件。如果映射定义文件在类路径(classpath)中,请使用 <literal>addResource()</literal>。例如:"
+msgid ""
+"You can obtain a <classname>org.hibernate.cfg.Configuration</classname> "
+"instance by instantiating it directly and specifying XML mapping documents. "
+"If the mapping files are in the classpath, use <literal>addResource()</"
+"literal>. For example:"
+msgstr ""
+"你可以直接实例化 <classname>org.hibernate.cfg.Configuration</classname> 来获"
+"取一个实例,并为它指定 XML 映射定义文件。如果映射定义文件在类路径"
+"(classpath)中,请使用 <literal>addResource()</literal>。例如:"
+#. Tag: programlisting
+#: configuration.xml:57
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");"
+msgstr ""
+"<![CDATA[Configuration cfg = new Configuration()\n"
+" .addResource(\"Item.hbm.xml\")\n"
+" .addResource(\"Bid.hbm.xml\");]]>"
+
#. Tag: para
+#: configuration.xml:59
#, no-c-format
-msgid "An alternative way is to specify the mapped class and allow Hibernate to find the mapping document for you:"
-msgstr "一个替代方法(有时是更好的选择)是,指定被映射的类,让 Hibernate 帮你寻找映射定义文件: "
+msgid ""
+"An alternative way is to specify the mapped class and allow Hibernate to "
+"find the mapping document for you:"
+msgstr ""
+"一个替代方法(有时是更好的选择)是,指定被映射的类,让 Hibernate 帮你寻找映射"
+"定义文件: "
+#. Tag: programlisting
+#: configuration.xml:62
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);"
+msgstr ""
+"<![CDATA[Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class);]]>"
+
#. Tag: para
+#: configuration.xml:64
#, no-c-format
-msgid "Hibernate will then search for mapping files named <filename>/org/hibernate/auction/Item.hbm.xml</filename> and <filename>/org/hibernate/auction/Bid.hbm.xml</filename> in the classpath. This approach eliminates any hardcoded filenames."
-msgstr "Hibernate 将会在类路径(classpath)中寻找名字为 <filename>/org/hibernate/auction/Item.hbm.xml</filename> 和 <filename>/org/hibernate/auction/Bid.hbm.xml</filename> 映射定义文件。这种方式消除了任何对文件名的硬编码(hardcoded)。"
+msgid ""
+"Hibernate will then search for mapping files named <filename>/org/hibernate/"
+"auction/Item.hbm.xml</filename> and <filename>/org/hibernate/auction/Bid.hbm."
+"xml</filename> in the classpath. This approach eliminates any hardcoded "
+"filenames."
+msgstr ""
+"Hibernate 将会在类路径(classpath)中寻找名字为 <filename>/org/hibernate/"
+"auction/Item.hbm.xml</filename> 和 <filename>/org/hibernate/auction/Bid.hbm."
+"xml</filename> 映射定义文件。这种方式消除了任何对文件名的硬编码"
+"(hardcoded)。"
#. Tag: para
+#: configuration.xml:69
#, no-c-format
-msgid "A <classname>org.hibernate.cfg.Configuration</classname> also allows you to specify configuration properties. For example:"
-msgstr "<classname>org.hibernate.cfg.Configuration</classname>> 也允许你指定配置属性。例如:"
+msgid ""
+"A <classname>org.hibernate.cfg.Configuration</classname> also allows you to "
+"specify configuration properties. For example:"
+msgstr ""
+"<classname>org.hibernate.cfg.Configuration</classname>> 也允许你指定配置属"
+"性。例如:"
+#. Tag: programlisting
+#: configuration.xml:72
+#, fuzzy, no-c-format
+msgid ""
+"Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");"
+msgstr ""
+"<![CDATA[Configuration cfg = new Configuration()\n"
+" .addClass(org.hibernate.auction.Item.class)\n"
+" .addClass(org.hibernate.auction.Bid.class)\n"
+" .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
+"MySQLInnoDBDialect\")\n"
+" .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/"
+"test\")\n"
+" .setProperty(\"hibernate.order_updates\", \"true\");]]>"
+
#. Tag: para
+#: configuration.xml:74
#, no-c-format
-msgid "This is not the only way to pass configuration properties to Hibernate. Some alternative options include:"
+msgid ""
+"This is not the only way to pass configuration properties to Hibernate. Some "
+"alternative options include:"
msgstr "当然这不是唯一的传递 Hibernate 配置属性的方式,其他可选方式还包括: "
#. Tag: para
+#: configuration.xml:79
#, no-c-format
-msgid "Pass an instance of <classname>java.util.Properties</classname> to <literal>Configuration.setProperties()</literal>."
-msgstr "传一个 <classname>java.util.Properties</classname> 实例给 <literal>Configuration.setProperties()</literal>。"
+msgid ""
+"Pass an instance of <classname>java.util.Properties</classname> to "
+"<literal>Configuration.setProperties()</literal>."
+msgstr ""
+"传一个 <classname>java.util.Properties</classname> 实例给 "
+"<literal>Configuration.setProperties()</literal>。"
#. Tag: para
+#: configuration.xml:84
#, no-c-format
-msgid "Place a file named <filename>hibernate.properties</filename> in a root directory of the classpath."
-msgstr "将 <filename>hibernate.properties</filename> 放置在类路径(classpath)的根目录下(root directory)。"
+msgid ""
+"Place a file named <filename>hibernate.properties</filename> in a root "
+"directory of the classpath."
+msgstr ""
+"将 <filename>hibernate.properties</filename> 放置在类路径(classpath)的根目"
+"录下(root directory)。"
#. Tag: para
+#: configuration.xml:89
#, no-c-format
-msgid "Set <literal>System</literal> properties using <literal>java -Dproperty=value</literal>."
-msgstr "通过 <literal>java -Dproperty=value</literal> 来设置系统(<literal>System</literal>)属性。"
+msgid ""
+"Set <literal>System</literal> properties using <literal>java -"
+"Dproperty=value</literal>."
+msgstr ""
+"通过 <literal>java -Dproperty=value</literal> 来设置系统(<literal>System</"
+"literal>)属性。"
#. Tag: para
+#: configuration.xml:94
#, no-c-format
-msgid "Include <literal><property></literal> elements in <literal>hibernate.cfg.xml</literal> (this is discussed later)."
-msgstr "在 <literal>hibernate.cfg.xml</literal> 中加入元素 <literal><property></literal>(稍后讨论)。 "
+msgid ""
+"Include <literal><property></literal> elements in <literal>hibernate."
+"cfg.xml</literal> (this is discussed later)."
+msgstr ""
+"在 <literal>hibernate.cfg.xml</literal> 中加入元素 <literal><property>"
+"</literal>(稍后讨论)。 "
#. Tag: para
+#: configuration.xml:99
#, no-c-format
-msgid "If you want to get started quickly<filename>hibernate.properties</filename> is the easiest approach."
-msgstr "如果你想快速上路,<filename>hibernate.properties</filename> 就是最容易的途径。"
+msgid ""
+"If you want to get started quickly<filename>hibernate.properties</filename> "
+"is the easiest approach."
+msgstr ""
+"如果你想快速上路,<filename>hibernate.properties</filename> 就是最容易的途"
+"径。"
#. Tag: para
+#: configuration.xml:103
#, no-c-format
-msgid "The <classname>org.hibernate.cfg.Configuration</classname> is intended as a startup-time object that will be discarded once a <literal>SessionFactory</literal> is created."
-msgstr "<classname>org.hibernate.cfg.Configuration</classname> 实例被设计成启动期间(startup-time)对象,一旦 <literal>SessionFactory</literal> 创建完成它就被丢弃了。"
+msgid ""
+"The <classname>org.hibernate.cfg.Configuration</classname> is intended as a "
+"startup-time object that will be discarded once a <literal>SessionFactory</"
+"literal> is created."
+msgstr ""
+"<classname>org.hibernate.cfg.Configuration</classname> 实例被设计成启动期间"
+"(startup-time)对象,一旦 <literal>SessionFactory</literal> 创建完成它就被丢"
+"弃了。"
#. Tag: title
+#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr "获得 SessionFactory"
#. Tag: para
+#: configuration.xml:111
#, no-c-format
-msgid "When all mappings have been parsed by the <classname>org.hibernate.cfg.Configuration</classname>, the application must obtain a factory for <interfacename>org.hibernate.Session</interfacename> instances. This factory is intended to be shared by all application threads:"
-msgstr "当所有映射定义被 <classname>org.hibernate.cfg.Configuration</classname> 解析后,应用程序必须获得一个用于构造 <interfacename>org.hibernate.Session</interfacename> 实例的工厂。这个工厂将被应用程序的所有线程共享:"
+msgid ""
+"When all mappings have been parsed by the <classname>org.hibernate.cfg."
+"Configuration</classname>, the application must obtain a factory for "
+"<interfacename>org.hibernate.Session</interfacename> instances. This factory "
+"is intended to be shared by all application threads:"
+msgstr ""
+"当所有映射定义被 <classname>org.hibernate.cfg.Configuration</classname> 解析"
+"后,应用程序必须获得一个用于构造 <interfacename>org.hibernate.Session</"
+"interfacename> 实例的工厂。这个工厂将被应用程序的所有线程共享:"
+#. Tag: programlisting
+#: configuration.xml:117
+#, fuzzy, no-c-format
+msgid "SessionFactory sessions = cfg.buildSessionFactory();"
+msgstr "<![CDATA[SessionFactory sessions = cfg.buildSessionFactory();]]>"
+
#. Tag: para
+#: configuration.xml:119
#, no-c-format
-msgid "Hibernate does allow your application to instantiate more than one <interfacename>org.hibernate.SessionFactory</interfacename>. This is useful if you are using more than one database."
-msgstr "Hibernate 允许你的应用程序创建多个 <interfacename>org.hibernate.SessionFactory</interfacename> 实例。这对 使用多个数据库的应用来说很有用。"
+msgid ""
+"Hibernate does allow your application to instantiate more than one "
+"<interfacename>org.hibernate.SessionFactory</interfacename>. This is useful "
+"if you are using more than one database."
+msgstr ""
+"Hibernate 允许你的应用程序创建多个 <interfacename>org.hibernate."
+"SessionFactory</interfacename> 实例。这对 使用多个数据库的应用来说很有用。"
#. Tag: title
+#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr "JDBC 连接"
#. Tag: para
+#: configuration.xml:127
#, no-c-format
-msgid "It is advisable to have the <interfacename>org.hibernate.SessionFactory</interfacename> create and pool JDBC connections for you. If you take this approach, opening a <interfacename>org.hibernate.Session</interfacename> is as simple as:"
-msgstr "通常你希望 <interfacename>org.hibernate.SessionFactory</interfacename> 来为你创建和缓存(pool)JDBC 连接。如果你采用这种方式,只需要如下例所示那样,打开一个 <interfacename>org.hibernate.Session</interfacename>:"
+msgid ""
+"It is advisable to have the <interfacename>org.hibernate.SessionFactory</"
+"interfacename> create and pool JDBC connections for you. If you take this "
+"approach, opening a <interfacename>org.hibernate.Session</interfacename> is "
+"as simple as:"
+msgstr ""
+"通常你希望 <interfacename>org.hibernate.SessionFactory</interfacename> 来为"
+"你创建和缓存(pool)JDBC 连接。如果你采用这种方式,只需要如下例所示那样,打开"
+"一个 <interfacename>org.hibernate.Session</interfacename>:"
+#. Tag: programlisting
+#: configuration.xml:133
+#, fuzzy, no-c-format
+msgid "Session session = sessions.openSession(); // open a new Session"
+msgstr ""
+"<![CDATA[Session session = sessions.openSession(); // open a new Session]]>"
+
#. Tag: para
+#: configuration.xml:135
#, no-c-format
-msgid "Once you start a task that requires access to the database, a JDBC connection will be obtained from the pool."
-msgstr "一旦你需要进行数据访问时,就会从连接池(connection pool)获得一个 JDBC 连接。 "
+msgid ""
+"Once you start a task that requires access to the database, a JDBC "
+"connection will be obtained from the pool."
+msgstr ""
+"一旦你需要进行数据访问时,就会从连接池(connection pool)获得一个 JDBC 连"
+"接。 "
#. Tag: para
+#: configuration.xml:138
#, no-c-format
-msgid "Before you can do this, you first need to pass some JDBC connection properties to Hibernate. All Hibernate property names and semantics are defined on the class <classname>org.hibernate.cfg.Environment</classname>. The most important settings for JDBC connection configuration are outlined below."
-msgstr "为了使这种方式工作起来,我们需要向 Hibernate 传递一些 JDBC 连接的属性。所有 Hibernate 属性的名字和语义都在 <classname>org.hibernate.cfg.Environment</classname> 中定义。我们现在将描述 JDBC 连接配置中最重要的设置。"
+msgid ""
+"Before you can do this, you first need to pass some JDBC connection "
+"properties to Hibernate. All Hibernate property names and semantics are "
+"defined on the class <classname>org.hibernate.cfg.Environment</classname>. "
+"The most important settings for JDBC connection configuration are outlined "
+"below."
+msgstr ""
+"为了使这种方式工作起来,我们需要向 Hibernate 传递一些 JDBC 连接的属性。所有 "
+"Hibernate 属性的名字和语义都在 <classname>org.hibernate.cfg.Environment</"
+"classname> 中定义。我们现在将描述 JDBC 连接配置中最重要的设置。"
#. Tag: para
+#: configuration.xml:144
#, no-c-format
-msgid "Hibernate will obtain and pool connections using <classname>java.sql.DriverManager</classname> if you set the following properties:"
-msgstr "如果你设置如下属性,Hibernate 将使用 <classname>java.sql.DriverManager</classname> 来获得(和缓存)JDBC 连接:"
+msgid ""
+"Hibernate will obtain and pool connections using <classname>java.sql."
+"DriverManager</classname> if you set the following properties:"
+msgstr ""
+"如果你设置如下属性,Hibernate 将使用 <classname>java.sql.DriverManager</"
+"classname> 来获得(和缓存)JDBC 连接:"
#. Tag: title
+#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr "Hibernate JDBC 属性"
#. Tag: entry
+#: configuration.xml:158 configuration.xml:236 configuration.xml:327
+#: configuration.xml:495 configuration.xml:657 configuration.xml:753
+#: configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr "属性名"
#. Tag: entry
+#: configuration.xml:160 configuration.xml:238 configuration.xml:329
+#: configuration.xml:497 configuration.xml:659 configuration.xml:755
+#: configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr "用途"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.driver_class</property>"
+#. Tag: property
+#: configuration.xml:166
+#, fuzzy, no-c-format
+msgid "hibernate.connection.driver_class"
msgstr "<property>hibernate.connection.driver_class</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>JDBC driver class</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:168
+#, fuzzy, no-c-format
+msgid "JDBC driver class"
msgstr "<emphasis>JDBC 驱动类</emphasis>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.url</property>"
+#. Tag: property
+#: configuration.xml:172
+#, fuzzy, no-c-format
+msgid "hibernate.connection.url"
msgstr "<property>hibernate.connection.url</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:174
#, no-c-format
-msgid "<emphasis>JDBC URL</emphasis>"
-msgstr "<emphasis>JDBC URL</emphasis>"
+msgid "JDBC URL"
+msgstr "JDBC URL"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.username</property>"
+#. Tag: property
+#: configuration.xml:178 configuration.xml:265
+#, fuzzy, no-c-format
+msgid "hibernate.connection.username"
msgstr "<property>hibernate.connection.username</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:180
#, no-c-format
-msgid "<emphasis>database user</emphasis>"
-msgstr "<emphasis>数据库用户</emphasis>(可选) "
+msgid "database user"
+msgstr "database user"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.password</property>"
+#. Tag: property
+#: configuration.xml:184 configuration.xml:271
+#, fuzzy, no-c-format
+msgid "hibernate.connection.password"
msgstr "<property>hibernate.connection.password</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:186
#, no-c-format
-msgid "<emphasis>database user password</emphasis>"
-msgstr "<emphasis>数据库密码</emphasis>(可选) "
+msgid "database user password"
+msgstr "数据库用户密码"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.pool_size</property>"
+#. Tag: property
+#: configuration.xml:190
+#, fuzzy, no-c-format
+msgid "hibernate.connection.pool_size"
msgstr "<property>hibernate.connection.pool_size</property>"
-#. Tag: entry
-#, no-c-format
-msgid "<emphasis>maximum number of pooled connections</emphasis>"
+#. Tag: emphasis
+#: configuration.xml:192
+#, fuzzy, no-c-format
+msgid "maximum number of pooled connections"
msgstr "<emphasis>连接池容量上限数目</emphasis>"
#. Tag: para
+#: configuration.xml:199
#, no-c-format
-msgid "Hibernate's own connection pooling algorithm is, however, quite rudimentary. It is intended to help you get started and is <emphasis>not intended for use in a production system</emphasis>, or even for performance testing. You should use a third party pool for best performance and stability. Just replace the <property>hibernate.connection.pool_size</property> property with connection pool specific settings. This will turn off Hibernate's internal pool. For example, you might like to use c3p0."
-msgstr "但 Hibernate 自带的连接池算法相当不成熟。它只是为了让你快些上手<emphasis>,并不适合用于产品系统</emphasis>或性能测试中。 出于最佳性能和稳定性考虑你应该使用第三方的连接池。只需要用特定连接池的设置替换 <literal>hibernate.connection.pool_size</literal> 即可。这将关闭 Hibernate 自带的连接池。例如,你可能会想用 C3P0。 "
+msgid ""
+"Hibernate's own connection pooling algorithm is, however, quite rudimentary. "
+"It is intended to help you get started and is <emphasis>not intended for use "
+"in a production system</emphasis>, or even for performance testing. You "
+"should use a third party pool for best performance and stability. Just "
+"replace the <property>hibernate.connection.pool_size</property> property "
+"with connection pool specific settings. This will turn off Hibernate's "
+"internal pool. For example, you might like to use c3p0."
+msgstr ""
+"但 Hibernate 自带的连接池算法相当不成熟。它只是为了让你快些上手<emphasis>,并"
+"不适合用于产品系统</emphasis>或性能测试中。 出于最佳性能和稳定性考虑你应该使"
+"用第三方的连接池。只需要用特定连接池的设置替换 <literal>hibernate.connection."
+"pool_size</literal> 即可。这将关闭 Hibernate 自带的连接池。例如,你可能会想"
+"用 C3P0。 "
#. Tag: para
+#: configuration.xml:208
#, no-c-format
-msgid "C3P0 is an open source JDBC connection pool distributed along with Hibernate in the <filename>lib</filename> directory. Hibernate will use its <classname>org.hibernate.connection.C3P0ConnectionProvider</classname> for connection pooling if you set <property>hibernate.c3p0.*</property> properties. If you would like to use Proxool, refer to the packaged <filename>hibernate.properties</filename> and the Hibernate web site for more information."
-msgstr "C3P0 是一个随 Hibernate 一同分发的开源的 JDBC 连接池,它位于 <literal>lib</literal>目录下。 如果你设置了 <literal>hibernate.c3p0.*</literal> 相关的属性,Hibernate将使用 <literal>C3P0ConnectionProvider</literal> 来缓存 JDBC 连接。如果你更原意使用 Proxool,请参考发行包中的 <literal>hibernate.properties</literal> 并到 Hibernate 网站获取更多的信息。 "
+msgid ""
+"C3P0 is an open source JDBC connection pool distributed along with Hibernate "
+"in the <filename>lib</filename> directory. Hibernate will use its "
+"<classname>org.hibernate.connection.C3P0ConnectionProvider</classname> for "
+"connection pooling if you set <property>hibernate.c3p0.*</property> "
+"properties. If you would like to use Proxool, refer to the packaged "
+"<filename>hibernate.properties</filename> and the Hibernate web site for "
+"more information."
+msgstr ""
+"C3P0 是一个随 Hibernate 一同分发的开源的 JDBC 连接池,它位于 <literal>lib</"
+"literal>目录下。 如果你设置了 <literal>hibernate.c3p0.*</literal> 相关的属"
+"性,Hibernate将使用 <literal>C3P0ConnectionProvider</literal> 来缓存 JDBC 连"
+"接。如果你更原意使用 Proxool,请参考发行包中的 <literal>hibernate."
+"properties</literal> 并到 Hibernate 网站获取更多的信息。 "
#. Tag: para
+#: configuration.xml:216
#, no-c-format
-msgid "The following is an example <filename>hibernate.properties</filename> file for c3p0:"
-msgstr "这是一个使用 C3P0 的 <literal>hibernate.properties</literal> 样例文件: "
+msgid ""
+"The following is an example <filename>hibernate.properties</filename> file "
+"for c3p0:"
+msgstr ""
+"这是一个使用 C3P0 的 <literal>hibernate.properties</literal> 样例文件: "
+#. Tag: programlisting
+#: configuration.xml:219
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+"<![CDATA[hibernate.connection.driver_class = org.postgresql.Driver\n"
+"hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
+"hibernate.connection.username = myuser\n"
+"hibernate.connection.password = secret\n"
+"hibernate.c3p0.min_size=5\n"
+"hibernate.c3p0.max_size=20\n"
+"hibernate.c3p0.timeout=1800\n"
+"hibernate.c3p0.max_statements=50\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
+
#. Tag: para
+#: configuration.xml:221
#, no-c-format
-msgid "For use inside an application server, you should almost always configure Hibernate to obtain connections from an application server <interfacename>javax.sql.Datasource</interfacename> registered in JNDI. You will need to set at least one of the following properties:"
-msgstr "为了能在应用程序服务器(application server)中使用 Hibernate,应当总是将 Hibernate 配置成从注册在 JNDI 中的 <literal>Datasource</literal> 处获得连接,你至少需要设置下列属性中的一个: "
+msgid ""
+"For use inside an application server, you should almost always configure "
+"Hibernate to obtain connections from an application server "
+"<interfacename>javax.sql.Datasource</interfacename> registered in JNDI. You "
+"will need to set at least one of the following properties:"
+msgstr ""
+"为了能在应用程序服务器(application server)中使用 Hibernate,应当总是将 "
+"Hibernate 配置成从注册在 JNDI 中的 <literal>Datasource</literal> 处获得连接,"
+"你至少需要设置下列属性中的一个: "
#. Tag: title
+#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr "Hibernate 数据源属性"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.datasource</property>"
+#. Tag: property
+#: configuration.xml:244
+#, fuzzy, no-c-format
+msgid "hibernate.connection.datasource"
msgstr "<property>hibernate.connection.datasource</property>"
-#. Tag: entry
+#. Tag: emphasis
+#: configuration.xml:246
#, no-c-format
-msgid "<emphasis>datasource JNDI name</emphasis>"
-msgstr "<emphasis>数据库用户</emphasis>(可选) "
+msgid "datasource JNDI name"
+msgstr "数据源 JNDI 名字"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.url</property>"
+#. Tag: property
+#: configuration.xml:250
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.url"
msgstr "<property>hibernate.jndi.url</property>"
#. Tag: entry
+#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider</emphasis> (optional)"
msgstr "<emphasis>JNDI 提供者的 URL</emphasis>(可选)"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jndi.class</property>"
+#. Tag: property
+#: configuration.xml:257
+#, fuzzy, no-c-format
+msgid "hibernate.jndi.class"
msgstr "<property>hibernate.jndi.class</property>"
#. Tag: entry
+#: configuration.xml:259
#, no-c-format
-msgid "<emphasis>class of the JNDI <literal>InitialContextFactory</literal></emphasis> (optional)"
-msgstr "<emphasis>JNDI <literal>InitialContextFactory</literal> 类</emphasis>(可选)"
+msgid ""
+"<emphasis>class of the JNDI <literal>InitialContextFactory</literal></"
+"emphasis> (optional)"
+msgstr ""
+"<emphasis>JNDI <literal>InitialContextFactory</literal> 类</emphasis>(可选)"
#. Tag: entry
+#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user</emphasis> (optional)"
msgstr "<emphasis>数据库用户</emphasis>(可选)"
#. Tag: entry
+#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password</emphasis> (optional)"
msgstr "<emphasis>数据库密码</emphasis>(可选)"
#. Tag: para
+#: configuration.xml:280
#, no-c-format
-msgid "Here is an example <filename>hibernate.properties</filename> file for an application server provided JNDI datasource:"
-msgstr "这是一个使用应用程序服务器提供的 JNDI 数据源的 <literal>hibernate.properties</literal> 样例文件: "
+msgid ""
+"Here is an example <filename>hibernate.properties</filename> file for an "
+"application server provided JNDI datasource:"
+msgstr ""
+"这是一个使用应用程序服务器提供的 JNDI 数据源的 <literal>hibernate."
+"properties</literal> 样例文件: "
+#. Tag: programlisting
+#: configuration.xml:283
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
+msgstr ""
+"<![CDATA[hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
+"hibernate.transaction.factory_class = \\\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+"hibernate.transaction.manager_lookup_class = \\\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup\n"
+"hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
+
#. Tag: para
+#: configuration.xml:285
#, no-c-format
-msgid "JDBC connections obtained from a JNDI datasource will automatically participate in the container-managed transactions of the application server."
-msgstr "从 JNDI 数据源获得的 JDBC 连接将自动参与到应用程序服务器中容器管理的事务(container-managed transactions)中去。"
+msgid ""
+"JDBC connections obtained from a JNDI datasource will automatically "
+"participate in the container-managed transactions of the application server."
+msgstr ""
+"从 JNDI 数据源获得的 JDBC 连接将自动参与到应用程序服务器中容器管理的事务"
+"(container-managed transactions)中去。"
#. Tag: para
+#: configuration.xml:289
#, no-c-format
-msgid "Arbitrary connection properties can be given by prepending \"<literal>hibernate.connection</literal>\" to the connection property name. For example, you can specify a <property>charSet</property> connection property using <property>hibernate.connection.charSet</property>."
-msgstr "任何连接(connection)属性的属性名都要以 \"<literal>hibernate.connnection</literal>\" 开头。例如,你可能会使用 <literal>hibernate.connection.charSet</literal> 来指定 <property>charSet</property> 连接属性。 "
+msgid ""
+"Arbitrary connection properties can be given by prepending "
+"\"<literal>hibernate.connection</literal>\" to the connection property name. "
+"For example, you can specify a <property>charSet</property> connection "
+"property using <property>hibernate.connection.charSet</property>."
+msgstr ""
+"任何连接(connection)属性的属性名都要以 \"<literal>hibernate.connnection</"
+"literal>\" 开头。例如,你可能会使用 <literal>hibernate.connection.charSet</"
+"literal> 来指定 <property>charSet</property> 连接属性。 "
#. Tag: para
+#: configuration.xml:294
#, no-c-format
-msgid "You can define your own plugin strategy for obtaining JDBC connections by implementing the interface <interfacename>org.hibernate.connection.ConnectionProvider</interfacename>, and specifying your custom implementation via the <property>hibernate.connection.provider_class</property> property."
-msgstr "通过实现 <literal>org.hibernate.connection.ConnectionProvider</literal> 接口,你可以定义属于你自己的获得JDBC连接的插件策略。通过设置<literal>hibernate.connection.provider_class</literal>,你可以选择一个自定义的实现。 "
+msgid ""
+"You can define your own plugin strategy for obtaining JDBC connections by "
+"implementing the interface <interfacename>org.hibernate.connection."
+"ConnectionProvider</interfacename>, and specifying your custom "
+"implementation via the <property>hibernate.connection.provider_class</"
+"property> property."
+msgstr ""
+"通过实现 <literal>org.hibernate.connection.ConnectionProvider</literal> 接"
+"口,你可以定义属于你自己的获得JDBC连接的插件策略。通过设置<literal>hibernate."
+"connection.provider_class</literal>,你可以选择一个自定义的实现。 "
#. Tag: title
+#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr "可选的配置属性"
#. Tag: para
+#: configuration.xml:304
#, no-c-format
-msgid "There are a number of other properties that control the behavior of Hibernate at runtime. All are optional and have reasonable default values."
-msgstr "有大量属性能用来控制 Hibernate 在运行期的行为。它们都是可选的,并拥有适当的默认值。 "
+msgid ""
+"There are a number of other properties that control the behavior of "
+"Hibernate at runtime. All are optional and have reasonable default values."
+msgstr ""
+"有大量属性能用来控制 Hibernate 在运行期的行为。它们都是可选的,并拥有适当的默"
+"认值。 "
#. Tag: para
+#: configuration.xml:309
#, no-c-format
-msgid "<emphasis>Some of these properties are \"system-level\" only.</emphasis> System-level properties can be set only via <literal>java -Dproperty=value</literal> or <filename>hibernate.properties</filename>. They <emphasis>cannot</emphasis> be set by the other techniques described above."
-msgstr "<emphasis>其中一些属性是\"系统级(system-level)的\"</emphasis>。系统级属性只能通过<literal>java -Dproperty=value</literal> 或 <literal>hibernate.properties</literal> 来设置,而<emphasis>不能</emphasis>用上面描述的其他方法来设置。"
+msgid ""
+"<emphasis>Some of these properties are \"system-level\" only.</emphasis> "
+"System-level properties can be set only via <literal>java -Dproperty=value</"
+"literal> or <filename>hibernate.properties</filename>. They "
+"<emphasis>cannot</emphasis> be set by the other techniques described above."
+msgstr ""
+"<emphasis>其中一些属性是\"系统级(system-level)的\"</emphasis>。系统级属性只"
+"能通过<literal>java -Dproperty=value</literal> 或 <literal>hibernate."
+"properties</literal> 来设置,而<emphasis>不能</emphasis>用上面描述的其他方法"
+"来设置。"
#. Tag: title
+#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr "Hibernate 配置属性"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.dialect</property>"
+#. Tag: property
+#: configuration.xml:335
+#, fuzzy, no-c-format
+msgid "hibernate.dialect"
msgstr "<property>hibernate.dialect</property>"
#. Tag: entry
+#: configuration.xml:337
#, no-c-format
-msgid "The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</classname> which allows Hibernate to generate SQL optimized for a particular relational database."
-msgstr "允许 Hibernate 针对特定的关系数据库生成优化的 SQL 的 <classname>org.hibernate.dialect.Dialect</classname> 的类名。"
+msgid ""
+"The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</"
+"classname> which allows Hibernate to generate SQL optimized for a particular "
+"relational database."
+msgstr ""
+"允许 Hibernate 针对特定的关系数据库生成优化的 SQL 的 <classname>org."
+"hibernate.dialect.Dialect</classname> 的类名。"
#. Tag: para
+#: configuration.xml:340
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of.Dialect</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>full.classname.of.Dialect</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>full.classname.of."
+"Dialect</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>full.classname.of."
+"Dialect</literal> "
#. Tag: para
+#: configuration.xml:341
#, no-c-format
-msgid "In most cases Hibernate will actually be able to choose the correct <classname>org.hibernate.dialect.Dialect</classname> implementation based on the <literal>JDBC metadata</literal> returned by the JDBC driver."
-msgstr "在大多数情况下,Hibernate 可以根据 JDBC 驱动返回的 <literal>JDBC metadata</literal> 选择正确的 <classname>org.hibernate.dialect.Dialect</classname> 实现。"
+msgid ""
+"In most cases Hibernate will actually be able to choose the correct "
+"<classname>org.hibernate.dialect.Dialect</classname> implementation based on "
+"the <literal>JDBC metadata</literal> returned by the JDBC driver."
+msgstr ""
+"在大多数情况下,Hibernate 可以根据 JDBC 驱动返回的 <literal>JDBC metadata</"
+"literal> 选择正确的 <classname>org.hibernate.dialect.Dialect</classname> 实"
+"现。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.show_sql</property>"
+#. Tag: property
+#: configuration.xml:349
+#, fuzzy, no-c-format
+msgid "hibernate.show_sql"
msgstr "<property>hibernate.show_sql</property>"
#. Tag: entry
+#: configuration.xml:351
#, no-c-format
-msgid "Write all SQL statements to console. This is an alternative to setting the log category <literal>org.hibernate.SQL</literal> to <literal>debug</literal>."
-msgstr "输出所有 SQL 语句到控制台。有一个另外的选择是把 <literal>org.hibernate.SQL</literal> 这个 log category设为 <literal>debug</literal>。"
+msgid ""
+"Write all SQL statements to console. This is an alternative to setting the "
+"log category <literal>org.hibernate.SQL</literal> to <literal>debug</"
+"literal>."
+msgstr ""
+"输出所有 SQL 语句到控制台。有一个另外的选择是把 <literal>org.hibernate.SQL</"
+"literal> 这个 log category设为 <literal>debug</literal>。"
#. Tag: para
+#: configuration.xml:353 configuration.xml:361 configuration.xml:426
+#: configuration.xml:435 configuration.xml:443 configuration.xml:453
+#: configuration.xml:468 configuration.xml:525 configuration.xml:545
+#: configuration.xml:555 configuration.xml:598 configuration.xml:797
+#: configuration.xml:808 configuration.xml:904
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | <literal>false</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>true</literal> | <literal>false</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>true</literal> | "
+"<literal>false</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>true</literal> | "
+"<literal>false</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.format_sql</property>"
+#. Tag: property
+#: configuration.xml:359
+#, fuzzy, no-c-format
+msgid "hibernate.format_sql"
msgstr "<property>hibernate.format_sql</property>"
#. Tag: entry
+#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr "在 log 和 console 中打印出更漂亮的 SQL。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_schema</property>"
+#. Tag: property
+#: configuration.xml:367
+#, fuzzy, no-c-format
+msgid "hibernate.default_schema"
msgstr "<property>hibernate.default_schema</property>"
#. Tag: entry
+#: configuration.xml:369
#, no-c-format
-msgid "Qualify unqualified table names with the given schema/tablespace in generated SQL."
-msgstr "在生成的 SQL 中,将给定的 schema/tablespace 附加于非全限定名的表名上。 "
+msgid ""
+"Qualify unqualified table names with the given schema/tablespace in "
+"generated SQL."
+msgstr ""
+"在生成的 SQL 中,将给定的 schema/tablespace 附加于非全限定名的表名上。 "
#. Tag: para
+#: configuration.xml:370
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>SCHEMA_NAME</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>SCHEMA_NAME</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>SCHEMA_NAME</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_catalog</property>"
+#. Tag: property
+#: configuration.xml:376
+#, fuzzy, no-c-format
+msgid "hibernate.default_catalog"
msgstr "<property>hibernate.default_catalog</property>"
#. Tag: entry
+#: configuration.xml:378
#, no-c-format
-msgid "Qualifies unqualified table names with the given catalog in generated SQL."
+msgid ""
+"Qualifies unqualified table names with the given catalog in generated SQL."
msgstr "在生成的 SQL 中,将给定的 catalog 附加于非全限定名的表名上。 "
#. Tag: para
+#: configuration.xml:379
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>CATALOG_NAME</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>CATALOG_NAME</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>CATALOG_NAME</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.session_factory_name</property>"
+#. Tag: property
+#: configuration.xml:384
+#, fuzzy, no-c-format
+msgid "hibernate.session_factory_name"
msgstr "<property>hibernate.session_factory_name</property>"
#. Tag: entry
+#: configuration.xml:386
#, no-c-format
-msgid "The <interfacename>org.hibernate.SessionFactory</interfacename> will be automatically bound to this name in JNDI after it has been created."
-msgstr "<interfacename>org.hibernate.SessionFactory</interfacename> 创建后,将自动使用这个名字绑定到 JNDI 中。"
+msgid ""
+"The <interfacename>org.hibernate.SessionFactory</interfacename> will be "
+"automatically bound to this name in JNDI after it has been created."
+msgstr ""
+"<interfacename>org.hibernate.SessionFactory</interfacename> 创建后,将自动使"
+"用这个名字绑定到 JNDI 中。"
#. Tag: para
+#: configuration.xml:389 configuration.xml:776
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>jndi/composite/name</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>jndi/composite/name</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>jndi/composite/name</"
+"literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.max_fetch_depth</property>"
+#. Tag: property
+#: configuration.xml:394
+#, fuzzy, no-c-format
+msgid "hibernate.max_fetch_depth"
msgstr "<property>hibernate.max_fetch_depth</property>"
#. Tag: entry
+#: configuration.xml:396
#, no-c-format
-msgid "Sets a maximum \"depth\" for the outer join fetch tree for single-ended associations (one-to-one, many-to-one). A <literal>0</literal> disables default outer join fetching."
-msgstr "为单向关联(一对一,多对一)的外连接抓取(outer join fetch)树设置最大深度。值为 <literal>0</literal> 意味着将关闭默认的外连接抓取。 "
+msgid ""
+"Sets a maximum \"depth\" for the outer join fetch tree for single-ended "
+"associations (one-to-one, many-to-one). A <literal>0</literal> disables "
+"default outer join fetching."
+msgstr ""
+"为单向关联(一对一,多对一)的外连接抓取(outer join fetch)树设置最大深度。"
+"值为 <literal>0</literal> 意味着将关闭默认的外连接抓取。 "
#. Tag: para
+#: configuration.xml:398
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> recommended values between <literal>0</literal> and <literal>3</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis> 建议在 <literal>0</literal> 到 <literal>3</literal> 之间取值 "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
+"<literal>0</literal> and <literal>3</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis> 建议在 <literal>0</literal> 到 "
+"<literal>3</literal> 之间取值 "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_batch_fetch_size</property>"
+#. Tag: property
+#: configuration.xml:404
+#, fuzzy, no-c-format
+msgid "hibernate.default_batch_fetch_size"
msgstr "<property>hibernate.default_batch_fetch_size</property>"
#. Tag: entry
+#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr "为 Hibernate 关联的批量抓取设置默认数量。 "
#. Tag: para
+#: configuration.xml:407
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</literal>, <literal>8</literal>, <literal>16</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis>建议的取值为 <literal>4</literal>,<literal>8</literal>,和 <literal>16</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> recommended values <literal>4</"
+"literal>, <literal>8</literal>, <literal>16</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis>建议的取值为 <literal>4</"
+"literal>,<literal>8</literal>,和 <literal>16</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.default_entity_mode</property>"
+#. Tag: property
+#: configuration.xml:413
+#, fuzzy, no-c-format
+msgid "hibernate.default_entity_mode"
msgstr "<property>hibernate.default_entity_mode</property>"
#. Tag: entry
+#: configuration.xml:415
#, no-c-format
-msgid "Sets a default mode for entity representation for all sessions opened from this <literal>SessionFactory</literal>"
-msgstr "为由这个 <literal>SessionFactory</literal> 打开的所有 Session 指定默认的实体表现模式。 "
+msgid ""
+"Sets a default mode for entity representation for all sessions opened from "
+"this <literal>SessionFactory</literal>"
+msgstr ""
+"为由这个 <literal>SessionFactory</literal> 打开的所有 Session 指定默认的实体"
+"表现模式。 "
#. Tag: para
+#: configuration.xml:416
#, no-c-format
-msgid "<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</literal>"
-msgstr "<emphasis role=\"strong\">取值</emphasis><literal>dynamic-map</literal>,<literal>dom4j</literal>,<literal>pojo</literal>"
+msgid ""
+"<literal>dynamic-map</literal>, <literal>dom4j</literal>, <literal>pojo</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">取值</emphasis><literal>dynamic-map</literal>,"
+"<literal>dom4j</literal>,<literal>pojo</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.order_updates</property>"
+#. Tag: property
+#: configuration.xml:422
+#, fuzzy, no-c-format
+msgid "hibernate.order_updates"
msgstr "<property>hibernate.order_updates</property>"
#. Tag: entry
+#: configuration.xml:424
#, no-c-format
-msgid "Forces Hibernate to order SQL updates by the primary key value of the items being updated. This will result in fewer transaction deadlocks in highly concurrent systems."
-msgstr "强制 Hibernate 按照被更新数据的主键,为 SQL 更新排序。这么做将减少在高并发系统中事务的死锁。"
+msgid ""
+"Forces Hibernate to order SQL updates by the primary key value of the items "
+"being updated. This will result in fewer transaction deadlocks in highly "
+"concurrent systems."
+msgstr ""
+"强制 Hibernate 按照被更新数据的主键,为 SQL 更新排序。这么做将减少在高并发系"
+"统中事务的死锁。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.generate_statistics</property>"
-msgstr "<property>hibernate.generate_statistics</property>"
+#. Tag: property
+#: configuration.xml:432
+#, fuzzy, no-c-format
+msgid "hibernate.generate_statistics"
+msgstr "Hibernate 的统计(statistics)机制"
#. Tag: entry
+#: configuration.xml:434
#, no-c-format
-msgid "If enabled, Hibernate will collect statistics useful for performance tuning."
+msgid ""
+"If enabled, Hibernate will collect statistics useful for performance tuning."
msgstr "如果开启,Hibernate 将收集有助于性能调节的统计数据。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.use_identifier_rollback</property>"
+#. Tag: property
+#: configuration.xml:440
+#, fuzzy, no-c-format
+msgid "hibernate.use_identifier_rollback"
msgstr "<property>hibernate.use_identifier_rollback</property>"
#. Tag: entry
+#: configuration.xml:442
#, no-c-format
-msgid "If enabled, generated identifier properties will be reset to default values when objects are deleted."
+msgid ""
+"If enabled, generated identifier properties will be reset to default values "
+"when objects are deleted."
msgstr "如果开启,在对象被删除时生成的标识属性将被重设为默认值。"
+#. Tag: property
+#: configuration.xml:449
+#, fuzzy, no-c-format
+msgid "hibernate.use_sql_comments"
+msgstr "<property>hibernate.use_sql_comments</property>"
+
#. Tag: entry
+#: configuration.xml:451
#, no-c-format
-msgid "<property>hibernate.use_sql_comments</property>"
-msgstr "<property>hibernate.use_sql_comments</property>"
+msgid ""
+"If turned on, Hibernate will generate comments inside the SQL, for easier "
+"debugging, defaults to <literal>false</literal>."
+msgstr ""
+"如果开启,Hibernate 将在 SQL 中生成有助于调试的注释信息,默认值为 "
+"<literal>false</literal>。"
+#. Tag: property
+#: configuration.xml:458
+#, no-c-format
+msgid "hibernate.id.new_generator_mappings"
+msgstr ""
+
#. Tag: entry
+#: configuration.xml:460
#, no-c-format
-msgid "If turned on, Hibernate will generate comments inside the SQL, for easier debugging, defaults to <literal>false</literal>."
-msgstr "如果开启,Hibernate 将在 SQL 中生成有助于调试的注释信息,默认值为 <literal>false</literal>。"
+msgid ""
+"Setting is relevant when using <classname>@GeneratedValue</classname>. It "
+"indicates whether or not the new <classname>IdentifierGenerator</classname> "
+"implementations are used for <classname>javax.persistence.GenerationType."
+"AUTO</classname>, <classname>javax.persistence.GenerationType.TABLE</"
+"classname> and <classname>javax.persistence.GenerationType.SEQUENCE</"
+"classname>. Default to <literal>false</literal> to keep backward "
+"compatibility."
+msgstr ""
+#. Tag: para
+#: configuration.xml:476
+#, no-c-format
+msgid ""
+"We recommend all new projects which make use of to use "
+"<classname>@GeneratedValue</classname> to also set <code>hibernate.id."
+"new_generator_mappings=true</code> as the new generators are more efficient "
+"and closer to the JPA 2 specification semantic. However they are not "
+"backward compatible with existing databases (if a sequence or a table is "
+"used for id generation)."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr "Hibernate JDBC 和连接(connection)属性"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.fetch_size</property>"
+#. Tag: property
+#: configuration.xml:503
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.fetch_size"
msgstr "<property>hibernate.jdbc.fetch_size</property>"
#. Tag: entry
+#: configuration.xml:505
#, no-c-format
-msgid "A non-zero value determines the JDBC fetch size (calls <literal>Statement.setFetchSize()</literal>)."
-msgstr "非零值,指定 JDBC 抓取数量的大小(调用 <literal>Statement.setFetchSize()</literal>)。"
+msgid ""
+"A non-zero value determines the JDBC fetch size (calls <literal>Statement."
+"setFetchSize()</literal>)."
+msgstr ""
+"非零值,指定 JDBC 抓取数量的大小(调用 <literal>Statement.setFetchSize()</"
+"literal>)。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_size</property>"
+#. Tag: property
+#: configuration.xml:510
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_size"
msgstr "<property>hibernate.jdbc.batch_size</property>"
#. Tag: entry
+#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr "非零值,允许 Hibernate 使用 JDBC2 的批量更新。"
#. Tag: para
+#: configuration.xml:513
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> recommended values between <literal>5</literal> and <literal>30</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis>建议取 <literal>5</literal> 到 <literal>30</literal> 之间的值 "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> recommended values between "
+"<literal>5</literal> and <literal>30</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis>建议取 <literal>5</literal> 到 "
+"<literal>30</literal> 之间的值 "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.batch_versioned_data</property>"
+#. Tag: property
+#: configuration.xml:519
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.batch_versioned_data"
msgstr "<property>hibernate.jdbc.batch_versioned_data</property>"
#. Tag: entry
-#, no-c-format
-msgid "Set this property to <literal>true</literal> if your JDBC driver returns correct row counts from <literal>executeBatch()</literal>. Iit is usually safe to turn this option on. Hibernate will then use batched DML for automatically versioned data. Defaults to <literal>false</literal>."
-msgstr "如果你想让你的 JDBC 驱动从 <literal>true</literal> 返回正确的行计数 ,那么将此属性设为 <literal>executeBatch()</literal>(开启这个选项通常是安全的)。同时,Hibernate 将为自动版本化的数据使用批量 DML。默认值为 <literal>false</literal>。 "
+#: configuration.xml:521
+#, fuzzy, no-c-format
+msgid ""
+"Set this property to <literal>true</literal> if your JDBC driver returns "
+"correct row counts from <literal>executeBatch()</literal>. It is usually "
+"safe to turn this option on. Hibernate will then use batched DML for "
+"automatically versioned data. Defaults to <literal>false</literal>."
+msgstr ""
+"如果你想让你的 JDBC 驱动从 <literal>true</literal> 返回正确的行计数 ,那么将"
+"此属性设为 <literal>executeBatch()</literal>(开启这个选项通常是安全的)。同"
+"时,Hibernate 将为自动版本化的数据使用批量 DML。默认值为 <literal>false</"
+"literal>。 "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.factory_class</property>"
+#. Tag: property
+#: configuration.xml:531
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.factory_class"
msgstr "<property>hibernate.jdbc.factory_class</property>"
#. Tag: entry
+#: configuration.xml:533
#, no-c-format
-msgid "Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. Most applications will not need this configuration property."
-msgstr "选择一个自定义的 <literal>Batcher</literal>。多数应用程序不需要这个配置属性。 "
+msgid ""
+"Select a custom <interfacename>org.hibernate.jdbc.Batcher</interfacename>. "
+"Most applications will not need this configuration property."
+msgstr ""
+"选择一个自定义的 <literal>Batcher</literal>。多数应用程序不需要这个配置属"
+"性。 "
#. Tag: para
+#: configuration.xml:535
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.BatcherFactory</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.Batcher</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
+"BatcherFactory</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.Batcher</"
+"literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_scrollable_resultset</property>"
+#. Tag: property
+#: configuration.xml:541
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr "<property>hibernate.jdbc.use_scrollable_resultset</property>"
#. Tag: entry
+#: configuration.xml:543
#, no-c-format
-msgid "Enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user-supplied JDBC connections. Hibernate uses connection metadata otherwise."
-msgstr "允许 Hibernate 使用 JDBC2 的可滚动结果集。只有在使用用户提供的 JDBC 连接时,这个选项才是必要的,否则 Hibernate 会使用连接的元数据。 "
+msgid ""
+"Enables use of JDBC2 scrollable resultsets by Hibernate. This property is "
+"only necessary when using user-supplied JDBC connections. Hibernate uses "
+"connection metadata otherwise."
+msgstr ""
+"允许 Hibernate 使用 JDBC2 的可滚动结果集。只有在使用用户提供的 JDBC 连接时,"
+"这个选项才是必要的,否则 Hibernate 会使用连接的元数据。 "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_streams_for_binary</property>"
+#. Tag: property
+#: configuration.xml:551
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_streams_for_binary"
msgstr "<property>hibernate.jdbc.use_streams_for_binary</property>"
#. Tag: entry
+#: configuration.xml:553
#, no-c-format
-msgid "Use streams when writing/reading <literal>binary</literal> or <literal>serializable</literal> types to/from JDBC. <emphasis>*system-level property*</emphasis>"
-msgstr "在 JDBC 读写 <literal>binary</literal> 或 <literal>serializable</literal> 的类型时使用流(stream)(系统级属性)。 "
+msgid ""
+"Use streams when writing/reading <literal>binary</literal> or "
+"<literal>serializable</literal> types to/from JDBC. <emphasis>*system-level "
+"property*</emphasis>"
+msgstr ""
+"在 JDBC 读写 <literal>binary</literal> 或 <literal>serializable</literal> 的"
+"类型时使用流(stream)(系统级属性)。 "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.jdbc.use_get_generated_keys</property>"
+#. Tag: property
+#: configuration.xml:561
+#, fuzzy, no-c-format
+msgid "hibernate.jdbc.use_get_generated_keys"
msgstr "<property>hibernate.jdbc.use_get_generated_keys</property>"
#. Tag: entry
+#: configuration.xml:563
#, no-c-format
-msgid "Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> to retrieve natively generated keys after insert. Requires JDBC3+ driver and JRE1.4+, set to false if your driver has problems with the Hibernate identifier generators. By default, it tries to determine the driver capabilities using connection metadata."
-msgstr "在数据插入数据库之后,允许使用 JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> 来获取数据库生成的 key(键)。需要 JDBC3+ 驱动和 JRE1.4+,如果你的数据库驱动在使用 Hibernate 的标识生成器时遇到问题,请将此值设为 false。默认情况下将使用连接的元数据来判定驱动的能力。 "
+msgid ""
+"Enables use of JDBC3 <literal>PreparedStatement.getGeneratedKeys()</literal> "
+"to retrieve natively generated keys after insert. Requires JDBC3+ driver and "
+"JRE1.4+, set to false if your driver has problems with the Hibernate "
+"identifier generators. By default, it tries to determine the driver "
+"capabilities using connection metadata."
+msgstr ""
+"在数据插入数据库之后,允许使用 JDBC3 <literal>PreparedStatement."
+"getGeneratedKeys()</literal> 来获取数据库生成的 key(键)。需要 JDBC3+ 驱动"
+"和 JRE1.4+,如果你的数据库驱动在使用 Hibernate 的标识生成器时遇到问题,请将此"
+"值设为 false。默认情况下将使用连接的元数据来判定驱动的能力。 "
#. Tag: para
+#: configuration.xml:569 configuration.xml:678 configuration.xml:687
+#: configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>true|false</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>true | false</literal> "
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>true | false</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.provider_class</property>"
+#. Tag: property
+#: configuration.xml:574
+#, fuzzy, no-c-format
+msgid "hibernate.connection.provider_class"
msgstr "<property>hibernate.connection.provider_class</property>"
#. Tag: entry
+#: configuration.xml:576
#, no-c-format
-msgid "The classname of a custom <interfacename>org.hibernate.connection.ConnectionProvider</interfacename> which provides JDBC connections to Hibernate."
-msgstr "自定义 <literal>ConnectionProvider</literal> 的类名,此类用来向 Hibernate 提供 JDBC 连接。 "
+msgid ""
+"The classname of a custom <interfacename>org.hibernate.connection."
+"ConnectionProvider</interfacename> which provides JDBC connections to "
+"Hibernate."
+msgstr ""
+"自定义 <literal>ConnectionProvider</literal> 的类名,此类用来向 Hibernate 提"
+"供 JDBC 连接。 "
#. Tag: para
+#: configuration.xml:578
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.ConnectionProvider</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.ConnectionProvider</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
+"ConnectionProvider</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>classname.of."
+"ConnectionProvider</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.isolation</property>"
+#. Tag: property
+#: configuration.xml:584
+#, fuzzy, no-c-format
+msgid "hibernate.connection.isolation"
msgstr "<property>hibernate.connection.isolation</property>"
#. Tag: entry
+#: configuration.xml:586
#, no-c-format
-msgid "Sets the JDBC transaction isolation level. Check <interfacename>java.sql.Connection</interfacename> for meaningful values, but note that most databases do not support all isolation levels and some define additional, non-standard isolations."
-msgstr "设置 JDBC 事务隔离级别。查看 <literal>java.sql.Connection</literal> 来了解各个值的具体意义,但请注意多数数据库都不支持所有的隔离级别。 "
+msgid ""
+"Sets the JDBC transaction isolation level. Check <interfacename>java.sql."
+"Connection</interfacename> for meaningful values, but note that most "
+"databases do not support all isolation levels and some define additional, "
+"non-standard isolations."
+msgstr ""
+"设置 JDBC 事务隔离级别。查看 <literal>java.sql.Connection</literal> 来了解各"
+"个值的具体意义,但请注意多数数据库都不支持所有的隔离级别。 "
#. Tag: para
+#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>1, 2, 4, 8</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>1, 2, 4, 8</literal> "
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>1, 2, 4, 8</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.autocommit</property>"
+#. Tag: property
+#: configuration.xml:595
+#, fuzzy, no-c-format
+msgid "hibernate.connection.autocommit"
msgstr "<property>hibernate.connection.autocommit</property>"
#. Tag: entry
+#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr "允许被缓存的 JDBC 连接开启自动提交(autocommit)(不推荐)。"
-#. Tag: entry
-#, no-c-format
-msgid "<property>hibernate.connection.release_mode</property>"
+#. Tag: property
+#: configuration.xml:603
+#, fuzzy, no-c-format
+msgid "hibernate.connection.release_mode"
msgstr "<property>hibernate.connection.release_mode</property>"
#. Tag: entry
+#: configuration.xml:605
#, no-c-format
-msgid "Specifies when Hibernate should release JDBC connections. By default, a JDBC connection is held until the session is explicitly closed or disconnected. For an application server JTA datasource, use <literal>after_statement</literal> to aggressively release connections after every JDBC call. For a non-JTA connection, it often makes sense to release the connection at the end of each transaction, by using <literal>after_transaction</literal>. <literal>auto</literal> will choose <literal>after_statement</literal> for the JTA and CMT transaction strategies and <literal>after_transaction</literal> for the JDBC transaction strategy."
-msgstr "指定 Hibernate 在何时释放 JDBC 连接。默认情况下,直到 Session 被显式关闭或被断开连接时,才会释放 JDBC 连接。对于应用程序服务器的 JTA 数据源,你应当使用 <literal>after_statement</literal>,这样在每次 JDBC 调用后,都会主动的释放连接。对于非 JTA 的连接,使用 <literal>after_transaction</literal> 在每个事务结束时释放连接是合理的。<literal>auto</literal> 将为 JTA 和 CMT 事务策略选择 <literal>after_statement</literal>,为JDBC事务策略选择 <literal>after_transaction</literal>。"
+msgid ""
+"Specifies when Hibernate should release JDBC connections. By default, a JDBC "
+"connection is held until the session is explicitly closed or disconnected. "
+"For an application server JTA datasource, use <literal>after_statement</"
+"literal> to aggressively release connections after every JDBC call. For a "
+"non-JTA connection, it often makes sense to release the connection at the "
+"end of each transaction, by using <literal>after_transaction</literal>. "
+"<literal>auto</literal> will choose <literal>after_statement</literal> for "
+"the JTA and CMT transaction strategies and <literal>after_transaction</"
+"literal> for the JDBC transaction strategy."
+msgstr ""
+"指定 Hibernate 在何时释放 JDBC 连接。默认情况下,直到 Session 被显式关闭或被断"
+"开连接时,才会释放 JDBC 连接。对于应用程序服务器的 JTA 数据源,你应当使用 "
+"<literal>after_statement</literal>,这样在每次 JDBC 调用后,都会主动的释放连"
+"接。对于非 JTA 的连接,使用 <literal>after_transaction</literal> 在每个事务结"
+"束时释放连接是合理的。<literal>auto</literal> 将为 JTA 和 CMT 事务策略选择 "
+"<literal>after_statement</literal>,为JDBC事务策略选择 "
+"<literal>after_transaction</literal>。"
#. Tag: para
+#: configuration.xml:615
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) | <literal>on_close</literal> | <literal>after_transaction</literal> | <literal>after_statement</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>auto</literal> (默认) | <literal>on_close</literal> | <literal>after_transaction</literal> | <literal>after_statement</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>auto</literal> (default) "
+"| <literal>on_close</literal> | <literal>after_transaction</literal> | "
+"<literal>after_statement</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>auto</literal> (默认) | "
+"<literal>on_close</literal> | <literal>after_transaction</literal> | "
+"<literal>after_statement</literal> "
#. Tag: para
-#, no-c-format
-msgid "This setting only affects <literal>Session</literal>s returned from <literal>SessionFactory.openSession</literal>. For <literal>Session</literal>s obtained through <literal>SessionFactory.getCurrentSession</literal>, the <literal>CurrentSessionContext</literal> implementation configured for use controls the connection release mode for those <literal>Session</literal>s. See <xref linkend=\"architecture-current-session\" />"
-msgstr "注意,这些设置仅对通过 <literal>SessionFactory.openSession</literal> 得到的 <literal>Session</literal> 起作用。对于通过 <literal>SessionFactory.getCurrentSession</literal> 得到的 <literal>Session</literal>,所配置的 <literal>CurrentSessionContext</literal> 实现控制这些 <literal>Session</literal> 的连接释放模式。请参阅 <xref linkend=\"architecture-current-session\" />。"
+#: configuration.xml:618
+#, fuzzy, no-c-format
+msgid ""
+"This setting only affects <literal>Session</literal>s returned from "
+"<literal>SessionFactory.openSession</literal>. For <literal>Session</"
+"literal>s obtained through <literal>SessionFactory.getCurrentSession</"
+"literal>, the <literal>CurrentSessionContext</literal> implementation "
+"configured for use controls the connection release mode for those "
+"<literal>Session</literal>s. See"
+msgstr ""
+"注意,这些设置仅对通过 <literal>SessionFactory.openSession</literal> 得到的 "
+"<literal>Session</literal> 起作用。对于通过 <literal>SessionFactory."
+"getCurrentSession</literal> 得到的 <literal>Session</literal>,所配置的 "
+"<literal>CurrentSessionContext</literal> 实现控制这些 <literal>Session</"
+"literal> 的连接释放模式。请参阅 <xref linkend=\"architecture-current-session"
+"\" />。"
#. Tag: entry
+#: configuration.xml:630
#, no-c-format
-msgid "<property>hibernate.connection.</property><emphasis><propertyName></emphasis>"
-msgstr "<property>hibernate.connection.</property><emphasis><propertyName></emphasis>"
+msgid ""
+"<property>hibernate.connection.</property><emphasis><propertyName></"
+"emphasis>"
+msgstr ""
+"<property>hibernate.connection.</property><emphasis><propertyName></"
+"emphasis>"
#. Tag: entry
+#: configuration.xml:632
#, no-c-format
-msgid "Pass the JDBC property <emphasis><propertyName></emphasis> to <literal>DriverManager.getConnection()</literal>."
-msgstr "把 JDBC 属性 <emphasis><propertyName></emphasis> 传递给 <literal>DriverManager.getConnection()</literal>。"
+msgid ""
+"Pass the JDBC property <emphasis><propertyName></emphasis> to "
+"<literal>DriverManager.getConnection()</literal>."
+msgstr ""
+"把 JDBC 属性 <emphasis><propertyName></emphasis> 传递给 "
+"<literal>DriverManager.getConnection()</literal>。"
#. Tag: entry
+#: configuration.xml:638
#, no-c-format
-msgid "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
-msgstr "<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
+msgid ""
+"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
+msgstr ""
+"<property>hibernate.jndi.</property><emphasis><propertyName></emphasis>"
#. Tag: entry
+#: configuration.xml:640
#, no-c-format
-msgid "Pass the property <emphasis><propertyName></emphasis> to the JNDI <literal>InitialContextFactory</literal>."
-msgstr "把 <emphasis><propertyName></emphasis> 属性传递给 JNDI <literal>InitialContextFactory</literal>。"
+msgid ""
+"Pass the property <emphasis><propertyName></emphasis> to the JNDI "
+"<literal>InitialContextFactory</literal>."
+msgstr ""
+"把 <emphasis><propertyName></emphasis> 属性传递给 JNDI "
+"<literal>InitialContextFactory</literal>。"
#. Tag: title
+#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr "Hibernate 缓存属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.provider_class</literal>"
+#. Tag: literal
+#: configuration.xml:665
+#, fuzzy, no-c-format
+msgid "hibernate.cache.provider_class"
msgstr "<literal>hibernate.cache.provider_class</literal>"
#. Tag: entry
+#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider</literal>."
msgstr "自定义的 <literal>CacheProvider</literal> 的类名。"
#. Tag: para
+#: configuration.xml:668
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.CacheProvider</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.CacheProvider</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
+"CacheProvider</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>classname.of."
+"CacheProvider</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_minimal_puts</literal>"
+#. Tag: literal
+#: configuration.xml:673
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_minimal_puts"
msgstr "<literal>hibernate.cache.use_minimal_puts</literal>"
#. Tag: entry
+#: configuration.xml:675
#, no-c-format
-msgid "Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This setting is most useful for clustered caches and, in Hibernate3, is enabled by default for clustered cache implementations."
-msgstr "以频繁的读操作为代价,优化二级缓存来最小化写操作。在 Hibernate3 中,这个设置对的集群缓存非常有用,对集群缓存的实现而言,默认是开启的。 "
+msgid ""
+"Optimizes second-level cache operation to minimize writes, at the cost of "
+"more frequent reads. This setting is most useful for clustered caches and, "
+"in Hibernate3, is enabled by default for clustered cache implementations."
+msgstr ""
+"以频繁的读操作为代价,优化二级缓存来最小化写操作。在 Hibernate3 中,这个设置"
+"对的集群缓存非常有用,对集群缓存的实现而言,默认是开启的。 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_query_cache</literal>"
+#. Tag: literal
+#: configuration.xml:684
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache"
msgstr "<literal>hibernate.cache.use_query_cache</literal>"
#. Tag: entry
+#: configuration.xml:686
#, no-c-format
-msgid "Enables the query cache. Individual queries still have to be set cachable."
+msgid ""
+"Enables the query cache. Individual queries still have to be set cachable."
msgstr "允许查询缓存,个别查询仍然需要被设置为可缓存的。 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_second_level_cache</literal>"
+#. Tag: literal
+#: configuration.xml:692
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_second_level_cache"
msgstr "<literal>hibernate.cache.use_second_level_cache</literal>"
#. Tag: entry
+#: configuration.xml:694
#, no-c-format
-msgid "Can be used to completely disable the second level cache, which is enabled by default for classes which specify a <literal><cache></literal> mapping."
-msgstr "能用来完全禁止使用二级缓存。对那些在类的映射定义中指定 <literal><cache></literal> 的类,会默认开启二级缓存。 "
+msgid ""
+"Can be used to completely disable the second level cache, which is enabled "
+"by default for classes which specify a <literal><cache></literal> "
+"mapping."
+msgstr ""
+"能用来完全禁止使用二级缓存。对那些在类的映射定义中指定 <literal><cache>"
+"</literal> 的类,会默认开启二级缓存。 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.query_cache_factory</literal>"
+#. Tag: literal
+#: configuration.xml:702
+#, fuzzy, no-c-format
+msgid "hibernate.cache.query_cache_factory"
msgstr "<literal>hibernate.cache.query_cache_factory</literal>"
#. Tag: entry
+#: configuration.xml:704
#, no-c-format
-msgid "The classname of a custom <literal>QueryCache</literal> interface, defaults to the built-in <literal>StandardQueryCache</literal>."
-msgstr "自定义实现 <literal>QueryCache</literal> 接口的类名,默认为内建的 <literal>StandardQueryCache</literal>。"
+msgid ""
+"The classname of a custom <literal>QueryCache</literal> interface, defaults "
+"to the built-in <literal>StandardQueryCache</literal>."
+msgstr ""
+"自定义实现 <literal>QueryCache</literal> 接口的类名,默认为内建的 "
+"<literal>StandardQueryCache</literal>。"
#. Tag: para
+#: configuration.xml:706
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.QueryCache</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.QueryCache</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.QueryCache</"
+"literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.region_prefix</literal>"
+#. Tag: literal
+#: configuration.xml:712
+#, fuzzy, no-c-format
+msgid "hibernate.cache.region_prefix"
msgstr "<literal>hibernate.cache.region_prefix</literal>"
#. Tag: entry
+#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr "二级缓存区域名的前缀。"
#. Tag: para
+#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>prefix</literal>"
msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>prefix</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cache.use_structured_entries</literal>"
+#. Tag: literal
+#: configuration.xml:720
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_structured_entries"
msgstr "<literal>hibernate.cache.use_structured_entries</literal>"
#. Tag: entry
+#: configuration.xml:722
#, no-c-format
-msgid "Forces Hibernate to store data in the second-level cache in a more human-friendly format."
+msgid ""
+"Forces Hibernate to store data in the second-level cache in a more human-"
+"friendly format."
msgstr "强制 Hibernate 以更人性化的格式将数据存入二级缓存。"
+#. Tag: literal
+#: configuration.xml:729
+#, no-c-format
+msgid "hibernate.cache.default_cache_concurrency_strategy"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:731
+#, no-c-format
+msgid ""
+"Setting used to give the name of the default <classname>org.hibernate."
+"annotations.CacheConcurrencyStrategy</classname> to use when either "
+"<classname>@Cacheable</classname> or <classname>@Cache</classname> is used. "
+"<code>@Cache(strategy=\"..\")</code> is used to override this default."
+msgstr ""
+
#. Tag: title
+#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr "Hibernate 事务属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:761
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.factory_class"
msgstr "<literal>hibernate.transaction.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:763
#, no-c-format
-msgid "The classname of a <literal>TransactionFactory</literal> to use with Hibernate <literal>Transaction</literal> API (defaults to <literal>JDBCTransactionFactory</literal>)."
-msgstr "一个 <literal>TransactionFactory</literal> 的类名,用于 Hibernate <literal>Transaction</literal> API(默认为 <literal>JDBCTransactionFactory</literal>)。"
+msgid ""
+"The classname of a <literal>TransactionFactory</literal> to use with "
+"Hibernate <literal>Transaction</literal> API (defaults to "
+"<literal>JDBCTransactionFactory</literal>)."
+msgstr ""
+"一个 <literal>TransactionFactory</literal> 的类名,用于 Hibernate "
+"<literal>Transaction</literal> API(默认为 <literal>JDBCTransactionFactory</"
+"literal>)。"
#. Tag: para
+#: configuration.xml:765
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.TransactionFactory</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.TransactionFactory</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
+"TransactionFactory</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>classname.of."
+"TransactionFactory</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>jta.UserTransaction</literal>"
+#. Tag: literal
+#: configuration.xml:771
+#, fuzzy, no-c-format
+msgid "jta.UserTransaction"
msgstr "<literal>jta.UserTransaction</literal>"
#. Tag: entry
+#: configuration.xml:773
#, no-c-format
-msgid "A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the JTA <literal>UserTransaction</literal> from the application server."
-msgstr "一个 JNDI 名字,被 <literal>JTATransactionFactory</literal> 用来从应用服务器获取 JTA <literal>UserTransaction</literal>。"
+msgid ""
+"A JNDI name used by <literal>JTATransactionFactory</literal> to obtain the "
+"JTA <literal>UserTransaction</literal> from the application server."
+msgstr ""
+"一个 JNDI 名字,被 <literal>JTATransactionFactory</literal> 用来从应用服务器"
+"获取 JTA <literal>UserTransaction</literal>。"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.manager_lookup_class</literal>"
+#. Tag: literal
+#: configuration.xml:781
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.manager_lookup_class"
msgstr "<literal>hibernate.transaction.manager_lookup_class</literal>"
#. Tag: entry
+#: configuration.xml:783
#, no-c-format
-msgid "The classname of a <literal>TransactionManagerLookup</literal>. It is required when JVM-level caching is enabled or when using hilo generator in a JTA environment."
-msgstr "一个 <literal>TransactionManagerLookup</literal> 的类名 — 当使用 JVM 级缓存,或在 JTA 环境中使用 hilo 生成器的时候需要该类。 "
+msgid ""
+"The classname of a <literal>TransactionManagerLookup</literal>. It is "
+"required when JVM-level caching is enabled or when using hilo generator in a "
+"JTA environment."
+msgstr ""
+"一个 <literal>TransactionManagerLookup</literal> 的类名 — 当使用 JVM 级缓存,"
+"或在 JTA 环境中使用 hilo 生成器的时候需要该类。 "
#. Tag: para
+#: configuration.xml:786
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of.TransactionManagerLookup</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>classname.of.TransactionManagerLookup</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>classname.of."
+"TransactionManagerLookup</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>classname.of."
+"TransactionManagerLookup</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.flush_before_completion</literal>"
+#. Tag: literal
+#: configuration.xml:792
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.flush_before_completion"
msgstr "<literal>hibernate.transaction.flush_before_completion</literal>"
#. Tag: entry
-#, no-c-format
-msgid "If enabled, the session will be automatically flushed during the before completion phase of the transaction. Built-in and automatic session context management is preferred, see <xref linkend=\"architecture-current-session\" />."
-msgstr "如果开启,session 在事务完成后将被自动清洗(flush)。现在更好的方法是使用自动 session 上下文管理。请参见 <xref linkend=\"architecture-current-session\"/>。 "
+#: configuration.xml:794
+#, fuzzy, no-c-format
+msgid ""
+"If enabled, the session will be automatically flushed during the before "
+"completion phase of the transaction. Built-in and automatic session context "
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
+">."
+msgstr ""
+"如果开启,session 在事务完成后将被自动清洗(flush)。现在更好的方法是使用自"
+"动 session 上下文管理。请参见 <xref linkend=\"architecture-current-session\"/"
+">。 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.transaction.auto_close_session</literal>"
+#. Tag: literal
+#: configuration.xml:803
+#, fuzzy, no-c-format
+msgid "hibernate.transaction.auto_close_session"
msgstr "<literal>hibernate.transaction.auto_close_session</literal>"
#. Tag: entry
-#, no-c-format
-msgid "If enabled, the session will be automatically closed during the after completion phase of the transaction. Built-in and automatic session context management is preferred, see <xref linkend=\"architecture-current-session\" />."
-msgstr "如果开启,session 在事务完成后将被自动关闭。 现在更好的方法是使用自动 session 上下文管理。请参见 <xref linkend=\"architecture-current-session\"/>。 "
+#: configuration.xml:805
+#, fuzzy, no-c-format
+msgid ""
+"If enabled, the session will be automatically closed during the after "
+"completion phase of the transaction. Built-in and automatic session context "
+"management is preferred, see <xref linkend=\"architecture-current-session\"/"
+">."
+msgstr ""
+"如果开启,session 在事务完成后将被自动关闭。 现在更好的方法是使用自动 "
+"session 上下文管理。请参见 <xref linkend=\"architecture-current-session\"/"
+">。 "
#. Tag: title
+#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr "其他属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.current_session_context_class</literal>"
+#. Tag: literal
+#: configuration.xml:834
+#, fuzzy, no-c-format
+msgid "hibernate.current_session_context_class"
msgstr "<literal>hibernate.current_session_context_class</literal>"
#. Tag: entry
-#, no-c-format
-msgid "Supply a custom strategy for the scoping of the \"current\" <literal>Session</literal>. See <xref linkend=\"architecture-current-session\" /> for more information about the built-in strategies."
-msgstr "为\"当前\" <literal>Session</literal> 指定一个(自定义的)策略。关于内置策略的详情,请参见 <xref linkend=\"architecture-current-session\"/>。 "
+#: configuration.xml:836
+#, fuzzy, no-c-format
+msgid ""
+"Supply a custom strategy for the scoping of the \"current\" "
+"<literal>Session</literal>. See <xref linkend=\"architecture-current-session"
+"\"/> for more information about the built-in strategies."
+msgstr ""
+"为\"当前\" <literal>Session</literal> 指定一个(自定义的)策略。关于内置策略"
+"的详情,请参见 <xref linkend=\"architecture-current-session\"/>。 "
#. Tag: para
+#: configuration.xml:839
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | <literal>thread</literal> | <literal>managed</literal> | <literal>custom.Class</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>jta</literal> | <literal>thread</literal> | <literal>managed</literal> | <literal>custom.Class</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>jta</literal> | "
+"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
+"Class</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>jta</literal> | "
+"<literal>thread</literal> | <literal>managed</literal> | <literal>custom."
+"Class</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.query.factory_class</literal>"
+#. Tag: literal
+#: configuration.xml:846
+#, fuzzy, no-c-format
+msgid "hibernate.query.factory_class"
msgstr "<literal>hibernate.query.factory_class</literal>"
#. Tag: entry
+#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr "选择 HQL 解析器的实现。"
#. Tag: para
+#: configuration.xml:848
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast.ASTQueryTranslatorFactory</literal> or <literal>org.hibernate.hql.classic.ClassicQueryTranslatorFactory</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>org.hibernate.hql.ast.ASTQueryTranslatorFactory</literal> 或 <literal>org.hibernate.hql.classic.ClassicQueryTranslatorFactory</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>org.hibernate.hql.ast."
+"ASTQueryTranslatorFactory</literal> or <literal>org.hibernate.hql.classic."
+"ClassicQueryTranslatorFactory</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>org.hibernate.hql.ast."
+"ASTQueryTranslatorFactory</literal> 或 <literal>org.hibernate.hql.classic."
+"ClassicQueryTranslatorFactory</literal> "
+#. Tag: literal
+#: configuration.xml:857
+#, fuzzy, no-c-format
+msgid "hibernate.query.substitutions"
+msgstr "hibernate.query.substitutions true=1,false=0"
+
#. Tag: entry
+#: configuration.xml:859
#, no-c-format
-msgid "<literal>hibernate.query.substitutions</literal>"
-msgstr "<literal>hibernate.query.substitutions</literal>"
+msgid ""
+"Is used to map from tokens in Hibernate queries to SQL tokens (tokens might "
+"be function or literal names, for example)."
+msgstr ""
+"将 Hibernate 查询中的符号映射到 SQL 查询中的符号(符号可能是函数名或常量名"
+"字)。 "
+#. Tag: para
+#: configuration.xml:861
+#, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, "
+"hqlFunction=SQLFUNC</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>hqlLiteral=SQL_LITERAL, "
+"hqlFunction=SQLFUNC</literal> "
+
+#. Tag: literal
+#: configuration.xml:867
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.auto"
+msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
+
#. Tag: entry
+#: configuration.xml:869
#, no-c-format
-msgid "Is used to map from tokens in Hibernate queries to SQL tokens (tokens might be function or literal names, for example)."
-msgstr "将 Hibernate 查询中的符号映射到 SQL 查询中的符号(符号可能是函数名或常量名字)。 "
+msgid ""
+"Automatically validates or exports schema DDL to the database when the "
+"<literal>SessionFactory</literal> is created. With <literal>create-drop</"
+"literal>, the database schema will be dropped when the "
+"<literal>SessionFactory</literal> is closed explicitly."
+msgstr ""
+"在 <literal>SessionFactory</literal> 创建时,自动检查数据库结构,或者将数据"
+"库 schema 的 DDL 导出到数据库。使用 <literal>create-drop</literal> 时,在显式"
+"关闭 <literal>SessionFactory</literal> 时,将删除掉数据库 schema。 "
#. Tag: para
+#: configuration.xml:873
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</literal> "
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | "
+"<literal>update</literal> | <literal>create</literal> | <literal>create-"
+"drop</literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>validate</literal> | "
+"<literal>update</literal> | <literal>create</literal> | <literal>create-"
+"drop</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.hbm2ddl.auto</literal>"
+#. Tag: literal
+#: configuration.xml:880
+#, fuzzy, no-c-format
+msgid "hibernate.hbm2ddl.import_file"
msgstr "<literal>hibernate.hbm2ddl.auto</literal>"
-#. Tag: entry
+#. Tag: para
+#: configuration.xml:882
#, no-c-format
-msgid "Automatically validates or exports schema DDL to the database when the <literal>SessionFactory</literal> is created. With <literal>create-drop</literal>, the database schema will be dropped when the <literal>SessionFactory</literal> is closed explicitly."
-msgstr "在 <literal>SessionFactory</literal> 创建时,自动检查数据库结构,或者将数据库 schema 的 DDL 导出到数据库。使用 <literal>create-drop</literal> 时,在显式关闭 <literal>SessionFactory</literal> 时,将删除掉数据库 schema。 "
+msgid ""
+"Comma-separated names of the optional files containing SQL DML statements "
+"executed during the <classname>SessionFactory</classname> creation. This is "
+"useful for testing or demoing: by adding INSERT statements for example you "
+"can populate your database with a minimal set of data when it is deployed."
+msgstr ""
#. Tag: para
+#: configuration.xml:887
#, no-c-format
-msgid "<emphasis role=\"strong\">e.g.</emphasis> <literal>validate</literal> | <literal>update</literal> | <literal>create</literal> | <literal>create-drop</literal>"
-msgstr "<emphasis role=\"strong\">例如:</emphasis><literal>validate</literal> | <literal>update</literal> | <literal>create</literal> | <literal>create-drop</literal> "
+msgid ""
+"File order matters, the statements of a give file are executed before the "
+"statements of the following files. These statements are only executed if the "
+"schema is created ie if <literal>hibernate.hbm2ddl.auto</literal> is set to "
+"<literal>create</literal> or <literal>create-drop</literal>."
+msgstr ""
-#. Tag: entry
-#, no-c-format
-msgid "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
+#. Tag: para
+#: configuration.xml:892
+#, fuzzy, no-c-format
+msgid ""
+"<emphasis role=\"strong\">e.g.</emphasis> <literal>/humans.sql,/dogs.sql</"
+"literal>"
+msgstr ""
+"<emphasis role=\"strong\">例如:</emphasis><literal>true | false</literal> "
+
+#. Tag: literal
+#: configuration.xml:898
+#, fuzzy, no-c-format
+msgid "hibernate.cglib.use_reflection_optimizer"
msgstr "<literal>hibernate.cglib.use_reflection_optimizer</literal>"
#. Tag: entry
+#: configuration.xml:900
#, no-c-format
-msgid "Enables the use of CGLIB instead of runtime reflection (System-level property). Reflection can sometimes be useful when troubleshooting. Hibernate always requires CGLIB even if you turn off the optimizer. You cannot set this property in <literal>hibernate.cfg.xml</literal>."
-msgstr "开启 CGLIB 来替代运行时反射机制(系统级属性)。反射机制有时在除错时比较有用。注意即使关闭这个优化,Hibernate 还是需要 CGLIB。你不能在 <literal>hibernate.cfg.xml</literal> 中设置此属性。 "
+msgid ""
+"Enables the use of CGLIB instead of runtime reflection (System-level "
+"property). Reflection can sometimes be useful when troubleshooting. "
+"Hibernate always requires CGLIB even if you turn off the optimizer. You "
+"cannot set this property in <literal>hibernate.cfg.xml</literal>."
+msgstr ""
+"开启 CGLIB 来替代运行时反射机制(系统级属性)。反射机制有时在除错时比较有用。"
+"注意即使关闭这个优化,Hibernate 还是需要 CGLIB。你不能在 <literal>hibernate."
+"cfg.xml</literal> 中设置此属性。 "
#. Tag: title
+#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr "SQL 方言"
#. Tag: para
+#: configuration.xml:915
#, no-c-format
-msgid "Always set the <literal>hibernate.dialect</literal> property to the correct <literal>org.hibernate.dialect.Dialect</literal> subclass for your database. If you specify a dialect, Hibernate will use sensible defaults for some of the other properties listed above. This means that you will not have to specify them manually."
-msgstr "你应当总是为你的数据库将 <literal>hibernate.dialect</literal> 属性设置成正确的 <literal>org.hibernate.dialect.Dialect</literal> 子类。如果你指定一种方言,Hibernate 将为上面列出的一些属性使用合理的默认值,这样你就不用手工指定它们。"
+msgid ""
+"Always set the <literal>hibernate.dialect</literal> property to the correct "
+"<literal>org.hibernate.dialect.Dialect</literal> subclass for your database. "
+"If you specify a dialect, Hibernate will use sensible defaults for some of "
+"the other properties listed above. This means that you will not have to "
+"specify them manually."
+msgstr ""
+"你应当总是为你的数据库将 <literal>hibernate.dialect</literal> 属性设置成正确"
+"的 <literal>org.hibernate.dialect.Dialect</literal> 子类。如果你指定一种方"
+"言,Hibernate 将为上面列出的一些属性使用合理的默认值,这样你就不用手工指定它"
+"们。"
#. Tag: title
+#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect</literal>)"
msgstr "Hibernate SQL 方言(<literal>hibernate.dialect</literal>)"
#. Tag: entry
+#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr "RDBMS"
#. Tag: entry
+#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr "Dialect"
#. Tag: entry
+#: configuration.xml:941
#, no-c-format
-msgid "DB2"
-msgstr "DB2"
+msgid "<entry>DB2</entry>"
+msgstr "<entry>DB2</entry>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:943
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2Dialect"
msgstr "<literal>org.hibernate.dialect.DB2Dialect</literal>"
#. Tag: entry
+#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr "DB2 AS/400"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:949
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2400Dialect"
msgstr "<literal>org.hibernate.dialect.DB2400Dialect</literal>"
#. Tag: entry
+#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr "DB2 OS390"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
+#. Tag: literal
+#: configuration.xml:955
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.DB2390Dialect"
msgstr "<literal>org.hibernate.dialect.DB2390Dialect</literal>"
#. Tag: entry
+#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr "PostgreSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:961
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr "<literal>org.hibernate.dialect.PostgreSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr "MySQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:967
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLDialect"
msgstr "<literal>org.hibernate.dialect.MySQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr "MySQL with InnoDB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:973
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr "<literal>org.hibernate.dialect.MySQLInnoDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr "MySQL with MyISAM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
+#. Tag: literal
+#: configuration.xml:979
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr "<literal>org.hibernate.dialect.MySQLMyISAMDialect</literal>"
#. Tag: entry
+#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr "Oracle(any version)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.OracleDialect</literal>"
+#. Tag: literal
+#: configuration.xml:985
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.OracleDialect"
msgstr "<literal>org.hibernate.dialect.OracleDialect</literal>"
#. Tag: entry
+#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr "Oracle 9i"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
+#. Tag: literal
+#: configuration.xml:991
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr "<literal>org.hibernate.dialect.Oracle9iDialect</literal>"
#. Tag: entry
+#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr "Oracle 10g"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
+#. Tag: literal
+#: configuration.xml:997
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr "<literal>org.hibernate.dialect.Oracle10gDialect</literal>"
#. Tag: entry
+#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr "Sybase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1003
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseDialect"
msgstr "<literal>org.hibernate.dialect.SybaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr "Sybase Anywhere"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1009
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr "<literal>org.hibernate.dialect.SybaseAnywhereDialect</literal>"
#. Tag: entry
+#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr "Microsoft SQL Server"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1015
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SQLServerDialect"
msgstr "<literal>org.hibernate.dialect.SQLServerDialect</literal>"
#. Tag: entry
+#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr "SAP DB"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1021
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.SAPDBDialect"
msgstr "<literal>org.hibernate.dialect.SAPDBDialect</literal>"
#. Tag: entry
+#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr "Informix"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InformixDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1027
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InformixDialect"
msgstr "<literal>org.hibernate.dialect.InformixDialect</literal>"
#. Tag: entry
+#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr "HypersonicSQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.HSQLDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1033
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.HSQLDialect"
msgstr "<literal>org.hibernate.dialect.HSQLDialect</literal>"
#. Tag: entry
+#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr "Ingres"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.IngresDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1039
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.IngresDialect"
msgstr "<literal>org.hibernate.dialect.IngresDialect</literal>"
#. Tag: entry
+#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr "Progress"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.ProgressDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1045
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.ProgressDialect"
msgstr "<literal>org.hibernate.dialect.ProgressDialect</literal>"
#. Tag: entry
+#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr "Mckoi SQL"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.MckoiDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1051
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.MckoiDialect"
msgstr "<literal>org.hibernate.dialect.MckoiDialect</literal>"
#. Tag: entry
+#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr "Interbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1057
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.InterbaseDialect"
msgstr "<literal>org.hibernate.dialect.InterbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr "Pointbase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1063
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.PointbaseDialect"
msgstr "<literal>org.hibernate.dialect.PointbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr "FrontBase"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1069
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr "<literal>org.hibernate.dialect.FrontbaseDialect</literal>"
#. Tag: entry
+#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr "Firebird"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
+#. Tag: literal
+#: configuration.xml:1075
+#, fuzzy, no-c-format
+msgid "org.hibernate.dialect.FirebirdDialect"
msgstr "<literal>org.hibernate.dialect.FirebirdDialect</literal>"
#. Tag: title
+#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr "外连接抓取(Outer Join Fetching)"
#. Tag: para
+#: configuration.xml:1085
#, no-c-format
-msgid "If your database supports ANSI, Oracle or Sybase style outer joins, <emphasis>outer join fetching</emphasis> will often increase performance by limiting the number of round trips to and from the database. This is, however, at the cost of possibly more work performed by the database itself. Outer join fetching allows a whole graph of objects connected by many-to-one, one-to-many, many-to-many and one-to-one associations to be retrieved in a single SQL <literal>SELECT</literal>."
-msgstr "如果你的数据库支持 ANSI、Oracle 或 Sybase 风格的外连接,<emphasis>外连接抓取</emphasis>通常能通过限制往返数据库次数(更多的工作交由数据库自己来完成)来提高效率。外连接抓取允许在单个 <literal>SELECT</literal> SQL 语句中, 通过 many-to-one、one-to-many、many-to-many 和 one-to-one 关联获取连接对象的整个对象图。"
+msgid ""
+"If your database supports ANSI, Oracle or Sybase style outer joins, "
+"<emphasis>outer join fetching</emphasis> will often increase performance by "
+"limiting the number of round trips to and from the database. This is, "
+"however, at the cost of possibly more work performed by the database itself. "
+"Outer join fetching allows a whole graph of objects connected by many-to-"
+"one, one-to-many, many-to-many and one-to-one associations to be retrieved "
+"in a single SQL <literal>SELECT</literal>."
+msgstr ""
+"如果你的数据库支持 ANSI、Oracle 或 Sybase 风格的外连接,<emphasis>外连接抓取"
+"</emphasis>通常能通过限制往返数据库次数(更多的工作交由数据库自己来完成)来提"
+"高效率。外连接抓取允许在单个 <literal>SELECT</literal> SQL 语句中, 通过 "
+"many-to-one、one-to-many、many-to-many 和 one-to-one 关联获取连接对象的整个对"
+"象图。"
#. Tag: para
+#: configuration.xml:1094
#, no-c-format
-msgid "Outer join fetching can be disabled <emphasis>globally</emphasis> by setting the property <literal>hibernate.max_fetch_depth</literal> to <literal>0</literal>. A setting of <literal>1</literal> or higher enables outer join fetching for one-to-one and many-to-one associations that have been mapped with <literal>fetch=\"join\"</literal>."
-msgstr "将 <literal>hibernate.max_fetch_depth</literal> 设为 <literal>0</literal> 能在<emphasis>全局</emphasis> 范围内禁止外连接抓取。设为 <literal>1</literal> 或更高值能启用 one-to-one 和 many-to-oneouter 关联的外连接抓取,它们通过 <literal>fetch=\"join\"</literal> 来映射。 "
+msgid ""
+"Outer join fetching can be disabled <emphasis>globally</emphasis> by setting "
+"the property <literal>hibernate.max_fetch_depth</literal> to <literal>0</"
+"literal>. A setting of <literal>1</literal> or higher enables outer join "
+"fetching for one-to-one and many-to-one associations that have been mapped "
+"with <literal>fetch=\"join\"</literal>."
+msgstr ""
+"将 <literal>hibernate.max_fetch_depth</literal> 设为 <literal>0</literal> 能"
+"在<emphasis>全局</emphasis> 范围内禁止外连接抓取。设为 <literal>1</literal> "
+"或更高值能启用 one-to-one 和 many-to-oneouter 关联的外连接抓取,它们通过 "
+"<literal>fetch=\"join\"</literal> 来映射。 "
#. Tag: para
-#, no-c-format
-msgid "See <xref linkend=\"performance-fetching\" /> for more information."
+#: configuration.xml:1100
+#, fuzzy, no-c-format
+msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr "参见 <xref linkend=\"performance-fetching\"/> 获得更多信息。 "
#. Tag: title
+#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr "二进制流(Binary Streams)"
#. Tag: para
+#: configuration.xml:1107
#, no-c-format
-msgid "Oracle limits the size of <literal>byte</literal> arrays that can be passed to and/or from its JDBC driver. If you wish to use large instances of <literal>binary</literal> or <literal>serializable</literal> type, you should enable <literal>hibernate.jdbc.use_streams_for_binary</literal>. <emphasis>This is a system-level setting only.</emphasis>"
-msgstr "Oracle 限制那些通过 JDBC 驱动传输的<literal>字节</literal>数组的数目。如果你希望使用<literal>二进值(binary)</literal>或 <literal>可序列化的(serializable)</literal>类型的大对象,你应该开启 <literal>hibernate.jdbc.use_streams_for_binary</literal> 属性。<emphasis>这是系统级属性。</emphasis> "
+msgid ""
+"Oracle limits the size of <literal>byte</literal> arrays that can be passed "
+"to and/or from its JDBC driver. If you wish to use large instances of "
+"<literal>binary</literal> or <literal>serializable</literal> type, you "
+"should enable <literal>hibernate.jdbc.use_streams_for_binary</literal>. "
+"<emphasis>This is a system-level setting only.</emphasis>"
+msgstr ""
+"Oracle 限制那些通过 JDBC 驱动传输的<literal>字节</literal>数组的数目。如果你"
+"希望使用<literal>二进值(binary)</literal>或 <literal>可序列化的"
+"(serializable)</literal>类型的大对象,你应该开启 <literal>hibernate.jdbc."
+"use_streams_for_binary</literal> 属性。<emphasis>这是系统级属性。</emphasis> "
#. Tag: title
+#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr "二级缓存与查询缓存"
#. Tag: para
-#, no-c-format
-msgid "The properties prefixed by <literal>hibernate.cache</literal> allow you to use a process or cluster scoped second-level cache system with Hibernate. See the <xref linkend=\"performance-cache\" /> for more information."
-msgstr "以 <literal>hibernate.cache</literal> 为前缀的属性允许你在 Hibernate 中,使用进程或群集范围内的二级缓存系统。参见 <xref linkend=\"performance-cache\"/> 获取更多的详情。"
+#: configuration.xml:1118
+#, fuzzy, no-c-format
+msgid ""
+"The properties prefixed by <literal>hibernate.cache</literal> allow you to "
+"use a process or cluster scoped second-level cache system with Hibernate. "
+"See the <xref linkend=\"performance-cache\"/> for more information."
+msgstr ""
+"以 <literal>hibernate.cache</literal> 为前缀的属性允许你在 Hibernate 中,使用"
+"进程或群集范围内的二级缓存系统。参见 <xref linkend=\"performance-cache\"/> 获"
+"取更多的详情。"
#. Tag: title
+#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr "查询语言中的替换"
#. Tag: para
+#: configuration.xml:1127
#, no-c-format
-msgid "You can define new Hibernate query tokens using <literal>hibernate.query.substitutions</literal>. For example:"
-msgstr "你可以使用 <literal>hibernate.query.substitutions</literal> 在 Hibernate 中定义新的查询符号。例如: "
+msgid ""
+"You can define new Hibernate query tokens using <literal>hibernate.query."
+"substitutions</literal>. For example:"
+msgstr ""
+"你可以使用 <literal>hibernate.query.substitutions</literal> 在 Hibernate 中定"
+"义新的查询符号。例如: "
+#. Tag: programlisting
+#: configuration.xml:1130
+#, no-c-format
+msgid "hibernate.query.substitutions true=1, false=0"
+msgstr "hibernate.query.substitutions true=1,false=0"
+
#. Tag: para
+#: configuration.xml:1132
#, no-c-format
-msgid "This would cause the tokens <literal>true</literal> and <literal>false</literal> to be translated to integer literals in the generated SQL."
-msgstr "将导致符号 <literal>true</literal> 和 <literal>false</literal> 在生成的 SQL 中被翻译成整数常量。"
+msgid ""
+"This would cause the tokens <literal>true</literal> and <literal>false</"
+"literal> to be translated to integer literals in the generated SQL."
+msgstr ""
+"将导致符号 <literal>true</literal> 和 <literal>false</literal> 在生成的 SQL "
+"中被翻译成整数常量。"
+#. Tag: programlisting
+#: configuration.xml:1136
+#, no-c-format
+msgid "hibernate.query.substitutions toLowercase=LOWER"
+msgstr "hibernate.query.substitutions toLowercase=LOWER"
+
#. Tag: para
+#: configuration.xml:1138
#, no-c-format
-msgid "This would allow you to rename the SQL <literal>LOWER</literal> function."
+msgid ""
+"This would allow you to rename the SQL <literal>LOWER</literal> function."
msgstr "将允许你重命名 SQL 中的 <literal>LOWER</literal> 函数。"
#. Tag: title
+#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr "Hibernate 的统计(statistics)机制"
#. Tag: para
+#: configuration.xml:1145
#, no-c-format
-msgid "If you enable <literal>hibernate.generate_statistics</literal>, Hibernate exposes a number of metrics that are useful when tuning a running system via <literal>SessionFactory.getStatistics()</literal>. Hibernate can even be configured to expose these statistics via JMX. Read the Javadoc of the interfaces in <literal>org.hibernate.stats</literal> for more information."
-msgstr "如果你开启 <literal>hibernate.generate_statistics</literal>,那么当你通过 <literal>SessionFactory.getStatistics()</literal> 调整正在运行的系统时,Hibernate 将导出大量有用的数据。Hibernate 甚至能被配置成通过 JMX 导出这些统计信息。参考 <literal>org.hibernate.stats</literal> 中接口的 Javadoc,以获得更多信息。 "
+msgid ""
+"If you enable <literal>hibernate.generate_statistics</literal>, Hibernate "
+"exposes a number of metrics that are useful when tuning a running system via "
+"<literal>SessionFactory.getStatistics()</literal>. Hibernate can even be "
+"configured to expose these statistics via JMX. Read the Javadoc of the "
+"interfaces in <literal>org.hibernate.stats</literal> for more information."
+msgstr ""
+"如果你开启 <literal>hibernate.generate_statistics</literal>,那么当你通过 "
+"<literal>SessionFactory.getStatistics()</literal> 调整正在运行的系统时,"
+"Hibernate 将导出大量有用的数据。Hibernate 甚至能被配置成通过 JMX 导出这些统计"
+"信息。参考 <literal>org.hibernate.stats</literal> 中接口的 Javadoc,以获得更"
+"多信息。 "
#. Tag: title
+#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr "日志"
#. Tag: para
+#: configuration.xml:1157
#, no-c-format
-msgid "Hibernate 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 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 url=\"http://www.slf4j.org/manual.html\">documentation</ulink> for more detail. To use Log4j you will also need to place a <filename>log4j.properties</filename> file in your classpath. An example properties file is distributed with Hibernate in the <literal>src/</literal> directory."
-msgstr "Hibernate 利用 <ulink url=\"http://www.slf4j.org/\">Simple Logging Facade for Java</ulink> (SLF4J) 来记录不同系统事件的日志。SLF4J 可以根据你选择的绑定把日志输出到几个日志框架(NOP、Simple、log4j version 1.2、JDK 1.4 logging、JCL 或 logback)上。为了设置日志,你需要在 classpath 里加入 <filename>slf4j-api.jar</filename> 和你选择的绑定的 JAR 文件(使用 Log4J 时加入 <filename>slf4j-log4j12.jar</filename>)。更多的细节请参考 SLF4J <ulink url=\"http://www.slf4j.org/manual.html\">文档</ulink>。要使用 Log4j,你也需要在 classpath 里加入 <filename>log4j.properties</filename> 文件。Hibernate 里的 <literal>src/</literal> 目录里带有一个属性文件的例子。"
+msgid ""
+"Hibernate 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 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 url=\"http://www.slf4j.org/manual.html\">documentation</"
+"ulink> for more detail. To use Log4j you will also need to place a "
+"<filename>log4j.properties</filename> file in your classpath. An example "
+"properties file is distributed with Hibernate in the <literal>src/</literal> "
+"directory."
+msgstr ""
+"Hibernate 利用 <ulink url=\"http://www.slf4j.org/\">Simple Logging Facade "
+"for Java</ulink> (SLF4J) 来记录不同系统事件的日志。SLF4J 可以根据你选择的绑定"
+"把日志输出到几个日志框架(NOP、Simple、log4j version 1.2、JDK 1.4 logging、"
+"JCL 或 logback)上。为了设置日志,你需要在 classpath 里加入 <filename>slf4j-"
+"api.jar</filename> 和你选择的绑定的 JAR 文件(使用 Log4J 时加入 "
+"<filename>slf4j-log4j12.jar</filename>)。更多的细节请参考 SLF4J <ulink url="
+"\"http://www.slf4j.org/manual.html\">文档</ulink>。要使用 Log4j,你也需要在 "
+"classpath 里加入 <filename>log4j.properties</filename> 文件。Hibernate 里的 "
+"<literal>src/</literal> 目录里带有一个属性文件的例子。"
#. Tag: para
+#: configuration.xml:1171
#, no-c-format
-msgid "It is recommended that you familiarize yourself with Hibernate's log messages. A lot of work has been put into making the Hibernate log as detailed as possible, without making it unreadable. It is an essential troubleshooting device. The most interesting log categories are the following:"
-msgstr "我们强烈建议你熟悉一下 Hibernate 的日志消息。在不失可读性的前提下,我们做了很多工作,使 Hibernate 的日志可能地详细。这是必要的查错利器。最令人感兴趣的日志分类有如下这些:"
+msgid ""
+"It is recommended that you familiarize yourself with Hibernate's log "
+"messages. A lot of work has been put into making the Hibernate log as "
+"detailed as possible, without making it unreadable. It is an essential "
+"troubleshooting device. The most interesting log categories are the "
+"following:"
+msgstr ""
+"我们强烈建议你熟悉一下 Hibernate 的日志消息。在不失可读性的前提下,我们做了很"
+"多工作,使 Hibernate 的日志可能地详细。这是必要的查错利器。最令人感兴趣的日志"
+"分类有如下这些:"
#. Tag: title
+#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr "Hibernate 日志类别"
#. Tag: entry
+#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr "类别"
#. Tag: entry
+#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr "功能"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.SQL</literal>"
-msgstr "<literal>org.hibernate.SQL</literal>"
+#. Tag: literal
+#: configuration.xml:1195
+#, fuzzy, no-c-format
+msgid "org.hibernate.SQL"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr "在所有 SQL DML 语句被执行时为它们记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.type</literal>"
-msgstr "<literal>org.hibernate.type</literal>"
+#. Tag: literal
+#: configuration.xml:1201
+#, fuzzy, no-c-format
+msgid "org.hibernate.type"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr "为所有 JDBC 参数记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.tool.hbm2ddl</literal>"
+#. Tag: literal
+#: configuration.xml:1207
+#, fuzzy, no-c-format
+msgid "org.hibernate.tool.hbm2ddl"
msgstr "<literal>org.hibernate.tool.hbm2ddl</literal>"
#. Tag: entry
+#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr "在所有 SQL DDL 语句执行时为它们记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.pretty</literal>"
-msgstr "<literal>org.hibernate.pretty</literal>"
+#. Tag: literal
+#: configuration.xml:1213
+#, fuzzy, no-c-format
+msgid "org.hibernate.pretty"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1215
#, no-c-format
-msgid "Log the state of all entities (max 20 entities) associated with the session at flush time"
-msgstr "在 session 清洗(flush)时,为所有与其关联的实体(最多 20 个)的状态记录日志"
+msgid ""
+"Log the state of all entities (max 20 entities) associated with the session "
+"at flush time"
+msgstr ""
+"在 session 清洗(flush)时,为所有与其关联的实体(最多 20 个)的状态记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache</literal>"
-msgstr "<literal>org.hibernate.cache</literal>"
+#. Tag: literal
+#: configuration.xml:1220
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr "为所有二级缓存的活动记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction</literal>"
+#. Tag: literal
+#: configuration.xml:1226
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction"
msgstr "<literal>org.hibernate.transaction</literal>"
#. Tag: entry
+#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr "为事务相关的活动记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.jdbc</literal>"
-msgstr "<literal>org.hibernate.jdbc</literal>"
+#. Tag: literal
+#: configuration.xml:1232
+#, fuzzy, no-c-format
+msgid "org.hibernate.jdbc"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr "为所有 JDBC 资源的获取记录日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.hql.ast.AST</literal>"
+#. Tag: literal
+#: configuration.xml:1238
+#, fuzzy, no-c-format
+msgid "org.hibernate.hql.ast.AST"
msgstr "<literal>org.hibernate.hql.ast.AST</literal>"
#. Tag: entry
+#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr "在解析查询的时候,记录 HQL 和 SQL 的 AST 分析日志"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.secure</literal>"
-msgstr "<literal>org.hibernate.secure</literal>"
+#. Tag: literal
+#: configuration.xml:1244
+#, fuzzy, no-c-format
+msgid "org.hibernate.secure"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr "为 JAAS 认证请求做日志"
-#. Tag: entry
+#. Tag: literal
+#: configuration.xml:1250
#, no-c-format
-msgid "<literal>org.hibernate</literal>"
-msgstr "<literal>org.hibernate</literal>"
+msgid "org.hibernate"
+msgstr "org.hibernate"
#. Tag: entry
+#: configuration.xml:1252
#, no-c-format
-msgid "Log everything. This is a lot of information but it is useful for troubleshooting"
+msgid ""
+"Log everything. This is a lot of information but it is useful for "
+"troubleshooting"
msgstr "为任何 Hibernate 相关信息记录日志(信息量较大,但对查错非常有帮助)"
#. Tag: para
+#: configuration.xml:1259
#, no-c-format
-msgid "When developing applications with Hibernate, you should almost always work with <literal>debug</literal> enabled for the category <literal>org.hibernate.SQL</literal>, or, alternatively, the property <literal>hibernate.show_sql</literal> enabled."
-msgstr "在使用 Hibernate 开发应用程序时,你应当总是为 <literal>org.hibernate.SQL</literal> 开启 <literal>debug</literal> 级别的日志记录,或者开启 <literal>hibernate.show_sql</literal> 属性。"
+msgid ""
+"When developing applications with Hibernate, you should almost always work "
+"with <literal>debug</literal> enabled for the category <literal>org."
+"hibernate.SQL</literal>, or, alternatively, the property <literal>hibernate."
+"show_sql</literal> enabled."
+msgstr ""
+"在使用 Hibernate 开发应用程序时,你应当总是为 <literal>org.hibernate.SQL</"
+"literal> 开启 <literal>debug</literal> 级别的日志记录,或者开启 "
+"<literal>hibernate.show_sql</literal> 属性。"
#. Tag: title
+#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy</literal>"
msgstr "实现 <literal>NamingStrategy</literal>"
#. Tag: para
+#: configuration.xml:1268
#, no-c-format
-msgid "The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you to specify a \"naming standard\" for database objects and schema elements."
-msgstr "<literal>org.hibernate.cfg.NamingStrategy</literal> 接口允许你为数据库中的对象和 schema 元素指定一个“命名标准”。"
+msgid ""
+"The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you "
+"to specify a \"naming standard\" for database objects and schema elements."
+msgstr ""
+"<literal>org.hibernate.cfg.NamingStrategy</literal> 接口允许你为数据库中的对"
+"象和 schema 元素指定一个“命名标准”。"
#. Tag: para
+#: configuration.xml:1272
#, no-c-format
-msgid "You can provide rules for automatically generating database identifiers from Java identifiers or for processing \"logical\" column and table names given in the mapping file into \"physical\" table and column names. This feature helps reduce the verbosity of the mapping document, eliminating repetitive noise (<literal>TBL_</literal> prefixes, for example). The default strategy used by Hibernate is quite minimal."
-msgstr "你可能会提供一些通过 Java 标识生成数据库标识或将映射定义文件中\"逻辑\"表/列名处理成\"物理\"表/列名的规则。这个特性有助于减少冗长的映射定义文件,消除重复内容(如 <literal>TBL_</literal> 前缀)。Hibernate 使用的缺省策略是相当精简的。"
+msgid ""
+"You can provide rules for automatically generating database identifiers from "
+"Java identifiers or for processing \"logical\" column and table names given "
+"in the mapping file into \"physical\" table and column names. This feature "
+"helps reduce the verbosity of the mapping document, eliminating repetitive "
+"noise (<literal>TBL_</literal> prefixes, for example). The default strategy "
+"used by Hibernate is quite minimal."
+msgstr ""
+"你可能会提供一些通过 Java 标识生成数据库标识或将映射定义文件中\"逻辑\"表/列名"
+"处理成\"物理\"表/列名的规则。这个特性有助于减少冗长的映射定义文件,消除重复内"
+"容(如 <literal>TBL_</literal> 前缀)。Hibernate 使用的缺省策略是相当精简的。"
#. Tag: para
+#: configuration.xml:1279
#, no-c-format
-msgid "You can specify a different strategy by calling <literal>Configuration.setNamingStrategy()</literal> before adding mappings:"
-msgstr "在加入映射定义前,你可以调用 <literal>Configuration.setNamingStrategy()</literal> 指定一个不同的命名策略: "
+msgid ""
+"You can specify a different strategy by calling <literal>Configuration."
+"setNamingStrategy()</literal> before adding mappings:"
+msgstr ""
+"在加入映射定义前,你可以调用 <literal>Configuration.setNamingStrategy()</"
+"literal> 指定一个不同的命名策略: "
+#. Tag: programlisting
+#: configuration.xml:1283
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+"<![CDATA[SessionFactory sf = new Configuration()\n"
+" .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
+" .addFile(\"Item.hbm.xml\")\n"
+" .addFile(\"Bid.hbm.xml\")\n"
+" .buildSessionFactory();]]>"
+
#. Tag: para
+#: configuration.xml:1285
#, no-c-format
-msgid "<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in strategy that might be a useful starting point for some applications."
-msgstr "<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> 是一个内建的命名策略,对一些应用程序而言,可能是非常有用的起点。"
+msgid ""
+"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in "
+"strategy that might be a useful starting point for some applications."
+msgstr ""
+"<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> 是一个内建的命名"
+"策略,对一些应用程序而言,可能是非常有用的起点。"
#. Tag: title
+#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr "XML 配置文件"
#. Tag: para
+#: configuration.xml:1293
#, no-c-format
-msgid "An alternative approach to configuration is to specify a full configuration in a file named <literal>hibernate.cfg.xml</literal>. This file can be used as a replacement for the <literal>hibernate.properties</literal> file or, if both are present, to override properties."
-msgstr "另一个配置方法是在 <literal>hibernate.cfg.xml</literal> 文件中指定一套完整的配置。这个文件可以当成 <literal>hibernate.properties</literal> 的替代。若两个文件同时存在,它将覆盖前者的属性。"
+msgid ""
+"An alternative approach to configuration is to specify a full configuration "
+"in a file named <literal>hibernate.cfg.xml</literal>. This file can be used "
+"as a replacement for the <literal>hibernate.properties</literal> file or, if "
+"both are present, to override properties."
+msgstr ""
+"另一个配置方法是在 <literal>hibernate.cfg.xml</literal> 文件中指定一套完整的"
+"配置。这个文件可以当成 <literal>hibernate.properties</literal> 的替代。若两个"
+"文件同时存在,它将覆盖前者的属性。"
#. Tag: para
+#: configuration.xml:1299
#, no-c-format
-msgid "The XML configuration file is by default expected to be in the root of your <literal>CLASSPATH</literal>. Here is an example:"
-msgstr "XML 配置文件被默认是放在 <literal>CLASSPATH</literal> 的根目录下。下面是一个例子: "
+msgid ""
+"The XML configuration file is by default expected to be in the root of your "
+"<literal>CLASSPATH</literal>. Here is an example:"
+msgstr ""
+"XML 配置文件被默认是放在 <literal>CLASSPATH</literal> 的根目录下。下面是一个"
+"例子: "
+#. Tag: programlisting
+#: configuration.xml:1302
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/"
+"MyDB</property>\n"
+" <property name=\"dialect\">org.hibernate.dialect."
+"MySQLDialect</property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/"
+"UserTransaction</property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
+"write\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
+"\"/>\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>"
+msgstr ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n"
+"\n"
+"<hibernate-configuration>\n"
+"\n"
+" <!-- a SessionFactory instance listed as /jndi/name -->\n"
+" <session-factory\n"
+" name=\"java:hibernate/SessionFactory\">\n"
+"\n"
+" <!-- properties -->\n"
+" <property name=\"connection.datasource\">java:/comp/env/jdbc/MyDB</"
+"property>\n"
+" <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</"
+"property>\n"
+" <property name=\"show_sql\">false</property>\n"
+" <property name=\"transaction.factory_class\">\n"
+" org.hibernate.transaction.JTATransactionFactory\n"
+" </property>\n"
+" <property name=\"jta.UserTransaction\">java:comp/UserTransaction</"
+"property>\n"
+"\n"
+" <!-- mapping files -->\n"
+" <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
+" <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
+"\n"
+" <!-- cache settings -->\n"
+" <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-write"
+"\"/>\n"
+" <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only\"/"
+">\n"
+" <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
+"usage=\"read-write\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+
#. Tag: para
+#: configuration.xml:1304
#, no-c-format
-msgid "The advantage of this approach is the externalization of the mapping file names to configuration. The <literal>hibernate.cfg.xml</literal> is also more convenient once you have to tune the Hibernate cache. It is your choice to use either <literal>hibernate.properties</literal> or <literal>hibernate.cfg.xml</literal>. Both are equivalent, except for the above mentioned benefits of using the XML syntax."
-msgstr "如你所见,这个方法优势在于,在配置文件中指出了映射定义文件的名字。一旦你需要调整 Hibernate 的缓存,<literal>hibernate.cfg.xml</literal> 也是更方便。注意,使用 <literal>hibernate.properties</literal> 还是 <literal>hibernate.cfg.xml</literal> 完全是由你来决定,除了上面提到的 XML 语法的优势之外,两者是等价的。 "
+msgid ""
+"The advantage of this approach is the externalization of the mapping file "
+"names to configuration. The <literal>hibernate.cfg.xml</literal> is also "
+"more convenient once you have to tune the Hibernate cache. It is your choice "
+"to use either <literal>hibernate.properties</literal> or <literal>hibernate."
+"cfg.xml</literal>. Both are equivalent, except for the above mentioned "
+"benefits of using the XML syntax."
+msgstr ""
+"如你所见,这个方法优势在于,在配置文件中指出了映射定义文件的名字。一旦你需要"
+"调整 Hibernate 的缓存,<literal>hibernate.cfg.xml</literal> 也是更方便。注"
+"意,使用 <literal>hibernate.properties</literal> 还是 <literal>hibernate.cfg."
+"xml</literal> 完全是由你来决定,除了上面提到的 XML 语法的优势之外,两者是等价"
+"的。 "
#. Tag: para
+#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr "使用 XML 配置,使得启动 Hibernate 变的异常简单:"
+#. Tag: programlisting
+#: configuration.xml:1314
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration().configure().buildSessionFactory();"
+msgstr ""
+"<![CDATA[SessionFactory sf = new Configuration().configure()."
+"buildSessionFactory();]]>"
+
#. Tag: para
+#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
msgstr "你可以使用如下代码来添加一个不同的 XML 配置文件:"
+#. Tag: programlisting
+#: configuration.xml:1318
+#, fuzzy, no-c-format
+msgid ""
+"SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();"
+msgstr ""
+"<![CDATA[SessionFactory sf = new Configuration()\n"
+" .configure(\"catdb.cfg.xml\")\n"
+" .buildSessionFactory();]]>"
+
#. Tag: title
+#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr "J2EE 应用程序服务器的集成"
#. Tag: para
+#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr "针对 J2EE 体系,Hibernate 有如下几个集成的方面:"
#. Tag: para
+#: configuration.xml:1329
#, no-c-format
-msgid "<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC connections managed by the container and provided through JNDI. Usually, a JTA compatible <literal>TransactionManager</literal> and a <literal>ResourceManager</literal> take care of transaction management (CMT), especially distributed transaction handling across several datasources. You can also demarcate transaction boundaries programmatically (BMT), or you might want to use the optional Hibernate <literal>Transaction</literal> API for this to keep your code portable."
-msgstr "<emphasis>容器管理的数据源(Container-managed datasources)</emphasis>: Hibernate 能使用通过容器管理,并由 JNDI 提供的 JDBC 连接。通常,特别是当处理多个数据源的分布式事务的时候,由一个 JTA 兼容的 <literal>TransactionManager</literal> 和一个 <literal>ResourceManager</literal> 来处理事务管理(CMT,容器管理的事务)。当然你可以通过 编程方式来划分事务边界(BMT,Bean 管理的事务)。或者为了代码的可移植性,你也也许会想使用可选的 Hibernate <literal>Transaction</literal> API。 "
+msgid ""
+"<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC "
+"connections managed by the container and provided through JNDI. Usually, a "
+"JTA compatible <literal>TransactionManager</literal> and a "
+"<literal>ResourceManager</literal> take care of transaction management "
+"(CMT), especially distributed transaction handling across several "
+"datasources. You can also demarcate transaction boundaries programmatically "
+"(BMT), or you might want to use the optional Hibernate <literal>Transaction</"
+"literal> API for this to keep your code portable."
+msgstr ""
+"<emphasis>容器管理的数据源(Container-managed datasources)</emphasis>: "
+"Hibernate 能使用通过容器管理,并由 JNDI 提供的 JDBC 连接。通常,特别是当处理"
+"多个数据源的分布式事务的时候,由一个 JTA 兼容的 <literal>TransactionManager</"
+"literal> 和一个 <literal>ResourceManager</literal> 来处理事务管理(CMT,容器"
+"管理的事务)。当然你可以通过 编程方式来划分事务边界(BMT,Bean 管理的事务)。"
+"或者为了代码的可移植性,你也也许会想使用可选的 Hibernate "
+"<literal>Transaction</literal> API。 "
#. Tag: para
+#: configuration.xml:1343
#, no-c-format
-msgid "<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its <literal>SessionFactory</literal> to JNDI after startup."
-msgstr "<emphasis>自动 JNDI 绑定</emphasis>:Hibernate 可以在启动后将 <literal>SessionFactory</literal> 绑定到 JNDI。"
+msgid ""
+"<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its "
+"<literal>SessionFactory</literal> to JNDI after startup."
+msgstr ""
+"<emphasis>自动 JNDI 绑定</emphasis>:Hibernate 可以在启动后将 "
+"<literal>SessionFactory</literal> 绑定到 JNDI。"
#. Tag: para
+#: configuration.xml:1350
#, no-c-format
-msgid "<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</literal> can be automatically bound to the scope of JTA transactions. Simply lookup the <literal>SessionFactory</literal> from JNDI and get the current <literal>Session</literal>. Let Hibernate manage flushing and closing the <literal>Session</literal> when your JTA transaction completes. Transaction demarcation is either declarative (CMT) or programmatic (BMT/UserTransaction)."
-msgstr "<emphasis>JTA Session 绑定:</emphasis> Hibernate <literal>Session</literal> 可以自动绑定到 JTA 事务作用的范围。只需简单地从 JNDI 查找 <literal>SessionFactory</literal> 并获得当前的 <literal>Session</literal>。当 JTA 事务完成时,让 Hibernate来处理 <literal>Session</literal> 的清洗(flush)与关闭。事务的划分可以是声明式的(CMT),也可以是编程式的(BMT/UserTransaction)。 "
+msgid ""
+"<emphasis>JTA Session binding:</emphasis> the Hibernate <literal>Session</"
+"literal> can be automatically bound to the scope of JTA transactions. Simply "
+"lookup the <literal>SessionFactory</literal> from JNDI and get the current "
+"<literal>Session</literal>. Let Hibernate manage flushing and closing the "
+"<literal>Session</literal> when your JTA transaction completes. Transaction "
+"demarcation is either declarative (CMT) or programmatic (BMT/"
+"UserTransaction)."
+msgstr ""
+"<emphasis>JTA Session 绑定:</emphasis> Hibernate <literal>Session</literal> "
+"可以自动绑定到 JTA 事务作用的范围。只需简单地从 JNDI 查找 "
+"<literal>SessionFactory</literal> 并获得当前的 <literal>Session</literal>。"
+"当 JTA 事务完成时,让 Hibernate来处理 <literal>Session</literal> 的清洗"
+"(flush)与关闭。事务的划分可以是声明式的(CMT),也可以是编程式的(BMT/"
+"UserTransaction)。 "
#. Tag: para
+#: configuration.xml:1362
#, no-c-format
-msgid "<emphasis>JMX deployment:</emphasis> if you have a JMX capable application server (e.g. JBoss AS), you can choose to deploy Hibernate as a managed MBean. This saves you the one line startup code to build your <literal>SessionFactory</literal> from a <literal>Configuration</literal>. The container will startup your <literal>HibernateService</literal> and also take care of service dependencies (datasource has to be available before Hibernate starts, etc)."
-msgstr "<emphasis>JMX 部署:</emphasis> 如果你使用支持 JMX 应用程序服务器(如,JBoss AS),那么你可以选择将 Hibernate 部署成托管 MBean。这将为你省去一行从<literal>Configuration</literal> 构建 <literal>SessionFactory</literal> 的启动代码。容器将启动你的 <literal>HibernateService</literal>,并完美地处理好服务间的依赖关系(在 Hibernate 启动前,数据源必须是可用的,等等)。 "
+msgid ""
+"<emphasis>JMX deployment:</emphasis> if you have a JMX capable application "
+"server (e.g. JBoss AS), you can choose to deploy Hibernate as a managed "
+"MBean. This saves you the one line startup code to build your "
+"<literal>SessionFactory</literal> from a <literal>Configuration</literal>. "
+"The container will startup your <literal>HibernateService</literal> and also "
+"take care of service dependencies (datasource has to be available before "
+"Hibernate starts, etc)."
+msgstr ""
+"<emphasis>JMX 部署:</emphasis> 如果你使用支持 JMX 应用程序服务器(如,JBoss "
+"AS),那么你可以选择将 Hibernate 部署成托管 MBean。这将为你省去一行从"
+"<literal>Configuration</literal> 构建 <literal>SessionFactory</literal> 的启"
+"动代码。容器将启动你的 <literal>HibernateService</literal>,并完美地处理好服"
+"务间的依赖关系(在 Hibernate 启动前,数据源必须是可用的,等等)。 "
#. Tag: para
+#: configuration.xml:1373
#, no-c-format
-msgid "Depending on your environment, you might have to set the configuration option <literal>hibernate.connection.aggressive_release</literal> to true if your application server shows \"connection containment\" exceptions."
-msgstr "如果应用程序服务器抛出 \"connection containment\" 异常,根据你的环境,也许该将配置属性 <literal>hibernate.connection.release_mode</literal> 设为 <literal>after_statement</literal>。"
+msgid ""
+"Depending on your environment, you might have to set the configuration "
+"option <literal>hibernate.connection.aggressive_release</literal> to true if "
+"your application server shows \"connection containment\" exceptions."
+msgstr ""
+"如果应用程序服务器抛出 \"connection containment\" 异常,根据你的环境,也许该"
+"将配置属性 <literal>hibernate.connection.release_mode</literal> 设为 "
+"<literal>after_statement</literal>。"
#. Tag: title
+#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr "事务策略配置"
#. Tag: para
+#: configuration.xml:1381
#, no-c-format
-msgid "The Hibernate <literal>Session</literal> API is independent of any transaction demarcation system in your architecture. If you let Hibernate use JDBC directly through a connection pool, you can begin and end your transactions by calling the JDBC API. If you run in a J2EE application server, you might want to use bean-managed transactions and call the JTA API and <literal>UserTransaction</literal> when needed."
-msgstr "在你的架构中,Hibernate 的 <literal>Session</literal> API 是独立于任何事务分界系统的。如果你让 Hibernate 通过连接池直接使用 JDBC,你需要调用 JDBC API 来打开和关闭你的事务。如果你运行在 J2EE 应用程序服务器中,你也许想用 Bean 管理的事务并在需要的时候调用 JTA API 和 <literal>UserTransaction</literal>。 "
+msgid ""
+"The Hibernate <literal>Session</literal> API is independent of any "
+"transaction demarcation system in your architecture. If you let Hibernate "
+"use JDBC directly through a connection pool, you can begin and end your "
+"transactions by calling the JDBC API. If you run in a J2EE application "
+"server, you might want to use bean-managed transactions and call the JTA API "
+"and <literal>UserTransaction</literal> when needed."
+msgstr ""
+"在你的架构中,Hibernate 的 <literal>Session</literal> API 是独立于任何事务分"
+"界系统的。如果你让 Hibernate 通过连接池直接使用 JDBC,你需要调用 JDBC API 来"
+"打开和关闭你的事务。如果你运行在 J2EE 应用程序服务器中,你也许想用 Bean 管理"
+"的事务并在需要的时候调用 JTA API 和 <literal>UserTransaction</literal>。 "
#. Tag: para
+#: configuration.xml:1389
#, no-c-format
-msgid "To keep your code portable between these two (and other) environments we recommend the optional Hibernate <literal>Transaction</literal> API, which wraps and hides the underlying system. You have to specify a factory class for <literal>Transaction</literal> instances by setting the Hibernate configuration property <literal>hibernate.transaction.factory_class</literal>."
-msgstr "为了让你的代码在两种(或其他)环境中可以移植,我们建议使用可选的 Hibernate <literal>Transaction</literal> API,它包装并隐藏了底层系统。你必须通过设置 Hibernate 配置属性 <literal>hibernate.transaction.factory_class</literal> 来指定一个 <literal>Transaction</literal> 实例的工厂类。"
+msgid ""
+"To keep your code portable between these two (and other) environments we "
+"recommend the optional Hibernate <literal>Transaction</literal> API, which "
+"wraps and hides the underlying system. You have to specify a factory class "
+"for <literal>Transaction</literal> instances by setting the Hibernate "
+"configuration property <literal>hibernate.transaction.factory_class</"
+"literal>."
+msgstr ""
+"为了让你的代码在两种(或其他)环境中可以移植,我们建议使用可选的 Hibernate "
+"<literal>Transaction</literal> API,它包装并隐藏了底层系统。你必须通过设置 "
+"Hibernate 配置属性 <literal>hibernate.transaction.factory_class</literal> 来"
+"指定一个 <literal>Transaction</literal> 实例的工厂类。"
#. Tag: para
+#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr "有三个标准(内建)的选择: "
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1401
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr "<literal>org.hibernate.transaction.JDBCTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr "委托给数据库(JDBC)事务(默认)"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1409
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr "<literal>org.hibernate.transaction.JTATransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1412
#, no-c-format
-msgid "delegates to container-managed transactions if an existing transaction is underway in this context (for example, EJB session bean method). Otherwise, a new transaction is started and bean-managed transactions are used."
-msgstr "如果在上下文环境中存在运行着的事务(如,EJB 会话 Bean 的方法),则委托给容器管理的事务。否则,将启动一个新的事务,并使用 Bean 管理的事务。"
+msgid ""
+"delegates to container-managed transactions if an existing transaction is "
+"underway in this context (for example, EJB session bean method). Otherwise, "
+"a new transaction is started and bean-managed transactions are used."
+msgstr ""
+"如果在上下文环境中存在运行着的事务(如,EJB 会话 Bean 的方法),则委托给容器"
+"管理的事务。否则,将启动一个新的事务,并使用 Bean 管理的事务。"
-#. Tag: term
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
+#. Tag: literal
+#: configuration.xml:1420
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr "<literal>org.hibernate.transaction.CMTTransactionFactory</literal>"
#. Tag: para
+#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr "委托给容器管理的 JTA 事务"
#. Tag: para
+#: configuration.xml:1428
#, no-c-format
-msgid "You can also define your own transaction strategies (for a CORBA transaction service, for example)."
+msgid ""
+"You can also define your own transaction strategies (for a CORBA transaction "
+"service, for example)."
msgstr "你也可以定义属于你自己的事务策略(如,针对 CORBA 的事务服务)。"
#. Tag: para
+#: configuration.xml:1431
#, no-c-format
-msgid "Some features in Hibernate (i.e., the second level cache, Contextual Sessions with JTA, etc.) require access to the JTA <literal>TransactionManager</literal> in a managed environment. In an application server, since J2EE does not standardize a single mechanism, you have to specify how Hibernate should obtain a reference to the <literal>TransactionManager</literal>:"
-msgstr "Hibernate 的一些特性(比如二级缓存,Contextual Sessions with JTA 等等)需要访问在托管环境中的 JTA <literal>TransactionManager</literal>。由于 J2EE 没有标准化一个单一的机制,Hibernate 在应用程序服务器中,你必须指定 Hibernate 如何获得 <literal>TransactionManager</literal> 的引用: "
+msgid ""
+"Some features in Hibernate (i.e., the second level cache, Contextual "
+"Sessions with JTA, etc.) require access to the JTA "
+"<literal>TransactionManager</literal> in a managed environment. In an "
+"application server, since J2EE does not standardize a single mechanism, you "
+"have to specify how Hibernate should obtain a reference to the "
+"<literal>TransactionManager</literal>:"
+msgstr ""
+"Hibernate 的一些特性(比如二级缓存,Contextual Sessions with JTA 等等)需要访"
+"问在托管环境中的 JTA <literal>TransactionManager</literal>。由于 J2EE 没有标"
+"准化一个单一的机制,Hibernate 在应用程序服务器中,你必须指定 Hibernate 如何获"
+"得 <literal>TransactionManager</literal> 的引用: "
#. Tag: title
+#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr "JTA TransactionManagers"
#. Tag: entry
+#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr "Transaction 工厂类"
#. Tag: entry
+#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr "应用程序服务器"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1456
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JBossTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr "JBoss"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1462
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.WeblogicTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr "Weblogic"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1468
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.WebSphereTransactionManagerLookup</"
+"literal>"
#. Tag: entry
+#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr "WebSphere"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1474
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</"
+"literal>"
#. Tag: entry
+#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr "WebSphere 6"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1480
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.OrionTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr "Orion"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1486
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.ResinTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr "Resin"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1492
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JOTMTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr "JOTM"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1498
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JOnASTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr "JOnAS"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1504
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.JRun4TransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr "JRun4"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
-msgstr "<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
+#. Tag: literal
+#: configuration.xml:1510
+#, fuzzy, no-c-format
+msgid "org.hibernate.transaction.BESTransactionManagerLookup"
+msgstr ""
+"<literal>org.hibernate.transaction.BESTransactionManagerLookup</literal>"
#. Tag: entry
+#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr "Borland ES"
#. Tag: title
+#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory</literal>"
msgstr "JNDI 绑定的 <literal>SessionFactory</literal>"
#. Tag: para
+#: configuration.xml:1522
#, no-c-format
-msgid "A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the lookup function of the factory and create new <literal>Session</literal>s. This is not, however, related to a JNDI bound <literal>Datasource</literal>; both simply use the same registry."
-msgstr "与 JNDI 绑定的 Hibernate 的 <literal>SessionFactory</literal> 能简化工厂的查询,简化创建新的 <literal>Session</literal>。需要注意的是这与 JNDI 绑定 <literal>Datasource</literal> 没有关系,它们只是恰巧用了相同的注册表。"
+msgid ""
+"A JNDI-bound Hibernate <literal>SessionFactory</literal> can simplify the "
+"lookup function of the factory and create new <literal>Session</literal>s. "
+"This is not, however, related to a JNDI bound <literal>Datasource</literal>; "
+"both simply use the same registry."
+msgstr ""
+"与 JNDI 绑定的 Hibernate 的 <literal>SessionFactory</literal> 能简化工厂的查"
+"询,简化创建新的 <literal>Session</literal>。需要注意的是这与 JNDI 绑定 "
+"<literal>Datasource</literal> 没有关系,它们只是恰巧用了相同的注册表。"
#. Tag: para
+#: configuration.xml:1528
#, no-c-format
-msgid "If you wish to have the <literal>SessionFactory</literal> bound to a JNDI namespace, specify a name (e.g. <literal>java:hibernate/SessionFactory</literal>) using the property <literal>hibernate.session_factory_name</literal>. If this property is omitted, the <literal>SessionFactory</literal> will not be bound to JNDI. This is especially useful in environments with a read-only JNDI default implementation (in Tomcat, for example)."
-msgstr "如果你希望将 <literal>SessionFactory</literal> 绑定到一个 JNDI 的名字空间,用属性 <literal>hibernate.session_factory_name</literal> 指定一个名字(如,<literal>java:hibernate/SessionFactory</literal>)。如果不设置这个属性,<literal>SessionFactory</literal> 将不会被绑定到 JNDI 中(在以只读 JNDI 为默认实现的环境中,这个设置尤其有用,如 Tomcat)。"
+msgid ""
+"If you wish to have the <literal>SessionFactory</literal> bound to a JNDI "
+"namespace, specify a name (e.g. <literal>java:hibernate/SessionFactory</"
+"literal>) using the property <literal>hibernate.session_factory_name</"
+"literal>. If this property is omitted, the <literal>SessionFactory</literal> "
+"will not be bound to JNDI. This is especially useful in environments with a "
+"read-only JNDI default implementation (in Tomcat, for example)."
+msgstr ""
+"如果你希望将 <literal>SessionFactory</literal> 绑定到一个 JNDI 的名字空间,用"
+"属性 <literal>hibernate.session_factory_name</literal> 指定一个名字(如,"
+"<literal>java:hibernate/SessionFactory</literal>)。如果不设置这个属性,"
+"<literal>SessionFactory</literal> 将不会被绑定到 JNDI 中(在以只读 JNDI 为默"
+"认实现的环境中,这个设置尤其有用,如 Tomcat)。"
#. Tag: para
+#: configuration.xml:1536
#, no-c-format
-msgid "When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will use the values of <literal>hibernate.jndi.url</literal>, <literal>hibernate.jndi.class</literal> to instantiate an initial context. If they are not specified, the default <literal>InitialContext</literal> will be used."
-msgstr "在将 <literal>SessionFactory</literal> 绑定至 JNDI 时,Hibernate 将使用 <literal>hibernate.jndi.url</literal>,和 <literal>hibernate.jndi.class</literal> 的值来实例化初始环境(initial context)。如果它们没有被指定,将使用默认的 <literal>InitialContext</literal>。"
+msgid ""
+"When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will "
+"use the values of <literal>hibernate.jndi.url</literal>, <literal>hibernate."
+"jndi.class</literal> to instantiate an initial context. If they are not "
+"specified, the default <literal>InitialContext</literal> will be used."
+msgstr ""
+"在将 <literal>SessionFactory</literal> 绑定至 JNDI 时,Hibernate 将使用 "
+"<literal>hibernate.jndi.url</literal>,和 <literal>hibernate.jndi.class</"
+"literal> 的值来实例化初始环境(initial context)。如果它们没有被指定,将使用"
+"默认的 <literal>InitialContext</literal>。"
#. Tag: para
+#: configuration.xml:1542
#, no-c-format
-msgid "Hibernate will automatically place the <literal>SessionFactory</literal> in JNDI after you call <literal>cfg.buildSessionFactory()</literal>. This means you will have this call in some startup code, or utility class in your application, unless you use JMX deployment with the <literal>HibernateService</literal> (this is discussed later in greater detail)."
-msgstr "在你调用 <literal>cfg.buildSessionFactory()</literal>后,Hibernate 会自动将 <literal>SessionFactory</literal> 注册到 JNDI。这意味这你至少需要在你应用程序的启动代码(或工具类)中完成这个调用,除非你使用 <literal>HibernateService</literal> 来做 JMX 部署(见后面讨论)。"
+msgid ""
+"Hibernate will automatically place the <literal>SessionFactory</literal> in "
+"JNDI after you call <literal>cfg.buildSessionFactory()</literal>. This means "
+"you will have this call in some startup code, or utility class in your "
+"application, unless you use JMX deployment with the "
+"<literal>HibernateService</literal> (this is discussed later in greater "
+"detail)."
+msgstr ""
+"在你调用 <literal>cfg.buildSessionFactory()</literal>后,Hibernate 会自动将 "
+"<literal>SessionFactory</literal> 注册到 JNDI。这意味这你至少需要在你应用程序"
+"的启动代码(或工具类)中完成这个调用,除非你使用 <literal>HibernateService</"
+"literal> 来做 JMX 部署(见后面讨论)。"
#. Tag: para
+#: configuration.xml:1550
#, no-c-format
-msgid "If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other class, you can obtain the <literal>SessionFactory</literal> using a JNDI lookup."
-msgstr "假若你使用 JNDI <literal>SessionFactory</literal>,EJB 或者任何其它类都可以从 JNDI 中找到此 <literal>SessionFactory</literal>。 "
+msgid ""
+"If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other "
+"class, you can obtain the <literal>SessionFactory</literal> using a JNDI "
+"lookup."
+msgstr ""
+"假若你使用 JNDI <literal>SessionFactory</literal>,EJB 或者任何其它类都可以"
+"从 JNDI 中找到此 <literal>SessionFactory</literal>。 "
#. Tag: para
-#, no-c-format
-msgid "It is recommended that you bind the <literal>SessionFactory</literal> to JNDI in a managed environment and use a <literal>static</literal> singleton otherwise. To shield your application code from these details, we also recommend to hide the actual lookup code for a <literal>SessionFactory</literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory()</literal>. Note that such a class is also a convenient way to startup Hibernate—see chapter 1."
-msgstr "我们建议,在受管理的环境中,把 <literal>SessionFactory</literal> 绑定到 JNDI,在其它情况下,使用一个 <literal>static(静态的)</literal>singleton。为了在你的应用程序代码中隐藏这些细节,我们还建议你用一个 helper 类把实际查找 <literal>SessionFactory</literal> 的代码隐藏起来,比如 <literal>HibernateUtil.getSessionFactory()</literal>。注意,这个类也就可以方便地启动 Hibernate,参见第一章。 "
+#: configuration.xml:1554
+#, fuzzy, no-c-format
+msgid ""
+"It is recommended that you bind the <literal>SessionFactory</literal> to "
+"JNDI in a managed environment and use a <literal>static</literal> singleton "
+"otherwise. To shield your application code from these details, we also "
+"recommend to hide the actual lookup code for a <literal>SessionFactory</"
+"literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory"
+"()</literal>. Note that such a class is also a convenient way to startup "
+"Hibernate—see chapter 1."
+msgstr ""
+"我们建议,在受管理的环境中,把 <literal>SessionFactory</literal> 绑定到 "
+"JNDI,在其它情况下,使用一个 <literal>static(静态的)</literal>singleton。为"
+"了在你的应用程序代码中隐藏这些细节,我们还建议你用一个 helper 类把实际查找 "
+"<literal>SessionFactory</literal> 的代码隐藏起来,比如 "
+"<literal>HibernateUtil.getSessionFactory()</literal>。注意,这个类也就可以方"
+"便地启动 Hibernate,参见第一章。 "
#. Tag: title
+#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr "在 JTA 环境下使用 Current Session context(当前 session 上下文)管理"
#. Tag: para
-#, no-c-format
-msgid "The easiest way to handle <literal>Sessions</literal> and transactions is Hibernate's automatic \"current\" <literal>Session</literal> management. For a discussion of contextual sessions see <xref linkend=\"architecture-current-session\" />. Using the <literal>\"jta\"</literal> session context, if there is no Hibernate <literal>Session</literal> associated with the current JTA transaction, one will be started and associated with that JTA transaction the first time you call <literal>sessionFactory.getCurrentSession()</literal>. The <literal>Session</literal>s retrieved via <literal>getCurrentSession()</literal> in the<literal>\"jta\"</literal> context are set to automatically flush before the transaction completes, close after the transaction completes, and aggressively release JDBC connections after each statement. This allows the <literal>Session</literal>s to be managed by the life cycle of the JTA transaction to which it is associated, keeping user code clean of s!
uch management concerns. Your code can either use JTA programmatically through <literal>UserTransaction</literal>, or (recommended for portable code) use the Hibernate <literal>Transaction</literal> API to set transaction boundaries. If you run in an EJB container, declarative transaction demarcation with CMT is preferred."
-msgstr "在 Hibernate 中,管理 <literal>Session</literal> 和 transaction 最好的方法是自动的\"当前\"<literal>Session</literal> 管理。请参见 <xref linkend=\"architecture-current-session\" /> 一节的讨论。使用 <literal>\"jta\"</literal> session 上下文,假若在当前 JTA 事务中还没有 Hibernate<literal>Session</literal> 关联,第一次 <literal>sessionFactory.getCurrentSession()</literal> 调用会启动一个 Session,并关联到当前的 JTA 事务。在 <literal>\"jta\"</literal> 上下文中调用 <literal>getCurrentSession()</literal> 获得的 <literal>Session</literal>,会被设置为在 transaction 关闭的时候自动 flush(清洗)、在 transaction 关闭之后自动关闭,每句语句之后主动释放 JDBC 连接。这就可以根据 JTA 事务的生命周期来管理与之关联的 <literal>Session</literal>,用户代码中就可以不再考虑这些管理。你的代码也可以通过 <literal>UserTransaction!
</literal>用编程方式使用 JTA,或者(我们建议,为了便于移植代码)使用 Hibernate 的 <literal>Transaction</literal> API 来设置 transaction 边界。如果你的代码运行在 EJB 容器中,我们建议对 CMT 使用声明式事务声明。 "
+#: configuration.xml:1567
+#, fuzzy, no-c-format
+msgid ""
+"The easiest way to handle <literal>Sessions</literal> and transactions is "
+"Hibernate's automatic \"current\" <literal>Session</literal> management. For "
+"a discussion of contextual sessions see <xref linkend=\"architecture-current-"
+"session\"/>. Using the <literal>\"jta\"</literal> session context, if there "
+"is no Hibernate <literal>Session</literal> associated with the current JTA "
+"transaction, one will be started and associated with that JTA transaction "
+"the first time you call <literal>sessionFactory.getCurrentSession()</"
+"literal>. The <literal>Session</literal>s retrieved via "
+"<literal>getCurrentSession()</literal> in the <literal>\"jta\"</literal> "
+"context are set to automatically flush before the transaction completes, "
+"close after the transaction completes, and aggressively release JDBC "
+"connections after each statement. This allows the <literal>Session</"
+"literal>s to be managed by the life cycle of the JTA transaction to which it "
+"is associated, keeping user code clean of such management concerns. Your "
+"code can either use JTA programmatically through <literal>UserTransaction</"
+"literal>, or (recommended for portable code) use the Hibernate "
+"<literal>Transaction</literal> API to set transaction boundaries. If you run "
+"in an EJB container, declarative transaction demarcation with CMT is "
+"preferred."
+msgstr ""
+"在 Hibernate 中,管理 <literal>Session</literal> 和 transaction 最好的方法是"
+"自动的\"当前\"<literal>Session</literal> 管理。请参见 <xref linkend="
+"\"architecture-current-session\" /> 一节的讨论。使用 <literal>\"jta\"</"
+"literal> session 上下文,假若在当前 JTA 事务中还没有 "
+"Hibernate<literal>Session</literal> 关联,第一次 <literal>sessionFactory."
+"getCurrentSession()</literal> 调用会启动一个 Session,并关联到当前的 JTA 事"
+"务。在 <literal>\"jta\"</literal> 上下文中调用 <literal>getCurrentSession()</"
+"literal> 获得的 <literal>Session</literal>,会被设置为在 transaction 关闭的时"
+"候自动 flush(清洗)、在 transaction 关闭之后自动关闭,每句语句之后主动释放 "
+"JDBC 连接。这就可以根据 JTA 事务的生命周期来管理与之关联的 <literal>Session</"
+"literal>,用户代码中就可以不再考虑这些管理。你的代码也可以通过 "
+"<literal>UserTransaction</literal>用编程方式使用 JTA,或者(我们建议,为了便"
+"于移植代码)使用 Hibernate 的 <literal>Transaction</literal> API 来设置 "
+"transaction 边界。如果你的代码运行在 EJB 容器中,我们建议对 CMT 使用声明式事"
+"务声明。 "
#. Tag: title
+#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr "JMX 部署"
#. Tag: para
+#: configuration.xml:1592
#, no-c-format
-msgid "The line <literal>cfg.buildSessionFactory()</literal> still has to be executed somewhere to get a <literal>SessionFactory</literal> into JNDI. You can do this either in a <literal>static</literal> initializer block, like the one in <literal>HibernateUtil</literal>, or you can deploy Hibernate as a <emphasis>managed service</emphasis>."
-msgstr "为了将 <literal>SessionFactory</literal> 注册到 JNDI 中,<literal>cfg.buildSessionFactory()</literal> 这行代码仍需在某处被执行。你可在一个 <literal>static</literal> 初始化块(像 <literal>HibernateUtil</literal> 中的那样)中执行它或将 Hibernate 部署为一个<emphasis>托管的服务</emphasis>。 "
+msgid ""
+"The line <literal>cfg.buildSessionFactory()</literal> still has to be "
+"executed somewhere to get a <literal>SessionFactory</literal> into JNDI. You "
+"can do this either in a <literal>static</literal> initializer block, like "
+"the one in <literal>HibernateUtil</literal>, or you can deploy Hibernate as "
+"a <emphasis>managed service</emphasis>."
+msgstr ""
+"为了将 <literal>SessionFactory</literal> 注册到 JNDI 中,<literal>cfg."
+"buildSessionFactory()</literal> 这行代码仍需在某处被执行。你可在一个 "
+"<literal>static</literal> 初始化块(像 <literal>HibernateUtil</literal> 中的"
+"那样)中执行它或将 Hibernate 部署为一个<emphasis>托管的服务</emphasis>。 "
#. Tag: para
+#: configuration.xml:1598
#, no-c-format
-msgid "Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</literal> for deployment on an application server with JMX capabilities, such as JBoss AS. The actual deployment and configuration is vendor-specific. Here is an example <literal>jboss-service.xml</literal> for JBoss 4.0.x:"
-msgstr "为了部署在一个支持 JMX 的应用程序服务器上,Hibernate 和 <literal>org.hibernate.jmx.HibernateService</literal> 一同分发,如 Jboss AS。 实际的部署和配置是由应用程序服务器提供者指定的。这里是 JBoss 4.0.x 的 <literal>jboss-service.xml</literal> 样例: "
+msgid ""
+"Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</"
+"literal> for deployment on an application server with JMX capabilities, such "
+"as JBoss AS. The actual deployment and configuration is vendor-specific. "
+"Here is an example <literal>jboss-service.xml</literal> for JBoss 4.0.x:"
+msgstr ""
+"为了部署在一个支持 JMX 的应用程序服务器上,Hibernate 和 <literal>org."
+"hibernate.jmx.HibernateService</literal> 一同分发,如 Jboss AS。 实际的部署和"
+"配置是由应用程序服务器提供者指定的。这里是 JBoss 4.0.x 的 <literal>jboss-"
+"service.xml</literal> 样例: "
+#. Tag: programlisting
+#: configuration.xml:1604
+#, fuzzy, no-c-format
+msgid ""
+"<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
+"attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</"
+"attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</"
+"attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</"
+"attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
+"Category.hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>"
+msgstr ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<server>\n"
+"\n"
+"<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
+" name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
+"\n"
+" <!-- Required services -->\n"
+" <depends>jboss.jca:service=RARDeployer</depends>\n"
+" <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
+"\n"
+" <!-- Bind the Hibernate service to JNDI -->\n"
+" <attribute name=\"JndiName\">java:/hibernate/SessionFactory</attribute>\n"
+"\n"
+" <!-- Datasource settings -->\n"
+" <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
+" <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
+"attribute>\n"
+"\n"
+" <!-- Transaction integration -->\n"
+" <attribute name=\"TransactionStrategy\">\n"
+" org.hibernate.transaction.JTATransactionFactory</attribute>\n"
+" <attribute name=\"TransactionManagerLookupStrategy\">\n"
+" org.hibernate.transaction.JBossTransactionManagerLookup</attribute>\n"
+" <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
+" <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
+"\n"
+" <!-- Fetching options -->\n"
+" <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
+"\n"
+" <!-- Second-level caching -->\n"
+" <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
+" <attribute name=\"CacheProviderClass\">org.hibernate.cache."
+"EhCacheProvider</attribute>\n"
+" <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
+"\n"
+" <!-- Logging -->\n"
+" <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
+"\n"
+" <!-- Mapping files -->\n"
+" <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/Category."
+"hbm.xml</attribute>\n"
+"\n"
+"</mbean>\n"
+"\n"
+"</server>]]>"
+
#. Tag: para
+#: configuration.xml:1606
#, no-c-format
-msgid "This file is deployed in a directory called <literal>META-INF</literal> and packaged in a JAR file with the extension <literal>.sar</literal> (service archive). You also need to package Hibernate, its required third-party libraries, your compiled persistent classes, as well as your mapping files in the same archive. Your enterprise beans (usually session beans) can be kept in their own JAR file, but you can include this EJB JAR file in the main service archive to get a single (hot-)deployable unit. Consult the JBoss AS documentation for more information about JMX service and EJB deployment."
-msgstr "这个文件是部署在 <literal>META-INF</literal> 目录下的,并会被打包到以 <literal>.sar</literal>(service archive)为扩展名的 JAR 文件中。同时,你需要将 Hibernate、它所需要的第三方库、你编译好的持久化类以及你的映射定义文件打包进同一个文档。你的企业 Bean(一般为会话 Bean)可能会被打包成它们自己的 JAR 文件,但你也许会将 EJB JAR 文件一同包含进能独立(热)部署的主服务文档。参考 JBoss AS 文档以了解更多的 JMX服务与 EJB 部署的信息。 "
+msgid ""
+"This file is deployed in a directory called <literal>META-INF</literal> and "
+"packaged in a JAR file with the extension <literal>.sar</literal> (service "
+"archive). You also need to package Hibernate, its required third-party "
+"libraries, your compiled persistent classes, as well as your mapping files "
+"in the same archive. Your enterprise beans (usually session beans) can be "
+"kept in their own JAR file, but you can include this EJB JAR file in the "
+"main service archive to get a single (hot-)deployable unit. Consult the "
+"JBoss AS documentation for more information about JMX service and EJB "
+"deployment."
+msgstr ""
+"这个文件是部署在 <literal>META-INF</literal> 目录下的,并会被打包到以 "
+"<literal>.sar</literal>(service archive)为扩展名的 JAR 文件中。同时,你需要"
+"将 Hibernate、它所需要的第三方库、你编译好的持久化类以及你的映射定义文件打包"
+"进同一个文档。你的企业 Bean(一般为会话 Bean)可能会被打包成它们自己的 JAR 文"
+"件,但你也许会将 EJB JAR 文件一同包含进能独立(热)部署的主服务文档。参考 "
+"JBoss AS 文档以了解更多的 JMX服务与 EJB 部署的信息。 "
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addResource(\"Item.hbm.xml\")\n"
-#~ " .addResource(\"Bid.hbm.xml\");]]>"
-#~ msgstr ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addResource(\"Item.hbm.xml\")\n"
-#~ " .addResource(\"Bid.hbm.xml\");]]>"
+#~ msgid "<emphasis>JDBC URL</emphasis>"
+#~ msgstr "<emphasis>JDBC URL</emphasis>"
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class);]]>"
-#~ msgstr ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class);]]>"
+#~ msgid "<emphasis>database user</emphasis>"
+#~ msgstr "<emphasis>数据库用户</emphasis>(可选) "
-#~ msgid ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class)\n"
-#~ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
-#~ "MySQLInnoDBDialect\")\n"
-#~ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/"
-#~ "jdbc/test\")\n"
-#~ " .setProperty(\"hibernate.order_updates\", \"true\");]]>"
-#~ msgstr ""
-#~ "<![CDATA[Configuration cfg = new Configuration()\n"
-#~ " .addClass(org.hibernate.auction.Item.class)\n"
-#~ " .addClass(org.hibernate.auction.Bid.class)\n"
-#~ " .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect."
-#~ "MySQLInnoDBDialect\")\n"
-#~ " .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/"
-#~ "jdbc/test\")\n"
-#~ " .setProperty(\"hibernate.order_updates\", \"true\");]]>"
+#~ msgid "<emphasis>database user password</emphasis>"
+#~ msgstr "<emphasis>数据库密码</emphasis>(可选) "
-#~ msgid "<![CDATA[SessionFactory sessions = cfg.buildSessionFactory();]]>"
-#~ msgstr "<![CDATA[SessionFactory sessions = cfg.buildSessionFactory();]]>"
+#~ msgid "<emphasis>datasource JNDI name</emphasis>"
+#~ msgstr "<emphasis>数据库用户</emphasis>(可选) "
-#~ msgid ""
-#~ "<![CDATA[Session session = sessions.openSession(); // open a new Session]]"
-#~ ">"
-#~ msgstr ""
-#~ "<![CDATA[Session session = sessions.openSession(); // open a new Session]]"
-#~ ">"
+#~ msgid "<property>hibernate.generate_statistics</property>"
+#~ msgstr "<property>hibernate.generate_statistics</property>"
-#~ msgid "JDBC URL"
-#~ msgstr "JDBC URL"
+#~ msgid "<literal>hibernate.query.substitutions</literal>"
+#~ msgstr "<literal>hibernate.query.substitutions</literal>"
-#~ msgid "database user"
-#~ msgstr "database user"
+#~ msgid "DB2"
+#~ msgstr "DB2"
-#~ msgid "database user password"
-#~ msgstr "数据库用户密码"
+#~ msgid "<literal>org.hibernate.SQL</literal>"
+#~ msgstr "<literal>org.hibernate.SQL</literal>"
-#~ msgid ""
-#~ "<![CDATA[hibernate.connection.driver_class = org.postgresql.Driver\n"
-#~ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
-#~ "hibernate.connection.username = myuser\n"
-#~ "hibernate.connection.password = secret\n"
-#~ "hibernate.c3p0.min_size=5\n"
-#~ "hibernate.c3p0.max_size=20\n"
-#~ "hibernate.c3p0.timeout=1800\n"
-#~ "hibernate.c3p0.max_statements=50\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
-#~ msgstr ""
-#~ "<![CDATA[hibernate.connection.driver_class = org.postgresql.Driver\n"
-#~ "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
-#~ "hibernate.connection.username = myuser\n"
-#~ "hibernate.connection.password = secret\n"
-#~ "hibernate.c3p0.min_size=5\n"
-#~ "hibernate.c3p0.max_size=20\n"
-#~ "hibernate.c3p0.timeout=1800\n"
-#~ "hibernate.c3p0.max_statements=50\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
+#~ msgid "<literal>org.hibernate.type</literal>"
+#~ msgstr "<literal>org.hibernate.type</literal>"
-#~ msgid "datasource JNDI name"
-#~ msgstr "数据源 JNDI 名字"
+#~ msgid "<literal>org.hibernate.pretty</literal>"
+#~ msgstr "<literal>org.hibernate.pretty</literal>"
-#~ msgid ""
-#~ "<![CDATA[hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
-#~ "hibernate.transaction.factory_class = \\\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ "hibernate.transaction.manager_lookup_class = \\\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
-#~ msgstr ""
-#~ "<![CDATA[hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
-#~ "hibernate.transaction.factory_class = \\\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ "hibernate.transaction.manager_lookup_class = \\\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup\n"
-#~ "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect]]>"
+#~ msgid "<literal>org.hibernate.cache</literal>"
+#~ msgstr "<literal>org.hibernate.cache</literal>"
-#~ msgid "<entry>DB2</entry>"
-#~ msgstr "<entry>DB2</entry>"
+#~ msgid "<literal>org.hibernate.jdbc</literal>"
+#~ msgstr "<literal>org.hibernate.jdbc</literal>"
-#~ msgid "hibernate.query.substitutions true=1, false=0"
-#~ msgstr "hibernate.query.substitutions true=1,false=0"
+#~ msgid "<literal>org.hibernate.secure</literal>"
+#~ msgstr "<literal>org.hibernate.secure</literal>"
-#~ msgid "hibernate.query.substitutions toLowercase=LOWER"
-#~ msgstr "hibernate.query.substitutions toLowercase=LOWER"
-
-#~ msgid "org.hibernate"
-#~ msgstr "org.hibernate"
-
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
-#~ " .addFile(\"Item.hbm.xml\")\n"
-#~ " .addFile(\"Bid.hbm.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
-#~ " .addFile(\"Item.hbm.xml\")\n"
-#~ " .addFile(\"Bid.hbm.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!DOCTYPE hibernate-configuration PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-configuration>\n"
-#~ "\n"
-#~ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
-#~ " <session-factory\n"
-#~ " name=\"java:hibernate/SessionFactory\">\n"
-#~ "\n"
-#~ " <!-- properties -->\n"
-#~ " <property name=\"connection.datasource\">java:/comp/env/jdbc/"
-#~ "MyDB</property>\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</"
-#~ "property>\n"
-#~ " <property name=\"show_sql\">false</property>\n"
-#~ " <property name=\"transaction.factory_class\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ " </property>\n"
-#~ " <property name=\"jta.UserTransaction\">java:comp/UserTransaction</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- mapping files -->\n"
-#~ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
-#~ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
-#~ "\n"
-#~ " <!-- cache settings -->\n"
-#~ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
-#~ "write\"/>\n"
-#~ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
-#~ "\"/>\n"
-#~ " <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
-#~ "usage=\"read-write\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!DOCTYPE hibernate-configuration PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
-#~ "\">\n"
-#~ "\n"
-#~ "<hibernate-configuration>\n"
-#~ "\n"
-#~ " <!-- a SessionFactory instance listed as /jndi/name -->\n"
-#~ " <session-factory\n"
-#~ " name=\"java:hibernate/SessionFactory\">\n"
-#~ "\n"
-#~ " <!-- properties -->\n"
-#~ " <property name=\"connection.datasource\">java:/comp/env/jdbc/"
-#~ "MyDB</property>\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</"
-#~ "property>\n"
-#~ " <property name=\"show_sql\">false</property>\n"
-#~ " <property name=\"transaction.factory_class\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory\n"
-#~ " </property>\n"
-#~ " <property name=\"jta.UserTransaction\">java:comp/UserTransaction</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- mapping files -->\n"
-#~ " <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
-#~ " <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
-#~ "\n"
-#~ " <!-- cache settings -->\n"
-#~ " <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-"
-#~ "write\"/>\n"
-#~ " <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only"
-#~ "\"/>\n"
-#~ " <collection-cache collection=\"org.hibernate.auction.Item.bids\" "
-#~ "usage=\"read-write\"/>\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration().configure()."
-#~ "buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "<![CDATA[SessionFactory sf = new Configuration().configure()."
-#~ "buildSessionFactory();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .configure(\"catdb.cfg.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-#~ msgstr ""
-#~ "<![CDATA[SessionFactory sf = new Configuration()\n"
-#~ " .configure(\"catdb.cfg.xml\")\n"
-#~ " .buildSessionFactory();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<server>\n"
-#~ "\n"
-#~ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
-#~ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
-#~ "\n"
-#~ " <!-- Required services -->\n"
-#~ " <depends>jboss.jca:service=RARDeployer</depends>\n"
-#~ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
-#~ "\n"
-#~ " <!-- Bind the Hibernate service to JNDI -->\n"
-#~ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Datasource settings -->\n"
-#~ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
-#~ " <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Transaction integration -->\n"
-#~ " <attribute name=\"TransactionStrategy\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory</attribute>\n"
-#~ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup</"
-#~ "attribute>\n"
-#~ " <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
-#~ " <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Fetching options -->\n"
-#~ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
-#~ "\n"
-#~ " <!-- Second-level caching -->\n"
-#~ " <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
-#~ " <attribute name=\"CacheProviderClass\">org.hibernate.cache."
-#~ "EhCacheProvider</attribute>\n"
-#~ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Logging -->\n"
-#~ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Mapping files -->\n"
-#~ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
-#~ "Category.hbm.xml</attribute>\n"
-#~ "\n"
-#~ "</mbean>\n"
-#~ "\n"
-#~ "</server>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<server>\n"
-#~ "\n"
-#~ "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
-#~ " name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
-#~ "\n"
-#~ " <!-- Required services -->\n"
-#~ " <depends>jboss.jca:service=RARDeployer</depends>\n"
-#~ " <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
-#~ "\n"
-#~ " <!-- Bind the Hibernate service to JNDI -->\n"
-#~ " <attribute name=\"JndiName\">java:/hibernate/SessionFactory</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Datasource settings -->\n"
-#~ " <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
-#~ " <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "attribute>\n"
-#~ "\n"
-#~ " <!-- Transaction integration -->\n"
-#~ " <attribute name=\"TransactionStrategy\">\n"
-#~ " org.hibernate.transaction.JTATransactionFactory</attribute>\n"
-#~ " <attribute name=\"TransactionManagerLookupStrategy\">\n"
-#~ " org.hibernate.transaction.JBossTransactionManagerLookup</"
-#~ "attribute>\n"
-#~ " <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
-#~ " <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Fetching options -->\n"
-#~ " <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
-#~ "\n"
-#~ " <!-- Second-level caching -->\n"
-#~ " <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
-#~ " <attribute name=\"CacheProviderClass\">org.hibernate.cache."
-#~ "EhCacheProvider</attribute>\n"
-#~ " <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Logging -->\n"
-#~ " <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
-#~ "\n"
-#~ " <!-- Mapping files -->\n"
-#~ " <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/"
-#~ "Category.hbm.xml</attribute>\n"
-#~ "\n"
-#~ "</mbean>\n"
-#~ "\n"
-#~ "</server>]]>"
+#~ msgid "<literal>org.hibernate</literal>"
+#~ msgstr "<literal>org.hibernate</literal>"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/filters.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/filters.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/filters.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:35\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2009-11-27 13:53+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -15,11 +15,13 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: filters.xml:31
#, no-c-format
msgid "Filtering data"
msgstr "过滤数据"
#. Tag: para
+#: filters.xml:33
#, no-c-format
msgid ""
"Hibernate3 provides an innovative new approach to handling data with "
@@ -33,11 +35,13 @@
"Hibernate session 您可以选择是否启用(或禁用)某个过滤器。"
#. Tag: title
+#: filters.xml:39
#, no-c-format
msgid "Hibernate filters"
msgstr "Hibernate 过滤器(filters)"
#. Tag: para
+#: filters.xml:41
#, no-c-format
msgid ""
"Hibernate3 has the ability to pre-define filter criteria and attach those "
@@ -56,9 +60,95 @@
"确定使用什么样的参数的。 "
#. Tag: para
+#: filters.xml:50
#, no-c-format
msgid ""
-"In order to use filters, they must first be defined and then attached to the "
+"Using annotatons filters are defined via <literal>@org.hibernate.annotations."
+"FilterDef</literal> or <literal>@org.hibernate.annotations.FilterDefs</"
+"literal>. A filter definition has a <methodname>name()</methodname> 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 "
+"<methodname>defaultCondition()</methodname> parameter for a given "
+"<literal>@FilterDef</literal> to set the default condition to use when none "
+"are defined in each individual <literal>@Filter</literal>. "
+"<literal>@FilterDef</literal>(s) can be defined at the class or package "
+"level."
+msgstr ""
+
+#. Tag: para
+#: filters.xml:63
+#, 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. The connection between "
+"<classname>@FilterName</classname> and <classname>@Filter</classname> is a "
+"matching name."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:70
+#, no-c-format
+msgid "@FilterDef and @Filter annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:72
+#, 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
+#: filters.xml:75
+#, 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 want "
+"to target the association table, use the <literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: title
+#: filters.xml:84
+#, no-c-format
+msgid ""
+"Using <classname>@FilterJoinTable</classname> for filterting on the "
+"association table"
+msgstr ""
+
+#. Tag: programlisting
+#: filters.xml:87
+#, 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: para
+#: filters.xml:90
+#, fuzzy, no-c-format
+msgid ""
+"Using Hibernate mapping files for defining filters the situtation is very "
+"similar. The filters must first be defined and then attached to the "
"appropriate mapping elements. To define a filter, use the <literal><"
"filter-def/></literal> element within a <literal><hibernate-mapping/"
"></literal> element:"
@@ -67,22 +157,58 @@
"<literal><hibernate-mapping/></literal> 节点之内的 <literal><filter-"
"def/></literal> 节点:"
-#. Tag: para
+#. Tag: title
+#: filters.xml:97
#, no-c-format
-msgid "This filter can then be attached to a class:"
-msgstr "定义好之后,就可以在某个类中使用这个过滤器: "
+msgid "Defining a filter definition via <literal><filter-def></literal>"
+msgstr ""
+#. Tag: programlisting
+#: filters.xml:100
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\">\n"
+" <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
+"</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"This filter can then be attached to a class or collection (or, to both or "
+"multiples of each at the same time):"
+msgstr "或者在同时可以使用多个过滤器。"
+
+#. Tag: title
+#: filters.xml:107
#, no-c-format
-msgid "Or, to a collection:"
-msgstr "或者也可以在某个集合使用它:"
+msgid ""
+"Attaching a filter to a class or collection using <literal><filter></"
+"literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: filters.xml:110
#, no-c-format
-msgid "Or, to both or multiples of each at the same time."
-msgstr "或者在同时可以使用多个过滤器。"
+msgid ""
+"<class name=\"myClass\" ...>\n"
+" ...\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+"\n"
+" <set ...>\n"
+" <filter name=\"myFilter\" condition=\":myFilterParam = "
+"MY_FILTERED_COLUMN\"/>\n"
+" </set> \n"
+"</class>"
+msgstr ""
#. Tag: para
+#: filters.xml:113
#, no-c-format
msgid ""
"The methods on <literal>Session</literal> are: <literal>enableFilter(String "
@@ -101,7 +227,18 @@
"enabledFilter()</literal> 方法显式的启用。该方法返回被启用的 "
"<literal>Filter</literal> 的实例。以上文定义的过滤器为例:"
+#. Tag: programlisting
+#: filters.xml:123
+#, fuzzy, no-c-format
+msgid ""
+"session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", \"some-"
+"value\");"
+msgstr ""
+"<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam\", "
+"\"some-value\");]]>"
+
#. Tag: para
+#: filters.xml:125
#, no-c-format
msgid ""
"Methods on the org.hibernate.Filter interface do allow the method-chaining "
@@ -112,13 +249,86 @@
"性。 "
#. Tag: para
+#: filters.xml:128
#, no-c-format
msgid ""
"The following is a full example, using temporal data with an effective "
"record date pattern:"
msgstr "下面是一个比较完整的例子,使用了记录生效日期模式过滤有时效的数据: "
+#. Tag: programlisting
+#: filters.xml:131
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
+"\"/>\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column="
+"\"eff_start_dt\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
+"\"/>\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<filter-def name=\"effectiveDate\">\n"
+" <filter-param name=\"asOfDate\" type=\"date\"/>\n"
+"</filter-def>\n"
+"\n"
+"<class name=\"Employee\" ...>\n"
+"...\n"
+" <many-to-one name=\"department\" column=\"dept_id\" class=\"Department\"/"
+">\n"
+" <property name=\"effectiveStartDate\" type=\"date\" column=\"eff_start_dt"
+"\"/>\n"
+" <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt\"/"
+">\n"
+"...\n"
+" <!--\n"
+" Note that this assumes non-terminal records have an eff_end_dt set "
+"to\n"
+" a max db date for simplicity-sake\n"
+" -->\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Department\" ...>\n"
+"...\n"
+" <set name=\"employees\" lazy=\"true\">\n"
+" <key column=\"dept_id\"/>\n"
+" <one-to-many class=\"Employee\"/>\n"
+" <filter name=\"effectiveDate\"\n"
+" condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
+">\n"
+" </set>\n"
+"</class>]]>"
+
#. Tag: para
+#: filters.xml:133
#, no-c-format
msgid ""
"In order to ensure that you are provided with currently effective records, "
@@ -127,7 +337,29 @@
"定义好后,如果想要保证取回的都是目前处于生效期的记录,只需在获取雇员数据的操"
"作之前先开启过滤器即可: "
+#. Tag: programlisting
+#: filters.xml:137
+#, fuzzy, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();"
+msgstr ""
+"<![CDATA[Session session = ...;\n"
+"session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new Date"
+"());\n"
+"List results = session.createQuery(\"from Employee as e where e.salary > :"
+"targetSalary\")\n"
+" .setLong(\"targetSalary\", new Long(1000000))\n"
+" .list();\n"
+"]]>"
+
#. Tag: para
+#: filters.xml:139
#, no-c-format
msgid ""
"Even though a salary constraint was mentioned explicitly on the results in "
@@ -139,6 +371,7 @@
"询将仅返回那些目前雇用关系处于生效期的,并且薪水高于一百万美元的雇员的数据。 "
#. Tag: para
+#: filters.xml:144
#, no-c-format
msgid ""
"If you want to use filters with outer joining, either through HQL or load "
@@ -151,6 +384,7 @@
"outer joining)。并且通常来说,先写参数,然后是操作符,最后写数据库字段名。"
#. Tag: para
+#: filters.xml:149
#, no-c-format
msgid ""
"After being defined, a filter might be attached to multiple entities and/or "
@@ -163,7 +397,20 @@
"这些条件都是一样的,每次都要定义就显得很繁琐。因此,<literal><filter-def/"
"></literal> 被用来定义一个默认条件,它可能作为属性或者 CDATA 出现: "
+#. Tag: programlisting
+#: filters.xml:155
+#, fuzzy, no-c-format
+msgid ""
+"<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
+"filter-def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>"
+msgstr ""
+"<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</filter-"
+"def>\n"
+"<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
+
#. Tag: para
+#: filters.xml:157
#, no-c-format
msgid ""
"This default condition will be used whenever the filter is attached to "
@@ -174,15 +421,12 @@
"当这个 filter 被附加到任何目的地,而又没有指明条件时,这个缺省条件就会被使"
"用。注意,换句话说,你可以通过给 filter 附加特别的条件来重载默认条件。"
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\">\n"
-#~ " <filter-param name=\"myFilterParam\" type=\"string\"/>\n"
-#~ "</filter-def>]]>"
+#~ msgid "This filter can then be attached to a class:"
+#~ msgstr "定义好之后,就可以在某个类中使用这个过滤器: "
+#~ msgid "Or, to a collection:"
+#~ msgstr "或者也可以在某个集合使用它:"
+
#~ msgid ""
#~ "<![CDATA[<class name=\"myClass\" ...>\n"
#~ " ...\n"
@@ -206,107 +450,3 @@
#~ " <filter name=\"myFilter\" condition=\":myFilterParam = "
#~ "MY_FILTERED_COLUMN\"/>\n"
#~ "</set>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-#~ msgstr ""
-#~ "<![CDATA[session.enableFilter(\"myFilter\").setParameter(\"myFilterParam"
-#~ "\", \"some-value\");]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"effectiveDate\">\n"
-#~ " <filter-param name=\"asOfDate\" type=\"date\"/>\n"
-#~ "</filter-def>\n"
-#~ "\n"
-#~ "<class name=\"Employee\" ...>\n"
-#~ "...\n"
-#~ " <many-to-one name=\"department\" column=\"dept_id\" class=\"Department"
-#~ "\"/>\n"
-#~ " <property name=\"effectiveStartDate\" type=\"date\" column="
-#~ "\"eff_start_dt\"/>\n"
-#~ " <property name=\"effectiveEndDate\" type=\"date\" column=\"eff_end_dt"
-#~ "\"/>\n"
-#~ "...\n"
-#~ " <!--\n"
-#~ " Note that this assumes non-terminal records have an eff_end_dt "
-#~ "set to\n"
-#~ " a max db date for simplicity-sake\n"
-#~ " -->\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt\"/"
-#~ ">\n"
-#~ "</class>\n"
-#~ "\n"
-#~ "<class name=\"Department\" ...>\n"
-#~ "...\n"
-#~ " <set name=\"employees\" lazy=\"true\">\n"
-#~ " <key column=\"dept_id\"/>\n"
-#~ " <one-to-many class=\"Employee\"/>\n"
-#~ " <filter name=\"effectiveDate\"\n"
-#~ " condition=\":asOfDate BETWEEN eff_start_dt and eff_end_dt"
-#~ "\"/>\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<![CDATA[Session session = ...;\n"
-#~ "session.enableFilter(\"effectiveDate\").setParameter(\"asOfDate\", new "
-#~ "Date());\n"
-#~ "List results = session.createQuery(\"from Employee as e where e.salary > :"
-#~ "targetSalary\")\n"
-#~ " .setLong(\"targetSalary\", new Long(1000000))\n"
-#~ " .list();\n"
-#~ "]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<filter-def name=\"myFilter\" condition=\"abc > xyz\">...</"
-#~ "filter-def>\n"
-#~ "<filter-def name=\"myOtherFilter\">abc=xyz</filter-def>]]>"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/performance.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/performance.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/performance.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: performance\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-15 15:27+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -16,16 +16,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "提升性能"
#. Tag: title
+#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "抓取策略(Fetching strategies)"
#. Tag: para
+#: performance.xml:36
#, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy</emphasis> to retrieve "
@@ -39,11 +42,13 @@
"(Criteria Query)</literal>中重载声明。"
#. Tag: para
+#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 定义了如下几种抓取策略:"
#. Tag: para
+#: performance.xml:46
#, no-c-format
msgid ""
"<emphasis>Join fetching</emphasis>: Hibernate retrieves the associated "
@@ -55,6 +60,7 @@
"获得对象的关联实例或者关联集合。 "
#. Tag: para
+#: performance.xml:53
#, no-c-format
msgid ""
"<emphasis>Select fetching</emphasis>: a second <literal>SELECT</literal> is "
@@ -68,6 +74,7 @@
"你真正访问关联关系的时候,才会执行第二条 select 语句。"
#. Tag: para
+#: performance.xml:61
#, no-c-format
msgid ""
"<emphasis>Subselect fetching</emphasis>: a second <literal>SELECT</literal> "
@@ -83,6 +90,7 @@
"语句。"
#. Tag: para
+#: performance.xml:70
#, no-c-format
msgid ""
"<emphasis>Batch fetching</emphasis>: an optimization strategy for select "
@@ -95,11 +103,13 @@
"批对象实例或集合。"
#. Tag: para
+#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "Hibernate 会区分下列各种情况:"
#. Tag: para
+#: performance.xml:81
#, no-c-format
msgid ""
"<emphasis>Immediate fetching</emphasis>: an association, collection or "
@@ -109,6 +119,7 @@
"或属性被立即抓取。"
#. Tag: para
+#: performance.xml:87
#, no-c-format
msgid ""
"<emphasis>Lazy collection fetching</emphasis>: a collection is fetched when "
@@ -119,6 +130,7 @@
"合进行了一次操作时,集合才被抓取(对集合而言这是默认行为)。"
#. Tag: para
+#: performance.xml:93
#, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching</emphasis>: individual elements "
@@ -131,6 +143,7 @@
"要,Hibernate 不会试图去把整个集合都抓取到内存里来(适用于非常大的集合)。"
#. Tag: para
+#: performance.xml:101
#, no-c-format
msgid ""
"<emphasis>Proxy fetching</emphasis>: a single-valued association is fetched "
@@ -141,6 +154,7 @@
"方法被调用,而非对其关键字进行 get 操作时才抓取。"
#. Tag: para
+#: performance.xml:107
#, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching</emphasis>: a single-valued association is "
@@ -157,6 +171,7 @@
"到。"
#. Tag: para
+#: performance.xml:117
#, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching</emphasis>: an attribute or single valued "
@@ -168,6 +183,7 @@
"方法很少是必要的。"
#. Tag: para
+#: performance.xml:124
#, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when</emphasis> is the "
@@ -183,11 +199,13 @@
"契约,对某特定类的某个脱管的实例,知道有哪些数据是可以使用的。"
#. Tag: title
+#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "操作延迟加载的关联"
#. Tag: para
+#: performance.xml:134
#, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
@@ -198,6 +216,7 @@
"代理抓取。对几乎是所有的应用而言,其绝大多数的关联,这种策略都是有效的。"
#. Tag: para
+#: performance.xml:138
#, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size</literal>, Hibernate "
@@ -209,6 +228,7 @@
"开)。"
#. Tag: para
+#: performance.xml:142
#, no-c-format
msgid ""
"Please be aware that access to a lazy association outside of the context of "
@@ -217,7 +237,36 @@
"然而,你必须了解延迟抓取带来的一个问题。在一个打开的 Hibernate session 上下文"
"之外调用延迟集合会导致一次意外。比如: "
+#. Tag: programlisting
+#: performance.xml:146
+#, fuzzy, no-c-format
+msgid ""
+"s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!"
+msgstr ""
+"<![CDATA[s = sessions.openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+" \n"
+"User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
+" .setString(\"userName\", userName).uniqueResult();\n"
+"Map permissions = u.getPermissions();\n"
+"\n"
+"tx.commit();\n"
+"s.close();\n"
+"\n"
+"Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!]]>"
+
#. Tag: para
+#: performance.xml:148
#, no-c-format
msgid ""
"Since the permissions collection was not initialized when the "
@@ -231,6 +280,7 @@
"emphasis>。这里的修改方法是将 permissions 读取数据的代码移到事务提交之前。"
#. Tag: para
+#: performance.xml:155
#, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
@@ -246,6 +296,7 @@
"中载入整个数据库到内存中。"
#. Tag: para
+#: performance.xml:162
#, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
@@ -260,11 +311,13 @@
"集合关联相一致的。 "
#. Tag: title
+#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "调整抓取策略(Tuning fetch strategies)"
#. Tag: para
+#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
@@ -273,7 +326,31 @@
"查询抓取(默认的)在 N+1 查询的情况下是极其脆弱的,因此我们可能会要求在映射文"
"档中定义使用连接抓取:"
+#. Tag: programlisting
+#: performance.xml:176
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"permissions\"\n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set"
+msgstr ""
+"<![CDATA[<set name=\"permissions\" \n"
+" fetch=\"join\">\n"
+" <key column=\"userId\"/>\n"
+" <one-to-many class=\"Permission\"/>\n"
+"</set]]>"
+
+#. Tag: programlisting
+#: performance.xml:178
+#, fuzzy, no-c-format
+msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
+msgstr ""
+"<![CDATA[<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>]]>"
+
#. Tag: para
+#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch</literal> strategy defined in the mapping document "
@@ -282,27 +359,32 @@
"在映射文档中定义的<literal>抓取</literal>策略将会对以下列表条目产生影响:"
#. Tag: para
+#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get()</literal> or <literal>load()</literal>"
msgstr ""
"通过 <literal>get()</literal> 或 <literal>load()</literal> 方法取得数据。"
#. Tag: para
+#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr "只有在关联之间进行导航时,才会隐式的取得数据。"
#. Tag: para
+#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria</literal> queries"
msgstr "条件查询"
#. Tag: para
+#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect</literal> fetching is used"
msgstr "使用了 <literal>subselect</literal> 抓取的 HQL 查询"
#. Tag: para
+#: performance.xml:204
#, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
@@ -313,6 +395,7 @@
"意味着在一条 HQL 查询后紧跟着一系列的查询。 "
#. Tag: para
+#: performance.xml:209
#, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
@@ -329,6 +412,7 @@
"<literal>setFetchMode(FetchMode.JOIN)</literal>语句。 "
#. Tag: para
+#: performance.xml:216
#, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get()</literal> "
@@ -338,7 +422,22 @@
"也许你喜欢仅仅通过条件查询,就可以改变 <literal>get()</literal> 或 "
"<literal>load()</literal> 语句中的数据抓取策略。例如: "
+#. Tag: programlisting
+#: performance.xml:220
+#, fuzzy, no-c-format
+msgid ""
+"User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();"
+msgstr ""
+"<![CDATA[User user = (User) session.createCriteria(User.class)\n"
+" .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
+" .add( Restrictions.idEq(userId) )\n"
+" .uniqueResult();]]>"
+
#. Tag: para
+#: performance.xml:222
#, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
@@ -347,6 +446,7 @@
"这就是其他 ORM 解决方案的“抓取计划(fetch plan)”在 Hibernate 中的等价物。"
#. Tag: para
+#: performance.xml:225
#, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
@@ -354,11 +454,13 @@
msgstr "截然不同的一种避免 N+1 次查询的方法是,使用二级缓存。 "
#. Tag: title
+#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "单端关联代理(Single-ended association proxies)"
#. Tag: para
+#: performance.xml:232
#, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
@@ -374,6 +476,7 @@
"代理。 "
#. Tag: para
+#: performance.xml:239
#, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
@@ -385,6 +488,7 @@
"one)</literal> 关联的延迟抓取。 "
#. Tag: para
+#: performance.xml:244
#, no-c-format
msgid ""
"The mapping file may declare an interface to use as the proxy interface for "
@@ -399,13 +503,33 @@
"拥有这样的构造函数。</emphasis>"
#. Tag: para
+#: performance.xml:251
#, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
"polymorphic classes.For example:"
msgstr "在如此方式定义一个多态类的时候,有许多值得注意的常见性的问题,例如: "
+#. Tag: programlisting
+#: performance.xml:254
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Cat\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>]]>"
+
#. Tag: para
+#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat</literal> will never be castable to "
@@ -416,12 +540,52 @@
"<literal>DomesticCat</literal>,即使它本身就是 <literal>DomesticCat</"
"literal> 实例。"
+#. Tag: programlisting
+#: performance.xml:260
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a proxy (does "
+"not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}"
+msgstr ""
+"<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
+"proxy (does not hit the db)\n"
+"if ( cat.isDomesticCat() ) { // hit the db to initialize "
+"the proxy\n"
+" DomesticCat dc = (DomesticCat) cat; // Error!\n"
+" ....\n"
+"}]]>"
+
#. Tag: para
+#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==</literal>:"
msgstr "其次,代理的“<literal>==</literal>”可能不再成立。 "
+#. Tag: programlisting
+#: performance.xml:265
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(Cat.class, id); // instantiate a Cat "
+"proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false"
+msgstr ""
+"<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // "
+"instantiate a Cat proxy\n"
+"DomesticCat dc = \n"
+" (DomesticCat) session.load(DomesticCat.class, id); // acquire new "
+"DomesticCat proxy!\n"
+"System.out.println(cat==dc); // false]]>"
+
#. Tag: para
+#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
@@ -431,7 +595,18 @@
"虽然如此,但实际情况并没有看上去那么糟糕。虽然我们现在有两个不同的引用,分别"
"指向这两个不同的代理对象,但实际上,其底层应该是同一个实例对象:"
+#. Tag: programlisting
+#: performance.xml:271
+#, fuzzy, no-c-format
+msgid ""
+"cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0"
+msgstr ""
+"<![CDATA[cat.setWeight(11.0); // hit the db to initialize the proxy\n"
+"System.out.println( dc.getWeight() ); // 11.0]]>"
+
#. Tag: para
+#: performance.xml:273
#, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final</literal> class or "
@@ -441,6 +616,7 @@
"法的类使用 CGLIB 代理。"
#. Tag: para
+#: performance.xml:276
#, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
@@ -453,6 +629,7 @@
"类。"
#. Tag: para
+#: performance.xml:281
#, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
@@ -469,7 +646,26 @@
"literal> 而 <literal>DomesticCatImpl</literal> 实现 <literal>DomesticCat</"
"literal> 接口。例如:"
+#. Tag: programlisting
+#: performance.xml:289
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"CatImpl\" proxy=\"Cat\">\n"
+" ......\n"
+" <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
+" .....\n"
+" </subclass>\n"
+"</class>]]>"
+
#. Tag: para
+#: performance.xml:291
#, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat</literal> and "
@@ -479,17 +675,34 @@
"然后,<literal>load()</literal> 和 <literal>iterate()</literal> 永远也不会返"
"回 <literal>Cat</literal> 和 <literal>DomesticCat</literal> 实例的代理。"
+#. Tag: programlisting
+#: performance.xml:295
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();"
+msgstr ""
+"<![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
+"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
+"name='fritz'\").iterate();\n"
+"Cat fritz = (Cat) iter.next();]]>"
+
#. Tag: title
+#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr "注意"
#. Tag: para
+#: performance.xml:300
#, no-c-format
msgid "<literal>list()</literal> does not usually return proxies."
msgstr "<literal>list()</literal> 通常不返回代理。"
#. Tag: para
+#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
@@ -500,12 +713,14 @@
"<literal>Cat</literal>,而不是 <literal>CatImpl</literal>。"
#. Tag: para
+#: performance.xml:308
#, no-c-format
msgid ""
"Certain operations do <emphasis>not</emphasis> require proxy initialization:"
msgstr "有些方法中是<emphasis>不</emphasis>需要代理初始化的:"
#. Tag: para
+#: performance.xml:313
#, no-c-format
msgid ""
"<literal>equals()</literal>: if the persistent class does not override "
@@ -515,6 +730,7 @@
"literal> 方法。"
#. Tag: para
+#: performance.xml:318
#, no-c-format
msgid ""
"<literal>hashCode()</literal>: if the persistent class does not override "
@@ -524,11 +740,13 @@
"literal> 方法。"
#. Tag: para
+#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "标志符的 getter 方法。"
#. Tag: para
+#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()</"
@@ -538,6 +756,7 @@
"<literal>hashCode()</literal> 方法的持久化类。"
#. Tag: para
+#: performance.xml:330
#, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default "
@@ -550,11 +769,13 @@
"码增强,并且所有的操作都会导致立刻进行代理初始化。 "
#. Tag: title
+#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "实例化集合和代理(Initializing collections and proxies)"
#. Tag: para
+#: performance.xml:340
#, no-c-format
msgid ""
"A <literal>LazyInitializationException</literal> will be thrown by Hibernate "
@@ -567,6 +788,7 @@
"状态下,访问一个实体所拥有的集合,或者访问其指向代理的属性时,会引发此异常。 "
#. Tag: para
+#: performance.xml:346
#, no-c-format
msgid ""
"Sometimes a proxy or collection needs to be initialized before closing the "
@@ -581,6 +803,7 @@
"者的疑惑,也不符合通常的代码规范。 "
#. Tag: para
+#: performance.xml:353
#, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize()</literal> and "
@@ -598,6 +821,7 @@
"合具有同样的功能。 "
#. Tag: para
+#: performance.xml:362
#, no-c-format
msgid ""
"Another option is to keep the <literal>Session</literal> open until all "
@@ -615,6 +839,7 @@
"open 状态经常会是一个问题。有两种方法可以解决此问题: "
#. Tag: para
+#: performance.xml:372
#, no-c-format
msgid ""
"In a web-based application, a servlet filter can be used to close the "
@@ -636,6 +861,7 @@
"Session in View\" 模式,你可以找到示例。 "
#. Tag: para
+#: performance.xml:385
#, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
@@ -660,6 +886,7 @@
"emphasis>,那么这项任务将会变得简单的多。 "
#. Tag: para
+#: performance.xml:401
#, no-c-format
msgid ""
"You can also attach a previously loaded object to a new <literal>Session</"
@@ -674,6 +901,7 @@
"emphasis>自动完成这些任务,因为这将引入一个特殊的事务语义。 "
#. Tag: para
+#: performance.xml:410
#, no-c-format
msgid ""
"Sometimes you do not want to initialize a large collection, but still need "
@@ -684,13 +912,25 @@
"小)、或者集合的部分内容。 "
#. Tag: para
+#: performance.xml:414
#, no-c-format
msgid ""
"You can use a collection filter to get the size of a collection without "
"initializing it:"
msgstr "你可以使用集合过滤器得到其集合的大小,而不必实例化整个集合:"
+#. Tag: programlisting
+#: performance.xml:417
+#, fuzzy, no-c-format
+msgid ""
+"( (Integer) s.createFilter( collection, \"select count(*)\" ).list().get"
+"(0) ).intValue()"
+msgstr ""
+"<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" ).list"
+"().get(0) ).intValue()]]>"
+
#. Tag: para
+#: performance.xml:419
#, no-c-format
msgid ""
"The <literal>createFilter()</literal> method is also used to efficiently "
@@ -700,12 +940,24 @@
"这里的 <literal>createFilter()</literal> 方法也可以被用来有效的抓取集合的部分"
"内容,而无需实例化整个集合:"
+#. Tag: programlisting
+#: performance.xml:423
+#, fuzzy, no-c-format
+msgid ""
+"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
+"list();"
+msgstr ""
+"<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0)."
+"setMaxResults(10).list();]]>"
+
#. Tag: title
+#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "使用批量抓取(Using batch fetching)"
#. Tag: para
+#: performance.xml:429
#, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
@@ -718,6 +970,7 @@
"方案,你可以在两种批量抓取方案之间进行选择:在类级别和集合级别。 "
#. Tag: para
+#: performance.xml:434
#, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
@@ -741,13 +994,21 @@
"映射文件的 <literal>Person</literal> 属性,显式声明 <literal>batch-size</"
"literal>,改变其行为: "
+#. Tag: programlisting
+#: performance.xml:447
+#, fuzzy, no-c-format
+msgid "<class name=\"Person\" batch-size=\"10\">...</class>"
+msgstr "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"
+
#. Tag: para
+#: performance.xml:449
#, no-c-format
msgid ""
"Hibernate will now execute only three queries: the pattern is 10, 10, 5."
msgstr "随之,Hibernate 将只需要执行三次查询,分别为 10、10、 5。 "
#. Tag: para
+#: performance.xml:452
#, no-c-format
msgid ""
"You can also enable batch fetching of collections. For example, if each "
@@ -766,7 +1027,24 @@
"<literal>cats</literal> 批量抓取,那么,Hibernate 将可以预先抓取整个集合。请"
"看例子: "
+#. Tag: programlisting
+#: performance.xml:461
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <set name=\"cats\" batch-size=\"3\">\n"
+" ...\n"
+" </set>\n"
+"</class>]]>"
+
#. Tag: para
+#: performance.xml:463
#, no-c-format
msgid ""
"With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 "
@@ -780,6 +1058,7 @@
"数。 "
#. Tag: para
+#: performance.xml:468
#, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
@@ -793,11 +1072,13 @@
"(materialized path)</emphasis>可能是更好的解决方法。)"
#. Tag: title
+#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "使用子查询抓取(Using subselect fetching)"
#. Tag: para
+#: performance.xml:477
#, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
@@ -809,19 +1090,21 @@
"加载。 "
#. Tag: title
+#: performance.xml:486
#, no-c-format
msgid "Fetch profiles"
msgstr "Fetch profile(抓取策略)"
#. Tag: para
-#, no-c-format
+#: performance.xml:488
+#, fuzzy, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
"is through something called a fetch profile, which is a named configuration "
"associated with the <interfacename>org.hibernate.SessionFactory</"
"interfacename> but enabled, by name, on the <interfacename>org.hibernate."
"Session</interfacename>. Once enabled on a <interfacename>org.hibernate."
-"Session</interfacename>, the fetch profile wull be in affect for that "
+"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session</interfacename> until it is explicitly "
"disabled."
msgstr ""
@@ -833,23 +1116,116 @@
"用。"
#. Tag: para
-#, no-c-format
+#: performance.xml:498
+#, fuzzy, no-c-format
msgid ""
-"So what does that mean? Well lets explain that by way of an example. Say we "
-"have the following mappings:"
+"So what does that mean? Well lets explain that by way of an example which "
+"show the different available approaches to configure a fetch profile:"
msgstr "这是什么意思呢?让我们通过一个例子进行解释。假设我们有下列映射:"
-#. Tag: para
+#. Tag: title
+#: performance.xml:503
#, no-c-format
+msgid "Specifying a fetch profile using <classname>@FetchProfile</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:506
+#, no-c-format
msgid ""
+"@Entity\n"
+"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
+" @FetchProfile.FetchOverride(entity = Customer.class, association = "
+"\"orders\", mode = FetchMode.JOIN)\n"
+"})\n"
+"public class Customer {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private long id;\n"
+"\n"
+" private String name;\n"
+"\n"
+" private long customerNumber;\n"
+"\n"
+" @OneToMany\n"
+" private Set<Order> orders;\n"
+"\n"
+" // standard getter/setter\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:510
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"outside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:514
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
+">\n"
+" </fetch-profile>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: performance.xml:518
+#, no-c-format
+msgid ""
+"Specifying a fetch profile using <literal><fetch-profile></literal> "
+"inside <literal><class></literal> node"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:522
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class name=\"Customer\">\n"
+" ...\n"
+" <set name=\"orders\" inverse=\"true\">\n"
+" <key column=\"cust_id\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </set>\n"
+" <fetch-profile name=\"customer-with-orders\">\n"
+" <fetch association=\"orders\" style=\"join\"/>\n"
+" </fetch-profile>\n"
+" </class>\n"
+" <class name=\"Order\">\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:525
+#, fuzzy, no-c-format
+msgid ""
"Now normally when you get a reference to a particular customer, that "
"customer's set of orders will be lazy meaning we will not yet have loaded "
"those orders from the database. Normally this is a good thing. Now lets say "
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
-"to use a fetch profile to achieve that. Just add the following to your "
-"mapping:"
+"to use a fetch profile to achieve that. The following code will load both "
+"the customer <emphasis>and</emphasis>their orders:"
msgstr ""
"现在,当你获得某个特定客户的引用时,这个客户的订单将处于 lazy 状态,表示我们"
"暂不会从数据库里加载这些订单。这样通常没有问题。假设在某种情况下,加载客户及"
@@ -857,19 +1233,35 @@
"略。另外一个方法就是使用抓取配置(Fetch Profile)。你可以在映射里加入下面的内"
"容:"
-#. Tag: para
+#. Tag: title
+#: performance.xml:536
#, no-c-format
-msgid "or even:"
-msgstr "甚至:"
+msgid "Activating a fetch profile for a given <classname>Session</classname>"
+msgstr ""
+#. Tag: programlisting
+#: performance.xml:539
+#, no-c-format
+msgid ""
+"Session session = ...;\n"
+"session.enableFetchProfile( \"customer-with-orders\" ); // name matches "
+"from mapping\n"
+"Customer customer = (Customer) session.get( Customer.class, customerId );"
+msgstr ""
+
#. Tag: para
+#: performance.xml:543
#, no-c-format
msgid ""
-"Now the following code will actually load both the customer <emphasis>and "
-"their orders</emphasis>:"
-msgstr "下面的代码将实际上加载客户<emphasis>以及</emphasis>订单:"
+"<classname>@FetchProfile </classname>definitions are global and it does not "
+"matter on which class you place them. You can place the "
+"<classname>@FetchProfile</classname> annotation either onto a class or "
+"package (package-info.java). In order to define multiple fetch profiles for "
+"the same class or package <classname>@FetchProfiles</classname> can be used."
+msgstr ""
#. Tag: para
+#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
@@ -881,11 +1273,13 @@
"3414\">HHH-3414</ulink>。"
#. Tag: title
+#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "使用延迟属性抓取(Using lazy property fetching)"
#. Tag: para
+#: performance.xml:560
#, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
@@ -902,6 +1296,7 @@
"有用,例如在原有表中拥有几百列数据、数据模型无法改动的情况下。 "
#. Tag: para
+#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy</literal> attribute "
@@ -910,7 +1305,34 @@
"可以在映射文件中对特定的属性设置 <literal>lazy</literal>,定义该属性为延迟载"
"入。"
+#. Tag: programlisting
+#: performance.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
+"\"true\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
+"\"/>\n"
+"</class>"
+msgstr ""
+"<![CDATA[<class name=\"Document\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
+" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy=\"true"
+"\"/>\n"
+" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true\"/"
+">\n"
+"</class>]]>"
+
#. Tag: para
+#: performance.xml:573
#, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
@@ -922,11 +1344,48 @@
"些属性的延迟设置,仍然将其直接载入。 "
#. Tag: para
+#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr "你可以在 Ant 的 Task 中,进行如下定义,对持久类代码加入“二进制指令。”"
+#. Tag: programlisting
+#: performance.xml:579
+#, fuzzy, no-c-format
+msgid ""
+"<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
+"instrument.InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
+"\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>"
+msgstr ""
+"<![CDATA[<target name=\"instrument\" depends=\"compile\">\n"
+" <taskdef name=\"instrument\" classname=\"org.hibernate.tool.instrument."
+"InstrumentTask\">\n"
+" <classpath path=\"${jar.path}\"/>\n"
+" <classpath path=\"${classes.dir}\"/>\n"
+" <classpath refid=\"lib.class.path\"/>\n"
+" </taskdef>\n"
+"\n"
+" <instrument verbose=\"true\">\n"
+" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"
+" <include name=\"*.class\"/>\n"
+" </fileset>\n"
+" </instrument>\n"
+"</target>]]>"
+
#. Tag: para
+#: performance.xml:581
#, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
@@ -939,6 +1398,7 @@
"制指令”处理,因此是一个更加值得选择的解决方法。 "
#. Tag: para
+#: performance.xml:586
#, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
@@ -947,11 +1407,13 @@
"有时你需要在 HQL 中通过<literal>抓取所有属性</literal>,强行抓取所有内容。 "
#. Tag: title
+#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "二级缓存(The Second Level Cache)"
#. Tag: para
+#: performance.xml:594
#, no-c-format
msgid ""
"A Hibernate <literal>Session</literal> is a transaction-level cache of "
@@ -969,15 +1431,17 @@
"(即使可以将缓存数据设定为定期失效)。 "
#. Tag: para
-#, no-c-format
+#: performance.xml:602
+#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property <literal>hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
-"integrations with the open-source cache providers that are listed below. You "
-"can also implement your own and plug it in as outlined above. Note that "
-"versions prior to 3.2 use EhCache as the default cache provider."
+"integrations with the open-source cache providers that are listed in <xref "
+"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
+"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
+"the default cache provider."
msgstr ""
"通过在 <literal>hibernate.cache.provider_class</literal> 属性中指定 "
"<literal>org.hibernate.cache.CacheProvider</literal> 的某个实现的类名,你可以"
@@ -987,156 +1451,403 @@
"样了。 "
#. Tag: title
+#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "缓存策略提供商(Cache Providers)"
#. Tag: entry
+#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "Cache"
#. Tag: entry
+#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "Provider class"
#. Tag: entry
+#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "Type"
#. Tag: entry
+#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "Cluster Safe"
#. Tag: entry
+#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "Query Cache Supported"
#. Tag: entry
+#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Hashtable (not intended for production use)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.HashtableCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:644
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "<literal>org.hibernate.cache.HashtableCacheProvider</literal> "
#. Tag: entry
+#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "memory"
#. Tag: entry
+#: performance.xml:650 performance.xml:662 performance.xml:674
+#: performance.xml:992 performance.xml:994 performance.xml:996
+#: performance.xml:1004 performance.xml:1006 performance.xml:1008
+#: performance.xml:1016 performance.xml:1018 performance.xml:1020
+#: performance.xml:1028 performance.xml:1030 performance.xml:1040
+#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
-msgid "yes"
-msgstr "yes"
+msgid "<entry>yes</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: entry
+#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.EhCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:656
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.EhCacheProvider"
msgstr "<literal>org.hibernate.cache.EhCacheProvider</literal> "
#. Tag: entry
+#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "memory,disk"
#. Tag: entry
+#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.OSCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:668
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.OSCacheProvider"
msgstr "<literal>org.hibernate.cache.OSCacheProvider</literal> "
#. Tag: entry
+#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:680
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "<literal>org.hibernate.cache.SwarmCacheProvider</literal>"
#. Tag: entry
+#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "clustered (ip multicast)"
#. Tag: entry
+#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "yes (clustered invalidation)"
#. Tag: entry
+#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr "JBoss Cache 1.x"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.TreeCacheProvider</literal>"
+#. Tag: literal
+#: performance.xml:692
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.TreeCacheProvider"
msgstr "<literal>org.hibernate.cache.TreeCacheProvider</literal> "
#. Tag: entry
+#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "clustered (ip multicast), transactional"
#. Tag: entry
+#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "yes (replication)"
#. Tag: entry
+#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "yes (clock sync req.)"
#. Tag: entry
+#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr "JBoss Cache 2"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
+#. Tag: literal
+#: performance.xml:704
+#, fuzzy, no-c-format
+msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "<literal>org.hibernate.cache.jbc.JBossCacheRegionFactory</literal>"
#. Tag: entry
+#: performance.xml:708
#, no-c-format
msgid "yes (replication or invalidation)"
msgstr "yes (replication or invalidation)"
#. Tag: title
+#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "缓存映射(Cache mappings)"
#. Tag: para
+#: performance.xml:719
#, no-c-format
msgid ""
-"The <literal><cache></literal> element of a class or collection "
-"mapping has the following form:"
+"As we have done in previous chapters we are looking at the two different "
+"possibiltites to configure caching. First configuration via annotations and "
+"then via Hibernate mapping files."
msgstr ""
-"类或者集合映射的“<literal><cache></literal> 元素”可以有下列形式:"
#. Tag: para
+#: performance.xml:723
#, no-c-format
msgid ""
+"By default, entities are not part of the second level cache and we recommend "
+"you to stick to this setting. However, you can override this by setting the "
+"<literal>shared-cache-mode</literal> element in your <filename>persistence."
+"xml</filename> file or by using the <literal>javax.persistence.sharedCache."
+"mode </literal>property in your configuration. The following values are "
+"possible:"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:732
+#, no-c-format
+msgid ""
+"<literal>ENABLE_SELECTIVE</literal> (Default and recommended value): "
+"entities are not cached unless explicitly marked as cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:738
+#, no-c-format
+msgid ""
+"<literal>DISABLE_SELECTIVE</literal>: entities are cached unless explicitly "
+"marked as not cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:743
+#, no-c-format
+msgid ""
+"<literal>ALL</literal>: all entities are always cached even if marked as non "
+"cacheable."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:748
+#, no-c-format
+msgid ""
+"<literal>NONE</literal>: no entity are cached even if marked as cacheable. "
+"This option can make sense to disable second-level cache altogether."
+msgstr ""
+
+#. Tag: para
+#: performance.xml:754
+#, no-c-format
+msgid ""
+"The cache concurrency strategy used by default can be set globaly via the "
+"<literal>hibernate.cache.default_cache_concurrency_strategy</literal> "
+"configuration property. The values for this property are:"
+msgstr ""
+
+#. Tag: literal
+#: performance.xml:761
+#, fuzzy, no-c-format
+msgid "<literal>read-only</literal>"
+msgstr "条件查询"
+
+#. Tag: literal
+#: performance.xml:765
+#, fuzzy, no-c-format
+msgid "<literal>read-write</literal>"
+msgstr "条件查询"
+
+#. Tag: literal
+#: performance.xml:769
+#, fuzzy, no-c-format
+msgid "<literal>nonstrict-read-write</literal>"
+msgstr "nonstrict-read-write"
+
+#. Tag: literal
+#: performance.xml:773
+#, fuzzy, no-c-format
+msgid "<literal>transactional</literal>"
+msgstr "条件查询"
+
+#. Tag: para
+#: performance.xml:778
+#, no-c-format
+msgid ""
+"It is recommended to define the cache concurrency strategy per entity rather "
+"than using a global one. Use the <classname>@org.hibernate.annotations."
+"Cache</classname> annotation for that."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:785
+#, no-c-format
+msgid ""
+"Definition of cache concurrency strategy via <classname>@Cache</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:788
+#, no-c-format
+msgid ""
+"@Entity \n"
+"@Cacheable\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:791
+#, no-c-format
+msgid ""
+"Hibernate also let's you cache the content of a collection or the "
+"identifiers if the collection contains other entities. Use the "
+"<classname>@Cache</classname> annotation on the collection property."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:797
+#, fuzzy, no-c-format
+msgid "Caching collections using annotations"
+msgstr "实例化集合和代理(Initializing collections and proxies)"
+
+#. Tag: programlisting
+#: performance.xml:799
+#, no-c-format
+msgid ""
+"@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: para
+#: performance.xml:802
+#, no-c-format
+msgid ""
+"shows the<literal> @org.hibernate.annotations.Cache</literal> annotations "
+"with its attributes. It allows you to define the caching strategy and region "
+"of a given second level cache."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:808
+#, no-c-format
+msgid "<classname>@Cache</classname> annotation with attributes"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:820
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:824
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: performance.xml:830
+#, 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
+#: performance.xml:835
+#, 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: para
+#: performance.xml:843
+#, no-c-format
+msgid ""
+"Let's now take a look at Hibernate mapping files. There the <literal><"
+"cache></literal> element of a class or collection mapping is used to "
+"configure the second level cache. Looking at <xref linkend=\"example-"
+"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
+msgstr ""
+
+#. Tag: title
+#: performance.xml:850
+#, no-c-format
+msgid "The Hibernate <literal><cache></literal> mapping element"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:862
+#, fuzzy, no-c-format
+msgid ""
+"<cache\n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>"
+msgstr ""
+"<![CDATA[<cache \n"
+" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
+" region=\"RegionName\"\n"
+" include=\"all|non-lazy\"\n"
+"/>]]>"
+
+#. Tag: para
+#: performance.xml:866
+#, no-c-format
+msgid ""
"<literal>usage</literal> (required) specifies the caching strategy: "
"<literal>transactional</literal>, <literal>read-write</literal>, "
"<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"
@@ -1146,6 +1857,7 @@
"literal> 或 <literal>read-only</literal>。"
#. Tag: para
+#: performance.xml:874
#, no-c-format
msgid ""
"<literal>region</literal> (optional: defaults to the class or collection "
@@ -1156,6 +1868,7 @@
"cache region) "
#. Tag: para
+#: performance.xml:880
#, no-c-format
msgid ""
"<literal>include</literal> (optional: defaults to <literal>all</literal>) "
@@ -1168,31 +1881,31 @@
"\"true\"</literal> 的实体的属性可能无法被缓存 "
#. Tag: para
-#, no-c-format
+#: performance.xml:890
+#, fuzzy, no-c-format
msgid ""
-"Alternatively, you can specify <literal><class-cache></literal> and "
-"<literal><collection-cache></literal> elements in <literal>hibernate."
-"cfg.xml</literal>."
+"Alternatively to <literal><cache></literal>, you can use <literal><"
+"class-cache></literal> and <literal><collection-cache></literal> "
+"elements in <literal>hibernate.cfg.xml</literal>."
msgstr ""
"另外(首选?),你可以在<literal>hibernate.cfg.xml</literal> 中指定 "
"<literal><class-cache></literal> 和 <literal><collection-cache></"
"literal> 元素。"
#. Tag: para
+#: performance.xml:895
#, no-c-format
-msgid ""
-"The <literal>usage</literal> attribute specifies a <emphasis>cache "
-"concurrency strategy</emphasis>."
+msgid "Let's now have a closer look at the different usage strategies"
msgstr ""
-"这里的 <literal>usage</literal> 属性指明了<emphasis>缓存并发策略(cache "
-"concurrency strategy)</emphasis>。"
#. Tag: title
+#: performance.xml:900
#, no-c-format
msgid "Strategy: read only"
msgstr "策略:只读缓存(Strategy:read only)"
#. Tag: para
+#: performance.xml:902
#, no-c-format
msgid ""
"If your application needs to read, but not modify, instances of a persistent "
@@ -1205,11 +1918,13 @@
"中,它也能完美地运作。 "
#. Tag: title
+#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "策略:读写/缓存(Strategy:read/write)"
#. Tag: para
+#: performance.xml:911
#, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write</literal> "
@@ -1235,11 +1950,13 @@
"(locking)。Hibernate 内置的缓存策略并不支持锁定功能。 "
#. Tag: title
+#: performance.xml:927
#, no-c-format
msgid "Strategy: nonstrict read/write"
msgstr "策略:非严格读/写缓存(Strategy:nonstrict read/write)"
#. Tag: para
+#: performance.xml:929
#, no-c-format
msgid ""
"If the application only occasionally needs to update data (i.e. if it is "
@@ -1259,11 +1976,13 @@
"<literal>Session.disconnect()</literal> 调用前,整个事务已经结束。 "
#. Tag: title
+#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "策略:事务缓存(transactional)"
#. Tag: para
+#: performance.xml:943
#, no-c-format
msgid ""
"The <literal>transactional</literal> cache strategy provides support for "
@@ -1276,11 +1995,13 @@
"<literal>hibernate.transaction.manager_lookup_class</literal> 属性。 "
#. Tag: title
+#: performance.xml:950
#, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "各种缓存提供商/缓存并发策略的兼容性"
#. Tag: para
+#: performance.xml:953
#, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
@@ -1289,6 +2010,7 @@
"其各自适用的并发策略。 "
#. Tag: para
+#: performance.xml:957
#, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
@@ -1298,37 +2020,44 @@
"其各自适用的并发策略。 "
#. Tag: title
+#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr ""
"各种缓存提供商对缓存并发策略的支持情况(Cache Concurrency Strategy Support)"
#. Tag: entry
-#, no-c-format
-msgid "read-only"
-msgstr "read-only"
+#: performance.xml:978
+#, fuzzy, no-c-format
+msgid "<entry>read-only</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: entry
-#, no-c-format
-msgid "nonstrict-read-write"
+#: performance.xml:980
+#, fuzzy, no-c-format
+msgid "<entry>nonstrict-read-write</entry>"
msgstr "nonstrict-read-write"
#. Tag: entry
-#, no-c-format
-msgid "read-write"
-msgstr "read-write"
+#: performance.xml:982
+#, fuzzy, no-c-format
+msgid "<entry>read-write</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: entry
-#, no-c-format
-msgid "transactional"
-msgstr "transactional"
+#: performance.xml:984
+#, fuzzy, no-c-format
+msgid "<entry>transactional</entry>"
+msgstr "<entry>yes</entry>"
#. Tag: title
+#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "管理缓存(Managing the caches)"
#. Tag: para
+#: performance.xml:1069
#, no-c-format
msgid ""
"Whenever you pass an object to <literal>save()</literal>, <literal>update()</"
@@ -1345,6 +2074,7 @@
"时,该对象都将被加入到 <literal>Session</literal> 的内部缓存中。 "
#. Tag: para
+#: performance.xml:1076
#, no-c-format
msgid ""
"When <literal>flush()</literal> is subsequently called, the state of that "
@@ -1358,7 +2088,36 @@
"操作发生,或者你正处理大量对象、需要对有效管理内存时,你可以调用 "
"<literal>evict()</literal> 方法,从一级缓存中去掉这些对象及其集合。 "
+#. Tag: title
+#: performance.xml:1084
+#, no-c-format
+msgid ""
+"Explcitly evicting a cached instance from the first level cache using "
+"<methodname>Session.evict()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1087
+#, fuzzy, no-c-format
+msgid ""
+"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
+"huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}"
+msgstr ""
+"<![CDATA[ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll"
+"(); //a huge result set\n"
+"while ( cats.next() ) {\n"
+" Cat cat = (Cat) cats.get(0);\n"
+" doSomethingWithACat(cat);\n"
+" sess.evict(cat);\n"
+"}]]>"
+
#. Tag: para
+#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session</literal> also provides a <literal>contains()</literal> "
@@ -1368,6 +2127,7 @@
"处于当前 session 的缓存中。"
#. Tag: para
+#: performance.xml:1094
#, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear()</"
@@ -1377,6 +2137,7 @@
"clear()</literal>。 "
#. Tag: para
+#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
@@ -1386,7 +2147,34 @@
"对于二级缓存来说,在 <literal>SessionFactory</literal> 中定义了许多方法,清除"
"缓存中实例、整个类、集合实例或者整个集合。"
+#. Tag: title
+#: performance.xml:1103
+#, no-c-format
+msgid ""
+"Second-level cache eviction via <methodname>SessionFactoty.evict() </"
+"methodname>and <methodname>SessionFacyory.evictCollection()</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1107
+#, fuzzy, no-c-format
+msgid ""
+"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections"
+msgstr ""
+"<![CDATA[sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
+"sessionFactory.evict(Cat.class); //evict all Cats\n"
+"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
+"collection of kittens\n"
+"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
+"collections]]>"
+
#. Tag: para
+#: performance.xml:1110
#, no-c-format
msgid ""
"The <literal>CacheMode</literal> controls how a particular session interacts "
@@ -1396,6 +2184,7 @@
"互。 "
#. Tag: para
+#: performance.xml:1115
#, no-c-format
msgid ""
"<literal>CacheMode.NORMAL</literal>: will read items from and write items to "
@@ -1403,6 +2192,7 @@
msgstr "<literal>CacheMode.NORMAL</literal>:从二级缓存中读、写数据。"
#. Tag: para
+#: performance.xml:1120
#, no-c-format
msgid ""
"<literal>CacheMode.GET</literal>: will read items from the second-level "
@@ -1412,6 +2202,7 @@
"缓存写数据。"
#. Tag: para
+#: performance.xml:1126
#, no-c-format
msgid ""
"<literal>CacheMode.PUT</literal>: will write items to the second-level "
@@ -1421,6 +2212,7 @@
"据。"
#. Tag: para
+#: performance.xml:1131
#, no-c-format
msgid ""
"<literal>CacheMode.REFRESH</literal>: will write items to the second-level "
@@ -1433,6 +2225,7 @@
"级缓存从数据库中读取数据,刷新缓存内容。"
#. Tag: para
+#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
@@ -1441,7 +2234,30 @@
"如若需要查看二级缓存或查询缓存区域的内容,你可以使用<literal>统计"
"(Statistics)</literal> API。"
+#. Tag: title
+#: performance.xml:1143
+#, fuzzy, no-c-format
+msgid ""
+"Browsing the second-level cache entries via the <classname>Statistics</"
+"classname> API"
+msgstr ""
+"如若需要查看二级缓存或查询缓存区域的内容,你可以使用<literal>统计"
+"(Statistics)</literal> API。"
+
+#. Tag: programlisting
+#: performance.xml:1146
+#, fuzzy, no-c-format
+msgid ""
+"Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();"
+msgstr ""
+"<![CDATA[Map cacheEntries = sessionFactory.getStatistics()\n"
+" .getSecondLevelCacheStatistics(regionName)\n"
+" .getEntries();]]>"
+
#. Tag: para
+#: performance.xml:1149
#, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
@@ -1451,11 +2267,29 @@
"缓存内容。 "
#. Tag: title
+#: performance.xml:1153
#, no-c-format
+msgid "Enabling Hibernate statistics"
+msgstr ""
+
+#. Tag: programlisting
+#: performance.xml:1155
+#, fuzzy, no-c-format
+msgid ""
+"hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true"
+msgstr ""
+"<![CDATA[hibernate.generate_statistics true\n"
+"hibernate.cache.use_structured_entries true]]>"
+
+#. Tag: title
+#: performance.xml:1160
+#, no-c-format
msgid "The Query Cache"
msgstr "查询缓存(The Query Cache)"
#. Tag: para
+#: performance.xml:1162
#, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
@@ -1465,11 +2299,13 @@
"处。"
#. Tag: title
+#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr "启用查询缓存"
#. Tag: para
+#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
@@ -1486,12 +2322,20 @@
"么时候失效。因为大多数应用程序不会从缓存查询结果中受益,所以 Hibernate 在缺省"
"情况下将禁用缓存。要使用查询缓存,你首先需要启用查询缓存:"
+#. Tag: programlisting
+#: performance.xml:1177
+#, fuzzy, no-c-format
+msgid "hibernate.cache.use_query_cache true"
+msgstr "<![CDATA[hibernate.cache.use_query_cache true]]>"
+
#. Tag: para
+#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr "这个设置创建了两个新的缓存 region:"
#. Tag: para
+#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache</classname>, holding the "
@@ -1501,6 +2345,7 @@
"结果"
#. Tag: para
+#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache</classname>, holding "
@@ -1511,10 +2356,11 @@
"询表的最近更新的时间戳。它们用于检验查询结果。"
#. Tag: para
+#: performance.xml:1194
#, fuzzy, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
-"timeouts is is very important that the cache timeout of the underlying cache "
+"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
@@ -1526,6 +2372,7 @@
"region 用于 expiry。请注意,特别是 LRU 缓存 expiry 策略总是不合适的。"
#. Tag: para
+#: performance.xml:1203
#, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
@@ -1541,6 +2388,7 @@
"查找结果,并将自己的结果集放到缓存中去。 "
#. Tag: para
+#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
@@ -1554,11 +2402,13 @@
"询缓存应该和二级缓存一起使用。"
#. Tag: title
+#: performance.xml:1221
#, no-c-format
msgid "Query cache regions"
msgstr "查询缓存区"
#. Tag: para
+#: performance.xml:1223
#, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
@@ -1568,7 +2418,28 @@
"如果你要对查询缓存的失效政策进行精确的控制,你必须调用 <literal>Query."
"setCacheRegion()</literal> 方法,为每个查询指定其命名的缓存区域。 "
+#. Tag: programlisting
+#: performance.xml:1227
+#, fuzzy, no-c-format
+msgid ""
+"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
+"\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();"
+msgstr ""
+"<![CDATA[List blogs = sess.createQuery(\"from Blog blog where blog.blogger "
+"= :blogger\")\n"
+" .setEntity(\"blogger\", blogger)\n"
+" .setMaxResults(15)\n"
+" .setCacheable(true)\n"
+" .setCacheRegion(\"frontpages\")\n"
+" .list();]]>"
+
#. Tag: para
+#: performance.xml:1229
#, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
@@ -1588,11 +2459,13 @@
"</literal> 的更为有效的替代方案,同样可以清除查询缓存区域。"
#. Tag: title
+#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "理解集合性能(Understanding Collection performance)"
#. Tag: para
+#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
@@ -1603,31 +2476,37 @@
"更多问题。"
#. Tag: title
+#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "分类(Taxonomy)"
#. Tag: para
+#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "Hibernate 定义了三种基本类型的集合:"
#. Tag: para
+#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "值数据集合"
#. Tag: para
+#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr "一对多关联(One-to-many Associations) "
#. Tag: para
+#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr "多对多关联 "
#. Tag: para
+#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
@@ -1642,21 +2521,25 @@
"或删除集合行数据的主键的结构”。因此得到了如下的分类:"
#. Tag: para
+#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "有序集合类"
#. Tag: para
+#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "集合(sets)"
#. Tag: para
+#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "包(bags)"
#. Tag: para
+#: performance.xml:1288
#, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
@@ -1671,6 +2554,7 @@
"时,可以迅速找到该行数据。 "
#. Tag: para
+#: performance.xml:1295
#, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key></literal> and "
@@ -1691,6 +2575,7 @@
"键,你必须把所有的字段都声明为 <literal>not-null=\"true\"</literal>。) "
#. Tag: para
+#: performance.xml:1306
#, no-c-format
msgid ""
"<literal><idbag></literal> mappings define a surrogate key, so they "
@@ -1700,6 +2585,7 @@
"新。事实上,<literal><idbag></literal> 拥有着最好的性能表现。 "
#. Tag: para
+#: performance.xml:1309
#, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
@@ -1714,6 +2600,7 @@
"新创建整个集合。因此 Bag 是非常低效的。 "
#. Tag: para
+#: performance.xml:1316
#, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
@@ -1726,12 +2613,14 @@
"如何进行“定位”的。) "
#. Tag: title
+#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
msgstr "Lists,maps 和 sets 用于更新效率最高"
#. Tag: para
+#: performance.xml:1326
#, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
@@ -1742,6 +2631,7 @@
"中拥有最好的性能。 "
#. Tag: para
+#: performance.xml:1330
#, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
@@ -1759,6 +2649,7 @@
"作时“改变”才有效。再次强调:这段讨论对“一对多关联”并不适用。 "
#. Tag: para
+#: performance.xml:1338
#, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
@@ -1772,6 +2663,7 @@
"型,这时因为“set”的语义在关系模型中是最自然的。 "
#. Tag: para
+#: performance.xml:1344
#, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
@@ -1785,11 +2677,13 @@
"作将会在多对一的这一端进行处理。因此对于此类情况,无需考虑其集合的更新性能。 "
#. Tag: title
+#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr "Bag 和 list 是反向集合类中效率最高的"
#. Tag: para
+#: performance.xml:1354
#, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
@@ -1808,12 +2702,30 @@
"<literal>Collection.addAll()</literal> 方法对 bag 或者 List 总是返回 true(这"
"点与与 Set 不同)。因此对于下面的相同代码来说,速度会快得多。 "
+#. Tag: programlisting
+#: performance.xml:1365
+#, fuzzy, no-c-format
+msgid ""
+"Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();"
+msgstr ""
+"<![CDATA[Parent p = (Parent) sess.load(Parent.class, id);\n"
+"Child c = new Child();\n"
+"c.setParent(p);\n"
+"p.getChildren().add(c); //no need to fetch the collection!\n"
+"sess.flush();]]>"
+
#. Tag: title
+#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "一次性删除(One shot delete)"
#. Tag: para
+#: performance.xml:1371
#, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
@@ -1826,6 +2738,7 @@
"定了。 "
#. Tag: para
+#: performance.xml:1377
#, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
@@ -1838,6 +2751,7 @@
"句(除非集合类是一个 bag)。这当然是令人满意的。 "
#. Tag: para
+#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
@@ -1847,11 +2761,13 @@
"式:"
#. Tag: para
+#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr "逐一的删除这 18 个数据,再新增三个;"
#. Tag: para
+#: performance.xml:1394
#, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE</literal> and insert "
@@ -1859,6 +2775,7 @@
msgstr "删除整个集合类(只用一句 DELETE 语句),然后逐一添加 5 个数据。"
#. Tag: para
+#: performance.xml:1400
#, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
@@ -1869,6 +2786,7 @@
"聪明也是好事,否则可能会引发意外的“数据库触发器”之类的问题。)"
#. Tag: para
+#: performance.xml:1404
#, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
@@ -1880,6 +2798,7 @@
"用的。 "
#. Tag: para
+#: performance.xml:1409
#, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
@@ -1889,11 +2808,13 @@
"合。 "
#. Tag: title
+#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "监测性能(Monitoring performance)"
#. Tag: para
+#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
@@ -1905,11 +2826,13 @@
"的示意图,因此可以从 每个 <literal>SessionFactory</literal> 抓取其统计数据。"
#. Tag: title
+#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "监测 SessionFactory"
#. Tag: para
+#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory</literal> metrics in two ways. Your "
@@ -1921,6 +2844,7 @@
"<literal>统计</literal>数据。"
#. Tag: para
+#: performance.xml:1430
#, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
@@ -1933,7 +2857,56 @@
"<literal>SessionFactory</literal> 同时共享一个 MBean,也可以每个 "
"SessionFactory 分配一个 MBean。下面的代码即是其演示代码: "
+#. Tag: programlisting
+#: performance.xml:1435
+#, fuzzy, no-c-format
+msgid ""
+"// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server"
+msgstr ""
+"<![CDATA[// MBean service registration for a specific SessionFactory\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
+"SessionFactory\n"
+"server.registerMBean(stats, on); // Register the Mbean on the server]]>"
+
+#. Tag: programlisting
+#: performance.xml:1437
+#, fuzzy, no-c-format
+msgid ""
+"// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server"
+msgstr ""
+"<![CDATA[// MBean service registration for all SessionFactory's\n"
+"Hashtable tb = new Hashtable();\n"
+"tb.put(\"type\", \"statistics\");\n"
+"tb.put(\"sessionFactory\", \"all\");\n"
+"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
+"\n"
+"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
+"server.registerMBean(stats, on); // Register the MBean on the server]]>"
+
#. Tag: para
+#: performance.xml:1439
#, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
@@ -1942,6 +2915,7 @@
"你可以通过以下方法打开或关闭 <literal>SessionFactory</literal> 的监测功能: "
#. Tag: para
+#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics</literal> "
@@ -1951,6 +2925,7 @@
"<literal>true</literal> 或 <literal>false</literal>;"
#. Tag: para
+#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true)</literal> "
@@ -1961,6 +2936,7 @@
"literal>"
#. Tag: para
+#: performance.xml:1458
#, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear()</"
@@ -1971,11 +2947,13 @@
"<literal>logSummary()</literal> 在日志中记录(info 级别)其总结。 "
#. Tag: title
+#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "数据记录(Metrics)"
#. Tag: para
+#: performance.xml:1466
#, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
@@ -1988,6 +2966,7 @@
"问,主要分为三类:"
#. Tag: para
+#: performance.xml:1473
#, no-c-format
msgid ""
"Metrics related to the general <literal>Session</literal> usage, such as "
@@ -1997,6 +2976,7 @@
"得的 JDBC 的连接数等;"
#. Tag: para
+#: performance.xml:1479
#, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
@@ -2004,6 +2984,7 @@
msgstr "实体、集合、查询、缓存等内容的统一数据记录。"
#. Tag: para
+#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
@@ -2011,6 +2992,7 @@
msgstr "和具体实体、集合、查询、缓存相关的详细数据记录"
#. Tag: para
+#: performance.xml:1489
#, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
@@ -2024,6 +3006,7 @@
"据精度和具体的 JVM 有关,在有些平台上其精度甚至只能精确到 10 秒。 "
#. Tag: para
+#: performance.xml:1495
#, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
@@ -2043,7 +3026,46 @@
"<literal>SecondLevelCacheStatistics</literal> 和 <literal>QueryStatistics</"
"literal> 的 API 文档以抓取更多信息。下面的代码则是个简单的例子: "
+#. Tag: programlisting
+#: performance.xml:1506
+#, fuzzy, no-c-format
+msgid ""
+"Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );"
+msgstr ""
+"<![CDATA[Statistics stats = HibernateUtil.sessionFactory.getStatistics();\n"
+"\n"
+"double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
+"double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
+"double queryCacheHitRatio =\n"
+" queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
+"\n"
+"log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
+"\n"
+"EntityStatistics entityStats =\n"
+" stats.getEntityStatistics( Cat.class.getName() );\n"
+"long changes =\n"
+" entityStats.getInsertCount()\n"
+" + entityStats.getUpdateCount()\n"
+" + entityStats.getDeleteCount();\n"
+"log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );]]>"
+
#. Tag: para
+#: performance.xml:1508
#, no-c-format
msgid ""
"You can work on all entities, collections, queries and region caches, by "
@@ -2057,7 +3079,40 @@
"<literal>getEntityNames()</literal>、<literal>getCollectionRoleNames()</"
"literal> 和 <literal>getSecondLevelCacheRegionNames()</literal>。"
+#~ msgid "or even:"
+#~ msgstr "甚至:"
+
#~ msgid ""
+#~ "Now the following code will actually load both the customer <emphasis>and "
+#~ "their orders</emphasis>:"
+#~ msgstr "下面的代码将实际上加载客户<emphasis>以及</emphasis>订单:"
+
+#~ msgid "yes"
+#~ msgstr "yes"
+
+#~ msgid ""
+#~ "The <literal><cache></literal> element of a class or collection "
+#~ "mapping has the following form:"
+#~ msgstr ""
+#~ "类或者集合映射的“<literal><cache></literal> 元素”可以有下列形式:"
+
+#~ msgid ""
+#~ "The <literal>usage</literal> attribute specifies a <emphasis>cache "
+#~ "concurrency strategy</emphasis>."
+#~ msgstr ""
+#~ "这里的 <literal>usage</literal> 属性指明了<emphasis>缓存并发策略(cache "
+#~ "concurrency strategy)</emphasis>。"
+
+#~ msgid "read-only"
+#~ msgstr "read-only"
+
+#~ msgid "read-write"
+#~ msgstr "read-write"
+
+#~ msgid "transactional"
+#~ msgstr "transactional"
+
+#~ msgid ""
#~ "This setting creates two new cache regions: one holding cached query "
#~ "result sets (<literal>org.hibernate.cache.StandardQueryCache</literal>), "
#~ "the other holding timestamps of the most recent updates to queryable "
@@ -2075,242 +3130,6 @@
#~ "会和二级缓存一起使用。 "
#~ msgid ""
-#~ "<![CDATA[s = sessions.openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ " \n"
-#~ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
-#~ " .setString(\"userName\", userName).uniqueResult();\n"
-#~ "Map permissions = u.getPermissions();\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();\n"
-#~ "\n"
-#~ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // "
-#~ "Error!]]>"
-#~ msgstr ""
-#~ "<![CDATA[s = sessions.openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ " \n"
-#~ "User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"
-#~ " .setString(\"userName\", userName).uniqueResult();\n"
-#~ "Map permissions = u.getPermissions();\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();\n"
-#~ "\n"
-#~ "Integer accessLevel = (Integer) permissions.get(\"accounts\"); // "
-#~ "Error!]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<set name=\"permissions\" \n"
-#~ " fetch=\"join\">\n"
-#~ " <key column=\"userId\"/>\n"
-#~ " <one-to-many class=\"Permission\"/>\n"
-#~ "</set]]>"
-#~ msgstr ""
-#~ "<![CDATA[<set name=\"permissions\" \n"
-#~ " fetch=\"join\">\n"
-#~ " <key column=\"userId\"/>\n"
-#~ " <one-to-many class=\"Permission\"/>\n"
-#~ "</set]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[User user = (User) session.createCriteria(User.class)\n"
-#~ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
-#~ " .add( Restrictions.idEq(userId) )\n"
-#~ " .uniqueResult();]]>"
-#~ msgstr ""
-#~ "<![CDATA[User user = (User) session.createCriteria(User.class)\n"
-#~ " .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
-#~ " .add( Restrictions.idEq(userId) )\n"
-#~ " .uniqueResult();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Cat\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Cat\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
-#~ "proxy (does not hit the db)\n"
-#~ "if ( cat.isDomesticCat() ) { // hit the db to initialize "
-#~ "the proxy\n"
-#~ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // instantiate a "
-#~ "proxy (does not hit the db)\n"
-#~ "if ( cat.isDomesticCat() ) { // hit the db to initialize "
-#~ "the proxy\n"
-#~ " DomesticCat dc = (DomesticCat) cat; // Error!\n"
-#~ " ....\n"
-#~ "}]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // "
-#~ "instantiate a Cat proxy\n"
-#~ "DomesticCat dc = \n"
-#~ " (DomesticCat) session.load(DomesticCat.class, id); // acquire "
-#~ "new DomesticCat proxy!\n"
-#~ "System.out.println(cat==dc); // false]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(Cat.class, id); // "
-#~ "instantiate a Cat proxy\n"
-#~ "DomesticCat dc = \n"
-#~ " (DomesticCat) session.load(DomesticCat.class, id); // acquire "
-#~ "new DomesticCat proxy!\n"
-#~ "System.out.println(cat==dc); // false]]>"
-
-#~ msgid ""
-#~ "<![CDATA[cat.setWeight(11.0); // hit the db to initialize the proxy\n"
-#~ "System.out.println( dc.getWeight() ); // 11.0]]>"
-#~ msgstr ""
-#~ "<![CDATA[cat.setWeight(11.0); // hit the db to initialize the proxy\n"
-#~ "System.out.println( dc.getWeight() ); // 11.0]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"CatImpl\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"CatImpl\" proxy=\"Cat\">\n"
-#~ " ......\n"
-#~ " <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
-#~ " .....\n"
-#~ " </subclass>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
-#~ "Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
-#~ "name='fritz'\").iterate();\n"
-#~ "Cat fritz = (Cat) iter.next();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
-#~ "Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
-#~ "name='fritz'\").iterate();\n"
-#~ "Cat fritz = (Cat) iter.next();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" )."
-#~ "list().get(0) ).intValue()]]>"
-#~ msgstr ""
-#~ "<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" )."
-#~ "list().get(0) ).intValue()]]>"
-
-#~ msgid ""
-#~ "<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0)."
-#~ "setMaxResults(10).list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0)."
-#~ "setMaxResults(10).list();]]>"
-
-#~ msgid "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"
-#~ msgstr "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <set name=\"cats\" batch-size=\"3\">\n"
-#~ " ...\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <set name=\"cats\" batch-size=\"3\">\n"
-#~ " ...\n"
-#~ " </set>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Document\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
-#~ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
-#~ "\"true\"/>\n"
-#~ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
-#~ "\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<class name=\"Document\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
-#~ " <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
-#~ "\"true\"/>\n"
-#~ " <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
-#~ "\"/>\n"
-#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[<target name=\"instrument\" depends=\"compile\">\n"
-#~ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
-#~ "instrument.InstrumentTask\">\n"
-#~ " <classpath path=\"${jar.path}\"/>\n"
-#~ " <classpath path=\"${classes.dir}\"/>\n"
-#~ " <classpath refid=\"lib.class.path\"/>\n"
-#~ " </taskdef>\n"
-#~ "\n"
-#~ " <instrument verbose=\"true\">\n"
-#~ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"
-#~ " <include name=\"*.class\"/>\n"
-#~ " </fileset>\n"
-#~ " </instrument>\n"
-#~ "</target>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<target name=\"instrument\" depends=\"compile\">\n"
-#~ " <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
-#~ "instrument.InstrumentTask\">\n"
-#~ " <classpath path=\"${jar.path}\"/>\n"
-#~ " <classpath path=\"${classes.dir}\"/>\n"
-#~ " <classpath refid=\"lib.class.path\"/>\n"
-#~ " </taskdef>\n"
-#~ "\n"
-#~ " <instrument verbose=\"true\">\n"
-#~ " <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"
-#~ " <include name=\"*.class\"/>\n"
-#~ " </fileset>\n"
-#~ " </instrument>\n"
-#~ "</target>]]>"
-
-#~ msgid "<entry>yes</entry>"
-#~ msgstr "<entry>yes</entry>"
-
-#~ msgid ""
-#~ "<![CDATA[<cache \n"
-#~ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
-#~ " region=\"RegionName\"\n"
-#~ " include=\"all|non-lazy\"\n"
-#~ "/>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<cache \n"
-#~ " usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
-#~ " region=\"RegionName\"\n"
-#~ " include=\"all|non-lazy\"\n"
-#~ "/>]]>"
-
-#~ msgid ""
#~ "<![CDATA[<class name=\"eg.Immutable\" mutable=\"false\">\n"
#~ " <cache usage=\"read-only\"/>\n"
#~ " ....\n"
@@ -2339,169 +3158,3 @@
#~ " ....\n"
#~ " </set>\n"
#~ "</class>]]>"
-
-#~ msgid ""
-#~ "<![CDATA[ScrollableResult cats = sess.createQuery(\"from Cat as cat\")."
-#~ "scroll(); //a huge result set\n"
-#~ "while ( cats.next() ) {\n"
-#~ " Cat cat = (Cat) cats.get(0);\n"
-#~ " doSomethingWithACat(cat);\n"
-#~ " sess.evict(cat);\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[ScrollableResult cats = sess.createQuery(\"from Cat as cat\")."
-#~ "scroll(); //a huge result set\n"
-#~ "while ( cats.next() ) {\n"
-#~ " Cat cat = (Cat) cats.get(0);\n"
-#~ " doSomethingWithACat(cat);\n"
-#~ " sess.evict(cat);\n"
-#~ "}]]>"
-
-#~ msgid ""
-#~ "<![CDATA[sessionFactory.evict(Cat.class, catId); //evict a particular "
-#~ "Cat\n"
-#~ "sessionFactory.evict(Cat.class); //evict all Cats\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a "
-#~ "particular collection of kittens\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
-#~ "collections]]>"
-#~ msgstr ""
-#~ "<![CDATA[sessionFactory.evict(Cat.class, catId); //evict a particular "
-#~ "Cat\n"
-#~ "sessionFactory.evict(Cat.class); //evict all Cats\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a "
-#~ "particular collection of kittens\n"
-#~ "sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
-#~ "collections]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Map cacheEntries = sessionFactory.getStatistics()\n"
-#~ " .getSecondLevelCacheStatistics(regionName)\n"
-#~ " .getEntries();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Map cacheEntries = sessionFactory.getStatistics()\n"
-#~ " .getSecondLevelCacheStatistics(regionName)\n"
-#~ " .getEntries();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[hibernate.generate_statistics true\n"
-#~ "hibernate.cache.use_structured_entries true]]>"
-#~ msgstr ""
-#~ "<![CDATA[hibernate.generate_statistics true\n"
-#~ "hibernate.cache.use_structured_entries true]]>"
-
-#~ msgid "<![CDATA[hibernate.cache.use_query_cache true]]>"
-#~ msgstr "<![CDATA[hibernate.cache.use_query_cache true]]>"
-
-#~ msgid ""
-#~ "<![CDATA[List blogs = sess.createQuery(\"from Blog blog where blog."
-#~ "blogger = :blogger\")\n"
-#~ " .setEntity(\"blogger\", blogger)\n"
-#~ " .setMaxResults(15)\n"
-#~ " .setCacheable(true)\n"
-#~ " .setCacheRegion(\"frontpages\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[List blogs = sess.createQuery(\"from Blog blog where blog."
-#~ "blogger = :blogger\")\n"
-#~ " .setEntity(\"blogger\", blogger)\n"
-#~ " .setMaxResults(15)\n"
-#~ " .setCacheable(true)\n"
-#~ " .setCacheRegion(\"frontpages\")\n"
-#~ " .list();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Parent p = (Parent) sess.load(Parent.class, id);\n"
-#~ "Child c = new Child();\n"
-#~ "c.setParent(p);\n"
-#~ "p.getChildren().add(c); //no need to fetch the collection!\n"
-#~ "sess.flush();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Parent p = (Parent) sess.load(Parent.class, id);\n"
-#~ "Child c = new Child();\n"
-#~ "c.setParent(p);\n"
-#~ "p.getChildren().add(c); //no need to fetch the collection!\n"
-#~ "sess.flush();]]>"
-
-#~ msgid ""
-#~ "<![CDATA[// MBean service registration for a specific SessionFactory\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "stats.setSessionFactory(sessionFactory); // Bind the stats to a "
-#~ "SessionFactory\n"
-#~ "server.registerMBean(stats, on); // Register the Mbean on the server]]>"
-#~ msgstr ""
-#~ "<![CDATA[// MBean service registration for a specific SessionFactory\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "stats.setSessionFactory(sessionFactory); // Bind the stats to a "
-#~ "SessionFactory\n"
-#~ "server.registerMBean(stats, on); // Register the Mbean on the server]]>"
-
-#~ msgid ""
-#~ "<![CDATA[// MBean service registration for all SessionFactory's\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"all\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "server.registerMBean(stats, on); // Register the MBean on the server]]>"
-#~ msgstr ""
-#~ "<![CDATA[// MBean service registration for all SessionFactory's\n"
-#~ "Hashtable tb = new Hashtable();\n"
-#~ "tb.put(\"type\", \"statistics\");\n"
-#~ "tb.put(\"sessionFactory\", \"all\");\n"
-#~ "ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
-#~ "\n"
-#~ "StatisticsService stats = new StatisticsService(); // MBean "
-#~ "implementation\n"
-#~ "server.registerMBean(stats, on); // Register the MBean on the server]]>"
-
-#~ msgid ""
-#~ "<![CDATA[Statistics stats = HibernateUtil.sessionFactory.getStatistics"
-#~ "();\n"
-#~ "\n"
-#~ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
-#~ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
-#~ "double queryCacheHitRatio =\n"
-#~ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
-#~ "\n"
-#~ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
-#~ "\n"
-#~ "EntityStatistics entityStats =\n"
-#~ " stats.getEntityStatistics( Cat.class.getName() );\n"
-#~ "long changes =\n"
-#~ " entityStats.getInsertCount()\n"
-#~ " + entityStats.getUpdateCount()\n"
-#~ " + entityStats.getDeleteCount();\n"
-#~ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );]]>"
-#~ msgstr ""
-#~ "<![CDATA[Statistics stats = HibernateUtil.sessionFactory.getStatistics"
-#~ "();\n"
-#~ "\n"
-#~ "double queryCacheHitCount = stats.getQueryCacheHitCount();\n"
-#~ "double queryCacheMissCount = stats.getQueryCacheMissCount();\n"
-#~ "double queryCacheHitRatio =\n"
-#~ " queryCacheHitCount / (queryCacheHitCount + queryCacheMissCount);\n"
-#~ "\n"
-#~ "log.info(\"Query Hit ratio:\" + queryCacheHitRatio);\n"
-#~ "\n"
-#~ "EntityStatistics entityStats =\n"
-#~ " stats.getEntityStatistics( Cat.class.getName() );\n"
-#~ "long changes =\n"
-#~ " entityStats.getInsertCount()\n"
-#~ " + entityStats.getUpdateCount()\n"
-#~ " + entityStats.getDeleteCount();\n"
-#~ "log.info(Cat.class.getName() + \" changed \" + changes + \"times\" );]]>"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/persistent_classes.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/persistent_classes.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/persistent_classes.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: persistent_classes\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 10:00+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -16,647 +16,1457 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "持久化类(Persistent Classes)"
#. Tag: para
-#, no-c-format
-msgid "Persistent classes are classes in an application that implement the entities of the business problem (e.g. Customer and Order in an E-commerce application). Not all instances of a persistent class are considered to be in the persistent state. For example, an instance can instead be transient or detached."
-msgstr "在应用程序中,用来实现业务问题实体的(如,在电子商务应用程序中的 Customer 和 Order)类就是持久化类。不能认为所有的持久化类的实例都是持久的状态 - 一个实例的状态也可能是瞬时的或脱管的。"
+#: persistent_classes.xml:34
+#, fuzzy, no-c-format
+msgid ""
+"Persistent classes are classes in an application that implement the entities "
+"of the business problem (e.g. Customer and Order in an E-commerce "
+"application). The term \"persistent\" here means that the classes are able "
+"to be persisted, not that they are in the persistent state (see <xref "
+"linkend=\"objectstate-overview\"/> for discussion)."
+msgstr ""
+"在应用程序中,用来实现业务问题实体的(如,在电子商务应用程序中的 Customer 和 "
+"Order)类就是持久化类。不能认为所有的持久化类的实例都是持久的状态 - 一个实例"
+"的状态也可能是瞬时的或脱管的。"
#. Tag: para
-#, no-c-format
-msgid "Hibernate works best if these classes follow some simple rules, also known as the Plain Old Java Object (POJO) programming model. However, none of these rules are hard requirements. Indeed, Hibernate3 assumes very little about the nature of your persistent objects. You can express a domain model in other ways (using trees of <literal>Map</literal> instances, for example)."
-msgstr "如果这些持久化类遵循一些简单的规则,Hibernate 能够工作得更好,这些规则也被称作简单传统 Java 对象(POJO:Plain Old Java Object)编程模型。但是这些规则并不是必需的。 实际上,Hibernate3 对于你的持久化类几乎不做任何设想。你可以用其他的方法来表达领域模型:比如,使用 <literal>Map</literal> 实例的树型结构。"
+#: persistent_classes.xml:41
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate works best if these classes follow some simple rules, also known "
+"as the Plain Old Java Object (POJO) programming model. However, none of "
+"these rules are hard requirements. Indeed, Hibernate assumes very little "
+"about the nature of your persistent objects. You can express a domain model "
+"in other ways (using trees of <interfacename>java.util.Map</interfacename> "
+"instances, for example)."
+msgstr ""
+"如果这些持久化类遵循一些简单的规则,Hibernate 能够工作得更好,这些规则也被称"
+"作简单传统 Java 对象(POJO:Plain Old Java Object)编程模型。但是这些规则并不"
+"是必需的。 实际上,Hibernate3 对于你的持久化类几乎不做任何设想。你可以用其他"
+"的方法来表达领域模型:比如,使用 <literal>Map</literal> 实例的树型结构。"
#. Tag: title
+#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "一个简单的 POJO 例子"
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:52
#, no-c-format
-msgid "Most Java applications require a persistent class representing felines. For example:"
-msgstr "大多数 Java 程序需要用一个持久化类来表示猫科动物。例如:"
+msgid "Simple POJO representing a cat"
+msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:53
+#, fuzzy, no-c-format
+msgid ""
+"package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+"private Long id; // identifier\n"
+"\n"
+"private Date birthdate;\n"
+"private Color color;\n"
+"private char sex;\n"
+"private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+"\n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() );\n"
+" kittens.add(kitten);\n"
+" }\n"
+"}"
+msgstr ""
+"<![CDATA[package eg;\n"
+"import java.util.Set;\n"
+"import java.util.Date;\n"
+"\n"
+"public class Cat {\n"
+" private Long id; // identifier\n"
+"\n"
+" private Date birthdate;\n"
+" private Color color;\n"
+" private char sex;\n"
+" private float weight;\n"
+" private int litterId;\n"
+"\n"
+" private Cat mother;\n"
+" private Set kittens = new HashSet();\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id=id;\n"
+" }\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" void setBirthdate(Date date) {\n"
+" birthdate = date;\n"
+" }\n"
+" public Date getBirthdate() {\n"
+" return birthdate;\n"
+" }\n"
+"\n"
+" void setWeight(float weight) {\n"
+" this.weight = weight;\n"
+" }\n"
+" public float getWeight() {\n"
+" return weight;\n"
+" }\n"
+"\n"
+" public Color getColor() {\n"
+" return color;\n"
+" }\n"
+" void setColor(Color color) {\n"
+" this.color = color;\n"
+" }\n"
+"\n"
+" void setSex(char sex) {\n"
+" this.sex=sex;\n"
+" }\n"
+" public char getSex() {\n"
+" return sex;\n"
+" }\n"
+"\n"
+" void setLitterId(int id) {\n"
+" this.litterId = id;\n"
+" }\n"
+" public int getLitterId() {\n"
+" return litterId;\n"
+" }\n"
+"\n"
+" void setMother(Cat mother) {\n"
+" this.mother = mother;\n"
+" }\n"
+" public Cat getMother() {\n"
+" return mother;\n"
+" }\n"
+" void setKittens(Set kittens) {\n"
+" this.kittens = kittens;\n"
+" }\n"
+" public Set getKittens() {\n"
+" return kittens;\n"
+" }\n"
+" \n"
+" // addKitten not needed by Hibernate\n"
+" public void addKitten(Cat kitten) {\n"
+" kitten.setMother(this);\n"
+" kitten.setLitterId( kittens.size() ); \n"
+" kittens.add(kitten);\n"
+" }\n"
+"}]]>"
+
#. Tag: para
+#: persistent_classes.xml:57
#, no-c-format
-msgid "The four main rules of persistent classes are explored in more detail in the following sections."
+msgid ""
+"The four main rules of persistent classes are explored in more detail in the "
+"following sections."
msgstr "在后续的章节里我们将介绍持久性类的 4 个主要规则的更多细节。"
#. Tag: title
+#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "实现一个默认的(即无参数的)构造方法(constructor)"
#. Tag: para
-#, no-c-format
-msgid "<literal>Cat</literal> has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using <literal>Constructor.newInstance()</literal>. It is recommended that you have a default constructor with at least <emphasis>package</emphasis> visibility for runtime proxy generation in Hibernate."
-msgstr "<literal>Cat</literal> 有一个无参数的构造方法。所有的持久化类都必须有一个默认的构造方法(可以不是 public 的),这样的话 Hibernate 就可以使用 <literal>Constructor.newInstance()</literal>来实例化它们。 我们强烈建议,在 Hibernate 中,为了运行期代理的生成,构造方法至少是<emphasis>包(package)</emphasis>内可见的。"
+#: persistent_classes.xml:64
+#, fuzzy, no-c-format
+msgid ""
+"<classname>Cat</classname> has a no-argument constructor. All persistent "
+"classes must have a default constructor (which can be non-public) so that "
+"Hibernate can instantiate them using <literal><classname>java.lang.reflect."
+"Constructor</classname>.newInstance()</literal>. It is recommended that this "
+"constructor be defined with at least <emphasis>package</emphasis> visibility "
+"in order for runtime proxy generation to work properly."
+msgstr ""
+"<literal>Cat</literal> 有一个无参数的构造方法。所有的持久化类都必须有一个默认"
+"的构造方法(可以不是 public 的),这样的话 Hibernate 就可以使用 "
+"<literal>Constructor.newInstance()</literal>来实例化它们。 我们强烈建议,在 "
+"Hibernate 中,为了运行期代理的生成,构造方法至少是<emphasis>包(package)</"
+"emphasis>内可见的。"
#. Tag: title
-#, no-c-format
-msgid "Provide an identifier property (optional)"
+#: persistent_classes.xml:74
+#, fuzzy, no-c-format
+msgid "Provide an identifier property"
msgstr "提供一个标识属性(identifier property)(可选)"
#. Tag: para
+#: persistent_classes.xml:77
#, no-c-format
-msgid "<literal>Cat</literal> has a property called <literal>id</literal>. This property maps to the primary key column of a database table. The property might have been called anything, and its type might have been any primitive type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or <literal>java.util.Date</literal>. If your legacy database table has composite keys, you can use a user-defined class with properties of these types (see the section on composite identifiers later in the chapter.)"
-msgstr "<literal>Cat</literal> 有一个属性叫做 <literal>id</literal>。这个属性映射数据库表的主 键字段。这个属性可以叫任何名字,其类型可以是任何的原始类型、原始类型的包装类型、 <literal>java.lang.String</literal> 或者是 <literal>java.util.Date</literal>。(如果你的遗留数据库表有联合主键,你甚至可以用一个用户自定义的类,该类拥有这些类型的属性。参见后面的关于联合标识符的章节。)"
+msgid ""
+"Historically this was considered option. While still not (yet) enforced, "
+"this should be considered a deprecated feature as it will be completely "
+"required to provide a identifier property in an upcoming release."
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:84
#, no-c-format
-msgid "The identifier property is strictly optional. You can leave them off and let Hibernate keep track of object identifiers internally. We do not recommend this, however."
-msgstr "标识符属性是可选的。可以不用管它,让 Hibernate 内部来追踪对象的识别。 但是我们并不推荐这样做。"
+msgid ""
+"<classname>Cat</classname> has a property named <literal>id</literal>. This "
+"property maps to the primary key column(s) of the underlying database table. "
+"The type of the identifier property can be any \"basic\" type (see <xref "
+"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
+"\"/> for information on mapping composite (multi-column) identifiers."
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:92
#, no-c-format
-msgid "In fact, some functionality is available only to classes that declare an identifier property:"
-msgstr "实际上,一些功能只对那些声明了标识符属性的类起作用: "
+msgid ""
+"Identifiers do not necessarily need to identify column(s) in the database "
+"physically defined as a primary key. They should just identify columns that "
+"can be used to uniquely identify rows in the underlying table."
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:99
#, no-c-format
-msgid "Transitive reattachment for detached objects (cascade update or cascade merge) - see <xref linkend=\"objectstate-transitive\" />"
-msgstr "托管对象的传播性再连接(级联更新或级联合并)- 参阅 <xref linkend=\"objectstate-transitive\"/>"
+msgid ""
+"We recommend that you declare consistently-named identifier properties on "
+"persistent classes and that you use a nullable (i.e., non-primitive) type."
+msgstr ""
+"我们建议你对持久化类声明命名一致的标识属性。我们还建议你使用一个可以为空(也"
+"就是说,不是原始类型)的类型。 "
+#. Tag: title
+#: persistent_classes.xml:107
+#, fuzzy, no-c-format
+msgid "Prefer non-final classes (semi-optional)"
+msgstr "使用非final的类(可选)"
+
#. Tag: para
+#: persistent_classes.xml:109
#, no-c-format
-msgid "<literal>Session.saveOrUpdate()</literal>"
-msgstr "<literal>Session.saveOrUpdate()</literal> "
+msgid ""
+"A central feature of Hibernate, <emphasis>proxies</emphasis> (lazy loading), "
+"depends upon the persistent class being either non-final, or the "
+"implementation of an interface that declares all public methods. You can "
+"persist <literal>final</literal> classes that do not implement an interface "
+"with Hibernate; you will not, however, be able to use proxies for lazy "
+"association fetching which will ultimately limit your options for "
+"performance tuning. To persist a <literal>final</literal> class which does "
+"not implement a \"full\" interface you must disable proxy generation. See "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
+"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
+"ann\"/>."
+msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:121
#, no-c-format
-msgid "<literal>Session.merge()</literal>"
-msgstr "<literal>Session.merge()</literal> "
+msgid "Disabling proxies in <literal>hbm.xml</literal>"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:122
#, no-c-format
-msgid "We recommend that you declare consistently-named identifier properties on persistent classes and that you use a nullable (i.e., non-primitive) type."
-msgstr "我们建议你对持久化类声明命名一致的标识属性。我们还建议你使用一个可以为空(也就是说,不是原始类型)的类型。 "
+msgid "<![CDATA[<class name=\"Cat\" lazy=\"false\"...>...</class>]]>"
+msgstr ""
#. Tag: title
+#: persistent_classes.xml:126
#, no-c-format
-msgid "Prefer non-final classes (optional)"
-msgstr "使用非final的类(可选)"
+msgid "Disabling proxies in annotations"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:127
#, no-c-format
-msgid "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon the persistent class being either non-final, or the implementation of an interface that declares all public methods."
-msgstr "<emphasis>代理(proxies)</emphasis>是 Hibernate 的一个重要的功能,它依赖的条件是,持久化类或者是非 final 的,或者是实现了一个所有方法都声明为 public 的接口。"
+msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:130
#, no-c-format
-msgid "You can persist <literal>final</literal> classes that do not implement an interface with Hibernate. You will not, however, be able to use proxies for lazy association fetching which will ultimately limit your options for performance tuning."
-msgstr "你可以用 Hibernate 持久化一个没有实现任何接口的 <literal>final</literal> 类,但是你不能使用代理来延迟关联加载,这会限制你进行性能优化的选择。 "
+msgid ""
+"If the <literal>final</literal> class does implement a proper interface, you "
+"could alternatively tell Hibernate to use the interface instead when "
+"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
+"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
+"final-example-proxy-interface-ann\"/>."
+msgstr ""
-#. Tag: para
+#. Tag: title
+#: persistent_classes.xml:139
#, no-c-format
-msgid "You should also avoid declaring <literal>public final</literal> methods on the non-final classes. If you want to use a class with a <literal>public final</literal> method, you must explicitly disable proxying by setting <literal>lazy=\"false\"</literal>."
-msgstr "你也应该避免在非 final 类中声明 <literal>public final</literal> 的方法。如果你想使用一个有 <literal>public final</literal> 方法的类,你必须通过设置 <literal>lazy=\"false\"</literal> 来明确地禁用代理。 "
+msgid "Proxying an interface in <literal>hbm.xml</literal>"
+msgstr ""
+#. Tag: programlisting
+#: persistent_classes.xml:140
+#, no-c-format
+msgid "<![CDATA[<class name=\"Cat\" proxy=\"ICat\"...>...</class>]]>"
+msgstr ""
+
#. Tag: title
+#: persistent_classes.xml:144
#, no-c-format
-msgid "Declare accessors and mutators for persistent fields (optional)"
-msgstr "为持久化字段声明访问器(accessors)和是否可变的标志(mutators)(可选)"
+msgid "Proxying an interface in annotations"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: persistent_classes.xml:145
#, no-c-format
-msgid "<literal>Cat</literal> declares accessor methods for all its persistent fields. Many other ORM tools directly persist instance variables. It is better to provide an indirection between the relational schema and internal data structures of the class. By default, Hibernate persists JavaBeans style properties and recognizes method names of the form <literal>getFoo</literal>, <literal>isFoo</literal> and <literal>setFoo</literal>. If required, you can switch to direct field access for particular properties."
-msgstr "<literal>Cat</literal> 为它的所有持久化字段声明了访问方法。很多其他 ORM 工具直接对实例变量进行持久化。我们相信,在关系数据库 schema 和类的内部数据结构之间引入间接层(原文为\"非直接\",indirection)会好一些。默认情况下 Hibernate 持久化 JavaBeans 风格的属性,认可 <literal>getFoo</literal>,<literal>isFoo</literal> 和 <literal>setFoo</literal> 这种形式的方法名。如果需要,你可以对某些特定属性实行直接字段访问。 "
+msgid ""
+"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
+"ICat { ... }]]>"
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:148
+#, fuzzy, no-c-format
+msgid ""
+"You should also avoid declaring <literal>public final</literal> methods as "
+"this will again limit the ability to generate <emphasis>proxies</emphasis> "
+"from this class. If you want to use a class with <literal>public final</"
+"literal> methods, you must explicitly disable proxying. Again, see <xref "
+"linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/> and "
+"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-ann\"/"
+">."
+msgstr ""
+"你也应该避免在非 final 类中声明 <literal>public final</literal> 的方法。如果"
+"你想使用一个有 <literal>public final</literal> 方法的类,你必须通过设置 "
+"<literal>lazy=\"false\"</literal> 来明确地禁用代理。 "
+
+#. Tag: title
+#: persistent_classes.xml:158
#, no-c-format
-msgid "Properties need <emphasis>not</emphasis> be declared public - Hibernate can persist a property with a default, <literal>protected</literal> or <literal>private</literal> get / set pair."
-msgstr "属性<emphasis>不需要</emphasis>要声明为 public 的。Hibernate 可以持久化一个有 <literal>default</literal>、<literal>protected</literal> 或 <literal>private</literal> 的 get/set 方法对的属性进行持久化。"
+msgid "Declare accessors and mutators for persistent fields (optional)"
+msgstr ""
+"为持久化字段声明访问器(accessors)和是否可变的标志(mutators)(可选)"
+#. Tag: para
+#: persistent_classes.xml:160
+#, fuzzy, no-c-format
+msgid ""
+"<classname>Cat</classname> declares accessor methods for all its persistent "
+"fields. Many other ORM tools directly persist instance variables. It is "
+"better to provide an indirection between the relational schema and internal "
+"data structures of the class. By default, Hibernate persists JavaBeans style "
+"properties and recognizes method names of the form <literal>getFoo</"
+"literal>, <literal>isFoo</literal> and <literal>setFoo</literal>. If "
+"required, you can switch to direct field access for particular properties."
+msgstr ""
+"<literal>Cat</literal> 为它的所有持久化字段声明了访问方法。很多其他 ORM 工具"
+"直接对实例变量进行持久化。我们相信,在关系数据库 schema 和类的内部数据结构之"
+"间引入间接层(原文为\"非直接\",indirection)会好一些。默认情况下 Hibernate "
+"持久化 JavaBeans 风格的属性,认可 <literal>getFoo</literal>,"
+"<literal>isFoo</literal> 和 <literal>setFoo</literal> 这种形式的方法名。如果"
+"需要,你可以对某些特定属性实行直接字段访问。 "
+
+#. Tag: para
+#: persistent_classes.xml:169
+#, fuzzy, no-c-format
+msgid ""
+"Properties need <emphasis>not</emphasis> be declared public. Hibernate can "
+"persist a property declared with <literal>package</literal>, "
+"<literal>protected</literal> or <literal>private</literal> visibility as "
+"well."
+msgstr ""
+"属性<emphasis>不需要</emphasis>要声明为 public 的。Hibernate 可以持久化一个"
+"有 <literal>default</literal>、<literal>protected</literal> 或 "
+"<literal>private</literal> 的 get/set 方法对的属性进行持久化。"
+
#. Tag: title
+#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "实现继承(Inheritance)"
#. Tag: para
+#: persistent_classes.xml:180
#, no-c-format
-msgid "A subclass must also observe the first and second rules. It inherits its identifier property from the superclass, <literal>Cat</literal>. For example:"
-msgstr "子类也必须遵守第一条和第二条规则。它从超类 <literal>Cat</literal> 继承了标识属性。例如:"
+msgid ""
+"A subclass must also observe the first and second rules. It inherits its "
+"identifier property from the superclass, <literal>Cat</literal>. For example:"
+msgstr ""
+"子类也必须遵守第一条和第二条规则。它从超类 <literal>Cat</literal> 继承了标识"
+"属性。例如:"
+#. Tag: programlisting
+#: persistent_classes.xml:184
+#, fuzzy, no-c-format
+msgid ""
+"package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}"
+msgstr ""
+"<![CDATA[package eg;\n"
+"\n"
+"public class DomesticCat extends Cat {\n"
+" private String name;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" protected void setName(String name) {\n"
+" this.name=name;\n"
+" }\n"
+"}]]>"
+
#. Tag: title
+#: persistent_classes.xml:188
#, no-c-format
-msgid "Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
-msgstr "实现 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法:"
+msgid ""
+"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
+msgstr ""
+"实现 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法:"
#. Tag: para
+#: persistent_classes.xml:191
#, no-c-format
-msgid "You have to override the <literal>equals()</literal> and <literal>hashCode()</literal> methods if you:"
-msgstr "如果你有如下需求,你必须重载 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法: "
+msgid ""
+"You have to override the <literal>equals()</literal> and <literal>hashCode()"
+"</literal> methods if you:"
+msgstr ""
+"如果你有如下需求,你必须重载 <literal>equals()</literal> 和 <literal>hashCode"
+"()</literal> 方法: "
#. Tag: para
+#: persistent_classes.xml:196
#, no-c-format
-msgid "intend to put instances of persistent classes in a <literal>Set</literal> (the recommended way to represent many-valued associations); <emphasis>and</emphasis>"
-msgstr "想把持久类的实例放入 <literal>Set</literal> 中(当表示多值关联时,推荐这么做),<emphasis>而且</emphasis>"
+msgid ""
+"intend to put instances of persistent classes in a <literal>Set</literal> "
+"(the recommended way to represent many-valued associations); <emphasis>and</"
+"emphasis>"
+msgstr ""
+"想把持久类的实例放入 <literal>Set</literal> 中(当表示多值关联时,推荐这么"
+"做),<emphasis>而且</emphasis>"
#. Tag: para
+#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "想重用脱管实例"
#. Tag: para
+#: persistent_classes.xml:206
#, no-c-format
-msgid "Hibernate guarantees equivalence of persistent identity (database row) and Java identity only inside a particular session scope. When you mix instances retrieved in different sessions, you must implement <literal>equals()</literal> and <literal>hashCode()</literal> if you wish to have meaningful semantics for <literal>Set</literal>s."
-msgstr "Hibernate 保证,仅在特定会话范围内,持久化标识(数据库的行)和 Java 标识是等价的。因此,一旦我们混合了从不同会话中获取的实例,如果希望 <literal>Set</literal> 有明确的语义,就必须实现 <literal>equals()</literal> 和 <literal>hashCode()</literal>。 "
+msgid ""
+"Hibernate guarantees equivalence of persistent identity (database row) and "
+"Java identity only inside a particular session scope. When you mix instances "
+"retrieved in different sessions, you must implement <literal>equals()</"
+"literal> and <literal>hashCode()</literal> if you wish to have meaningful "
+"semantics for <literal>Set</literal>s."
+msgstr ""
+"Hibernate 保证,仅在特定会话范围内,持久化标识(数据库的行)和 Java 标识是等"
+"价的。因此,一旦我们混合了从不同会话中获取的实例,如果希望 <literal>Set</"
+"literal> 有明确的语义,就必须实现 <literal>equals()</literal> 和 "
+"<literal>hashCode()</literal>。 "
#. Tag: para
+#: persistent_classes.xml:212
#, no-c-format
-msgid "The most obvious way is to implement <literal>equals()</literal>/<literal>hashCode()</literal> by comparing the identifier value of both objects. If the value is the same, both must be the same database row, because they are equal. If both are added to a <literal>Set</literal>, you will only have one element in the <literal>Set</literal>). Unfortunately, you cannot use that approach with generated identifiers. Hibernate will only assign identifier values to objects that are persistent; a newly created instance will not have any identifier value. Furthermore, if an instance is unsaved and currently in a <literal>Set</literal>, saving it will assign an identifier value to the object. If <literal>equals()</literal> and <literal>hashCode()</literal> are based on the identifier value, the hash code would change, breaking the contract of the <literal>Set</literal>. See the Hibernate website for a full discussion of this problem. This is not a Hibernate issue, but normal Ja!
va semantics of object identity and equality."
-msgstr "实现 <literal>equals()</literal>/<literal>hashCode()</literal> 最显而易见的方法是比较两个对象 标识符的值。如果值相同,则两个对象对应于数据库的同一行,因此它们是相等的(如果都被添加到 <literal>Set</literal>,则在 <literal>Set</literal> 中只有一个元素)。不幸的是,对生成的标识不能 使用这种方法。Hibernate 仅对那些持久化对象赋标识值,一个新创建的实例将不会有任何标识值。此外, 如果一个实例没有被保存(unsaved),并且它当前正在一个 <literal>Set</literal> 中,保存它将会给这个对象赋一个标识值。如果 <literal>equals()</literal> 和 <literal>hashCode()</literal> 是基于标识值 实现的,则其哈希码将会改变,这违反了 <literal>Set</literal> 的契约。建议去 Hibernate 的站点阅读关于这个问题的全部讨论。注意,这不是 Hibernate 的问题,而是一般的 Java 对象标!
识和 Java 对象等价的语义问题。 "
+msgid ""
+"The most obvious way is to implement <literal>equals()</literal>/"
+"<literal>hashCode()</literal> by comparing the identifier value of both "
+"objects. If the value is the same, both must be the same database row, "
+"because they are equal. If both are added to a <literal>Set</literal>, you "
+"will only have one element in the <literal>Set</literal>). Unfortunately, "
+"you cannot use that approach with generated identifiers. Hibernate will only "
+"assign identifier values to objects that are persistent; a newly created "
+"instance will not have any identifier value. Furthermore, if an instance is "
+"unsaved and currently in a <literal>Set</literal>, saving it will assign an "
+"identifier value to the object. If <literal>equals()</literal> and "
+"<literal>hashCode()</literal> are based on the identifier value, the hash "
+"code would change, breaking the contract of the <literal>Set</literal>. See "
+"the Hibernate website for a full discussion of this problem. This is not a "
+"Hibernate issue, but normal Java semantics of object identity and equality."
+msgstr ""
+"实现 <literal>equals()</literal>/<literal>hashCode()</literal> 最显而易见的方"
+"法是比较两个对象 标识符的值。如果值相同,则两个对象对应于数据库的同一行,因此"
+"它们是相等的(如果都被添加到 <literal>Set</literal>,则在 <literal>Set</"
+"literal> 中只有一个元素)。不幸的是,对生成的标识不能 使用这种方法。"
+"Hibernate 仅对那些持久化对象赋标识值,一个新创建的实例将不会有任何标识值。此"
+"外, 如果一个实例没有被保存(unsaved),并且它当前正在一个 <literal>Set</"
+"literal> 中,保存它将会给这个对象赋一个标识值。如果 <literal>equals()</"
+"literal> 和 <literal>hashCode()</literal> 是基于标识值 实现的,则其哈希码将会"
+"改变,这违反了 <literal>Set</literal> 的契约。建议去 Hibernate 的站点阅读关于"
+"这个问题的全部讨论。注意,这不是 Hibernate 的问题,而是一般的 Java 对象标识"
+"和 Java 对象等价的语义问题。 "
#. Tag: para
+#: persistent_classes.xml:228
#, no-c-format
-msgid "It is recommended that you implement <literal>equals()</literal> and <literal>hashCode()</literal> using <emphasis>Business key equality</emphasis>. Business key equality means that the <literal>equals()</literal> method compares only the properties that form the business key. It is a key that would identify our instance in the real world (a <emphasis>natural</emphasis> candidate key):"
-msgstr "我们建议使用<emphasis>业务键值相等(Business key equality)</emphasis>来实现 <literal>equals()</literal> 和 <literal>hashCode()</literal>。业务键值相等的意思是,<literal>equals()</literal> 方法仅仅比较形成业务键的属性,它能在现实世界里标识我们的实例(是一个<emphasis>自然的</emphasis>候选码)。"
+msgid ""
+"It is recommended that you implement <literal>equals()</literal> and "
+"<literal>hashCode()</literal> using <emphasis>Business key equality</"
+"emphasis>. Business key equality means that the <literal>equals()</literal> "
+"method compares only the properties that form the business key. It is a key "
+"that would identify our instance in the real world (a <emphasis>natural</"
+"emphasis> candidate key):"
+msgstr ""
+"我们建议使用<emphasis>业务键值相等(Business key equality)</emphasis>来实现 "
+"<literal>equals()</literal> 和 <literal>hashCode()</literal>。业务键值相等的"
+"意思是,<literal>equals()</literal> 方法仅仅比较形成业务键的属性,它能在现实"
+"世界里标识我们的实例(是一个<emphasis>自然的</emphasis>候选码)。"
+#. Tag: programlisting
+#: persistent_classes.xml:235
+#, fuzzy, no-c-format
+msgid ""
+"public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}"
+msgstr ""
+"<![CDATA[public class Cat {\n"
+"\n"
+" ...\n"
+" public boolean equals(Object other) {\n"
+" if (this == other) return true;\n"
+" if ( !(other instanceof Cat) ) return false;\n"
+"\n"
+" final Cat cat = (Cat) other;\n"
+"\n"
+" if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
+" if ( !cat.getMother().equals( getMother() ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = getMother().hashCode();\n"
+" result = 29 * result + getLitterId();\n"
+" return result;\n"
+" }\n"
+"\n"
+"}]]>"
+
#. Tag: para
-#, no-c-format
-msgid "A business key does not have to be as solid as a database primary key candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable or unique properties are usually good candidates for a business key."
-msgstr "注意,业务键不必像数据库的主键那样固定不变(参见 <xref linkend=\"transactions-basics-identity\"/>)。对业务键而言,不可变或唯一的属性是不错的选择。"
+#: persistent_classes.xml:237
+#, fuzzy, no-c-format
+msgid ""
+"A business key does not have to be as solid as a database primary key "
+"candidate (see <xref linkend=\"transactions-basics-identity\"/>). Immutable "
+"or unique properties are usually good candidates for a business key."
+msgstr ""
+"注意,业务键不必像数据库的主键那样固定不变(参见 <xref linkend="
+"\"transactions-basics-identity\"/>)。对业务键而言,不可变或唯一的属性是不错"
+"的选择。"
#. Tag: title
+#: persistent_classes.xml:244
#, no-c-format
msgid "Dynamic models"
msgstr "动态模型(Dynamic models)"
#. Tag: title
+#: persistent_classes.xml:247
#, no-c-format
msgid "Note"
msgstr "注意"
-#. Tag: para
-#, no-c-format
-msgid "<emphasis>The following features are currently considered experimental and may change in the near future.</emphasis>"
-msgstr "<emphasis>注意,以下特性在当前处于试验阶段,将来可能会有变化。</emphasis> "
+#. Tag: emphasis
+#: persistent_classes.xml:249
+#, fuzzy, no-c-format
+msgid ""
+"The following features are currently considered experimental and may change "
+"in the near future."
+msgstr ""
+"<emphasis>注意,以下特性在当前处于试验阶段,将来可能会有变化。</emphasis> "
#. Tag: para
+#: persistent_classes.xml:253
#, no-c-format
-msgid "Persistent entities do not necessarily have to be represented as POJO classes or as JavaBean objects at runtime. Hibernate also supports dynamic models (using <literal>Map</literal>s of <literal>Map</literal>s at runtime) and the representation of entities as DOM4J trees. With this approach, you do not write persistent classes, only mapping files."
-msgstr "运行期的持久化实体没有必要一定表示为像 POJO 类或 JavaBean 对象那样的形式。Hibernate 也支持动态模型 (在运行期使用 <literal>Map</literal> 的 <literal>Map</literal>)和象 DOM4J 的树模型那样的实体表示。使用这种方法,你不用写持久化类,只写映射文件就行了。 "
+msgid ""
+"Persistent entities do not necessarily have to be represented as POJO "
+"classes or as JavaBean objects at runtime. Hibernate also supports dynamic "
+"models (using <literal>Map</literal>s of <literal>Map</literal>s at runtime) "
+"and the representation of entities as DOM4J trees. With this approach, you "
+"do not write persistent classes, only mapping files."
+msgstr ""
+"运行期的持久化实体没有必要一定表示为像 POJO 类或 JavaBean 对象那样的形式。"
+"Hibernate 也支持动态模型 (在运行期使用 <literal>Map</literal> 的 "
+"<literal>Map</literal>)和象 DOM4J 的树模型那样的实体表示。使用这种方法,你不"
+"用写持久化类,只写映射文件就行了。 "
#. Tag: para
-#, no-c-format
-msgid "By default, Hibernate works in normal POJO mode. You can set a default entity representation mode for a particular <literal>SessionFactory</literal> using the <literal>default_entity_mode</literal> configuration option (see <xref linkend=\"configuration-optional-properties\" />)."
-msgstr "Hibernate 默认工作在普通 POJO 模式。你可以使用配置选项 <literal>default_entity_mode</literal>, 对特定的 <literal>SessionFactory</literal>,设置一个默认的实体表示模式。(参见 <xref linkend=\"configuration-optional-properties\"/>)。"
+#: persistent_classes.xml:259
+#, fuzzy, no-c-format
+msgid ""
+"By default, Hibernate works in normal POJO mode. You can set a default "
+"entity representation mode for a particular <literal>SessionFactory</"
+"literal> using the <literal>default_entity_mode</literal> configuration "
+"option (see <xref linkend=\"configuration-optional-properties\"/>)."
+msgstr ""
+"Hibernate 默认工作在普通 POJO 模式。你可以使用配置选项 "
+"<literal>default_entity_mode</literal>, 对特定的 <literal>SessionFactory</"
+"literal>,设置一个默认的实体表示模式。(参见 <xref linkend=\"configuration-"
+"optional-properties\"/>)。"
#. Tag: para
+#: persistent_classes.xml:265
#, no-c-format
-msgid "The following examples demonstrate the representation using <literal>Map</literal>s. First, in the mapping file an <literal>entity-name</literal> has to be declared instead of, or in addition to, a class name:"
-msgstr "下面是用 <literal>Map</literal> 来表示的例子。首先,在映射文件中,要声明 <literal>entity-name</literal> 来代替一个类名(或作为一种附属)。 "
+msgid ""
+"The following examples demonstrate the representation using <literal>Map</"
+"literal>s. First, in the mapping file an <literal>entity-name</literal> has "
+"to be declared instead of, or in addition to, a class name:"
+msgstr ""
+"下面是用 <literal>Map</literal> 来表示的例子。首先,在映射文件中,要声明 "
+"<literal>entity-name</literal> 来代替一个类名(或作为一种附属)。 "
+#. Tag: programlisting
+#: persistent_classes.xml:270
+#, fuzzy, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>"
+msgstr ""
+"<![CDATA[<hibernate-mapping>\n"
+"\n"
+" <class entity-name=\"Customer\">\n"
+"\n"
+" <id name=\"id\"\n"
+" type=\"long\"\n"
+" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <property name=\"name\"\n"
+" column=\"NAME\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <property name=\"address\"\n"
+" column=\"ADDRESS\"\n"
+" type=\"string\"/>\n"
+"\n"
+" <many-to-one name=\"organization\"\n"
+" column=\"ORGANIZATION_ID\"\n"
+" class=\"Organization\"/>\n"
+"\n"
+" <bag name=\"orders\"\n"
+" inverse=\"true\"\n"
+" lazy=\"false\"\n"
+" cascade=\"all\">\n"
+" <key column=\"CUSTOMER_ID\"/>\n"
+" <one-to-many class=\"Order\"/>\n"
+" </bag>\n"
+"\n"
+" </class>\n"
+" \n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: persistent_classes.xml:272
#, no-c-format
-msgid "Even though associations are declared using target class names, the target type of associations can also be a dynamic entity instead of a POJO."
-msgstr "注意,虽然是用目标类名来声明关联的,但是关联的目标类型除了是 POJO 之外,也可以是一个动态的实体。 "
+msgid ""
+"Even though associations are declared using target class names, the target "
+"type of associations can also be a dynamic entity instead of a POJO."
+msgstr ""
+"注意,虽然是用目标类名来声明关联的,但是关联的目标类型除了是 POJO 之外,也可"
+"以是一个动态的实体。 "
#. Tag: para
+#: persistent_classes.xml:276
#, no-c-format
-msgid "After setting the default entity mode to <literal>dynamic-map</literal> for the <literal>SessionFactory</literal>, you can, at runtime, work with <literal>Map</literal>s of <literal>Map</literal>s:"
-msgstr "在使用 <literal>dynamic-map</literal> 为 <literal>SessionFactory</literal> 设置了默认的实体模式之后,可以在运行期使用 <literal>Map</literal> 的 <literal>Map</literal>:"
+msgid ""
+"After setting the default entity mode to <literal>dynamic-map</literal> for "
+"the <literal>SessionFactory</literal>, you can, at runtime, work with "
+"<literal>Map</literal>s of <literal>Map</literal>s:"
+msgstr ""
+"在使用 <literal>dynamic-map</literal> 为 <literal>SessionFactory</literal> 设"
+"置了默认的实体模式之后,可以在运行期使用 <literal>Map</literal> 的 "
+"<literal>Map</literal>:"
+#. Tag: programlisting
+#: persistent_classes.xml:281
+#, fuzzy, no-c-format
+msgid ""
+"Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();"
+msgstr ""
+"<![CDATA[Session s = openSession();\n"
+"Transaction tx = s.beginTransaction();\n"
+"Session s = openSession();\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"\n"
+"// Create an organization\n"
+"Map foobar = new HashMap();\n"
+"foobar.put(\"name\", \"Foobar Inc.\");\n"
+"\n"
+"// Link both\n"
+"david.put(\"organization\", foobar);\n"
+"\n"
+"// Save both\n"
+"s.save(\"Customer\", david);\n"
+"s.save(\"Organization\", foobar);\n"
+"\n"
+"tx.commit();\n"
+"s.close();]]>"
+
#. Tag: para
+#: persistent_classes.xml:283
#, no-c-format
-msgid "One of the main advantages of dynamic mapping is quick turnaround time for prototyping, without the need for entity class implementation. However, you lose compile-time type checking and will likely deal with many exceptions at runtime. As a result of the Hibernate mapping, the database schema can easily be normalized and sound, allowing to add a proper domain model implementation on top later on."
-msgstr "动态映射的好处是,变化所需要的时间少了,因为原型不需要实现实体类。然而,你无法进行编译期的类型检查,并可能由此会处理很多的运行期异常。幸亏有了 Hibernate 映射,它使得数据库的 schema 能容易的规格化和合理化,并允许稍后在此之上添加合适的领域模型实现。 "
+msgid ""
+"One of the main advantages of dynamic mapping is quick turnaround time for "
+"prototyping, without the need for entity class implementation. However, you "
+"lose compile-time type checking and will likely deal with many exceptions at "
+"runtime. As a result of the Hibernate mapping, the database schema can "
+"easily be normalized and sound, allowing to add a proper domain model "
+"implementation on top later on."
+msgstr ""
+"动态映射的好处是,变化所需要的时间少了,因为原型不需要实现实体类。然而,你无"
+"法进行编译期的类型检查,并可能由此会处理很多的运行期异常。幸亏有了 Hibernate "
+"映射,它使得数据库的 schema 能容易的规格化和合理化,并允许稍后在此之上添加合"
+"适的领域模型实现。 "
#. Tag: para
+#: persistent_classes.xml:290
#, no-c-format
-msgid "Entity representation modes can also be set on a per <literal>Session</literal> basis:"
+msgid ""
+"Entity representation modes can also be set on a per <literal>Session</"
+"literal> basis:"
msgstr "实体表示模式也能在每个 <literal>Session</literal> 的基础上设置:"
+#. Tag: programlisting
+#: persistent_classes.xml:293
+#, fuzzy, no-c-format
+msgid ""
+"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession"
+msgstr ""
+"<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
+"\n"
+"// Create a customer\n"
+"Map david = new HashMap();\n"
+"david.put(\"name\", \"David\");\n"
+"dynamicSession.save(\"Customer\", david);\n"
+"...\n"
+"dynamicSession.flush();\n"
+"dynamicSession.close()\n"
+"...\n"
+"// Continue on pojoSession\n"
+"]]>"
+
#. Tag: para
+#: persistent_classes.xml:295
#, no-c-format
-msgid "Please note that the call to <literal>getSession()</literal> using an <literal>EntityMode</literal> is on the <literal>Session</literal> API, not the <literal>SessionFactory</literal>. That way, the new <literal>Session</literal> shares the underlying JDBC connection, transaction, and other context information. This means you do not have to call <literal>flush()</literal> and <literal>close()</literal> on the secondary <literal>Session</literal>, and also leave the transaction and connection handling to the primary unit of work."
-msgstr "请注意,用 <literal>EntityMode</literal> 调用 <literal>getSession()</literal> 是在 <literal>Session</literal> 的 API 中,而不是 <literal>SessionFactory</literal>。 这样,新的 <literal>Session</literal> 共享底层的 JDBC 连接,事务,和其他的上下文信息。这意味着,你不需要在第二个 <literal>Session</literal> 中调用 <literal>flush()</literal> 和 <literal>close()</literal>,同样的,把事务和连接的处理交给原来的工作单元。 "
+msgid ""
+"Please note that the call to <literal>getSession()</literal> using an "
+"<literal>EntityMode</literal> is on the <literal>Session</literal> API, not "
+"the <literal>SessionFactory</literal>. That way, the new <literal>Session</"
+"literal> shares the underlying JDBC connection, transaction, and other "
+"context information. This means you do not have to call <literal>flush()</"
+"literal> and <literal>close()</literal> on the secondary <literal>Session</"
+"literal>, and also leave the transaction and connection handling to the "
+"primary unit of work."
+msgstr ""
+"请注意,用 <literal>EntityMode</literal> 调用 <literal>getSession()</"
+"literal> 是在 <literal>Session</literal> 的 API 中,而不是 "
+"<literal>SessionFactory</literal>。 这样,新的 <literal>Session</literal> 共"
+"享底层的 JDBC 连接,事务,和其他的上下文信息。这意味着,你不需要在第二个 "
+"<literal>Session</literal> 中调用 <literal>flush()</literal> 和 "
+"<literal>close()</literal>,同样的,把事务和连接的处理交给原来的工作单元。 "
#. Tag: para
-#, no-c-format
-msgid "More information about the XML representation capabilities can be found in <xref linkend=\"xml\" />."
+#: persistent_classes.xml:304
+#, fuzzy, no-c-format
+msgid ""
+"More information about the XML representation capabilities can be found in "
+"<xref linkend=\"xml\"/>."
msgstr "关于 XML 表示能力的更多信息可以在 <xref linkend=\"xml\"/> 中找到。"
#. Tag: title
+#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "元组片断映射(Tuplizers)"
#. Tag: para
+#: persistent_classes.xml:312
+#, fuzzy, no-c-format
+msgid ""
+"<interfacename>org.hibernate.tuple.Tuplizer</interfacename> and its sub-"
+"interfaces are responsible for managing a particular representation of a "
+"piece of data given that representation's <classname>org.hibernate."
+"EntityMode</classname>. If a given piece of data is thought of as a data "
+"structure, then a tuplizer is the thing that knows how to create such a data "
+"structure, how to extract values from such a data structure and how to "
+"inject values into such a data structure. For example, for the POJO entity "
+"mode, the corresponding tuplizer knows how create the POJO through its "
+"constructor. It also knows how to access the POJO properties using the "
+"defined property accessors."
+msgstr ""
+"<literal>org.hibernate.tuple.Tuplizer</literal>,以及其子接口,负责根据给定的"
+"<literal>org.hibernate.EntityMode</literal>,来复现片断数据。如果给定的片断数"
+"据被认为其是一种数据结构,\"tuplizer\" 就是一个知道如何创建这样的数据结构,以"
+"及如何给这个数据结构赋值的东西。比如说,对于 POJO 这种 Entity Mode,对应的 "
+"tuplizer 知道通过其构造方法来创建一个 POJO,再通过其属性访问器来访问 POJO 属"
+"性。有两大类高层 Tuplizer,分别是<literal>org.hibernate.tuple.entity."
+"EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.entity."
+"ComponentTuplizer</literal> 接口。<literal>EntityTuplizer</literal> 负责管理"
+"上面提到的实体的契约,而 <literal>ComponentTuplizer</literal> 则是针对组件"
+"的。 "
+
+#. Tag: para
+#: persistent_classes.xml:322
#, no-c-format
-msgid "<literal>org.hibernate.tuple.Tuplizer</literal>, 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 that 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 corresponding tuplizer knows how create the POJO through its constructor. It also knows how to access the POJO properties using the defined property accessors."
-msgstr "<literal>org.hibernate.tuple.Tuplizer</literal>,以及其子接口,负责根据给定的<literal>org.hibernate.EntityMode</literal>,来复现片断数据。如果给定的片断数据被认为其是一种数据结构,\"tuplizer\" 就是一个知道如何创建这样的数据结构,以及如何给这个数据结构赋值的东西。比如说,对于 POJO 这种 Entity Mode,对应的 tuplizer 知道通过其构造方法来创建一个 POJO,再通过其属性访问器来访问 POJO 属性。有两大类高层 Tuplizer,分别是<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.entity.ComponentTuplizer</literal> 接口。<literal>EntityTuplizer</literal> 负责管理上面提到的实体的契约,而 <literal>ComponentTuplizer</literal> 则是针对组件的。 "
+msgid "There are two (high-level) types of Tuplizers:"
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:326
#, no-c-format
-msgid "There are two high-level types of Tuplizers, represented by the <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate.tuple.component.ComponentTuplizer</literal> interfaces. <literal>EntityTuplizer</literal>s are responsible for managing the above mentioned contracts in regards to entities, while <literal>ComponentTuplizer</literal>s do the same for components."
-msgstr "有两种高层类型的 Tuplizer,分别由 <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.component.ComponentTuplizer</literal> 接口代表。<literal>EntityTuplizer</literal> 负责管理和实体相关的上述合约,而<literal>ComponentTuplizer</literal> 则负责组件。"
+msgid ""
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"which is responsible for managing the above mentioned contracts in regards "
+"to entities"
+msgstr ""
#. Tag: para
+#: persistent_classes.xml:332
#, no-c-format
-msgid "Users can also plug in their own tuplizers. Perhaps you require that a <literal>java.util.Map</literal> implementation other than <literal>java.util.HashMap</literal> be used while in the dynamic-map entity-mode. Or perhaps you need to define a different proxy generation strategy than the one used by default. Both would be achieved by defining a custom tuplizer implementation. Tuplizer definitions are attached to the entity or component mapping they are meant to manage. Going back to the example of our customer entity:"
-msgstr "用户也可以插入其自定义的 tuplizer。或许您需要一种不同于 dynamic-map entity-mode 中使用的 <literal>java.util.HashMap</literal> 的 <literal>java.util.Map</literal> 实现;或许您需要与默认策略不同的代理生成策略(proxy generation strategy)。通过自定义 tuplizer 实现,这两个目标您都可以达到。Tuplizer 定义被附加到它们期望管理的 entity 或者 component 映射中。回到我们的 customer entity 例子: "
+msgid ""
+"<interfacename>org.hibernate.tuple.component.ComponentTuplizer</"
+"interfacename> which does the same for components"
+msgstr ""
+#. Tag: para
+#: persistent_classes.xml:340
+#, fuzzy, no-c-format
+msgid ""
+"Users can also plug in their own tuplizers. Perhaps you require that "
+"<interfacename>java.util.Map</interfacename> implementation other than "
+"<classname>java.util.HashMap</classname> be used while in the dynamic-map "
+"entity-mode. Or perhaps you need to define a different proxy generation "
+"strategy than the one used by default. Both would be achieved by defining a "
+"custom tuplizer implementation. Tuplizer definitions are attached to the "
+"entity or component mapping they are meant to manage. Going back to the "
+"example of our <classname>Customer</classname> entity, <xref linkend="
+"\"example-specify-custom-tuplizer-ann\"/> shows how to specify a custom "
+"<interfacename>org.hibernate.tuple.entity.EntityTuplizer</interfacename> "
+"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
+"\"/> shows how to do the same in <literal>hbm.xml</literal>"
+msgstr ""
+"用户也可以插入其自定义的 tuplizer。或许您需要一种不同于 dynamic-map entity-"
+"mode 中使用的 <literal>java.util.HashMap</literal> 的 <literal>java.util."
+"Map</literal> 实现;或许您需要与默认策略不同的代理生成策略(proxy generation "
+"strategy)。通过自定义 tuplizer 实现,这两个目标您都可以达到。Tuplizer 定义被"
+"附加到它们期望管理的 entity 或者 component 映射中。回到我们的 customer "
+"entity 例子: "
+
#. Tag: title
+#: persistent_classes.xml:353
#, no-c-format
+msgid "Specify custom tuplizers in annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:354
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Tuplizer(impl = DynamicEntityTuplizer.class)\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"
+" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:357
+#, no-c-format
+msgid "Specify custom tuplizers in <literal>hbm.xml</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: persistent_classes.xml:358
+#, no-c-format
+msgid ""
+"<hibernate-mapping>\n"
+" <class entity-name=\"Customer\">\n"
+" <!--\n"
+" Override the dynamic-map entity-mode\n"
+" tuplizer for the customer entity\n"
+" -->\n"
+" <tuplizer entity-mode=\"dynamic-map\"\n"
+" class=\"CustomMapTuplizerImpl\"/>\n"
+"\n"
+" <id name=\"id\" type=\"long\" column=\"ID\">\n"
+" <generator class=\"sequence\"/>\n"
+" </id>\n"
+"\n"
+" <!-- other properties -->\n"
+" ...\n"
+" </class>\n"
+"</hibernate-mapping>"
+msgstr ""
+
+#. Tag: title
+#: persistent_classes.xml:363
+#, no-c-format
msgid "EntityNameResolvers"
msgstr "EntityNameResolvers"
#. Tag: para
-#, no-c-format
-msgid "The <interfacename>org.hibernate.EntityNameResolver</interfacename> interface is a contract for resolving the entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname> which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and would indicate that the resolver does not know how to resolve the entity name of the given entity instance). Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The hibernate test suite has an example of this exact style of usage under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package for illustration."
-msgstr "<interfacename>org.hibernate.EntityNameResolver</interfacename> 接口是一个解析给定实体实例的实体名称的合约。这个接口定义了一个单一的方法 <methodname>resolveEntityName</methodname>,它传递实体实例并预期返回合适的实体名称(null 指明解析器不知道如何解析给定实体实例的实体名称)。一般说来,<interfacename>org.hibernate.EntityNameResolver</interfacename> 在动态模型里最为有用。其中的例子是把代理接口用作你的域模型。Hibernate Test Suite 在 <package>org.hibernate.test.dynamicentity.tuplizer2</package> 下有具有完全相同风格的例子。下面是该包里的一些代码:"
+#: persistent_classes.xml:365
+#, fuzzy, no-c-format
+msgid ""
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> is a "
+"contract for resolving the entity name of a given entity instance. The "
+"interface defines a single method <methodname>resolveEntityName</methodname> "
+"which is passed the entity instance and is expected to return the "
+"appropriate entity name (null is allowed and would indicate that the "
+"resolver does not know how to resolve the entity name of the given entity "
+"instance). Generally speaking, an <interfacename>org.hibernate."
+"EntityNameResolver</interfacename> is going to be most useful in the case of "
+"dynamic models. One example might be using proxied interfaces as your domain "
+"model. The hibernate test suite has an example of this exact style of usage "
+"under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. "
+"Here is some of the code from that package for illustration."
+msgstr ""
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> 接口是一个解"
+"析给定实体实例的实体名称的合约。这个接口定义了一个单一的方法 "
+"<methodname>resolveEntityName</methodname>,它传递实体实例并预期返回合适的实"
+"体名称(null 指明解析器不知道如何解析给定实体实例的实体名称)。一般说来,"
+"<interfacename>org.hibernate.EntityNameResolver</interfacename> 在动态模型里"
+"最为有用。其中的例子是把代理接口用作你的域模型。Hibernate Test Suite 在 "
+"<package>org.hibernate.test.dynamicentity.tuplizer2</package> 下有具有完全相"
+"同风格的例子。下面是该包里的一些代码:"
+#. Tag: programlisting
+#: persistent_classes.xml:377
+#, fuzzy, no-c-format
+msgid ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an\n"
+" * interface as the domain model and simply store persistent state in an "
+"internal\n"
+" * Map. This is an extremely trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" *\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names\n"
+" * should be resolved. Since this particular impl can handle resolution for "
+"all of our\n"
+" * entities we want to take advantage of the fact that SessionFactoryImpl "
+"keeps these\n"
+" * in a Set so that we only ever have one instance registered. Why? Well, "
+"when it\n"
+" * comes time to resolve an entity name, Hibernate must iterate over all the "
+"registered\n"
+" * resolvers. So keeping that number down helps that process be as speedy "
+"as possible.\n"
+" * Hence the equals and hashCode implementations as is\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ..."
+msgstr ""
+"/**\n"
+" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
+"an interface as\n"
+" * the domain model and simply store persistent state in an internal Map. "
+"This is an extremely\n"
+" * trivial example meant only for illustration.\n"
+" */\n"
+"public final class DataProxyHandler implements InvocationHandler {\n"
+" private String entityName;\n"
+" private HashMap data = new HashMap();\n"
+"\n"
+" public DataProxyHandler(String entityName, Serializable id) {\n"
+" this.entityName = entityName;\n"
+" data.put( \"Id\", id );\n"
+" }\n"
+"\n"
+" public Object invoke(Object proxy, Method method, Object[] args) "
+"throws Throwable {\n"
+" String methodName = method.getName();\n"
+" if ( methodName.startsWith( \"set\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" data.put( propertyName, args[0] );\n"
+" }\n"
+" else if ( methodName.startsWith( \"get\" ) ) {\n"
+" String propertyName = methodName.substring( 3 );\n"
+" return data.get( propertyName );\n"
+" }\n"
+" else if ( \"toString\".equals( methodName ) ) {\n"
+" return entityName + \"#\" + data.get( \"Id\" );\n"
+" }\n"
+" else if ( \"hashCode\".equals( methodName ) ) {\n"
+" return new Integer( this.hashCode() );\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" public String getEntityName() {\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" public HashMap getData() {\n"
+" return data;\n"
+" }\n"
+"}\n"
+"\n"
+"/**\n"
+" *\n"
+" */\n"
+"public class ProxyHelper {\n"
+" public static String extractEntityName(Object object) {\n"
+" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
+" // their appropriate entity name, so we simply extract it from "
+"there\n"
+" // if this represents one of our proxies; otherwise, we return null\n"
+" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
+" InvocationHandler handler = Proxy.getInvocationHandler"
+"( object );\n"
+" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
+"() ) ) {\n"
+" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
+" return myHandler.getEntityName();\n"
+" }\n"
+" }\n"
+" return null;\n"
+" }\n"
+"\n"
+" // various other utility methods ....\n"
+"\n"
+"}\n"
+"\n"
+"/**\n"
+" * The EntityNameResolver implementation.\n"
+" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
+"entity names should be\n"
+" * resolved. Since this particular impl can handle resolution for all of "
+"our entities we want to\n"
+" * take advantage of the fact that SessionFactoryImpl keeps these in a Set "
+"so that we only ever\n"
+" * have one instance registered. Why? Well, when it comes time to resolve "
+"an entity name,\n"
+" * Hibernate must iterate over all the registered resolvers. So keeping "
+"that number down\n"
+" * helps that process be as speedy as possible. Hence the equals and "
+"hashCode impls\n"
+" */\n"
+"public class MyEntityNameResolver implements EntityNameResolver {\n"
+" public static final MyEntityNameResolver INSTANCE = new "
+"MyEntityNameResolver();\n"
+"\n"
+" public String resolveEntityName(Object entity) {\n"
+" return ProxyHelper.extractEntityName( entity );\n"
+" }\n"
+"\n"
+" public boolean equals(Object obj) {\n"
+" return getClass().equals( obj.getClass() );\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" return getClass().hashCode();\n"
+" }\n"
+"}\n"
+"\n"
+"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
+" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
+"PersistentClass mappedEntity) {\n"
+" super( entityMetamodel, mappedEntity );\n"
+" }\n"
+"\n"
+" public EntityNameResolver[] getEntityNameResolvers() {\n"
+" return new EntityNameResolver[] { MyEntityNameResolver."
+"INSTANCE };\n"
+" }\n"
+"\n"
+" public String determineConcreteSubclassEntityName(Object entityInstance, "
+"SessionFactoryImplementor factory) {\n"
+" String entityName = ProxyHelper.extractEntityName"
+"( entityInstance );\n"
+" if ( entityName == null ) {\n"
+" entityName = super.determineConcreteSubclassEntityName"
+"( entityInstance, factory );\n"
+" }\n"
+" return entityName;\n"
+" }\n"
+"\n"
+" ...\n"
+"}"
+
#. Tag: para
+#: persistent_classes.xml:379
#, no-c-format
-msgid "In order to register an <interfacename>org.hibernate.EntityNameResolver</interfacename> users must either:"
-msgstr "为了注册 <interfacename>org.hibernate.EntityNameResolver</interfacename>,用户必须:"
+msgid ""
+"In order to register an <interfacename>org.hibernate.EntityNameResolver</"
+"interfacename> users must either:"
+msgstr ""
+"为了注册 <interfacename>org.hibernate.EntityNameResolver</interfacename>,用"
+"户必须:"
#. Tag: para
-#, no-c-format
-msgid "Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</link>, implementing the <methodname>getEntityNameResolvers</methodname> method."
-msgstr "实现自定义的 <link linkend=\"persistent-classes-tuplizers\">Tuplizer</link> 并实现 <methodname>getEntityNameResolvers</methodname> 方法。"
+#: persistent_classes.xml:383
+#, fuzzy, no-c-format
+msgid ""
+"Implement a custom tuplizer (see <xref linkend=\"persistent-classes-tuplizers"
+"\"/>), implementing the <methodname>getEntityNameResolvers</methodname> "
+"method"
+msgstr ""
+"实现自定义的 <link linkend=\"persistent-classes-tuplizers\">Tuplizer</link> "
+"并实现 <methodname>getEntityNameResolvers</methodname> 方法。"
#. Tag: para
+#: persistent_classes.xml:389
#, no-c-format
-msgid "Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</classname> (which is the implementation class for <interfacename>org.hibernate.SessionFactory</interfacename>) using the <methodname>registerEntityNameResolver</methodname> method."
-msgstr "用 <methodname>registerEntityNameResolver</methodname> 方法注册到 <classname>org.hibernate.impl.SessionFactoryImpl</classname>(它是 <interfacename>org.hibernate.SessionFactory</interfacename> 的实现类)。"
+msgid ""
+"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</"
+"classname> (which is the implementation class for <interfacename>org."
+"hibernate.SessionFactory</interfacename>) using the "
+"<methodname>registerEntityNameResolver</methodname> method."
+msgstr ""
+"用 <methodname>registerEntityNameResolver</methodname> 方法注册到 "
+"<classname>org.hibernate.impl.SessionFactoryImpl</classname>(它是 "
+"<interfacename>org.hibernate.SessionFactory</interfacename> 的实现类)。"
#~ msgid ""
-#~ "<![CDATA[package eg;\n"
-#~ "import java.util.Set;\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Cat {\n"
-#~ " private Long id; // identifier\n"
-#~ "\n"
-#~ " private Date birthdate;\n"
-#~ " private Color color;\n"
-#~ " private char sex;\n"
-#~ " private float weight;\n"
-#~ " private int litterId;\n"
-#~ "\n"
-#~ " private Cat mother;\n"
-#~ " private Set kittens = new HashSet();\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id=id;\n"
-#~ " }\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setBirthdate(Date date) {\n"
-#~ " birthdate = date;\n"
-#~ " }\n"
-#~ " public Date getBirthdate() {\n"
-#~ " return birthdate;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setWeight(float weight) {\n"
-#~ " this.weight = weight;\n"
-#~ " }\n"
-#~ " public float getWeight() {\n"
-#~ " return weight;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Color getColor() {\n"
-#~ " return color;\n"
-#~ " }\n"
-#~ " void setColor(Color color) {\n"
-#~ " this.color = color;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setSex(char sex) {\n"
-#~ " this.sex=sex;\n"
-#~ " }\n"
-#~ " public char getSex() {\n"
-#~ " return sex;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setLitterId(int id) {\n"
-#~ " this.litterId = id;\n"
-#~ " }\n"
-#~ " public int getLitterId() {\n"
-#~ " return litterId;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setMother(Cat mother) {\n"
-#~ " this.mother = mother;\n"
-#~ " }\n"
-#~ " public Cat getMother() {\n"
-#~ " return mother;\n"
-#~ " }\n"
-#~ " void setKittens(Set kittens) {\n"
-#~ " this.kittens = kittens;\n"
-#~ " }\n"
-#~ " public Set getKittens() {\n"
-#~ " return kittens;\n"
-#~ " }\n"
-#~ " \n"
-#~ " // addKitten not needed by Hibernate\n"
-#~ " public void addKitten(Cat kitten) {\n"
-#~ " kitten.setMother(this);\n"
-#~ " kitten.setLitterId( kittens.size() ); \n"
-#~ " kittens.add(kitten);\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "Most Java applications require a persistent class representing felines. "
+#~ "For example:"
+#~ msgstr "大多数 Java 程序需要用一个持久化类来表示猫科动物。例如:"
+
+#~ msgid ""
+#~ "<literal>Cat</literal> has a property called <literal>id</literal>. This "
+#~ "property maps to the primary key column of a database table. The property "
+#~ "might have been called anything, and its type might have been any "
+#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
+#~ "String</literal> or <literal>java.util.Date</literal>. If your legacy "
+#~ "database table has composite keys, you can use a user-defined class with "
+#~ "properties of these types (see the section on composite identifiers later "
+#~ "in the chapter.)"
#~ msgstr ""
-#~ "<![CDATA[package eg;\n"
-#~ "import java.util.Set;\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Cat {\n"
-#~ " private Long id; // identifier\n"
-#~ "\n"
-#~ " private Date birthdate;\n"
-#~ " private Color color;\n"
-#~ " private char sex;\n"
-#~ " private float weight;\n"
-#~ " private int litterId;\n"
-#~ "\n"
-#~ " private Cat mother;\n"
-#~ " private Set kittens = new HashSet();\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id=id;\n"
-#~ " }\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setBirthdate(Date date) {\n"
-#~ " birthdate = date;\n"
-#~ " }\n"
-#~ " public Date getBirthdate() {\n"
-#~ " return birthdate;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setWeight(float weight) {\n"
-#~ " this.weight = weight;\n"
-#~ " }\n"
-#~ " public float getWeight() {\n"
-#~ " return weight;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Color getColor() {\n"
-#~ " return color;\n"
-#~ " }\n"
-#~ " void setColor(Color color) {\n"
-#~ " this.color = color;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setSex(char sex) {\n"
-#~ " this.sex=sex;\n"
-#~ " }\n"
-#~ " public char getSex() {\n"
-#~ " return sex;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setLitterId(int id) {\n"
-#~ " this.litterId = id;\n"
-#~ " }\n"
-#~ " public int getLitterId() {\n"
-#~ " return litterId;\n"
-#~ " }\n"
-#~ "\n"
-#~ " void setMother(Cat mother) {\n"
-#~ " this.mother = mother;\n"
-#~ " }\n"
-#~ " public Cat getMother() {\n"
-#~ " return mother;\n"
-#~ " }\n"
-#~ " void setKittens(Set kittens) {\n"
-#~ " this.kittens = kittens;\n"
-#~ " }\n"
-#~ " public Set getKittens() {\n"
-#~ " return kittens;\n"
-#~ " }\n"
-#~ " \n"
-#~ " // addKitten not needed by Hibernate\n"
-#~ " public void addKitten(Cat kitten) {\n"
-#~ " kitten.setMother(this);\n"
-#~ " kitten.setLitterId( kittens.size() ); \n"
-#~ " kittens.add(kitten);\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "<literal>Cat</literal> 有一个属性叫做 <literal>id</literal>。这个属性映射"
+#~ "数据库表的主 键字段。这个属性可以叫任何名字,其类型可以是任何的原始类型、"
+#~ "原始类型的包装类型、 <literal>java.lang.String</literal> 或者是 "
+#~ "<literal>java.util.Date</literal>。(如果你的遗留数据库表有联合主键,你甚"
+#~ "至可以用一个用户自定义的类,该类拥有这些类型的属性。参见后面的关于联合标识"
+#~ "符的章节。)"
+
#~ msgid ""
-#~ "<![CDATA[package eg;\n"
-#~ "\n"
-#~ "public class DomesticCat extends Cat {\n"
-#~ " private String name;\n"
-#~ "\n"
-#~ " public String getName() {\n"
-#~ " return name;\n"
-#~ " }\n"
-#~ " protected void setName(String name) {\n"
-#~ " this.name=name;\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "The identifier property is strictly optional. You can leave them off and "
+#~ "let Hibernate keep track of object identifiers internally. We do not "
+#~ "recommend this, however."
#~ msgstr ""
-#~ "<![CDATA[package eg;\n"
-#~ "\n"
-#~ "public class DomesticCat extends Cat {\n"
-#~ " private String name;\n"
-#~ "\n"
-#~ " public String getName() {\n"
-#~ " return name;\n"
-#~ " }\n"
-#~ " protected void setName(String name) {\n"
-#~ " this.name=name;\n"
-#~ " }\n"
-#~ "}]]>"
+#~ "标识符属性是可选的。可以不用管它,让 Hibernate 内部来追踪对象的识别。 但是"
+#~ "我们并不推荐这样做。"
+
#~ msgid ""
-#~ "<![CDATA[public class Cat {\n"
-#~ "\n"
-#~ " ...\n"
-#~ " public boolean equals(Object other) {\n"
-#~ " if (this == other) return true;\n"
-#~ " if ( !(other instanceof Cat) ) return false;\n"
-#~ "\n"
-#~ " final Cat cat = (Cat) other;\n"
-#~ "\n"
-#~ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
-#~ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
-#~ "\n"
-#~ " return true;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " int result;\n"
-#~ " result = getMother().hashCode();\n"
-#~ " result = 29 * result + getLitterId();\n"
-#~ " return result;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
+#~ "In fact, some functionality is available only to classes that declare an "
+#~ "identifier property:"
+#~ msgstr "实际上,一些功能只对那些声明了标识符属性的类起作用: "
+
+#~ msgid ""
+#~ "Transitive reattachment for detached objects (cascade update or cascade "
+#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
#~ msgstr ""
-#~ "<![CDATA[public class Cat {\n"
-#~ "\n"
-#~ " ...\n"
-#~ " public boolean equals(Object other) {\n"
-#~ " if (this == other) return true;\n"
-#~ " if ( !(other instanceof Cat) ) return false;\n"
-#~ "\n"
-#~ " final Cat cat = (Cat) other;\n"
-#~ "\n"
-#~ " if ( !cat.getLitterId().equals( getLitterId() ) ) return false;\n"
-#~ " if ( !cat.getMother().equals( getMother() ) ) return false;\n"
-#~ "\n"
-#~ " return true;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " int result;\n"
-#~ " result = getMother().hashCode();\n"
-#~ " result = 29 * result + getLitterId();\n"
-#~ " return result;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
+#~ "托管对象的传播性再连接(级联更新或级联合并)- 参阅 <xref linkend="
+#~ "\"objectstate-transitive\"/>"
+
+#~ msgid "<literal>Session.saveOrUpdate()</literal>"
+#~ msgstr "<literal>Session.saveOrUpdate()</literal> "
+
+#~ msgid "<literal>Session.merge()</literal>"
+#~ msgstr "<literal>Session.merge()</literal> "
+
#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class entity-name=\"Customer\">\n"
-#~ "\n"
-#~ " <id name=\"id\"\n"
-#~ " type=\"long\"\n"
-#~ " column=\"ID\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " column=\"NAME\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <property name=\"address\"\n"
-#~ " column=\"ADDRESS\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"organization\"\n"
-#~ " column=\"ORGANIZATION_ID\"\n"
-#~ " class=\"Organization\"/>\n"
-#~ "\n"
-#~ " <bag name=\"orders\"\n"
-#~ " inverse=\"true\"\n"
-#~ " lazy=\"false\"\n"
-#~ " cascade=\"all\">\n"
-#~ " <key column=\"CUSTOMER_ID\"/>\n"
-#~ " <one-to-many class=\"Order\"/>\n"
-#~ " </bag>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ " \n"
-#~ "</hibernate-mapping>]]>"
+#~ "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends "
+#~ "upon the persistent class being either non-final, or the implementation "
+#~ "of an interface that declares all public methods."
#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class entity-name=\"Customer\">\n"
-#~ "\n"
-#~ " <id name=\"id\"\n"
-#~ " type=\"long\"\n"
-#~ " column=\"ID\">\n"
-#~ " <generator class=\"sequence\"/>\n"
-#~ " </id>\n"
-#~ "\n"
-#~ " <property name=\"name\"\n"
-#~ " column=\"NAME\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <property name=\"address\"\n"
-#~ " column=\"ADDRESS\"\n"
-#~ " type=\"string\"/>\n"
-#~ "\n"
-#~ " <many-to-one name=\"organization\"\n"
-#~ " column=\"ORGANIZATION_ID\"\n"
-#~ " class=\"Organization\"/>\n"
-#~ "\n"
-#~ " <bag name=\"orders\"\n"
-#~ " inverse=\"true\"\n"
-#~ " lazy=\"false\"\n"
-#~ " cascade=\"all\">\n"
-#~ " <key column=\"CUSTOMER_ID\"/>\n"
-#~ " <one-to-many class=\"Order\"/>\n"
-#~ " </bag>\n"
-#~ "\n"
-#~ " </class>\n"
-#~ " \n"
-#~ "</hibernate-mapping>]]>"
+#~ "<emphasis>代理(proxies)</emphasis>是 Hibernate 的一个重要的功能,它依赖"
+#~ "的条件是,持久化类或者是非 final 的,或者是实现了一个所有方法都声明为 "
+#~ "public 的接口。"
+
#~ msgid ""
-#~ "<![CDATA[Session s = openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ "Session s = openSession();\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "\n"
-#~ "// Create an organization\n"
-#~ "Map foobar = new HashMap();\n"
-#~ "foobar.put(\"name\", \"Foobar Inc.\");\n"
-#~ "\n"
-#~ "// Link both\n"
-#~ "david.put(\"organization\", foobar);\n"
-#~ "\n"
-#~ "// Save both\n"
-#~ "s.save(\"Customer\", david);\n"
-#~ "s.save(\"Organization\", foobar);\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();]]>"
+#~ "You can persist <literal>final</literal> classes that do not implement an "
+#~ "interface with Hibernate. You will not, however, be able to use proxies "
+#~ "for lazy association fetching which will ultimately limit your options "
+#~ "for performance tuning."
#~ msgstr ""
-#~ "<![CDATA[Session s = openSession();\n"
-#~ "Transaction tx = s.beginTransaction();\n"
-#~ "Session s = openSession();\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "\n"
-#~ "// Create an organization\n"
-#~ "Map foobar = new HashMap();\n"
-#~ "foobar.put(\"name\", \"Foobar Inc.\");\n"
-#~ "\n"
-#~ "// Link both\n"
-#~ "david.put(\"organization\", foobar);\n"
-#~ "\n"
-#~ "// Save both\n"
-#~ "s.save(\"Customer\", david);\n"
-#~ "s.save(\"Organization\", foobar);\n"
-#~ "\n"
-#~ "tx.commit();\n"
-#~ "s.close();]]>"
+#~ "你可以用 Hibernate 持久化一个没有实现任何接口的 <literal>final</literal> "
+#~ "类,但是你不能使用代理来延迟关联加载,这会限制你进行性能优化的选择。 "
+
#~ msgid ""
-#~ "<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode."
-#~ "MAP);\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "dynamicSession.save(\"Customer\", david);\n"
-#~ "...\n"
-#~ "dynamicSession.flush();\n"
-#~ "dynamicSession.close()\n"
-#~ "...\n"
-#~ "// Continue on pojoSession\n"
-#~ "]]>"
+#~ "There are two high-level types of Tuplizers, represented by the "
+#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and "
+#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer</literal> "
+#~ "interfaces. <literal>EntityTuplizer</literal>s are responsible for "
+#~ "managing the above mentioned contracts in regards to entities, while "
+#~ "<literal>ComponentTuplizer</literal>s do the same for components."
#~ msgstr ""
-#~ "<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode."
-#~ "MAP);\n"
-#~ "\n"
-#~ "// Create a customer\n"
-#~ "Map david = new HashMap();\n"
-#~ "david.put(\"name\", \"David\");\n"
-#~ "dynamicSession.save(\"Customer\", david);\n"
-#~ "...\n"
-#~ "dynamicSession.flush();\n"
-#~ "dynamicSession.close()\n"
-#~ "...\n"
-#~ "// Continue on pojoSession\n"
-#~ "]]>"
+#~ "有两种高层类型的 Tuplizer,分别由 <literal>org.hibernate.tuple.entity."
+#~ "EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.component."
+#~ "ComponentTuplizer</literal> 接口代表。<literal>EntityTuplizer</literal> 负"
+#~ "责管理和实体相关的上述合约,而<literal>ComponentTuplizer</literal> 则负责"
+#~ "组件。"
+
#~ msgid ""
#~ "<![CDATA[<hibernate-mapping>\n"
#~ " <class entity-name=\"Customer\">\n"
@@ -731,262 +1541,3 @@
#~ " }\n"
#~ " }\n"
#~ "}]]>"
-#~ msgid ""
-#~ "/**\n"
-#~ " * A very trivial JDK Proxy InvocationHandler implementation where we "
-#~ "proxy an interface as\n"
-#~ " * the domain model and simply store persistent state in an internal "
-#~ "Map. This is an extremely\n"
-#~ " * trivial example meant only for illustration.\n"
-#~ " */\n"
-#~ "public final class DataProxyHandler implements InvocationHandler {\n"
-#~ " private String entityName;\n"
-#~ " private HashMap data = new HashMap();\n"
-#~ "\n"
-#~ " public DataProxyHandler(String entityName, Serializable id) {\n"
-#~ " this.entityName = entityName;\n"
-#~ " data.put( \"Id\", id );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Object invoke(Object proxy, Method method, Object[] args) "
-#~ "throws Throwable {\n"
-#~ " String methodName = method.getName();\n"
-#~ " if ( methodName.startsWith( \"set\" ) ) {\n"
-#~ " String propertyName = methodName.substring( 3 );\n"
-#~ " data.put( propertyName, args[0] );\n"
-#~ " }\n"
-#~ " else if ( methodName.startsWith( \"get\" ) ) {\n"
-#~ " String propertyName = methodName.substring( 3 );\n"
-#~ " return data.get( propertyName );\n"
-#~ " }\n"
-#~ " else if ( \"toString\".equals( methodName ) ) {\n"
-#~ " return entityName + \"#\" + data.get( \"Id\" );\n"
-#~ " }\n"
-#~ " else if ( \"hashCode\".equals( methodName ) ) {\n"
-#~ " return new Integer( this.hashCode() );\n"
-#~ " }\n"
-#~ " return null;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getEntityName() {\n"
-#~ " return entityName;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public HashMap getData() {\n"
-#~ " return data;\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "/**\n"
-#~ " *\n"
-#~ " */\n"
-#~ "public class ProxyHelper {\n"
-#~ " public static String extractEntityName(Object object) {\n"
-#~ " // Our custom java.lang.reflect.Proxy instances actually bundle\n"
-#~ " // their appropriate entity name, so we simply extract it from "
-#~ "there\n"
-#~ " // if this represents one of our proxies; otherwise, we return "
-#~ "null\n"
-#~ " if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
-#~ " InvocationHandler handler = Proxy.getInvocationHandler"
-#~ "( object );\n"
-#~ " if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
-#~ "() ) ) {\n"
-#~ " DataProxyHandler myHandler = ( DataProxyHandler ) "
-#~ "handler;\n"
-#~ " return myHandler.getEntityName();\n"
-#~ " }\n"
-#~ " }\n"
-#~ " return null;\n"
-#~ " }\n"
-#~ "\n"
-#~ " // various other utility methods ....\n"
-#~ "\n"
-#~ "}\n"
-#~ "\n"
-#~ "/**\n"
-#~ " * The EntityNameResolver implementation.\n"
-#~ " * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
-#~ "entity names should be\n"
-#~ " * resolved. Since this particular impl can handle resolution for all of "
-#~ "our entities we want to\n"
-#~ " * take advantage of the fact that SessionFactoryImpl keeps these in a "
-#~ "Set so that we only ever\n"
-#~ " * have one instance registered. Why? Well, when it comes time to "
-#~ "resolve an entity name,\n"
-#~ " * Hibernate must iterate over all the registered resolvers. So keeping "
-#~ "that number down\n"
-#~ " * helps that process be as speedy as possible. Hence the equals and "
-#~ "hashCode impls\n"
-#~ " */\n"
-#~ "public class MyEntityNameResolver implements EntityNameResolver {\n"
-#~ " public static final MyEntityNameResolver INSTANCE = new "
-#~ "MyEntityNameResolver();\n"
-#~ "\n"
-#~ " public String resolveEntityName(Object entity) {\n"
-#~ " return ProxyHelper.extractEntityName( entity );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public boolean equals(Object obj) {\n"
-#~ " return getClass().equals( obj.getClass() );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " return getClass().hashCode();\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
-#~ " public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
-#~ "PersistentClass mappedEntity) {\n"
-#~ " super( entityMetamodel, mappedEntity );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public EntityNameResolver[] getEntityNameResolvers() {\n"
-#~ " return new EntityNameResolver[] { MyEntityNameResolver."
-#~ "INSTANCE };\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String determineConcreteSubclassEntityName(Object "
-#~ "entityInstance, SessionFactoryImplementor factory) {\n"
-#~ " String entityName = ProxyHelper.extractEntityName"
-#~ "( entityInstance );\n"
-#~ " if ( entityName == null ) {\n"
-#~ " entityName = super.determineConcreteSubclassEntityName"
-#~ "( entityInstance, factory );\n"
-#~ " }\n"
-#~ " return entityName;\n"
-#~ " }\n"
-#~ "\n"
-#~ " ...\n"
-#~ "}"
-#~ msgstr ""
-#~ "/**\n"
-#~ " * A very trivial JDK Proxy InvocationHandler implementation where we "
-#~ "proxy an interface as\n"
-#~ " * the domain model and simply store persistent state in an internal "
-#~ "Map. This is an extremely\n"
-#~ " * trivial example meant only for illustration.\n"
-#~ " */\n"
-#~ "public final class DataProxyHandler implements InvocationHandler {\n"
-#~ " private String entityName;\n"
-#~ " private HashMap data = new HashMap();\n"
-#~ "\n"
-#~ " public DataProxyHandler(String entityName, Serializable id) {\n"
-#~ " this.entityName = entityName;\n"
-#~ " data.put( \"Id\", id );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Object invoke(Object proxy, Method method, Object[] args) "
-#~ "throws Throwable {\n"
-#~ " String methodName = method.getName();\n"
-#~ " if ( methodName.startsWith( \"set\" ) ) {\n"
-#~ " String propertyName = methodName.substring( 3 );\n"
-#~ " data.put( propertyName, args[0] );\n"
-#~ " }\n"
-#~ " else if ( methodName.startsWith( \"get\" ) ) {\n"
-#~ " String propertyName = methodName.substring( 3 );\n"
-#~ " return data.get( propertyName );\n"
-#~ " }\n"
-#~ " else if ( \"toString\".equals( methodName ) ) {\n"
-#~ " return entityName + \"#\" + data.get( \"Id\" );\n"
-#~ " }\n"
-#~ " else if ( \"hashCode\".equals( methodName ) ) {\n"
-#~ " return new Integer( this.hashCode() );\n"
-#~ " }\n"
-#~ " return null;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getEntityName() {\n"
-#~ " return entityName;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public HashMap getData() {\n"
-#~ " return data;\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "/**\n"
-#~ " *\n"
-#~ " */\n"
-#~ "public class ProxyHelper {\n"
-#~ " public static String extractEntityName(Object object) {\n"
-#~ " // Our custom java.lang.reflect.Proxy instances actually bundle\n"
-#~ " // their appropriate entity name, so we simply extract it from "
-#~ "there\n"
-#~ " // if this represents one of our proxies; otherwise, we return "
-#~ "null\n"
-#~ " if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
-#~ " InvocationHandler handler = Proxy.getInvocationHandler"
-#~ "( object );\n"
-#~ " if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
-#~ "() ) ) {\n"
-#~ " DataProxyHandler myHandler = ( DataProxyHandler ) "
-#~ "handler;\n"
-#~ " return myHandler.getEntityName();\n"
-#~ " }\n"
-#~ " }\n"
-#~ " return null;\n"
-#~ " }\n"
-#~ "\n"
-#~ " // various other utility methods ....\n"
-#~ "\n"
-#~ "}\n"
-#~ "\n"
-#~ "/**\n"
-#~ " * The EntityNameResolver implementation.\n"
-#~ " * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
-#~ "entity names should be\n"
-#~ " * resolved. Since this particular impl can handle resolution for all of "
-#~ "our entities we want to\n"
-#~ " * take advantage of the fact that SessionFactoryImpl keeps these in a "
-#~ "Set so that we only ever\n"
-#~ " * have one instance registered. Why? Well, when it comes time to "
-#~ "resolve an entity name,\n"
-#~ " * Hibernate must iterate over all the registered resolvers. So keeping "
-#~ "that number down\n"
-#~ " * helps that process be as speedy as possible. Hence the equals and "
-#~ "hashCode impls\n"
-#~ " */\n"
-#~ "public class MyEntityNameResolver implements EntityNameResolver {\n"
-#~ " public static final MyEntityNameResolver INSTANCE = new "
-#~ "MyEntityNameResolver();\n"
-#~ "\n"
-#~ " public String resolveEntityName(Object entity) {\n"
-#~ " return ProxyHelper.extractEntityName( entity );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public boolean equals(Object obj) {\n"
-#~ " return getClass().equals( obj.getClass() );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public int hashCode() {\n"
-#~ " return getClass().hashCode();\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
-#~ " public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
-#~ "PersistentClass mappedEntity) {\n"
-#~ " super( entityMetamodel, mappedEntity );\n"
-#~ " }\n"
-#~ "\n"
-#~ " public EntityNameResolver[] getEntityNameResolvers() {\n"
-#~ " return new EntityNameResolver[] { MyEntityNameResolver."
-#~ "INSTANCE };\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String determineConcreteSubclassEntityName(Object "
-#~ "entityInstance, SessionFactoryImplementor factory) {\n"
-#~ " String entityName = ProxyHelper.extractEntityName"
-#~ "( entityInstance );\n"
-#~ " if ( entityName == null ) {\n"
-#~ " entityName = super.determineConcreteSubclassEntityName"
-#~ "( entityInstance, factory );\n"
-#~ " }\n"
-#~ " return entityName;\n"
-#~ " }\n"
-#~ "\n"
-#~ " ...\n"
-#~ "}"
-
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/preface.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/preface.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 10:12+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -15,77 +15,277 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: preface.xml:33
#, no-c-format
msgid "Preface"
msgstr "前言"
#. Tag: para
-#, no-c-format
-msgid "Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. Hibernate is an Object/Relational Mapping tool for Java environments. The term Object/Relational Mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema."
-msgstr "在今日的企业环境中,把面向对象的软件和关系型数据库一起使用可能是相当麻烦和浪费时间的。Hibernate 是一个面向 Java 环境的对象/关系型数据库映射工具。对象/关系型数据库映射(object/relational mapping,ORM)这个术语表示一种技术,用来把对象模型表示的对象映射到基于 SQL 的关系模型数据结构中去。 "
+#: preface.xml:35
+#, fuzzy, no-c-format
+msgid ""
+"Working with both Object-Oriented software and Relational Databases can be "
+"cumbersome and time consuming. Development costs are significantly higher "
+"due to a paradigm mismatch between how data is represented in objects versus "
+"relational databases. Hibernate is an Object/Relational Mapping solution for "
+"Java environments. The term Object/Relational Mapping refers to the "
+"technique of mapping a data representation from an object model to a "
+"relational data model with a SQL-based schema; see <ulink url=\"http://en."
+"wikipedia.org/wiki/Object-relational_mapping\">http://en.wikipedia.org/wiki/"
+"Object-relational_mapping</ulink> for a discussion."
+msgstr ""
+"在今日的企业环境中,把面向对象的软件和关系型数据库一起使用可能是相当麻烦和浪"
+"费时间的。Hibernate 是一个面向 Java 环境的对象/关系型数据库映射工具。对象/关"
+"系型数据库映射(object/relational mapping,ORM)这个术语表示一种技术,用来把"
+"对象模型表示的对象映射到基于 SQL 的关系模型数据结构中去。 "
#. Tag: para
+#: preface.xml:46
#, no-c-format
-msgid "Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. It can also significantly reduce development time otherwise spent with manual data handling in SQL and JDBC."
-msgstr "Hibernate 不仅管理 Java 类到数据库表的映射(包括 Java 数据类型到 SQL 数据类型的映射),还提供数据查询和获取数据的方法,可以大幅度减少开发时对人工使用 SQL 和 JDBC 处理数据的时间。 "
+msgid ""
+"While having a strong background in SQL is not required to use Hibernate, "
+"having a basic understanding of the concepts can greatly help you understand "
+"Hibernate more fully and quickly. Probably the single best background is an "
+"understanding of data modeling principles. You might want to consider these "
+"resources as a good starting point:"
+msgstr ""
-#. Tag: para
+#. Tag: ulink
+#: preface.xml:54
#, no-c-format
-msgid "Hibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects."
-msgstr "Hibernate 的目标是对于开发者通常的数据持久化相关的编程任务,解放其中的 95%。对于以数据为中心的程序来说,它们往往只在数据库中使用存储过程来实现商业逻辑,Hibernate 可能不是最好的解决方案;对于那些在基于 Java 的中间层应用中,它们实现面向对象的业务模型和商业逻辑的应用,Hibernate 是最有用的。不管怎样,Hibernate 一定可以帮助你消除或者包装那些针对特定厂商的 SQL 代码,而且帮助你结果集从表格式的表示形式转换到一系列的对象中去。 "
+msgid "http://www.agiledata.org/essays/dataModeling101.html"
+msgstr ""
-#. Tag: para
+#. Tag: ulink
+#: preface.xml:59
#, no-c-format
-msgid "If you are new to Hibernate and Object/Relational Mapping or even Java, please follow these steps:"
-msgstr "如果你对 Hibernate 和对象/关系型数据库映射还是个新手,甚至对 Java 也不熟悉,请按照下面的步骤来学习。"
+msgid "http://en.wikipedia.org/wiki/Data_modeling"
+msgstr ""
#. Tag: para
+#: preface.xml:66
#, no-c-format
-msgid "Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step instructions. The source code for the tutorial is included in the distribution in the <literal>doc/reference/tutorial/</literal> directory."
-msgstr "阅读 <xref linkend=\"tutorial\"/>,这是一篇包含详细的逐步知道的指南。本指南的源代码包含在发行包里,你可以在 <literal>doc/reference/tutorial/</literal> 目录下找到。"
+msgid ""
+"Hibernate not only takes care of the mapping from Java classes to database "
+"tables (and from Java data types to SQL data types), but also provides data "
+"query and retrieval facilities. It can also significantly reduce development "
+"time otherwise spent with manual data handling in SQL and JDBC."
+msgstr ""
+"Hibernate 不仅管理 Java 类到数据库表的映射(包括 Java 数据类型到 SQL 数据类型"
+"的映射),还提供数据查询和获取数据的方法,可以大幅度减少开发时对人工使用 SQL "
+"和 JDBC 处理数据的时间。 "
#. Tag: para
+#: preface.xml:72
#, no-c-format
-msgid "Read <xref linkend=\"architecture\" /> to understand the environments where Hibernate can be used."
-msgstr "阅读 <xref linkend=\"architecture\"/> 来理解 Hibernate 可以使用的环境。"
+msgid ""
+"Hibernate’s design goal is to relieve the developer from 95% of common data "
+"persistence-related programming tasks by eliminating the need for manual, "
+"hand-crafted data processing using SQL and JDBC. However, unlike many other "
+"persistence solutions, Hibernate does not hide the power of SQL from you and "
+"guarantees that your investment in relational technology and knowledge is as "
+"valid as always."
+msgstr ""
#. Tag: para
+#: preface.xml:79
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate may not be the best solution for data-centric applications that "
+"only use stored-procedures to implement the business logic in the database, "
+"it is most useful with object-oriented domain models and business logic in "
+"the Java-based middle-tier. However, Hibernate can certainly help you to "
+"remove or encapsulate vendor-specific SQL code and will help with the common "
+"task of result set translation from a tabular representation to a graph of "
+"objects."
+msgstr ""
+"Hibernate 的目标是对于开发者通常的数据持久化相关的编程任务,解放其中的 95%。"
+"对于以数据为中心的程序来说,它们往往只在数据库中使用存储过程来实现商业逻辑,"
+"Hibernate 可能不是最好的解决方案;对于那些在基于 Java 的中间层应用中,它们实"
+"现面向对象的业务模型和商业逻辑的应用,Hibernate 是最有用的。不管怎样,"
+"Hibernate 一定可以帮助你消除或者包装那些针对特定厂商的 SQL 代码,而且帮助你结"
+"果集从表格式的表示形式转换到一系列的对象中去。 "
+
+#. Tag: para
+#: preface.xml:88
#, no-c-format
-msgid "View the <literal>eg/</literal> directory in the Hibernate distribution. It contains a simple standalone application. Copy your JDBC driver to the <literal>lib/</literal> directory and edit <literal>etc/hibernate.properties</literal>, specifying correct values for your database. From a command prompt in the distribution directory, type <literal>ant eg</literal> (using Ant), or under Windows, type <literal>build eg</literal>."
-msgstr "查看 Hibernate 发行包中的 <literal>eg/</literal> 目录,里面有个一简单的独立运行的程序。把你的 JDBC 驱动复制到 <literal>lib/</literal> 目录并修改一下 <literal>etc/hibernate.properties</literal>,指定数据库的信息。然后进入命令行,切换到发行包的目录,输入 <literal>ant eg</literal>(使用 Ant),或者在 Windows 系统下使用 <literal>build eg</literal>。 "
+msgid ""
+"If you are new to Hibernate and Object/Relational Mapping or even Java, "
+"please follow these steps:"
+msgstr ""
+"如果你对 Hibernate 和对象/关系型数据库映射还是个新手,甚至对 Java 也不熟悉,"
+"请按照下面的步骤来学习。"
#. Tag: para
+#: preface.xml:95
+#, fuzzy, no-c-format
+msgid ""
+"Read <xref linkend=\"tutorial\"/> for a tutorial with step-by-step "
+"instructions. The source code for the tutorial is included in the "
+"distribution in the <literal>doc/reference/tutorial/</literal> directory."
+msgstr ""
+"阅读 <xref linkend=\"tutorial\"/>,这是一篇包含详细的逐步知道的指南。本指南的"
+"源代码包含在发行包里,你可以在 <literal>doc/reference/tutorial/</literal> 目"
+"录下找到。"
+
+#. Tag: para
+#: preface.xml:103
+#, fuzzy, no-c-format
+msgid ""
+"Read <xref linkend=\"architecture\"/> to understand the environments where "
+"Hibernate can be used."
+msgstr ""
+"阅读 <xref linkend=\"architecture\"/> 来理解 Hibernate 可以使用的环境。"
+
+#. Tag: para
+#: preface.xml:109
#, no-c-format
-msgid "Use this reference documentation as your primary source of information. Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
-msgstr "把这份文档作为你学习的主要信息来源。如果你需要应用程序设计方面的帮助或者你希望有一个按部就班的指南,你可以考虑阅读 <biblioref linkend=\"biblio-JPwH\"></biblioref> 。你也可以访问 <ulink url=\"http://caveatemptor.hibernate.org\" /> 并从 <biblioref linkend=\"biblio-JPwH\"></biblioref> 下载示例程序。"
+msgid ""
+"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
+"contains a simple standalone application. Copy your JDBC driver to the "
+"<literal>lib/</literal> directory and edit <literal>etc/hibernate."
+"properties</literal>, specifying correct values for your database. From a "
+"command prompt in the distribution directory, type <literal>ant eg</literal> "
+"(using Ant), or under Windows, type <literal>build eg</literal>."
+msgstr ""
+"查看 Hibernate 发行包中的 <literal>eg/</literal> 目录,里面有个一简单的独立运"
+"行的程序。把你的 JDBC 驱动复制到 <literal>lib/</literal> 目录并修改一下 "
+"<literal>etc/hibernate.properties</literal>,指定数据库的信息。然后进入命令"
+"行,切换到发行包的目录,输入 <literal>ant eg</literal>(使用 Ant),或者在 "
+"Windows 系统下使用 <literal>build eg</literal>。 "
#. Tag: para
+#: preface.xml:120
+#, fuzzy, no-c-format
+msgid ""
+"Use this reference documentation as your primary source of information. "
+"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
+"more help with application design, or if you prefer a step-by-step tutorial. "
+"Also visit <ulink url=\"http://caveatemptor.hibernate.org\"></ulink> and "
+"download the example application from <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref>."
+msgstr ""
+"把这份文档作为你学习的主要信息来源。如果你需要应用程序设计方面的帮助或者你希"
+"望有一个按部就班的指南,你可以考虑阅读 <biblioref linkend=\"biblio-JPwH\"></"
+"biblioref> 。你也可以访问 <ulink url=\"http://caveatemptor.hibernate.org\" /"
+"> 并从 <biblioref linkend=\"biblio-JPwH\"></biblioref> 下载示例程序。"
+
+#. Tag: para
+#: preface.xml:130
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr "在 Hibernate 网站上可以找到问题和解答(FAQ)。"
#. Tag: para
+#: preface.xml:135
#, no-c-format
-msgid "Links to third party demos, examples, and tutorials are maintained on the Hibernate website."
+msgid ""
+"Links to third party demos, examples, and tutorials are maintained on the "
+"Hibernate website."
msgstr "在 Hibernate 网站上还有第三方的演示、示例和教程的链接。 "
#. Tag: para
+#: preface.xml:141
#, no-c-format
-msgid "The Community Area on the Hibernate website is a good resource for design patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, etc.)."
-msgstr "Hibernate 网站的社区是讨论关于设计模式以及很多整合方案(Tomcat、JBoss AS、Struts、EJB 等)的好地方。"
+msgid ""
+"The Community Area on the Hibernate website is a good resource for design "
+"patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, "
+"etc.)."
+msgstr ""
+"Hibernate 网站的社区是讨论关于设计模式以及很多整合方案(Tomcat、JBoss AS、"
+"Struts、EJB 等)的好地方。"
#. Tag: para
+#: preface.xml:149
#, no-c-format
-msgid "If you have questions, use the user forum linked on the Hibernate website. We also provide a JIRA issue tracking system for bug reports and feature requests. If you are interested in the development of Hibernate, join the developer mailing list. If you are interested in translating this documentation into your language, contact us on the developer mailing list."
-msgstr "如果你有任何问题,请使用 Hibernate 网站上链接的用户论坛。我们也提供一个 JIRA 问题追踪系统,来搜集 bug 报告和新的功能请求。如果对开发 Hibernate 有兴趣,请加入开发者的邮件列表。如果你对翻译本文档感兴趣,请通过开发者的邮件列表来联系我们。 "
+msgid ""
+"There are a number of ways to become involved in the Hibernate community, "
+"including"
+msgstr ""
#. Tag: para
+#: preface.xml:153
#, no-c-format
-msgid "Commercial development support, production support, and training for Hibernate is available through JBoss Inc. (see http://www.hibernate.org/SupportTraining/). Hibernate is a Professional Open Source project and a critical component of the JBoss Enterprise Middleware System (JEMS) suite of products."
-msgstr "商业开发、产品支持和 Hibernate 培训可以通过 JBoss Inc. 获得(请查阅: http://www.hibernate.org/SupportTraining/)。Hibernate 是一个专业的开源项目,也是 JBoss 企业级中间件系统(JBoss Enterprise Middleware System,JEMS)里的一个核心组件。 "
+msgid ""
+"Trying stuff out and reporting bugs. See <ulink url=\"http://hibernate.org/"
+"issuetracker.html\">http://hibernate.org/issuetracker.html</ulink> details."
+msgstr ""
+#. Tag: para
+#: preface.xml:160
+#, no-c-format
+msgid ""
+"Trying your hand at fixing some bugs or implementing enhancements. Again, "
+"see <ulink url=\"http://hibernate.org/issuetracker.html\">http://hibernate."
+"org/issuetracker.html</ulink> details."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:167
+#, no-c-format
+msgid ""
+"<ulink url=\"http://hibernate.org/community.html\">http://hibernate.org/"
+"community.html</ulink> list a few ways to engage in the community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:172
+#, no-c-format
+msgid ""
+"There are forums for users to ask questions and receive help from the "
+"community."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:177
+#, no-c-format
+msgid ""
+"There are also <ulink url=\"http://en.wikipedia.org/wiki/Internet_Relay_Chat"
+"\">IRC</ulink> channels for both user and developer discussions."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:186
+#, no-c-format
+msgid ""
+"Helping improve or translate this documentation. Contact us on the developer "
+"mailing list if you have interest."
+msgstr ""
+
+#. Tag: para
+#: preface.xml:192
+#, no-c-format
+msgid "Evangelizing Hibernate within your organization."
+msgstr ""
+
+#~ msgid ""
+#~ "If you have questions, use the user forum linked on the Hibernate "
+#~ "website. We also provide a JIRA issue tracking system for bug reports and "
+#~ "feature requests. If you are interested in the development of Hibernate, "
+#~ "join the developer mailing list. If you are interested in translating "
+#~ "this documentation into your language, contact us on the developer "
+#~ "mailing list."
+#~ msgstr ""
+#~ "如果你有任何问题,请使用 Hibernate 网站上链接的用户论坛。我们也提供一个 "
+#~ "JIRA 问题追踪系统,来搜集 bug 报告和新的功能请求。如果对开发 Hibernate 有"
+#~ "兴趣,请加入开发者的邮件列表。如果你对翻译本文档感兴趣,请通过开发者的邮件"
+#~ "列表来联系我们。 "
+
+#~ msgid ""
+#~ "Commercial development support, production support, and training for "
+#~ "Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
+#~ "SupportTraining/). Hibernate is a Professional Open Source project and a "
+#~ "critical component of the JBoss Enterprise Middleware System (JEMS) suite "
+#~ "of products."
+#~ msgstr ""
+#~ "商业开发、产品支持和 Hibernate 培训可以通过 JBoss Inc. 获得(请查阅: "
+#~ "http://www.hibernate.org/SupportTraining/)。Hibernate 是一个专业的开源项"
+#~ "目,也是 JBoss 企业级中间件系统(JBoss Enterprise Middleware System,"
+#~ "JEMS)里的一个核心组件。 "
+
#~ msgid "Feedback"
#~ msgstr "反馈"
+
#~ msgid ""
#~ "Use <ulink url=\"http://opensource.atlassian.com/projects/hibernate"
#~ "\">Hibernate JIRA</ulink> to report errors or request enhacements to this "
@@ -93,4 +293,3 @@
#~ msgstr ""
#~ "用 <ulink url=\"http://opensource.atlassian.com/projects/hibernate"
#~ "\">Hibernate JIRA</ulink> 来报告错误或改进本文档。"
-
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/query_sql.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/query_sql.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/query_sql.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 10:16+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -15,1100 +15,2210 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: query_sql.xml:31
#, no-c-format
msgid "Native SQL"
msgstr "Native SQL 查询"
#. Tag: para
+#: query_sql.xml:33
#, no-c-format
-msgid "You can also express queries in the native SQL dialect of your database. This is useful if you want to utilize database-specific features such as query hints or the <literal>CONNECT</literal> keyword in Oracle. It also provides a clean migration path from a direct SQL/JDBC based application to Hibernate."
-msgstr "你也可以使用你的数据库的 Native SQL 语言来查询数据。这对你在要使用数据库的某些特性的时候(比如说在查询提示或者 Oracle 中的 <literal>CONNECT</literal> 关键字),这是非常有用的。这就能够扫清你把原来直接使用 SQL/JDBC 的程序迁移到基于 Hibernate 应用的道路上的障碍。 "
+msgid ""
+"You can also express queries in the native SQL dialect of your database. "
+"This is useful if you want to utilize database-specific features such as "
+"query hints or the <literal>CONNECT</literal> keyword in Oracle. It also "
+"provides a clean migration path from a direct SQL/JDBC based application to "
+"Hibernate."
+msgstr ""
+"你也可以使用你的数据库的 Native SQL 语言来查询数据。这对你在要使用数据库的某"
+"些特性的时候(比如说在查询提示或者 Oracle 中的 <literal>CONNECT</literal> 关"
+"键字),这是非常有用的。这就能够扫清你把原来直接使用 SQL/JDBC 的程序迁移到基"
+"于 Hibernate 应用的道路上的障碍。 "
#. Tag: para
+#: query_sql.xml:39
#, no-c-format
-msgid "Hibernate3 allows you to specify handwritten SQL, including stored procedures, for all create, update, delete, and load operations."
-msgstr "Hibernate3 允许你使用手写的 sql 来完成所有的 create、update、delete 和 load 操作(包括存储过程) "
+msgid ""
+"Hibernate3 allows you to specify handwritten SQL, including stored "
+"procedures, for all create, update, delete, and load operations."
+msgstr ""
+"Hibernate3 允许你使用手写的 sql 来完成所有的 create、update、delete 和 load "
+"操作(包括存储过程) "
#. Tag: title
+#: query_sql.xml:43
#, no-c-format
msgid "Using a <literal>SQLQuery</literal>"
msgstr "使用 <literal>SQLQuery</literal>"
#. Tag: para
+#: query_sql.xml:45
#, no-c-format
-msgid "Execution of native SQL queries is controlled via the <literal>SQLQuery</literal> interface, which is obtained by calling <literal>Session.createSQLQuery()</literal>. The following sections describe how to use this API for querying."
-msgstr "对原生 SQL 查询执行的控制是通过 <literal>SQLQuery</literal> 接口进行的,通过执行<literal>Session.createSQLQuery()</literal>获取这个接口。下面来描述如何使用这个 API 进行查询。 "
+msgid ""
+"Execution of native SQL queries is controlled via the <literal>SQLQuery</"
+"literal> interface, which is obtained by calling <literal>Session."
+"createSQLQuery()</literal>. The following sections describe how to use this "
+"API for querying."
+msgstr ""
+"对原生 SQL 查询执行的控制是通过 <literal>SQLQuery</literal> 接口进行的,通过"
+"执行<literal>Session.createSQLQuery()</literal>获取这个接口。下面来描述如何使"
+"用这个 API 进行查询。 "
#. Tag: title
+#: query_sql.xml:51
#, no-c-format
msgid "Scalar queries"
msgstr "标量查询(Scalar queries)"
#. Tag: para
+#: query_sql.xml:53
#, no-c-format
msgid "The most basic SQL query is to get a list of scalars (values)."
msgstr "最基本的 SQL 查询就是获得一个标量(数值)的列表。"
+#. Tag: programlisting
+#: query_sql.xml:56
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+
#. Tag: para
+#: query_sql.xml:58
#, no-c-format
-msgid "These will return a List of Object arrays (Object[]) with scalar values for each column in the CATS table. Hibernate will use ResultSetMetadata to deduce the actual order and types of the returned scalar values."
-msgstr "它们都将返回一个 Object 数组(Object[])组成的 List,数组每个元素都是 CATS 表的一个字段值。Hibernate 会使用 ResultSetMetadata 来判定返回的标量值的实际顺序和类型。 "
+msgid ""
+"These will return a List of Object arrays (Object[]) with scalar values for "
+"each column in the CATS table. Hibernate will use ResultSetMetadata to "
+"deduce the actual order and types of the returned scalar values."
+msgstr ""
+"它们都将返回一个 Object 数组(Object[])组成的 List,数组每个元素都是 CATS 表"
+"的一个字段值。Hibernate 会使用 ResultSetMetadata 来判定返回的标量值的实际顺序"
+"和类型。 "
#. Tag: para
+#: query_sql.xml:63
#, no-c-format
-msgid "To avoid the overhead of using <literal>ResultSetMetadata</literal>, or simply to be more explicit in what is returned, one can use <literal>addScalar()</literal>:"
-msgstr "如果要避免过多的使用 <literal>ResultSetMetadata</literal>,或者只是为了更加明确的指名返回值,可以使用 <literal>addScalar()</literal>: "
+msgid ""
+"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or "
+"simply to be more explicit in what is returned, one can use "
+"<literal>addScalar()</literal>:"
+msgstr ""
+"如果要避免过多的使用 <literal>ResultSetMetadata</literal>,或者只是为了更加明"
+"确的指名返回值,可以使用 <literal>addScalar()</literal>: "
+#. Tag: programlisting
+#: query_sql.xml:67
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\", Hibernate.STRING)\n"
+" .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+
#. Tag: para
+#: query_sql.xml:69 query_sql.xml:116 query_sql.xml:197 query_sql.xml:349
#, no-c-format
msgid "This query specified:"
msgstr "这个查询指定:"
#. Tag: para
+#: query_sql.xml:73 query_sql.xml:120 query_sql.xml:353
#, no-c-format
msgid "the SQL query string"
msgstr "SQL 查询字符串"
#. Tag: para
+#: query_sql.xml:77
#, no-c-format
msgid "the columns and types to return"
msgstr "要返回的字段和类型"
#. Tag: para
+#: query_sql.xml:81
#, no-c-format
-msgid "This will return Object arrays, but now it will not use <literal>ResultSetMetadata</literal> but will instead explicitly get the ID, NAME and BIRTHDATE column as respectively a Long, String and a Short from the underlying resultset. This also means that only these three columns will be returned, even though the query is using <literal>*</literal> and could return more than the three listed columns."
-msgstr "它仍然会返回 Object 数组,但是此时不再使用 <literal>ResultSetMetdata</literal>,而是明确的将 ID,NAME 和 BIRTHDATE 按照 Long,String 和 Short 类型从 resultset 中取出。同时,也指明了就算 query 是使用 <literal>*</literal> 来查询的,可能获得超过列出的这三个字段,也仅仅会返回这三个字段。 "
+msgid ""
+"This will return Object arrays, but now it will not use "
+"<literal>ResultSetMetadata</literal> but will instead explicitly get the ID, "
+"NAME and BIRTHDATE column as respectively a Long, String and a Short from "
+"the underlying resultset. This also means that only these three columns will "
+"be returned, even though the query is using <literal>*</literal> and could "
+"return more than the three listed columns."
+msgstr ""
+"它仍然会返回 Object 数组,但是此时不再使用 <literal>ResultSetMetdata</"
+"literal>,而是明确的将 ID,NAME 和 BIRTHDATE 按照 Long,String 和 Short 类型"
+"从 resultset 中取出。同时,也指明了就算 query 是使用 <literal>*</literal> 来"
+"查询的,可能获得超过列出的这三个字段,也仅仅会返回这三个字段。 "
#. Tag: para
+#: query_sql.xml:89
#, no-c-format
-msgid "It is possible to leave out the type information for all or some of the scalars."
+msgid ""
+"It is possible to leave out the type information for all or some of the "
+"scalars."
msgstr "对全部或者部分的标量值不设置类型信息也是可以的。"
+#. Tag: programlisting
+#: query_sql.xml:92
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
+" .addScalar(\"ID\", Hibernate.LONG)\n"
+" .addScalar(\"NAME\")\n"
+" .addScalar(\"BIRTHDATE\")"
+
#. Tag: para
+#: query_sql.xml:94
#, no-c-format
-msgid "This is essentially the same query as before, but now <literal>ResultSetMetaData</literal> is used to determine the type of NAME and BIRTHDATE, where as the type of ID is explicitly specified."
-msgstr "基本上这和前面一个查询相同,只是此时使用 <literal>ResultSetMetaData</literal> 来决定 NAME 和 BIRTHDATE 的类型,而 ID 的类型是明确指出的。 "
+msgid ""
+"This is essentially the same query as before, but now "
+"<literal>ResultSetMetaData</literal> is used to determine the type of NAME "
+"and BIRTHDATE, where as the type of ID is explicitly specified."
+msgstr ""
+"基本上这和前面一个查询相同,只是此时使用 <literal>ResultSetMetaData</literal> "
+"来决定 NAME 和 BIRTHDATE 的类型,而 ID 的类型是明确指出的。 "
#. Tag: para
+#: query_sql.xml:99
#, no-c-format
-msgid "How the java.sql.Types returned from ResultSetMetaData is mapped to Hibernate types is controlled by the Dialect. If a specific type is not mapped, or does not result in the expected type, it is possible to customize it via calls to <literal>registerHibernateType</literal> in the Dialect."
-msgstr "关于从 ResultSetMetaData 返回的 java.sql.Types 是如何映射到 Hibernate 类型,是由方言(Dialect)控制的。假若某个指定的类型没有被映射,或者不是你所预期的类型,你可以通过 Dialet 的 <literal>registerHibernateType</literal> 调用自行定义。 "
+msgid ""
+"How the java.sql.Types returned from ResultSetMetaData is mapped to "
+"Hibernate types is controlled by the Dialect. If a specific type is not "
+"mapped, or does not result in the expected type, it is possible to customize "
+"it via calls to <literal>registerHibernateType</literal> in the Dialect."
+msgstr ""
+"关于从 ResultSetMetaData 返回的 java.sql.Types 是如何映射到 Hibernate 类型,"
+"是由方言(Dialect)控制的。假若某个指定的类型没有被映射,或者不是你所预期的类"
+"型,你可以通过 Dialet 的 <literal>registerHibernateType</literal> 调用自行定"
+"义。 "
#. Tag: title
+#: query_sql.xml:107
#, no-c-format
msgid "Entity queries"
msgstr "实体查询(Entity queries)"
#. Tag: para
+#: query_sql.xml:109
#, no-c-format
-msgid "The above queries were all about returning scalar values, basically returning the \"raw\" values from the resultset. The following shows how to get entity objects from a native sql query via <literal>addEntity()</literal>."
-msgstr "上面的查询都是返回标量值的,也就是从 resultset 中返回的“裸”数据。下面展示如何通过 <literal>addEntity()</literal> 让原生查询返回实体对象。"
+msgid ""
+"The above queries were all about returning scalar values, basically "
+"returning the \"raw\" values from the resultset. The following shows how to "
+"get entity objects from a native sql query via <literal>addEntity()</"
+"literal>."
+msgstr ""
+"上面的查询都是返回标量值的,也就是从 resultset 中返回的“裸”数据。下面展示如何"
+"通过 <literal>addEntity()</literal> 让原生查询返回实体对象。"
+#. Tag: programlisting
+#: query_sql.xml:114
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+msgstr ""
+"sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity(Cat."
+"class);"
+
#. Tag: para
+#: query_sql.xml:124
#, no-c-format
msgid "the entity returned by the query"
msgstr "要返回的实体"
#. Tag: para
+#: query_sql.xml:128
#, no-c-format
-msgid "Assuming that Cat is mapped as a class with the columns ID, NAME and BIRTHDATE the above queries will both return a List where each element is a Cat entity."
-msgstr "假设 Cat 被映射为拥有 ID,NAME 和 BIRTHDATE 三个字段的类,以上的两个查询都返回一个 List,每个元素都是一个 Cat 实体。"
+msgid ""
+"Assuming that Cat is mapped as a class with the columns ID, NAME and "
+"BIRTHDATE the above queries will both return a List where each element is a "
+"Cat entity."
+msgstr ""
+"假设 Cat 被映射为拥有 ID,NAME 和 BIRTHDATE 三个字段的类,以上的两个查询都返"
+"回一个 List,每个元素都是一个 Cat 实体。"
#. Tag: para
+#: query_sql.xml:132
#, no-c-format
-msgid "If the entity is mapped with a <literal>many-to-one</literal> to another entity it is required to also return this when performing the native query, otherwise a database specific \"column not found\" error will occur. The additional columns will automatically be returned when using the * notation, but we prefer to be explicit as in the following example for a <literal>many-to-one</literal> to a <literal>Dog</literal>:"
-msgstr "假若实体在映射时有一个 <literal>many-to-one</literal> 的关联指向另外一个实体,在查询时必须也返回那个实体,否则会导致发生一个 \"column not found\" 的数据库错误。这些附加的字段可以使用 * 标注来自动返回,但我们希望还是明确指明,看下面这个具有指向 <literal>Dog</literal> 的 <literal>many-to-one</literal> 的例子:"
+msgid ""
+"If the entity is mapped with a <literal>many-to-one</literal> to another "
+"entity it is required to also return this when performing the native query, "
+"otherwise a database specific \"column not found\" error will occur. The "
+"additional columns will automatically be returned when using the * notation, "
+"but we prefer to be explicit as in the following example for a <literal>many-"
+"to-one</literal> to a <literal>Dog</literal>:"
+msgstr ""
+"假若实体在映射时有一个 <literal>many-to-one</literal> 的关联指向另外一个实"
+"体,在查询时必须也返回那个实体,否则会导致发生一个 \"column not found\" 的数"
+"据库错误。这些附加的字段可以使用 * 标注来自动返回,但我们希望还是明确指明,看"
+"下面这个具有指向 <literal>Dog</literal> 的 <literal>many-to-one</literal> 的"
+"例子:"
+#. Tag: programlisting
+#: query_sql.xml:140
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+msgstr ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
+"addEntity(Cat.class);"
+
#. Tag: para
+#: query_sql.xml:142
#, no-c-format
msgid "This will allow cat.getDog() to function properly."
msgstr "这样 cat.getDog() 就能正常运作。"
#. Tag: title
+#: query_sql.xml:146
#, no-c-format
msgid "Handling associations and collections"
msgstr "处理关联和集合类(Handling associations and collections)"
#. Tag: para
+#: query_sql.xml:148
#, no-c-format
-msgid "It is possible to eagerly join in the <literal>Dog</literal> to avoid the possible extra roundtrip for initializing the proxy. This is done via the <literal>addJoin()</literal> method, which allows you to join in an association or collection."
-msgstr "通过提前抓取将 <literal>Dog</literal> 连接获得,而避免初始化 proxy 带来的额外开销也是可能的。这是通过 <literal>addJoin()</literal> 方法进行的,这个方法可以让你将关联或集合连接进来。"
+msgid ""
+"It is possible to eagerly join in the <literal>Dog</literal> to avoid the "
+"possible extra roundtrip for initializing the proxy. This is done via the "
+"<literal>addJoin()</literal> method, which allows you to join in an "
+"association or collection."
+msgstr ""
+"通过提前抓取将 <literal>Dog</literal> 连接获得,而避免初始化 proxy 带来的额外"
+"开销也是可能的。这是通过 <literal>addJoin()</literal> 方法进行的,这个方法可"
+"以让你将关联或集合连接进来。"
+#. Tag: programlisting
+#: query_sql.xml:153
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+msgstr ""
+"sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
+"FROM CATS c, DOGS d \n"
+" WHERE c.DOG_ID = d.D_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dog\");"
+
#. Tag: para
+#: query_sql.xml:155
#, no-c-format
-msgid "In this example, the returned <literal>Cat</literal>'s will have their <literal>dog</literal> property fully initialized without any extra roundtrip to the database. Notice that you added an alias name (\"cat\") to be able to specify the target property path of the join. It is possible to do the same eager joining for collections, e.g. if the <literal>Cat</literal> had a one-to-many to <literal>Dog</literal> instead."
-msgstr "上面这个例子中,返回的 <literal>Cat</literal> 对象,其 <literal>dog</literal> 属性被完全初始化了,不再需要数据库的额外操作。注意,我们加了一个别名(\"cat\"),以便指明 join 的目标属性路径。通过同样的提前连接也可以作用于集合类,例如,假若 <literal>Cat</literal> 有一个指向 <literal>Dog</literal> 的一对多关联。 "
+msgid ""
+"In this example, the returned <literal>Cat</literal>'s will have their "
+"<literal>dog</literal> property fully initialized without any extra "
+"roundtrip to the database. Notice that you added an alias name (\"cat\") to "
+"be able to specify the target property path of the join. It is possible to "
+"do the same eager joining for collections, e.g. if the <literal>Cat</"
+"literal> had a one-to-many to <literal>Dog</literal> instead."
+msgstr ""
+"上面这个例子中,返回的 <literal>Cat</literal> 对象,其 <literal>dog</"
+"literal> 属性被完全初始化了,不再需要数据库的额外操作。注意,我们加了一个别名"
+"(\"cat\"),以便指明 join 的目标属性路径。通过同样的提前连接也可以作用于集合"
+"类,例如,假若 <literal>Cat</literal> 有一个指向 <literal>Dog</literal> 的一"
+"对多关联。 "
+#. Tag: programlisting
+#: query_sql.xml:163
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+msgstr ""
+"sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM "
+"CATS c, DOGS d\n"
+" WHERE c.ID = d.CAT_ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addJoin(\"cat.dogs\");"
+
#. Tag: para
+#: query_sql.xml:165
#, no-c-format
-msgid "At this stage you are reaching the limits of what is possible with native queries, without starting to enhance the sql queries to make them usable in Hibernate. Problems can arise when returning multiple entities of the same type or when the default alias/column names are not enough."
-msgstr "到此为止,我们碰到了天花板:若不对 SQL 查询进行增强,这些已经是在 Hibernate 中使用原生 SQL 查询所能做到的最大可能了。下面的问题即将出现:返回多个同样类型的实体怎么办?或者默认的别名/字段不够又怎么办? "
+msgid ""
+"At this stage you are reaching the limits of what is possible with native "
+"queries, without starting to enhance the sql queries to make them usable in "
+"Hibernate. Problems can arise when returning multiple entities of the same "
+"type or when the default alias/column names are not enough."
+msgstr ""
+"到此为止,我们碰到了天花板:若不对 SQL 查询进行增强,这些已经是在 Hibernate "
+"中使用原生 SQL 查询所能做到的最大可能了。下面的问题即将出现:返回多个同样类型"
+"的实体怎么办?或者默认的别名/字段不够又怎么办? "
#. Tag: title
+#: query_sql.xml:173
#, no-c-format
msgid "Returning multiple entities"
msgstr "返回多个实体(Returning multiple entities)"
#. Tag: para
+#: query_sql.xml:175
#, no-c-format
-msgid "Until now, the result set column names are assumed to be the same as the column names specified in the mapping document. This can be problematic for SQL queries that join multiple tables, since the same column names can appear in more than one table."
-msgstr "到目前为止,结果集字段名被假定为和映射文件中指定的的字段名是一致的。假若 SQL 查询连接了多个表,同一个字段名可能在多个表中出现多次,这就会造成问题。 "
+msgid ""
+"Until now, the result set column names are assumed to be the same as the "
+"column names specified in the mapping document. This can be problematic for "
+"SQL queries that join multiple tables, since the same column names can "
+"appear in more than one table."
+msgstr ""
+"到目前为止,结果集字段名被假定为和映射文件中指定的的字段名是一致的。假若 SQL "
+"查询连接了多个表,同一个字段名可能在多个表中出现多次,这就会造成问题。 "
#. Tag: para
+#: query_sql.xml:180
#, no-c-format
-msgid "Column alias injection is needed in the following query (which most likely will fail):"
+msgid ""
+"Column alias injection is needed in the following query (which most likely "
+"will fail):"
msgstr "下面的查询中需要使用字段别名注射(这个例子本身会失败):"
+#. Tag: programlisting
+#: query_sql.xml:183
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID "
+"= c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+
#. Tag: para
+#: query_sql.xml:185
#, no-c-format
-msgid "The query was intended to return two Cat instances per row: a cat and its mother. The query will, however, fail because there is a conflict of names; the instances are mapped to the same column names. Also, on some databases the returned column aliases will most likely be on the form \"c.ID\", \"c.NAME\", etc. which are not equal to the columns specified in the mappings (\"ID\" and \"NAME\")."
-msgstr "这个查询的本意是希望每行返回两个 Cat 实例,一个是 cat,另一个是它的妈妈。但是因为它们的字段名被映射为相同的,而且在某些数据库中,返回的字段别名是“c.ID”,\"c.NAME\" 这样的形式,而它们和在映射文件中的名字(\"ID\" 和 \"NAME\")不匹配,这就会造成失败。 "
+msgid ""
+"The query was intended to return two Cat instances per row: a cat and its "
+"mother. The query will, however, fail because there is a conflict of names; "
+"the instances are mapped to the same column names. Also, on some databases "
+"the returned column aliases will most likely be on the form \"c.ID\", \"c."
+"NAME\", etc. which are not equal to the columns specified in the mappings "
+"(\"ID\" and \"NAME\")."
+msgstr ""
+"这个查询的本意是希望每行返回两个 Cat 实例,一个是 cat,另一个是它的妈妈。但是"
+"因为它们的字段名被映射为相同的,而且在某些数据库中,返回的字段别名是“c.ID”,"
+"\"c.NAME\" 这样的形式,而它们和在映射文件中的名字(\"ID\" 和 \"NAME\")不匹"
+"配,这就会造成失败。 "
#. Tag: para
+#: query_sql.xml:192
#, no-c-format
msgid "The following form is not vulnerable to column name duplication:"
msgstr "下面的形式可以解决字段名重复:"
+#. Tag: programlisting
+#: query_sql.xml:195
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+msgstr ""
+"sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE "
+"c.MOTHER_ID = c.ID\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class)"
+
#. Tag: para
+#: query_sql.xml:201
#, no-c-format
-msgid "the SQL query string, with placeholders for Hibernate to inject column aliases"
+msgid ""
+"the SQL query string, with placeholders for Hibernate to inject column "
+"aliases"
msgstr "SQL 查询语句,其中包含占位附来让 Hibernate 注射字段别名"
#. Tag: para
+#: query_sql.xml:206
#, no-c-format
msgid "the entities returned by the query"
msgstr "查询返回的实体"
#. Tag: para
+#: query_sql.xml:210
#, no-c-format
-msgid "The {cat.*} and {mother.*} notation used above is a shorthand for \"all properties\". Alternatively, you can list the columns explicitly, but even in this case Hibernate injects the SQL column aliases for each property. The placeholder for a column alias is just the property name qualified by the table alias. In the following example, you retrieve Cats and their mothers from a different table (cat_log) to the one declared in the mapping metadata. You can even use the property aliases in the where clause."
-msgstr "上面使用的 {cat.*} 和 {mother.*} 标记是作为“所有属性”的简写形式出现的。当然你也可以明确地罗列出字段名,但在这个例子里面我们让 Hibernate 来为每个属性注射 SQL 字段别名。字段别名的占位符是属性名加上表别名的前缀。在下面的例子中,我们从另外一个表(cat_log)中通过映射元数据中的指定获取 Cat 和它的妈妈。注意,要是我们愿意,我们甚至可以在 where 子句中使用属性别名。 "
+msgid ""
+"The {cat.*} and {mother.*} notation used above is a shorthand for \"all "
+"properties\". Alternatively, you can list the columns explicitly, but even "
+"in this case Hibernate injects the SQL column aliases for each property. The "
+"placeholder for a column alias is just the property name qualified by the "
+"table alias. In the following example, you retrieve Cats and their mothers "
+"from a different table (cat_log) to the one declared in the mapping "
+"metadata. You can even use the property aliases in the where clause."
+msgstr ""
+"上面使用的 {cat.*} 和 {mother.*} 标记是作为“所有属性”的简写形式出现的。当然你"
+"也可以明确地罗列出字段名,但在这个例子里面我们让 Hibernate 来为每个属性注射 "
+"SQL 字段别名。字段别名的占位符是属性名加上表别名的前缀。在下面的例子中,我们"
+"从另外一个表(cat_log)中通过映射元数据中的指定获取 Cat 和它的妈妈。注意,要"
+"是我们愿意,我们甚至可以在 where 子句中使用属性别名。 "
+#. Tag: programlisting
+#: query_sql.xml:219
+#, fuzzy, no-c-format
+msgid ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" +\n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+msgstr ""
+"String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
+" \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "
+"\" +\n"
+" \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
+"\n"
+"List loggedCats = sess.createSQLQuery(sql)\n"
+" .addEntity(\"cat\", Cat.class)\n"
+" .addEntity(\"mother\", Cat.class).list()"
+
#. Tag: title
+#: query_sql.xml:222
#, no-c-format
msgid "Alias and property references"
msgstr "别名和属性引用(Alias and property references)"
#. Tag: para
+#: query_sql.xml:224
#, no-c-format
-msgid "In most cases the above alias injection is needed. For queries relating to more complex mappings, like composite properties, inheritance discriminators, collections etc., you can use specific aliases that allow Hibernate to inject the proper aliases."
-msgstr "大多数情况下,都需要上面的属性注射,但在使用更加复杂的映射,比如复合属性、通过标识符构造继承树,以及集合类等等情况下,也有一些特别的别名,来允许 Hibernate 注入合适的别名。 "
+msgid ""
+"In most cases the above alias injection is needed. For queries relating to "
+"more complex mappings, like composite properties, inheritance "
+"discriminators, collections etc., you can use specific aliases that allow "
+"Hibernate to inject the proper aliases."
+msgstr ""
+"大多数情况下,都需要上面的属性注射,但在使用更加复杂的映射,比如复合属性、通"
+"过标识符构造继承树,以及集合类等等情况下,也有一些特别的别名,来允许 "
+"Hibernate 注入合适的别名。 "
#. Tag: para
+#: query_sql.xml:229
#, no-c-format
-msgid "The following table shows the different ways you can use the alias injection. Please note that the alias names in the result are simply examples; each alias will have a unique and probably different name when used."
-msgstr "下表列出了使用别名注射参数的不同可能性。注意:下面结果中的别名只是示例,实用时每个别名需要唯一并且不同的名字。 "
+msgid ""
+"The following table shows the different ways you can use the alias "
+"injection. Please note that the alias names in the result are simply "
+"examples; each alias will have a unique and probably different name when "
+"used."
+msgstr ""
+"下表列出了使用别名注射参数的不同可能性。注意:下面结果中的别名只是示例,实用"
+"时每个别名需要唯一并且不同的名字。 "
#. Tag: title
+#: query_sql.xml:235
#, no-c-format
msgid "Alias injection names"
msgstr "别名注射(alias injection names)"
#. Tag: entry
+#: query_sql.xml:246
#, no-c-format
msgid "Description"
msgstr "描述"
#. Tag: entry
+#: query_sql.xml:248
#, no-c-format
msgid "Syntax"
msgstr "语法"
#. Tag: entry
+#: query_sql.xml:250
#, no-c-format
msgid "Example"
msgstr "示例"
#. Tag: entry
+#: query_sql.xml:256
#, no-c-format
msgid "A simple property"
msgstr "简单属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].[propertyname]</literal>"
+#. Tag: literal
+#: query_sql.xml:258
+#, fuzzy, no-c-format
+msgid "{[aliasname].[propertyname]"
msgstr "<literal>{[aliasname].[propertyname]</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>A_NAME as {item.name}</literal>"
+#. Tag: literal
+#: query_sql.xml:260
+#, fuzzy, no-c-format
+msgid "A_NAME as {item.name}"
msgstr "<literal>A_NAME as {item.name}</literal>"
#. Tag: entry
+#: query_sql.xml:264
#, no-c-format
msgid "A composite property"
msgstr "复合属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
+#. Tag: literal
+#: query_sql.xml:266
+#, fuzzy, no-c-format
+msgid "{[aliasname].[componentname].[propertyname]}"
msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</literal>"
-msgstr "<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</literal> "
+#. Tag: literal
+#: query_sql.xml:268
+#, fuzzy, no-c-format
+msgid "CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}"
+msgstr ""
+"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
+"literal> "
#. Tag: entry
+#: query_sql.xml:273
#, no-c-format
msgid "Discriminator of an entity"
msgstr "实体辨别器(Discriminator of an entity)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].class}</literal>"
+#. Tag: literal
+#: query_sql.xml:275
+#, fuzzy, no-c-format
+msgid "{[aliasname].class}"
msgstr "<literal>{[aliasname].class}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>DISC as {item.class}</literal>"
+#. Tag: literal
+#: query_sql.xml:277
+#, fuzzy, no-c-format
+msgid "DISC as {item.class}"
msgstr "<literal>DISC as {item.class}</literal>"
#. Tag: entry
+#: query_sql.xml:281
#, no-c-format
msgid "All properties of an entity"
msgstr "实体的所有属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].*}</literal>"
+#. Tag: literal
+#: query_sql.xml:283 query_sql.xml:331
+#, fuzzy, no-c-format
+msgid "{[aliasname].*}"
msgstr "<literal>{[aliasname].*}</literal>"
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:285
#, no-c-format
-msgid "<literal>{item.*}</literal>"
-msgstr "<literal>{item.*}</literal>"
+msgid "{item.*}"
+msgstr "{item.*}"
#. Tag: entry
+#: query_sql.xml:289
#, no-c-format
msgid "A collection key"
msgstr "集合键(collection key)"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].key}</literal>"
+#. Tag: literal
+#: query_sql.xml:291
+#, fuzzy, no-c-format
+msgid "{[aliasname].key}"
msgstr "<literal>{[aliasname].key}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>ORGID as {coll.key}</literal>"
+#. Tag: literal
+#: query_sql.xml:293
+#, fuzzy, no-c-format
+msgid "ORGID as {coll.key}"
msgstr "<literal>ORGID as {coll.key}</literal>"
#. Tag: entry
+#: query_sql.xml:297
#, no-c-format
msgid "The id of an collection"
msgstr "集合 id"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].id}</literal>"
+#. Tag: literal
+#: query_sql.xml:299
+#, fuzzy, no-c-format
+msgid "{[aliasname].id}"
msgstr "<literal>{[aliasname].id}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>EMPID as {coll.id}</literal>"
+#. Tag: literal
+#: query_sql.xml:301
+#, fuzzy, no-c-format
+msgid "EMPID as {coll.id}"
msgstr "<literal>EMPID as {coll.id}</literal>"
#. Tag: entry
+#: query_sql.xml:305
#, no-c-format
msgid "The element of an collection"
msgstr "集合元素"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element}</literal>"
+#. Tag: literal
+#: query_sql.xml:307
+#, fuzzy, no-c-format
+msgid "{[aliasname].element}"
msgstr "<literal>{[aliasname].element}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>XID as {coll.element}</literal>"
+#. Tag: literal
+#: query_sql.xml:309
+#, fuzzy, no-c-format
+msgid "XID as {coll.element}"
msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry
+#: query_sql.xml:313
#, no-c-format
msgid "property of the element in the collection"
msgstr "集合元素的属性 "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
+#. Tag: literal
+#: query_sql.xml:315
+#, fuzzy, no-c-format
+msgid "{[aliasname].element.[propertyname]}"
msgstr "<literal>{[aliasname].element.[propertyname]}</literal> "
-#. Tag: entry
-#, no-c-format
-msgid "<literal>NAME as {coll.element.name}</literal>"
+#. Tag: literal
+#: query_sql.xml:317
+#, fuzzy, no-c-format
+msgid "NAME as {coll.element.name}"
msgstr "<literal>NAME as {coll.element.name}</literal>"
#. Tag: entry
+#: query_sql.xml:321
#, no-c-format
msgid "All properties of the element in the collection"
msgstr "集合元素的所有属性"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{[aliasname].element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:323
+#, fuzzy, no-c-format
+msgid "{[aliasname].element.*}"
msgstr "<literal>{[aliasname].element.*}</literal>"
-#. Tag: entry
-#, no-c-format
-msgid "<literal>{coll.element.*}</literal>"
-msgstr "<literal>{coll.element.*}</literal>"
+#. Tag: literal
+#: query_sql.xml:325
+#, fuzzy, no-c-format
+msgid "{coll.element.*}"
+msgstr "{coll.*}"
#. Tag: entry
+#: query_sql.xml:329
#, no-c-format
msgid "All properties of the collection"
msgstr "集合的所有属性 "
-#. Tag: entry
+#. Tag: literal
+#: query_sql.xml:333
#, no-c-format
-msgid "<literal>{coll.*}</literal>"
-msgstr "<literal>{coll.*}</literal>"
+msgid "{coll.*}"
+msgstr "{coll.*}"
#. Tag: title
+#: query_sql.xml:342
#, no-c-format
msgid "Returning non-managed entities"
msgstr "返回非受管实体(Returning non-managed entities)"
#. Tag: para
+#: query_sql.xml:344
#, no-c-format
-msgid "It is possible to apply a ResultTransformer to native SQL queries, allowing it to return non-managed entities."
-msgstr "可以对原生 sql 查询使用 ResultTransformer。这会返回不受 Hibernate 管理的实体。 "
+msgid ""
+"It is possible to apply a ResultTransformer to native SQL queries, allowing "
+"it to return non-managed entities."
+msgstr ""
+"可以对原生 sql 查询使用 ResultTransformer。这会返回不受 Hibernate 管理的实"
+"体。 "
+#. Tag: programlisting
+#: query_sql.xml:347
+#, fuzzy, no-c-format
+msgid ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+msgstr ""
+"sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
+" .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+
#. Tag: para
+#: query_sql.xml:357
#, no-c-format
msgid "a result transformer"
msgstr "结果转换器(result transformer)"
#. Tag: para
+#: query_sql.xml:361
#, no-c-format
-msgid "The above query will return a list of <literal>CatDTO</literal> which has been instantiated and injected the values of NAME and BIRTHNAME into its corresponding properties or fields."
-msgstr "上面的查询将会返回 <literal>CatDTO</literal> 的列表,它将被实例化并且将 NAME 和 BIRTHDAY 的值注射入对应的属性或者字段。"
+msgid ""
+"The above query will return a list of <literal>CatDTO</literal> which has "
+"been instantiated and injected the values of NAME and BIRTHNAME into its "
+"corresponding properties or fields."
+msgstr ""
+"上面的查询将会返回 <literal>CatDTO</literal> 的列表,它将被实例化并且将 NAME "
+"和 BIRTHDAY 的值注射入对应的属性或者字段。"
#. Tag: title
+#: query_sql.xml:367
#, no-c-format
msgid "Handling inheritance"
msgstr "处理继承(Handling inheritance)"
#. Tag: para
+#: query_sql.xml:369
#, no-c-format
-msgid "Native SQL queries which query for entities that are mapped as part of an inheritance must include all properties for the baseclass and all its subclasses."
-msgstr "原生 SQL 查询假若其查询结果实体是继承树中的一部分,它必须包含基类和所有子类的所有属性。 "
+msgid ""
+"Native SQL queries which query for entities that are mapped as part of an "
+"inheritance must include all properties for the baseclass and all its "
+"subclasses."
+msgstr ""
+"原生 SQL 查询假若其查询结果实体是继承树中的一部分,它必须包含基类和所有子类的"
+"所有属性。 "
#. Tag: title
+#: query_sql.xml:375
#, no-c-format
msgid "Parameters"
msgstr "参数(Parameters)"
#. Tag: para
+#: query_sql.xml:377
#, no-c-format
msgid "Native SQL queries support positional as well as named parameters:"
msgstr "原生查询支持位置参数和命名参数: "
+#. Tag: programlisting
+#: query_sql.xml:380
+#, fuzzy, no-c-format
+msgid ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+msgstr ""
+"Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(0, \"Pus%\").list();\n"
+" \n"
+"query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
+"addEntity(Cat.class);\n"
+"List pusList = query.setString(\"name\", \"Pus%\").list();"
+
#. Tag: title
+#: query_sql.xml:385
#, no-c-format
msgid "Named SQL queries"
msgstr "命名 SQL 查询"
#. Tag: para
+#: query_sql.xml:387
+#, fuzzy, no-c-format
+msgid ""
+"Named SQL queries can also be defined in the mapping document and called in "
+"exactly the same way as a named HQL query (see <xref linkend=\"objectstate-"
+"querying-executing-named\"/>). In this case, you do <emphasis>not</emphasis> "
+"need to call <literal>addEntity()</literal>."
+msgstr ""
+"可以在映射文档中定义查询的名字,然后就可以象调用一个命名的 HQL 查询一样直接调"
+"用命名 SQL 查询.在这种情况下,我们<emphasis>不</emphasis> 需要调用 "
+"<literal>addEntity()</literal> 方法。 "
+
+#. Tag: title
+#: query_sql.xml:394
#, no-c-format
-msgid "Named SQL queries can be defined in the mapping document and called in exactly the same way as a named HQL query. In this case, you do <emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
-msgstr "可以在映射文档中定义查询的名字,然后就可以象调用一个命名的 HQL 查询一样直接调用命名 SQL 查询.在这种情况下,我们<emphasis>不</emphasis> 需要调用 <literal>addEntity()</literal> 方法。 "
+msgid "Named sql query using the <sql-query> maping element"
+msgstr ""
+#. Tag: programlisting
+#: query_sql.xml:397
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"persons\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex}\n"
+" FROM PERSON person\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
+#. Tag: title
+#: query_sql.xml:401
+#, no-c-format
+msgid "Execution of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:403
+#, fuzzy, no-c-format
+msgid ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+msgstr ""
+"List people = sess.getNamedQuery(\"persons\")\n"
+" .setString(\"namePattern\", namePattern)\n"
+" .setMaxResults(50)\n"
+" .list();"
+
#. Tag: para
+#: query_sql.xml:406
#, no-c-format
-msgid "The <literal><return-join></literal> element is use to join associations and the <literal><load-collection></literal> element is used to define queries which initialize collections,"
-msgstr "<literal><return-join></literal> 和 <literal><load-collection></literal> 元素是用来连接关联以及将查询定义为预先初始化各个集合的。 "
+msgid ""
+"The <literal><return-join></literal> element is use to join "
+"associations and the <literal><load-collection></literal> element is "
+"used to define queries which initialize collections,"
+msgstr ""
+"<literal><return-join></literal> 和 <literal><load-collection></"
+"literal> 元素是用来连接关联以及将查询定义为预先初始化各个集合的。 "
+#. Tag: title
+#: query_sql.xml:411
+#, no-c-format
+msgid "Named sql query with association"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:413
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"personsWith\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" adddress.STREET AS {address.street},\n"
+" adddress.CITY AS {address.city},\n"
+" adddress.STATE AS {address.state},\n"
+" adddress.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS adddress\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:416
#, no-c-format
-msgid "A named SQL query may return a scalar value. You must declare the column alias and Hibernate type using the <literal><return-scalar></literal> element:"
-msgstr "一个命名查询可能会返回一个标量值。你必须使用 <literal><return-scalar></literal> 元素来指定字段的别名和 Hibernate 类型:"
+msgid ""
+"A named SQL query may return a scalar value. You must declare the column "
+"alias and Hibernate type using the <literal><return-scalar></literal> "
+"element:"
+msgstr ""
+"一个命名查询可能会返回一个标量值。你必须使用 <literal><return-scalar></"
+"literal> 元素来指定字段的别名和 Hibernate 类型:"
+#. Tag: title
+#: query_sql.xml:421
+#, no-c-format
+msgid "Named query returning a scalar"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:423
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name, \n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return-scalar column=\"name\" type=\"string\"/>\n"
+" <return-scalar column=\"age\" type=\"long\"/>\n"
+" SELECT p.NAME AS name,\n"
+" p.AGE AS age,\n"
+" FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:426
#, no-c-format
-msgid "You can externalize the resultset mapping information in a <literal><resultset></literal> element which will allow you to either reuse them across several named queries or through the <literal>setResultSetMapping()</literal> API."
-msgstr "你可以把结果集映射的信息放在外部的 <literal><resultset></literal> 元素中,这样就可以在多个命名查询间,或者通过 <literal>setResultSetMapping()</literal> API 来访问。 "
+msgid ""
+"You can externalize the resultset mapping information in a <literal><"
+"resultset></literal> element which will allow you to either reuse them "
+"across several named queries or through the <literal>setResultSetMapping()</"
+"literal> API."
+msgstr ""
+"你可以把结果集映射的信息放在外部的 <literal><resultset></literal> 元素"
+"中,这样就可以在多个命名查询间,或者通过 <literal>setResultSetMapping()</"
+"literal> API 来访问。 "
+#. Tag: title
+#: query_sql.xml:432
+#, no-c-format
+msgid "<resultset> mapping used to externalize mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:435
+#, fuzzy, no-c-format
+msgid ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" address.STREET AS {address.street},\n"
+" address.CITY AS {address.city},\n"
+" address.STATE AS {address.state},\n"
+" address.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS address\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+msgstr ""
+"<resultset name=\"personAddress\">\n"
+" <return alias=\"person\" class=\"eg.Person\"/>\n"
+" <return-join alias=\"address\" property=\"person.mailingAddress\"/"
+">\n"
+"</resultset>\n"
+"\n"
+"<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
+" SELECT person.NAME AS {person.name},\n"
+" person.AGE AS {person.age},\n"
+" person.SEX AS {person.sex},\n"
+" adddress.STREET AS {address.street},\n"
+" adddress.CITY AS {address.city},\n"
+" adddress.STATE AS {address.state},\n"
+" adddress.ZIP AS {address.zip}\n"
+" FROM PERSON person\n"
+" JOIN ADDRESS adddress\n"
+" ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
+" WHERE person.NAME LIKE :namePattern\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:438
#, no-c-format
-msgid "You can, alternatively, use the resultset mapping information in your hbm files directly in java code."
+msgid ""
+"You can, alternatively, use the resultset mapping information in your hbm "
+"files directly in java code."
msgstr "另外,你可以在 java 代码中直接使用 hbm 文件中的结果集定义信息。 "
#. Tag: title
+#: query_sql.xml:442
#, no-c-format
+msgid "Programmatically specifying the result mapping information"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:445
+#, fuzzy, no-c-format
+msgid ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+msgstr ""
+"List cats = sess.createSQLQuery(\n"
+" \"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten."
+"mother = cat.id\"\n"
+" )\n"
+" .setResultSetMapping(\"catAndKitten\")\n"
+" .list();"
+
+#. Tag: para
+#: query_sql.xml:448
+#, no-c-format
+msgid ""
+"So far we have only looked at externalizing SQL queries using Hibernate "
+"mapping files. The same concept is also available with anntations and is "
+"called named native queries. You can use <classname>@NamedNativeQuery</"
+"classname> (<classname>@NamedNativeQueries</classname>) in conjunction with "
+"<literal>@SqlResultSetMapping</literal> (<literal>@SqlResultSetMappings</"
+"literal>). Like <literal>@NamedQuery</literal>, "
+"<classname>@NamedNativeQuery</classname> and <literal>@SqlResultSetMapping</"
+"literal> can be defined at class level, but their scope is global to the "
+"application. Lets look at a view examples."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:460
+#, no-c-format
+msgid ""
+"shows how 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. "
+"In the example 2 entities, <literal>Night</literal> and <literal>Area</"
+"literal>, are returned and each property is declared and associated to a "
+"column name, actually the column name retrieved by the query."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:475
+#, no-c-format
+msgid ""
+"In <xref linkend=\"example-implicit-result-set-mapping\"/> the result set "
+"mapping is implicit. We only describe the entity class of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the model property is bound to the model_txt column."
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:481
+#, no-c-format
+msgid ""
+"Finally, 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. This can be seen in "
+"<xref linkend=\"example-field-result-annotation-with-associations\"/>."
+msgstr ""
+
+#. Tag: title
+#: query_sql.xml:490
+#, no-c-format
+msgid ""
+"Named SQL query using <classname>@NamedNativeQuery</classname> together with "
+"<classname>@SqlResultSetMapping</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:493
+#, 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\", \n"
+" resultSetMapping=\"joinMapping\")\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=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: title
+#: query_sql.xml:497
+#, no-c-format
+msgid "Implicit result set mapping"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:499
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"implicit\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", \n"
+" query=\"select * from SpaceShip\", \n"
+" resultSetMapping=\"implicit\")\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: title
+#: query_sql.xml:503
+#, no-c-format
+msgid "Using dot notation in @FieldResult for specifying associations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:506
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=@EntityResult(entityClass=SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column = \"name\"),\n"
+" @FieldResult(name=\"model\", column = \"model\"),\n"
+" @FieldResult(name=\"speed\", column = \"speed\"),\n"
+" @FieldResult(name=\"captain.firstname\", column = "
+"\"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column = \"lastn"
+"\"),\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"
+"@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
+#: query_sql.xml:510
+#, no-c-format
+msgid ""
+"If you retrieve a single entity using the default mapping, you can specify "
+"the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:514
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from SpaceShip"
+"\", resultClass=SpaceShip.class)\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:517
+#, 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: title
+#: query_sql.xml:525
+#, no-c-format
+msgid "Scalar values via <classname>@ColumnResult</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:527
+#, no-c-format
+msgid ""
+"@SqlResultSetMapping(name=\"scalar\", columns=@ColumnResult(name=\"dimension"
+"\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as dimension "
+"from SpaceShip\", resultSetMapping=\"scalar\")"
+msgstr ""
+
+#. Tag: para
+#: query_sql.xml:530
+#, 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
+#: query_sql.xml:535
+#, no-c-format
msgid "Using return-property to explicitly specify column/alias names"
msgstr "使用 return-property 来明确地指定字段/别名"
#. Tag: para
+#: query_sql.xml:538
#, no-c-format
-msgid "You can explicitly tell Hibernate what column aliases to use with <literal><return-property></literal>, instead of using the <literal>{}</literal>-syntax to let Hibernate inject its own aliases.For example:"
-msgstr "使用 <literal><return-property></literal> 你可以明确的告诉 Hibernate 使用哪些字段别名,这取代了使用 <literal>{}</literal>-语法 来让 Hibernate 注入它自己的别名。例如:"
+msgid ""
+"You can explicitly tell Hibernate what column aliases to use with "
+"<literal><return-property></literal>, instead of using the <literal>{}"
+"</literal>-syntax to let Hibernate inject its own aliases.For example:"
+msgstr ""
+"使用 <literal><return-property></literal> 你可以明确的告诉 Hibernate 使"
+"用哪些字段别名,这取代了使用 <literal>{}</literal>-语法 来让 Hibernate 注入它"
+"自己的别名。例如:"
+#. Tag: programlisting
+#: query_sql.xml:543
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"mySqlQuery\">\n"
+" <return alias=\"person\" class=\"eg.Person\">\n"
+" <return-property name=\"name\" column=\"myName\"/>\n"
+" <return-property name=\"age\" column=\"myAge\"/>\n"
+" <return-property name=\"sex\" column=\"mySex\"/>\n"
+" </return>\n"
+" SELECT person.NAME AS myName,\n"
+" person.AGE AS myAge,\n"
+" person.SEX AS mySex,\n"
+" FROM PERSON person WHERE person.NAME LIKE :name\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:545
#, no-c-format
-msgid "<literal><return-property></literal> also works with multiple columns. This solves a limitation with the <literal>{}</literal>-syntax which cannot allow fine grained control of multi-column properties."
-msgstr "<literal><return-property></literal> 也可用于多个字段,它解决了使用 <literal>{}</literal>-语法不能细粒度控制多个字段的限制。 "
+msgid ""
+"<literal><return-property></literal> also works with multiple columns. "
+"This solves a limitation with the <literal>{}</literal>-syntax which cannot "
+"allow fine grained control of multi-column properties."
+msgstr ""
+"<literal><return-property></literal> 也可用于多个字段,它解决了使用 "
+"<literal>{}</literal>-语法不能细粒度控制多个字段的限制。 "
+#. Tag: programlisting
+#: query_sql.xml:550
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"organizationCurrentEmployments\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
+" </return>\n"
+" SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
+" STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
+" REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT\n"
+" WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
+" ORDER BY STARTDATE ASC\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:552
#, no-c-format
-msgid "In this example <literal><return-property></literal> was used in combination with the <literal>{}</literal>-syntax for injection. This allows users to choose how they want to refer column and properties."
-msgstr "注意在这个例子中,我们使用了 <literal><return-property></literal> 结合 <literal>{}</literal> 的注入语法。允许用户来选择如何引用字段以及属性。 "
+msgid ""
+"In this example <literal><return-property></literal> was used in "
+"combination with the <literal>{}</literal>-syntax for injection. This allows "
+"users to choose how they want to refer column and properties."
+msgstr ""
+"注意在这个例子中,我们使用了 <literal><return-property></literal> 结合 "
+"<literal>{}</literal> 的注入语法。允许用户来选择如何引用字段以及属性。 "
#. Tag: para
+#: query_sql.xml:557
#, no-c-format
-msgid "If your mapping has a discriminator you must use <literal><return-discriminator></literal> to specify the discriminator column."
-msgstr "如果你映射一个识别器(discriminator),你必须使用 <literal><return-discriminator></literal> 来指定识别器字段。"
+msgid ""
+"If your mapping has a discriminator you must use <literal><return-"
+"discriminator></literal> to specify the discriminator column."
+msgstr ""
+"如果你映射一个识别器(discriminator),你必须使用 <literal><return-"
+"discriminator></literal> 来指定识别器字段。"
#. Tag: title
+#: query_sql.xml:563
#, no-c-format
msgid "Using stored procedures for querying"
msgstr "使用存储过程来查询"
#. Tag: para
+#: query_sql.xml:565
#, no-c-format
-msgid "Hibernate3 provides support for queries via stored procedures and functions. Most of the following documentation is equivalent for both. The stored procedure/function must return a resultset as the first out-parameter to be able to work with Hibernate. An example of such a stored function in Oracle 9 and higher is as follows:"
-msgstr "Hibernate 3 引入了对存储过程查询(stored procedure)和函数(function)的支持。以下的说明中,这二者一般都适用。存储过程/函数必须返回一个结果集,作为 Hibernate 能够使用的第一个外部参数。下面是一个 Oracle9 和更高版本的存储过程例子。 "
+msgid ""
+"Hibernate3 provides support for queries via stored procedures and functions. "
+"Most of the following documentation is equivalent for both. The stored "
+"procedure/function must return a resultset as the first out-parameter to be "
+"able to work with Hibernate. An example of such a stored function in Oracle "
+"9 and higher is as follows:"
+msgstr ""
+"Hibernate 3 引入了对存储过程查询(stored procedure)和函数(function)的支"
+"持。以下的说明中,这二者一般都适用。存储过程/函数必须返回一个结果集,作为 "
+"Hibernate 能够使用的第一个外部参数。下面是一个 Oracle9 和更高版本的存储过程例"
+"子。 "
+#. Tag: programlisting
+#: query_sql.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+msgstr ""
+"CREATE OR REPLACE FUNCTION selectAllEmployments\n"
+" RETURN SYS_REFCURSOR\n"
+"AS\n"
+" st_cursor SYS_REFCURSOR;\n"
+"BEGIN\n"
+" OPEN st_cursor FOR\n"
+" SELECT EMPLOYEE, EMPLOYER,\n"
+" STARTDATE, ENDDATE,\n"
+" REGIONCODE, EID, VALUE, CURRENCY\n"
+" FROM EMPLOYMENT;\n"
+" RETURN st_cursor;\n"
+" END;"
+
#. Tag: para
+#: query_sql.xml:573
#, no-c-format
msgid "To use this query in Hibernate you need to map it via a named query."
msgstr "在 Hibernate 里要要使用这个查询,你需要通过命名查询来映射它。"
+#. Tag: programlisting
+#: query_sql.xml:576
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
+" <return alias=\"emp\" class=\"Employment\">\n"
+" <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
+" <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
+" <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
+" <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
+" <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
+" <return-property name=\"id\" column=\"EID\"/>\n"
+" <return-property name=\"salary\">\n"
+" <return-column name=\"VALUE\"/>\n"
+" <return-column name=\"CURRENCY\"/>\n"
+" </return-property>\n"
+" </return>\n"
+" { ? = call selectAllEmployments() }\n"
+"</sql-query>"
+
#. Tag: para
+#: query_sql.xml:578
#, no-c-format
-msgid "Stored procedures currently only return scalars and entities. <literal><return-join></literal> and <literal><load-collection></literal> are not supported."
-msgstr "注意存储过程当前仅仅返回标量和实体现在。不支持 <literal><return-join></literal> 和 <literal><load-collection></literal>。 "
+msgid ""
+"Stored procedures currently only return scalars and entities. <literal><"
+"return-join></literal> and <literal><load-collection></literal> are "
+"not supported."
+msgstr ""
+"注意存储过程当前仅仅返回标量和实体现在。不支持 <literal><return-join></"
+"literal> 和 <literal><load-collection></literal>。 "
#. Tag: title
+#: query_sql.xml:583
#, no-c-format
msgid "Rules/limitations for using stored procedures"
msgstr "使用存储过程的规则和限制"
#. Tag: para
+#: query_sql.xml:585
#, no-c-format
-msgid "You cannot use stored procedures with Hibernate unless you follow some procedure/function rules. If they do not follow those rules they are not usable with Hibernate. If you still want to use these procedures you have to execute them via <literal>session.connection()</literal>. The rules are different for each database, since database vendors have different stored procedure semantics/syntax."
-msgstr "为了在 Hibernate 中使用存储过程,你必须遵循一些规则。不遵循这些规则的存储过程将不可用。如果你仍然想使用他们,你必须通过 <literal>session.connection()</literal> 来执行他们。这些规则针对于不同的数据库。因为数据库提供商有各种不同的存储过程语法和语义。 "
+msgid ""
+"You cannot use stored procedures with Hibernate unless you follow some "
+"procedure/function rules. If they do not follow those rules they are not "
+"usable with Hibernate. If you still want to use these procedures you have to "
+"execute them via <literal>session.connection()</literal>. The rules are "
+"different for each database, since database vendors have different stored "
+"procedure semantics/syntax."
+msgstr ""
+"为了在 Hibernate 中使用存储过程,你必须遵循一些规则。不遵循这些规则的存储过程"
+"将不可用。如果你仍然想使用他们,你必须通过 <literal>session.connection()</"
+"literal> 来执行他们。这些规则针对于不同的数据库。因为数据库提供商有各种不同的"
+"存储过程语法和语义。 "
#. Tag: para
+#: query_sql.xml:593
#, no-c-format
-msgid "Stored procedure queries cannot be paged with <literal>setFirstResult()/setMaxResults()</literal>."
-msgstr "对存储过程进行的查询无法使用 <literal>setFirstResult()/setMaxResults()</literal> 进行分页。 "
+msgid ""
+"Stored procedure queries cannot be paged with <literal>setFirstResult()/"
+"setMaxResults()</literal>."
+msgstr ""
+"对存储过程进行的查询无法使用 <literal>setFirstResult()/setMaxResults()</"
+"literal> 进行分页。 "
#. Tag: para
+#: query_sql.xml:596
#, no-c-format
-msgid "The recommended call form is standard SQL92: <literal>{ ? = call functionName(<parameters>) }</literal> or <literal>{ ? = call procedureName(<parameters>}</literal>. Native call syntax is not supported."
-msgstr "建议采用的调用方式是标准 SQL92: <literal>{ ? = call functionName(<parameters>) }</literal> 或者 <literal>{ ? = call procedureName(<parameters>) }</literal>。原生调用语法不被支持。 "
+msgid ""
+"The recommended call form is standard SQL92: <literal>{ ? = call functionName"
+"(<parameters>) }</literal> or <literal>{ ? = call procedureName(<"
+"parameters>}</literal>. Native call syntax is not supported."
+msgstr ""
+"建议采用的调用方式是标准 SQL92: <literal>{ ? = call functionName(<"
+"parameters>) }</literal> 或者 <literal>{ ? = call procedureName(<"
+"parameters>) }</literal>。原生调用语法不被支持。 "
#. Tag: para
+#: query_sql.xml:601
#, no-c-format
msgid "For Oracle the following rules apply:"
msgstr "对于 Oracle 有如下规则:"
#. Tag: para
+#: query_sql.xml:605
#, no-c-format
-msgid "A function must return a result set. The first parameter of a procedure must be an <literal>OUT</literal> that returns a result set. This is done by using a <literal>SYS_REFCURSOR</literal> type in Oracle 9 or 10. In Oracle you need to define a <literal>REF CURSOR</literal> type. See Oracle literature for further information."
-msgstr "函数必须返回一个结果集。存储过程的第一个参数必须是 <literal>OUT</literal>,它返回一个结果集。这是通过 Oracle 9 或 10 的 <literal>SYS_REFCURSOR</literal> 类型来完成的。在 Oracle 中你需要定义一个 <literal>REF CURSOR</literal> 类型,参见 Oracle 的手册。 "
+msgid ""
+"A function must return a result set. The first parameter of a procedure must "
+"be an <literal>OUT</literal> that returns a result set. This is done by "
+"using a <literal>SYS_REFCURSOR</literal> type in Oracle 9 or 10. In Oracle "
+"you need to define a <literal>REF CURSOR</literal> type. See Oracle "
+"literature for further information."
+msgstr ""
+"函数必须返回一个结果集。存储过程的第一个参数必须是 <literal>OUT</literal>,它"
+"返回一个结果集。这是通过 Oracle 9 或 10 的 <literal>SYS_REFCURSOR</literal> "
+"类型来完成的。在 Oracle 中你需要定义一个 <literal>REF CURSOR</literal> 类型,"
+"参见 Oracle 的手册。 "
#. Tag: para
+#: query_sql.xml:614
#, no-c-format
msgid "For Sybase or MS SQL server the following rules apply:"
msgstr "对于 Sybase 或者 MS SQL server 有如下规则:"
#. Tag: para
+#: query_sql.xml:618
#, no-c-format
-msgid "The procedure must return a result set. Note that since these servers can return multiple result sets and update counts, Hibernate will iterate the results and take the first result that is a result set as its return value. Everything else will be discarded."
-msgstr "存储过程必须返回一个结果集。注意这些 servers 可能返回多个结果集以及更新的数目。Hibernate 将取出第一条结果集作为它的返回值,其他将被丢弃。 "
+msgid ""
+"The procedure must return a result set. Note that since these servers can "
+"return multiple result sets and update counts, Hibernate will iterate the "
+"results and take the first result that is a result set as its return value. "
+"Everything else will be discarded."
+msgstr ""
+"存储过程必须返回一个结果集。注意这些 servers 可能返回多个结果集以及更新的数"
+"目。Hibernate 将取出第一条结果集作为它的返回值,其他将被丢弃。 "
#. Tag: para
+#: query_sql.xml:626
#, no-c-format
-msgid "If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it will probably be more efficient, but this is not a requirement."
-msgstr "如果你能够在存储过程里设定 <literal>SET NOCOUNT ON</literal>,这可能会效率更高,但这不是必需的。"
+msgid ""
+"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it "
+"will probably be more efficient, but this is not a requirement."
+msgstr ""
+"如果你能够在存储过程里设定 <literal>SET NOCOUNT ON</literal>,这可能会效率更"
+"高,但这不是必需的。"
#. Tag: title
+#: query_sql.xml:636
#, no-c-format
msgid "Custom SQL for create, update and delete"
msgstr "定制 SQL 用来 create,update 和 delete"
#. Tag: para
+#: query_sql.xml:638
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate3 can use custom SQL for create, update, and delete operations. The "
+"SQL can be overridden at the statement level or inidividual column level. "
+"This section describes statement overrides. For columns, see <xref linkend="
+"\"mapping-column-read-and-write\"/>. <xref linkend=\"example-custom-crdu-via-"
+"annotations\"/> shows how to define custom SQL operatons using annotations."
+msgstr ""
+"Hibernate3 可以自定义 create、update 和 delete 操作。SQL 可以在语句或单个字段"
+"级别进行覆盖。本节描述了语句覆盖。对于字段覆盖,请参考 <xref linkend="
+"\"mapping-column-read-and-write\" />。"
+
+#. Tag: title
+#: query_sql.xml:646
#, no-c-format
-msgid "Hibernate3 can use custom SQL for create, update, and delete operations. The SQL can be overridden at the statement level or inidividual column level. This section describes statement overrides. For columns, see <xref linkend=\"mapping-column-read-and-write\" />."
-msgstr "Hibernate3 可以自定义 create、update 和 delete 操作。SQL 可以在语句或单个字段级别进行覆盖。本节描述了语句覆盖。对于字段覆盖,请参考 <xref linkend=\"mapping-column-read-and-write\" />。"
+msgid "Custom CRUD via annotations"
+msgstr ""
-#. Tag: para
+#. Tag: programlisting
+#: query_sql.xml:648
#, no-c-format
-msgid "The class and collection persisters in Hibernate already contain a set of configuration time generated strings (insertsql, deletesql, updatesql etc.). The mapping tags <literal><sql-insert></literal>, <literal><sql-delete></literal>, and <literal><sql-update></literal> override these strings:"
-msgstr "Hibernate3 能够使用定制的 SQL 语句来执行 create,update 和 delete 操作。在 Hibernate 中,持久化的类和集合已经包含了一套配置期产生的语句(insertsql,deletesql,updatesql 等等),这些映射标记 <literal><sql-insert></literal>,<literal><sql-delete></literal> 和 <literal><sql-update></literal> 重载了这些语句。 "
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"@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"
+"@Loader(namedQuery = \"chaos\")\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
+#: query_sql.xml:651
#, no-c-format
-msgid "The SQL is directly executed in your database, so you can use any dialect you like. This will reduce the portability of your mapping if you use database specific SQL."
-msgstr "这些 SQL 直接在你的数据库里执行,所以你可以自由的使用你喜欢的任意语法。但如果你使用数据库特定的语法,这当然会降低你映射的可移植性。 "
+msgid ""
+"<literal>@SQLInsert</literal>, <literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>, <literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT, UPDATE, DELETE, and DELETE all statement. The same can "
+"be achieved using Hibernate mapping files and the <literal><sql-insert>"
+"</literal>, <literal><sql-update></literal> and <literal><sql-"
+"delete></literal> nodes. This can be seen in <xref linkend=\"example-"
+"custom-crdu-via-xml\"/>."
+msgstr ""
+#. Tag: title
+#: query_sql.xml:661
+#, no-c-format
+msgid "Custom CRUD XML"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:663
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
+"</sql-insert>\n"
+" <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
+"update>\n"
+" <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
+"</class>"
+
#. Tag: para
+#: query_sql.xml:666
#, no-c-format
-msgid "Stored procedures are supported if the <literal>callable</literal> attribute is set:"
-msgstr "如果设定 <literal>callable</literal>,则能够支持存储过程了。"
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to <constant>true</constant>. In "
+"annotations as well as in xml."
+msgstr ""
#. Tag: para
+#: query_sql.xml:670
#, no-c-format
-msgid "The order of the positional parameters is vital, as they must be in the same sequence as Hibernate expects them."
-msgstr "参数的位置顺序是非常重要的,他们必须和 Hibernate 所期待的顺序相同。 "
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
#. Tag: para
+#: query_sql.xml:675
#, no-c-format
-msgid "You can view 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 view the expected sequence, do not include your custom SQL in the mapping files, as this will override the Hibernate generated static SQL."
-msgstr "你能够通过设定日志调试级别为 <literal>org.hiberante.persister.entity</literal> 来查看 Hibernate 所期待的顺序。在这个级别下,Hibernate 将会打印出create,update 和 delete 实体的静态 SQL。(如果想看到预计的顺序。记得不要将定制 SQL 包含在映射文件里,因为他们会重载 Hibernate 生成的静态 SQL。) "
+msgid ""
+"none: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
#. Tag: para
+#: query_sql.xml:680
#, no-c-format
-msgid "The stored procedures are in most cases required to return the number of rows inserted, updated and deleted, as Hibernate has some runtime checks for the success of the statement. Hibernate always registers the first statement parameter as a numeric output parameter for the CUD operations:"
-msgstr "在大多数情况下(最好这么做),存储过程需要返回插入/更新/删除的行数,因为 Hibernate 对语句的成功执行有些运行时的检查。Hibernate 常会把进行 CUD 操作的语句的第一个参数注册为一个数值型输出参数。 "
+msgid "count: use of rowcount to check that the update is successful"
+msgstr ""
-#. Tag: title
+#. Tag: para
+#: query_sql.xml:685
#, no-c-format
-msgid "Custom SQL for loading"
-msgstr "定制装载 SQL"
+msgid ""
+"param: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
#. Tag: para
+#: query_sql.xml:690
#, no-c-format
-msgid "You can also declare your own SQL (or HQL) queries for entity loading. As with inserts, updates, and deletes, this can be done at the individual column level as described in <xref linkend=\"mapping-column-read-and-write\" /> or at the statement level. Here is an example of a statement level override:"
-msgstr "你也可以为实体加载声明自己的 SQL(或 HQL)。如 <xref linkend=\"mapping-column-read-and-write\" /> 所描述的,inserts、updates 和 deletes 可以在字段级别或语句级别来完成。下面是一个语句覆盖的例子:"
+msgid ""
+"To define the result check style, use the <literal>check</literal> parameter "
+"which is again available in annoations as well as in xml."
+msgstr ""
#. Tag: para
+#: query_sql.xml:693
#, no-c-format
-msgid "This is just a named query declaration, as discussed earlier. You can reference this named query in a class mapping:"
-msgstr "这只是一个前面讨论过的命名查询声明,你可以在类映射里引用这个命名查询。 "
+msgid ""
+"You can use the exact same set of annotations respectively xml nodes to "
+"override the collection related statements -see <xref linkend=\"example-"
+"overriding-sql-collections-annotations\"/>."
+msgstr ""
+#. Tag: title
+#: query_sql.xml:698
+#, no-c-format
+msgid "Overriding SQL statements for collections using annotations"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:701
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"@SQLInsert( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?"
+"\")\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:705
+#, fuzzy, no-c-format
+msgid ""
+"The parameter order is important and is defined by the order Hibernate "
+"handles 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 or mapping files "
+"as that will override the Hibernate generated static sql)"
+msgstr ""
+"你能够通过设定日志调试级别为 <literal>org.hiberante.persister.entity</"
+"literal> 来查看 Hibernate 所期待的顺序。在这个级别下,Hibernate 将会打印出"
+"create,update 和 delete 实体的静态 SQL。(如果想看到预计的顺序。记得不要将定"
+"制 SQL 包含在映射文件里,因为他们会重载 Hibernate 生成的静态 SQL。) "
+
+#. Tag: para
+#: query_sql.xml:715
#, no-c-format
-msgid "This even works with stored procedures."
-msgstr "这也可以用于存储过程"
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>@org.hibernate.annotations.Table</literal> and either (or all) "
+"attributes <literal>sqlInsert</literal>, <literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+#. Tag: title
+#: query_sql.xml:721
+#, no-c-format
+msgid "Overriding SQL statements for secondary tables"
+msgstr ""
+
+#. Tag: programlisting
+#: query_sql.xml:723
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"@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"
+" sqlInsert=@SQLInsert(sql=\"insert into Cat2(storyPart2, id) values"
+"(upper(?), ?)\") )\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
#. Tag: para
+#: query_sql.xml:726
#, no-c-format
-msgid "You can even define a query for collection loading:"
-msgstr "你甚至可以定一个用于集合装载的查询: "
+msgid ""
+"The previous example also shows that you can give a comment to a given table "
+"(primary or secondary): This comment will be used for DDL generation."
+msgstr ""
#. Tag: para
+#: query_sql.xml:731
+#, fuzzy, no-c-format
+msgid ""
+"The SQL is directly executed in your database, so you can use any dialect "
+"you like. This will, however, reduce the portability of your mapping if you "
+"use database specific SQL."
+msgstr ""
+"这些 SQL 直接在你的数据库里执行,所以你可以自由的使用你喜欢的任意语法。但如果"
+"你使用数据库特定的语法,这当然会降低你映射的可移植性。 "
+
+#. Tag: para
+#: query_sql.xml:736
+#, fuzzy, no-c-format
+msgid ""
+"Last but not least, stored procedures are in most cases required to return "
+"the number of rows inserted, updated and deleted. Hibernate always registers "
+"the first statement parameter as a numeric output parameter for the CUD "
+"operations:"
+msgstr ""
+"在大多数情况下(最好这么做),存储过程需要返回插入/更新/删除的行数,因为 "
+"Hibernate 对语句的成功执行有些运行时的检查。Hibernate 常会把进行 CUD 操作的语"
+"句的第一个参数注册为一个数值型输出参数。 "
+
+#. Tag: title
+#: query_sql.xml:742
#, no-c-format
-msgid "You can also define an entity loader that loads a collection by join fetching:"
-msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装载一个集合: "
+msgid "Stored procedures and their return value"
+msgstr ""
-#~ msgid ""
-#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
-#~ msgstr "你可能需要声明你自己的 SQL(或 HQL)来装载实体:"
+#. Tag: programlisting
+#: query_sql.xml:744
+#, fuzzy, no-c-format
+msgid ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
+msgstr ""
+"CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)\n"
+" RETURN NUMBER IS\n"
+"BEGIN\n"
+"\n"
+" update PERSON\n"
+" set\n"
+" NAME = uname,\n"
+" where\n"
+" ID = uid;\n"
+"\n"
+" return SQL%ROWCOUNT;\n"
+"\n"
+"END updatePerson;"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\").list();\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").list();"
+#. Tag: title
+#: query_sql.xml:749
+#, no-c-format
+msgid "Custom SQL for loading"
+msgstr "定制装载 SQL"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\", Hibernate.STRING)\n"
-#~ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\", Hibernate.STRING)\n"
-#~ " .addScalar(\"BIRTHDATE\", Hibernate.DATE)"
+#. Tag: para
+#: query_sql.xml:751
+#, fuzzy, no-c-format
+msgid ""
+"You can also declare your own SQL (or HQL) queries for entity loading. As "
+"with inserts, updates, and deletes, this can be done at the individual "
+"column level as described in <xref linkend=\"mapping-column-read-and-write\"/"
+"> or at the statement level. Here is an example of a statement level "
+"override:"
+msgstr ""
+"你也可以为实体加载声明自己的 SQL(或 HQL)。如 <xref linkend=\"mapping-"
+"column-read-and-write\" /> 所描述的,inserts、updates 和 deletes 可以在字段级"
+"别或语句级别来完成。下面是一个语句覆盖的例子:"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\")\n"
-#~ " .addScalar(\"BIRTHDATE\")\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\")\n"
-#~ " .addScalar(\"ID\", Hibernate.LONG)\n"
-#~ " .addScalar(\"NAME\")\n"
-#~ " .addScalar(\"BIRTHDATE\")"
+#. Tag: programlisting
+#: query_sql.xml:757
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
+" SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
+" FROM PERSON\n"
+" WHERE ID=?\n"
+" FOR UPDATE\n"
+"</sql-query>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat."
-#~ "class);\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity"
-#~ "(Cat.class);\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT * FROM CATS\").addEntity(Cat.class);\n"
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE FROM CATS\").addEntity"
-#~ "(Cat.class);"
+#. Tag: para
+#: query_sql.xml:759
+#, no-c-format
+msgid ""
+"This is just a named query declaration, as discussed earlier. You can "
+"reference this named query in a class mapping:"
+msgstr ""
+"这只是一个前面讨论过的命名查询声明,你可以在类映射里引用这个命名查询。 "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM "
-#~ "CATS\").addEntity(Cat.class);\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS\")."
-#~ "addEntity(Cat.class);"
+#. Tag: programlisting
+#: query_sql.xml:762
+#, fuzzy, no-c-format
+msgid ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
+msgstr ""
+"<class name=\"Person\">\n"
+" <id name=\"id\">\n"
+" <generator class=\"increment\"/>\n"
+" </id>\n"
+" <property name=\"name\" not-null=\"true\"/>\n"
+" <loader query-ref=\"person\"/>\n"
+"</class>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, "
-#~ "D_ID, D_NAME FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dog\");\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME "
-#~ "FROM CATS c, DOGS d \n"
-#~ " WHERE c.DOG_ID = d.D_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dog\");"
+#. Tag: para
+#: query_sql.xml:764
+#, no-c-format
+msgid "This even works with stored procedures."
+msgstr "这也可以用于存储过程"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, "
-#~ "CAT_ID FROM CATS c, DOGS d WHERE c.ID = d.CAT_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dogs\");\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID "
-#~ "FROM CATS c, DOGS d\n"
-#~ " WHERE c.ID = d.CAT_ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addJoin(\"cat.dogs\");"
+#. Tag: para
+#: query_sql.xml:766
+#, no-c-format
+msgid "You can even define a query for collection loading:"
+msgstr "你甚至可以定一个用于集合装载的查询: "
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE "
-#~ "c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT c.*, m.* FROM CATS c, CATS m WHERE c."
-#~ "MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)"
+#. Tag: programlisting
+#: query_sql.xml:768
+#, fuzzy, no-c-format
+msgid ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
+msgstr ""
+"<set name=\"employments\" inverse=\"true\">\n"
+" <key/>\n"
+" <one-to-many class=\"Employment\"/>\n"
+" <loader query-ref=\"employments\"/>\n"
+"</set>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, "
-#~ "CATS m WHERE c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m "
-#~ "WHERE c.MOTHER_ID = c.ID\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class)"
+#. Tag: programlisting
+#: query_sql.xml:770
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"employments\">\n"
+" <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
+" SELECT {emp.*}\n"
+" FROM EMPLOYMENT emp\n"
+" WHERE EMPLOYER = :id\n"
+" ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
+"</sql-query>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
-#~ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother."
-#~ "*} \" +\n"
-#~ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
-#~ "\n"
-#~ "List loggedCats = sess.createSQLQuery(sql)\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class).list()\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "String sql = \"SELECT ID as {c.id}, NAME as {c.name}, \" + \n"
-#~ " \"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother."
-#~ "*} \" +\n"
-#~ " \"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID\";\n"
-#~ "\n"
-#~ "List loggedCats = sess.createSQLQuery(sql)\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ " .addEntity(\"mother\", Cat.class).list()"
+#. Tag: para
+#: query_sql.xml:772
+#, no-c-format
+msgid ""
+"You can also define an entity loader that loads a collection by join "
+"fetching:"
+msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装载一个集合: "
-#, fuzzy
-#~ msgid "A_NAME as {item.name}"
+#. Tag: programlisting
+#: query_sql.xml:775
+#, fuzzy, no-c-format
+msgid ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+msgstr ""
+"<sql-query name=\"person\">\n"
+" <return alias=\"pers\" class=\"Person\"/>\n"
+" <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
+" SELECT NAME AS {pers.*}, {emp.*}\n"
+" FROM PERSON pers\n"
+" LEFT OUTER JOIN EMPLOYMENT emp\n"
+" ON pers.ID = emp.PERSON_ID\n"
+" WHERE ID=?\n"
+"</sql-query>"
+
+#. Tag: para
+#: query_sql.xml:777
+#, no-c-format
+msgid ""
+"The annotation equivalent <literal><loader></literal> is the @Loader "
+"annotation as seen in <xref linkend=\"example-custom-crdu-via-annotations\"/"
+">."
+msgstr ""
+
+#~ msgid "<literal>A_NAME as {item.name}</literal>"
#~ msgstr "<literal>A_NAME as {item.name}</literal>"
-#, fuzzy
-#~ msgid "{[aliasname].class}"
+#~ msgid "<literal>{[aliasname].class}</literal>"
#~ msgstr "<literal>{[aliasname].class}</literal>"
-#, fuzzy
-#~ msgid "DISC as {item.class}"
+#~ msgid "<literal>DISC as {item.class}</literal>"
#~ msgstr "<literal>DISC as {item.class}</literal>"
-#, fuzzy
-#~ msgid "{[aliasname].*}"
+#~ msgid "<literal>{[aliasname].*}</literal>"
#~ msgstr "<literal>{[aliasname].*}</literal>"
-#~ msgid "{item.*}"
-#~ msgstr "{item.*}"
-#, fuzzy
-#~ msgid "{[aliasname].key}"
+#~ msgid "<literal>{item.*}</literal>"
+#~ msgstr "<literal>{item.*}</literal>"
+
+#~ msgid "<literal>{[aliasname].key}</literal>"
#~ msgstr "<literal>{[aliasname].key}</literal>"
-#, fuzzy
-#~ msgid "ORGID as {coll.key}"
+#~ msgid "<literal>ORGID as {coll.key}</literal>"
#~ msgstr "<literal>ORGID as {coll.key}</literal>"
-#, fuzzy
-#~ msgid "{[aliasname].id}"
+#~ msgid "<literal>{[aliasname].id}</literal>"
#~ msgstr "<literal>{[aliasname].id}</literal>"
-#, fuzzy
-#~ msgid "EMPID as {coll.id}"
+#~ msgid "<literal>EMPID as {coll.id}</literal>"
#~ msgstr "<literal>EMPID as {coll.id}</literal>"
-#, fuzzy
-#~ msgid "{[aliasname].element}"
+#~ msgid "<literal>{[aliasname].element}</literal>"
#~ msgstr "<literal>{[aliasname].element}</literal>"
-#, fuzzy
-#~ msgid "XID as {coll.element}"
+#~ msgid "<literal>XID as {coll.element}</literal>"
#~ msgstr "<literal>XID as {coll.element}</literal>"
-#, fuzzy
-#~ msgid "NAME as {coll.element.name}"
+#~ msgid "<literal>NAME as {coll.element.name}</literal>"
#~ msgstr "<literal>NAME as {coll.element.name}</literal>"
-#, fuzzy
-#~ msgid "{[aliasname].element.*}"
+#~ msgid "<literal>{[aliasname].element.*}</literal>"
#~ msgstr "<literal>{[aliasname].element.*}</literal>"
-#, fuzzy
-#~ msgid "{coll.element.*}"
-#~ msgstr "{coll.*}"
-#~ msgid "{coll.*}"
-#~ msgstr "{coll.*}"
+#~ msgid "<literal>{coll.element.*}</literal>"
+#~ msgstr "<literal>{coll.element.*}</literal>"
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
-#~ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))]]>"
-#~ msgstr ""
-#~ "sess.createSQLQuery(\"SELECT NAME, BIRTHDATE FROM CATS\")\n"
-#~ " .setResultTransformer(Transformers.aliasToBean(CatDTO.class))"
+#~ msgid "<literal>{coll.*}</literal>"
+#~ msgstr "<literal>{coll.*}</literal>"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE "
-#~ "NAME like ?\").addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(0, \"Pus%\").list();\n"
-#~ " \n"
-#~ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
-#~ "addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(\"name\", \"Pus%\").list(); ]]>"
+#~ "The class and collection persisters in Hibernate already contain a set of "
+#~ "configuration time generated strings (insertsql, deletesql, updatesql "
+#~ "etc.). The mapping tags <literal><sql-insert></literal>, "
+#~ "<literal><sql-delete></literal>, and <literal><sql-update></"
+#~ "literal> override these strings:"
#~ msgstr ""
-#~ "Query query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like ?"
-#~ "\").addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(0, \"Pus%\").list();\n"
-#~ " \n"
-#~ "query = sess.createSQLQuery(\"SELECT * FROM CATS WHERE NAME like :name\")."
-#~ "addEntity(Cat.class);\n"
-#~ "List pusList = query.setString(\"name\", \"Pus%\").list();"
+#~ "Hibernate3 能够使用定制的 SQL 语句来执行 create,update 和 delete 操作。"
+#~ "在 Hibernate 中,持久化的类和集合已经包含了一套配置期产生的语句"
+#~ "(insertsql,deletesql,updatesql 等等),这些映射标记 <literal><sql-"
+#~ "insert></literal>,<literal><sql-delete></literal> 和 "
+#~ "<literal><sql-update></literal> 重载了这些语句。 "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"persons\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex}\n"
-#~ " FROM PERSON person\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"persons\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex}\n"
-#~ " FROM PERSON person\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
+#~ "Stored procedures are supported if the <literal>callable</literal> "
+#~ "attribute is set:"
+#~ msgstr "如果设定 <literal>callable</literal>,则能够支持存储过程了。"
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[List people = sess.getNamedQuery(\"persons\")\n"
-#~ " .setString(\"namePattern\", namePattern)\n"
-#~ " .setMaxResults(50)\n"
-#~ " .list();]]>"
+#~ "The order of the positional parameters is vital, as they must be in the "
+#~ "same sequence as Hibernate expects them."
#~ msgstr ""
-#~ "List people = sess.getNamedQuery(\"persons\")\n"
-#~ " .setString(\"namePattern\", namePattern)\n"
-#~ " .setMaxResults(50)\n"
-#~ " .list();"
+#~ "参数的位置顺序是非常重要的,他们必须和 Hibernate 所期待的顺序相同。 "
-#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"personsWith\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " address.STREET AS {address.street},\n"
-#~ " address.CITY AS {address.city},\n"
-#~ " address.STATE AS {address.state},\n"
-#~ " address.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS address\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"personsWith\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/"
-#~ ">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " adddress.STREET AS {address.street},\n"
-#~ " adddress.CITY AS {address.city},\n"
-#~ " adddress.STATE AS {address.state},\n"
-#~ " adddress.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS adddress\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
+#~ "You can also declare your own SQL (or HQL) queries for entity loading:"
+#~ msgstr "你可能需要声明你自己的 SQL(或 HQL)来装载实体:"
#, fuzzy
#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"mySqlQuery\">\n"
-#~ " <return-scalar column=\"name\" type=\"string\"/>\n"
-#~ " <return-scalar column=\"age\" type=\"long\"/>\n"
-#~ " SELECT p.NAME AS name,\n"
-#~ " p.AGE AS age,\n"
-#~ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"mySqlQuery\">\n"
-#~ " <return-scalar column=\"name\" type=\"string\"/>\n"
-#~ " <return-scalar column=\"age\" type=\"long\"/>\n"
-#~ " SELECT p.NAME AS name,\n"
-#~ " p.AGE AS age,\n"
-#~ " FROM PERSON p WHERE p.NAME LIKE 'Hiber%'\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<resultset name=\"personAddress\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/>\n"
-#~ "</resultset>\n"
-#~ "\n"
-#~ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " address.STREET AS {address.street},\n"
-#~ " address.CITY AS {address.city},\n"
-#~ " address.STATE AS {address.state},\n"
-#~ " address.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS address\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<resultset name=\"personAddress\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\"/>\n"
-#~ " <return-join alias=\"address\" property=\"person.mailingAddress\"/"
-#~ ">\n"
-#~ "</resultset>\n"
-#~ "\n"
-#~ "<sql-query name=\"personsWith\" resultset-ref=\"personAddress\">\n"
-#~ " SELECT person.NAME AS {person.name},\n"
-#~ " person.AGE AS {person.age},\n"
-#~ " person.SEX AS {person.sex},\n"
-#~ " adddress.STREET AS {address.street},\n"
-#~ " adddress.CITY AS {address.city},\n"
-#~ " adddress.STATE AS {address.state},\n"
-#~ " adddress.ZIP AS {address.zip}\n"
-#~ " FROM PERSON person\n"
-#~ " JOIN ADDRESS adddress\n"
-#~ " ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'\n"
-#~ " WHERE person.NAME LIKE :namePattern\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[List cats = sess.createSQLQuery(\n"
-#~ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where "
-#~ "kitten.mother = cat.id\"\n"
-#~ " )\n"
-#~ " .setResultSetMapping(\"catAndKitten\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "List cats = sess.createSQLQuery(\n"
-#~ " \"select {cat.*}, {kitten.*} from cats cat, cats kitten where "
-#~ "kitten.mother = cat.id\"\n"
-#~ " )\n"
-#~ " .setResultSetMapping(\"catAndKitten\")\n"
-#~ " .list();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"mySqlQuery\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\">\n"
-#~ " <return-property name=\"name\" column=\"myName\"/>\n"
-#~ " <return-property name=\"age\" column=\"myAge\"/>\n"
-#~ " <return-property name=\"sex\" column=\"mySex\"/>\n"
-#~ " </return>\n"
-#~ " SELECT person.NAME AS myName,\n"
-#~ " person.AGE AS myAge,\n"
-#~ " person.SEX AS mySex,\n"
-#~ " FROM PERSON person WHERE person.NAME LIKE :name\n"
-#~ "</sql-query>\n"
-#~ "]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"mySqlQuery\">\n"
-#~ " <return alias=\"person\" class=\"eg.Person\">\n"
-#~ " <return-property name=\"name\" column=\"myName\"/>\n"
-#~ " <return-property name=\"age\" column=\"myAge\"/>\n"
-#~ " <return-property name=\"sex\" column=\"mySex\"/>\n"
-#~ " </return>\n"
-#~ " SELECT person.NAME AS myName,\n"
-#~ " person.AGE AS myAge,\n"
-#~ " person.SEX AS mySex,\n"
-#~ " FROM PERSON person WHERE person.NAME LIKE :name\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"organizationCurrentEmployments\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
-#~ " </return>\n"
-#~ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
-#~ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
-#~ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT\n"
-#~ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
-#~ " ORDER BY STARTDATE ASC\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"organizationCurrentEmployments\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " <return-property name=\"endDate\" column=\"myEndDate\"/>\n"
-#~ " </return>\n"
-#~ " SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},\n"
-#~ " STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},\n"
-#~ " REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT\n"
-#~ " WHERE EMPLOYER = :id AND ENDDATE IS NULL\n"
-#~ " ORDER BY STARTDATE ASC\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[CREATE OR REPLACE FUNCTION selectAllEmployments\n"
-#~ " RETURN SYS_REFCURSOR\n"
-#~ "AS\n"
-#~ " st_cursor SYS_REFCURSOR;\n"
-#~ "BEGIN\n"
-#~ " OPEN st_cursor FOR\n"
-#~ " SELECT EMPLOYEE, EMPLOYER,\n"
-#~ " STARTDATE, ENDDATE,\n"
-#~ " REGIONCODE, EID, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT;\n"
-#~ " RETURN st_cursor;\n"
-#~ " END;]]>"
-#~ msgstr ""
-#~ "CREATE OR REPLACE FUNCTION selectAllEmployments\n"
-#~ " RETURN SYS_REFCURSOR\n"
-#~ "AS\n"
-#~ " st_cursor SYS_REFCURSOR;\n"
-#~ "BEGIN\n"
-#~ " OPEN st_cursor FOR\n"
-#~ " SELECT EMPLOYEE, EMPLOYER,\n"
-#~ " STARTDATE, ENDDATE,\n"
-#~ " REGIONCODE, EID, VALUE, CURRENCY\n"
-#~ " FROM EMPLOYMENT;\n"
-#~ " RETURN st_cursor;\n"
-#~ " END;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
-#~ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
-#~ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
-#~ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
-#~ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/>\n"
-#~ " <return-property name=\"id\" column=\"EID\"/>\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " </return>\n"
-#~ " { ? = call selectAllEmployments() }\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"selectAllEmployees_SP\" callable=\"true\">\n"
-#~ " <return alias=\"emp\" class=\"Employment\">\n"
-#~ " <return-property name=\"employee\" column=\"EMPLOYEE\"/>\n"
-#~ " <return-property name=\"employer\" column=\"EMPLOYER\"/>\n"
-#~ " <return-property name=\"startDate\" column=\"STARTDATE\"/>\n"
-#~ " <return-property name=\"endDate\" column=\"ENDDATE\"/>\n"
-#~ " <return-property name=\"regionCode\" column=\"REGIONCODE\"/"
-#~ ">\n"
-#~ " <return-property name=\"id\" column=\"EID\"/>\n"
-#~ " <return-property name=\"salary\">\n"
-#~ " <return-column name=\"VALUE\"/>\n"
-#~ " <return-column name=\"CURRENCY\"/>\n"
-#~ " </return-property>\n"
-#~ " </return>\n"
-#~ " { ? = call selectAllEmployments() }\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
#~ "<![CDATA[<class name=\"Person\">\n"
#~ " <id name=\"id\">\n"
#~ " <generator class=\"increment\"/>\n"
#~ " </id>\n"
#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</sql-"
-#~ "insert>\n"
-#~ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-update>\n"
-#~ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )"
-#~ "</sql-insert>\n"
-#~ " <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-"
-#~ "update>\n"
-#~ " <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
#~ " <sql-insert callable=\"true\">{call createPerson (?, ?)}</sql-"
#~ "insert>\n"
#~ " <sql-delete callable=\"true\">{? = call deletePerson (?)}</sql-"
@@ -1129,127 +2239,3 @@
#~ " <sql-update callable=\"true\">{? = call updatePerson (?, ?)}"
#~ "</sql-update>\n"
#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN "
-#~ "VARCHAR2)\n"
-#~ " RETURN NUMBER IS\n"
-#~ "BEGIN\n"
-#~ "\n"
-#~ " update PERSON\n"
-#~ " set\n"
-#~ " NAME = uname,\n"
-#~ " where\n"
-#~ " ID = uid;\n"
-#~ "\n"
-#~ " return SQL%ROWCOUNT;\n"
-#~ "\n"
-#~ "END updatePerson;]]>"
-#~ msgstr ""
-#~ "CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN "
-#~ "VARCHAR2)\n"
-#~ " RETURN NUMBER IS\n"
-#~ "BEGIN\n"
-#~ "\n"
-#~ " update PERSON\n"
-#~ " set\n"
-#~ " NAME = uname,\n"
-#~ " where\n"
-#~ " ID = uid;\n"
-#~ "\n"
-#~ " return SQL%ROWCOUNT;\n"
-#~ "\n"
-#~ "END updatePerson;"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/>\n"
-#~ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
-#~ " FROM PERSON\n"
-#~ " WHERE ID=?\n"
-#~ " FOR UPDATE\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\" lock-mode=\"upgrade\"/"
-#~ ">\n"
-#~ " SELECT NAME AS {pers.name}, ID AS {pers.id}\n"
-#~ " FROM PERSON\n"
-#~ " WHERE ID=?\n"
-#~ " FOR UPDATE\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <loader query-ref=\"person\"/>\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"Person\">\n"
-#~ " <id name=\"id\">\n"
-#~ " <generator class=\"increment\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"name\" not-null=\"true\"/>\n"
-#~ " <loader query-ref=\"person\"/>\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<set name=\"employments\" inverse=\"true\">\n"
-#~ " <key/>\n"
-#~ " <one-to-many class=\"Employment\"/>\n"
-#~ " <loader query-ref=\"employments\"/>\n"
-#~ "</set>]]>"
-#~ msgstr ""
-#~ "<set name=\"employments\" inverse=\"true\">\n"
-#~ " <key/>\n"
-#~ " <one-to-many class=\"Employment\"/>\n"
-#~ " <loader query-ref=\"employments\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"employments\">\n"
-#~ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
-#~ " SELECT {emp.*}\n"
-#~ " FROM EMPLOYMENT emp\n"
-#~ " WHERE EMPLOYER = :id\n"
-#~ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"employments\">\n"
-#~ " <load-collection alias=\"emp\" role=\"Person.employments\"/>\n"
-#~ " SELECT {emp.*}\n"
-#~ " FROM EMPLOYMENT emp\n"
-#~ " WHERE EMPLOYER = :id\n"
-#~ " ORDER BY STARTDATE ASC, EMPLOYEE ASC\n"
-#~ "</sql-query>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\"/>\n"
-#~ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
-#~ " SELECT NAME AS {pers.*}, {emp.*}\n"
-#~ " FROM PERSON pers\n"
-#~ " LEFT OUTER JOIN EMPLOYMENT emp\n"
-#~ " ON pers.ID = emp.PERSON_ID\n"
-#~ " WHERE ID=?\n"
-#~ "</sql-query>]]>"
-#~ msgstr ""
-#~ "<sql-query name=\"person\">\n"
-#~ " <return alias=\"pers\" class=\"Person\"/>\n"
-#~ " <return-join alias=\"emp\" property=\"pers.employments\"/>\n"
-#~ " SELECT NAME AS {pers.*}, {emp.*}\n"
-#~ " FROM PERSON pers\n"
-#~ " LEFT OUTER JOIN EMPLOYMENT emp\n"
-#~ " ON pers.ID = emp.PERSON_ID\n"
-#~ " WHERE ID=?\n"
-#~ "</sql-query>"
-
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/session_api.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/session_api.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/session_api.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: session_api\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:48\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 09:58+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -16,1328 +16,2528 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "与对象共事"
#. Tag: para
+#: session_api.xml:33
#, no-c-format
-msgid "Hibernate is a full object/relational mapping solution that not only shields the developer from the details of the underlying database management system, but also offers <emphasis>state management</emphasis> of objects. This is, contrary to the management of SQL <literal>statements</literal> in common JDBC/SQL persistence layers, a natural object-oriented view of persistence in Java applications."
-msgstr "Hibernate 是完整的对象/关系映射解决方案,它提供了对象<emphasis>状态管理(state management)</emphasis>的功能,使开发者不再需要理会底层数据库系统的细节。也就是说,相对于常见的 JDBC/SQL 持久层方案中需要<literal>管理 SQL 语句</literal>,Hibernate 采用了更自然的面向对象的视角来持久化 Java 应用中的数据。 "
+msgid ""
+"Hibernate is a full object/relational mapping solution that not only shields "
+"the developer from the details of the underlying database management system, "
+"but also offers <emphasis>state management</emphasis> of objects. This is, "
+"contrary to the management of SQL <literal>statements</literal> in common "
+"JDBC/SQL persistence layers, a natural object-oriented view of persistence "
+"in Java applications."
+msgstr ""
+"Hibernate 是完整的对象/关系映射解决方案,它提供了对象<emphasis>状态管理"
+"(state management)</emphasis>的功能,使开发者不再需要理会底层数据库系统的细"
+"节。也就是说,相对于常见的 JDBC/SQL 持久层方案中需要<literal>管理 SQL 语句</"
+"literal>,Hibernate 采用了更自然的面向对象的视角来持久化 Java 应用中的数据。 "
#. Tag: para
+#: session_api.xml:40
#, no-c-format
-msgid "In other words, Hibernate application developers should always think about the <emphasis>state</emphasis> of their objects, and not necessarily about the execution of SQL statements. This part is taken care of by Hibernate and is only relevant for the application developer when tuning the performance of the system."
-msgstr "换句话说,使用 Hibernate 的开发者应该总是关注对象的<emphasis>状态(state)</emphasis>,不必考虑 SQL 语句的执行。这部分细节已经由 Hibernate 掌管妥当,只有开发者在进行系统性能调优的时候才需要进行了解。"
+msgid ""
+"In other words, Hibernate application developers should always think about "
+"the <emphasis>state</emphasis> of their objects, and not necessarily about "
+"the execution of SQL statements. This part is taken care of by Hibernate and "
+"is only relevant for the application developer when tuning the performance "
+"of the system."
+msgstr ""
+"换句话说,使用 Hibernate 的开发者应该总是关注对象的<emphasis>状态(state)</"
+"emphasis>,不必考虑 SQL 语句的执行。这部分细节已经由 Hibernate 掌管妥当,只有"
+"开发者在进行系统性能调优的时候才需要进行了解。"
#. Tag: title
+#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "Hibernate 对象状态(object states)"
#. Tag: para
+#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr "Hibernate 定义并支持下列对象状态(state):"
#. Tag: para
+#: session_api.xml:53
#, no-c-format
-msgid "<emphasis>Transient</emphasis> - an object is transient if it has just been instantiated using the <literal>new</literal> operator, and it is not associated with a Hibernate <literal>Session</literal>. It has no persistent representation in the database and no identifier value has been assigned. Transient instances will be destroyed by the garbage collector if the application does not hold a reference anymore. Use the Hibernate <literal>Session</literal> to make an object persistent (and let Hibernate take care of the SQL statements that need to be executed for this transition)."
-msgstr "<emphasis>瞬时(Transient)</emphasis> — 由 <literal>new</literal> 操作符创建,且尚未与Hibernate <literal>Session</literal> 关联的对象被认定为瞬时(Transient)的。瞬时(Transient)对象不会被持久化到数据库中,也不会被赋予持久化标识(identifier)。 如果瞬时(Transient)对象在程序中没有被引用,它会被垃圾回收器(garbage collector)销毁。 使用 Hibernate <literal>Session</literal>可以将其变为持久(Persistent)状态。(Hibernate会自动执行必要的SQL语句) "
+msgid ""
+"<emphasis>Transient</emphasis> - an object is transient if it has just been "
+"instantiated using the <literal>new</literal> operator, and it is not "
+"associated with a Hibernate <literal>Session</literal>. It has no persistent "
+"representation in the database and no identifier value has been assigned. "
+"Transient instances will be destroyed by the garbage collector if the "
+"application does not hold a reference anymore. Use the Hibernate "
+"<literal>Session</literal> to make an object persistent (and let Hibernate "
+"take care of the SQL statements that need to be executed for this "
+"transition)."
+msgstr ""
+"<emphasis>瞬时(Transient)</emphasis> — 由 <literal>new</literal> 操作符创"
+"建,且尚未与Hibernate <literal>Session</literal> 关联的对象被认定为瞬时"
+"(Transient)的。瞬时(Transient)对象不会被持久化到数据库中,也不会被赋予持"
+"久化标识(identifier)。 如果瞬时(Transient)对象在程序中没有被引用,它会被"
+"垃圾回收器(garbage collector)销毁。 使用 Hibernate <literal>Session</"
+"literal>可以将其变为持久(Persistent)状态。(Hibernate会自动执行必要的SQL语"
+"句) "
#. Tag: para
+#: session_api.xml:65
#, no-c-format
-msgid "<emphasis>Persistent</emphasis> - a persistent instance has a representation in the database and an identifier value. It might just have been saved or loaded, however, it is by definition in the scope of a <literal>Session</literal>. Hibernate will detect any changes made to an object in persistent state and synchronize the state with the database when the unit of work completes. Developers do not execute manual <literal>UPDATE</literal> statements, or <literal>DELETE</literal> statements when an object should be made transient."
-msgstr "<emphasis>持久(Persistent)</emphasis> — 持久(Persistent)的实例在数据库中有对应的记录,并拥有一个持久化标识(identifier)。 持久(Persistent)的实例可能是刚被保存的,或刚被加载的,无论哪一种,按定义,它存在于相关联的<literal>Session</literal>作用范围内。 Hibernate会检测到处于持久(Persistent)状态的对象的任何改动,在当前操作单元(unit of work)执行完毕时将对象数据(state)与数据库同步(synchronize)。 开发者不需要手动执行<literal>UPDATE</literal>。将对象从持久(Persistent)状态变成瞬时(Transient)状态同样也不需要手动执行 <literal>DELETE</literal> 语句。 "
+msgid ""
+"<emphasis>Persistent</emphasis> - a persistent instance has a representation "
+"in the database and an identifier value. It might just have been saved or "
+"loaded, however, it is by definition in the scope of a <literal>Session</"
+"literal>. Hibernate will detect any changes made to an object in persistent "
+"state and synchronize the state with the database when the unit of work "
+"completes. Developers do not execute manual <literal>UPDATE</literal> "
+"statements, or <literal>DELETE</literal> statements when an object should be "
+"made transient."
+msgstr ""
+"<emphasis>持久(Persistent)</emphasis> — 持久(Persistent)的实例在数据库中"
+"有对应的记录,并拥有一个持久化标识(identifier)。 持久(Persistent)的实例可"
+"能是刚被保存的,或刚被加载的,无论哪一种,按定义,它存在于相关联的"
+"<literal>Session</literal>作用范围内。 Hibernate会检测到处于持久"
+"(Persistent)状态的对象的任何改动,在当前操作单元(unit of work)执行完毕时"
+"将对象数据(state)与数据库同步(synchronize)。 开发者不需要手动执行"
+"<literal>UPDATE</literal>。将对象从持久(Persistent)状态变成瞬时"
+"(Transient)状态同样也不需要手动执行 <literal>DELETE</literal> 语句。 "
#. Tag: para
+#: session_api.xml:77
#, no-c-format
-msgid "<emphasis>Detached</emphasis> - a detached instance is an object that has been persistent, but its <literal>Session</literal> has been closed. The reference to the object is still valid, of course, and the detached instance might even be modified in this state. A detached instance can be reattached to a new <literal>Session</literal> at a later point in time, making it (and all the modifications) persistent again. This feature enables a programming model for long running units of work that require user think-time. We call them <emphasis>application transactions</emphasis>, i.e., a unit of work from the point of view of the user."
-msgstr "<emphasis>脱管(Detached)</emphasis> — 与持久(Persistent)对象关联的<literal>Session</literal>被关闭后,对象就变为脱管(Detached)的。对脱管(Detached)对象的引用依然有效,对象可继续被修改。脱管(Detached)对象如果重新关联到某个新的 <literal>Session</literal> 上, 会再次转变为持久(Persistent)的(在Detached其间的改动将被持久化到数据库)。 这个功能使得一种编程模型,即中间会给用户思考时间(user think-time)的长时间运行的操作单元(unit of work)的编程模型成为可能。我们称之为<emphasis>应用程序事务</emphasis>,即从用户观点看是一个操作单元(unit of work)。 "
+msgid ""
+"<emphasis>Detached</emphasis> - a detached instance is an object that has "
+"been persistent, but its <literal>Session</literal> has been closed. The "
+"reference to the object is still valid, of course, and the detached instance "
+"might even be modified in this state. A detached instance can be reattached "
+"to a new <literal>Session</literal> at a later point in time, making it (and "
+"all the modifications) persistent again. This feature enables a programming "
+"model for long running units of work that require user think-time. We call "
+"them <emphasis>application transactions</emphasis>, i.e., a unit of work "
+"from the point of view of the user."
+msgstr ""
+"<emphasis>脱管(Detached)</emphasis> — 与持久(Persistent)对象关联的"
+"<literal>Session</literal>被关闭后,对象就变为脱管(Detached)的。对脱管"
+"(Detached)对象的引用依然有效,对象可继续被修改。脱管(Detached)对象如果重"
+"新关联到某个新的 <literal>Session</literal> 上, 会再次转变为持久"
+"(Persistent)的(在Detached其间的改动将被持久化到数据库)。 这个功能使得一种"
+"编程模型,即中间会给用户思考时间(user think-time)的长时间运行的操作单元"
+"(unit of work)的编程模型成为可能。我们称之为<emphasis>应用程序事务</"
+"emphasis>,即从用户观点看是一个操作单元(unit of work)。 "
#. Tag: para
+#: session_api.xml:90
#, no-c-format
-msgid "We will now discuss the states and state transitions (and the Hibernate methods that trigger a transition) in more detail."
-msgstr "接下来我们来细致地讨论下状态(states)及状态间的转换(state transitions)(以及触发状态转换的 Hibernate 方法)。 "
+msgid ""
+"We will now discuss the states and state transitions (and the Hibernate "
+"methods that trigger a transition) in more detail."
+msgstr ""
+"接下来我们来细致地讨论下状态(states)及状态间的转换(state transitions)(以"
+"及触发状态转换的 Hibernate 方法)。 "
#. Tag: title
+#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "使对象持久化"
#. Tag: para
+#: session_api.xml:97
#, no-c-format
-msgid "Newly instantiated instances of a persistent class are considered <emphasis>transient</emphasis> by Hibernate. We can make a transient instance <emphasis>persistent</emphasis> by associating it with a session:"
-msgstr "Hibernate 认为持久化类(persistent class)新实例化的对象是<emphasis>瞬时(Transient)</emphasis>的。我们可通过将瞬时(Transient)对象与 session 关联而把它变为<emphasis>持久的(Persistent)</emphasis>。"
+msgid ""
+"Newly instantiated instances of a persistent class are considered "
+"<emphasis>transient</emphasis> by Hibernate. We can make a transient "
+"instance <emphasis>persistent</emphasis> by associating it with a session:"
+msgstr ""
+"Hibernate 认为持久化类(persistent class)新实例化的对象是<emphasis>瞬时"
+"(Transient)</emphasis>的。我们可通过将瞬时(Transient)对象与 session 关联"
+"而把它变为<emphasis>持久的(Persistent)</emphasis>。"
+#. Tag: programlisting
+#: session_api.xml:102
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);"
+msgstr ""
+"<![CDATA[DomesticCat fritz = new DomesticCat();\n"
+"fritz.setColor(Color.GINGER);\n"
+"fritz.setSex('M');\n"
+"fritz.setName(\"Fritz\");\n"
+"Long generatedId = (Long) sess.save(fritz);]]>"
+
#. Tag: para
+#: session_api.xml:104
#, no-c-format
-msgid "If <literal>Cat</literal> has a generated identifier, the identifier is generated and assigned to the <literal>cat</literal> when <literal>save()</literal> is called. If <literal>Cat</literal> has an <literal>assigned</literal> identifier, or a composite key, the identifier should be assigned to the <literal>cat</literal> instance before calling <literal>save()</literal>. You can also use <literal>persist()</literal> instead of <literal>save()</literal>, with the semantics defined in the EJB3 early draft."
-msgstr "如果 <literal>Cat</literal> 的持久化标识(identifier)是 <literal>generated</literal> 类型的, 那么该标识(identifier)会自动在 <literal>save()</literal> 被调用时产生并分配给 <literal>cat</literal>。如果 <literal>Cat</literal> 的持久化标识(identifier)是<literal>assigned</literal>类型的,或是一个复合主键(composite key),那么该标识(identifier)应当在调用 <literal>save()</literal> 之前手动赋予给 <literal>cat</literal>。你也可以按照 EJB3 early draft 中定义的语义,使用 <literal>persist()</literal> 替代<literal>save()</literal>。 "
+msgid ""
+"If <literal>Cat</literal> has a generated identifier, the identifier is "
+"generated and assigned to the <literal>cat</literal> when <literal>save()</"
+"literal> is called. If <literal>Cat</literal> has an <literal>assigned</"
+"literal> identifier, or a composite key, the identifier should be assigned "
+"to the <literal>cat</literal> instance before calling <literal>save()</"
+"literal>. You can also use <literal>persist()</literal> instead of "
+"<literal>save()</literal>, with the semantics defined in the EJB3 early "
+"draft."
+msgstr ""
+"如果 <literal>Cat</literal> 的持久化标识(identifier)是 <literal>generated</"
+"literal> 类型的, 那么该标识(identifier)会自动在 <literal>save()</literal> "
+"被调用时产生并分配给 <literal>cat</literal>。如果 <literal>Cat</literal> 的持"
+"久化标识(identifier)是<literal>assigned</literal>类型的,或是一个复合主键"
+"(composite key),那么该标识(identifier)应当在调用 <literal>save()</"
+"literal> 之前手动赋予给 <literal>cat</literal>。你也可以按照 EJB3 early "
+"draft 中定义的语义,使用 <literal>persist()</literal> 替代<literal>save()</"
+"literal>。 "
#. Tag: para
+#: session_api.xml:115
#, no-c-format
-msgid "<literal>persist()</literal> makes a transient instance persistent. However, it does not guarantee that the identifier value will be assigned to the persistent instance immediately, the assignment might happen at flush time. <literal>persist()</literal> also guarantees that it will not execute an <literal>INSERT</literal> statement if it is called outside of transaction boundaries. This is useful in long-running conversations with an extended Session/persistence context."
-msgstr "<literal>persist()</literal> 使一个临时实例持久化。然而,它不保证立即把标识符值分配给持久性实例,这会发生在冲刷(flush)的时候。<literal>persist()</literal> 也保证它在事务边界外调用时不会执行 <literal>INSERT</literal> 语句。这对于长期运行的带有扩展会话/持久化上下文的会话是很有用的。"
+msgid ""
+"<literal>persist()</literal> makes a transient instance persistent. However, "
+"it does not guarantee that the identifier value will be assigned to the "
+"persistent instance immediately, the assignment might happen at flush time. "
+"<literal>persist()</literal> also guarantees that it will not execute an "
+"<literal>INSERT</literal> statement if it is called outside of transaction "
+"boundaries. This is useful in long-running conversations with an extended "
+"Session/persistence context."
+msgstr ""
+"<literal>persist()</literal> 使一个临时实例持久化。然而,它不保证立即把标识符"
+"值分配给持久性实例,这会发生在冲刷(flush)的时候。<literal>persist()</"
+"literal> 也保证它在事务边界外调用时不会执行 <literal>INSERT</literal> 语句。"
+"这对于长期运行的带有扩展会话/持久化上下文的会话是很有用的。"
#. Tag: para
+#: session_api.xml:126
#, no-c-format
-msgid "<literal>save()</literal> does guarantee to return an identifier. If an INSERT has to be executed to get the identifier ( e.g. \"identity\" generator, not \"sequence\"), this INSERT happens immediately, no matter if you are inside or outside of a transaction. This is problematic in a long-running conversation with an extended Session/persistence context."
-msgstr "<literal>save()</literal> 保证返回一个标识符。如果需要运行 INSERT 来获取标识符(如 \"identity\" 而非 \"sequence\" 生成器),这个 INSERT 将立即执行,不管你是否在事务内部还是外部。这对于长期运行的带有扩展会话/持久化上下文的会话来说会出现问题。"
+msgid ""
+"<literal>save()</literal> does guarantee to return an identifier. If an "
+"INSERT has to be executed to get the identifier ( e.g. \"identity\" "
+"generator, not \"sequence\"), this INSERT happens immediately, no matter if "
+"you are inside or outside of a transaction. This is problematic in a long-"
+"running conversation with an extended Session/persistence context."
+msgstr ""
+"<literal>save()</literal> 保证返回一个标识符。如果需要运行 INSERT 来获取标识"
+"符(如 \"identity\" 而非 \"sequence\" 生成器),这个 INSERT 将立即执行,不管"
+"你是否在事务内部还是外部。这对于长期运行的带有扩展会话/持久化上下文的会话来说"
+"会出现问题。"
#. Tag: para
+#: session_api.xml:135
#, no-c-format
-msgid "Alternatively, you can assign the identifier using an overloaded version of <literal>save()</literal>."
+msgid ""
+"Alternatively, you can assign the identifier using an overloaded version of "
+"<literal>save()</literal>."
msgstr "此外,你可以用一个重载版本的 <literal>save()</literal> 方法。 "
+#. Tag: programlisting
+#: session_api.xml:138
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );"
+msgstr ""
+"<![CDATA[DomesticCat pk = new DomesticCat();\n"
+"pk.setColor(Color.TABBY);\n"
+"pk.setSex('F');\n"
+"pk.setName(\"PK\");\n"
+"pk.setKittens( new HashSet() );\n"
+"pk.addKitten(fritz);\n"
+"sess.save( pk, new Long(1234) );]]>"
+
#. Tag: para
+#: session_api.xml:140
#, no-c-format
-msgid "If the object you make persistent has associated objects (e.g. the <literal>kittens</literal> collection in the previous example), these objects can be made persistent in any order you like unless you have a <literal>NOT NULL</literal> constraint upon a foreign key column. There is never a risk of violating foreign key constraints. However, you might violate a <literal>NOT NULL</literal> constraint if you <literal>save()</literal> the objects in the wrong order."
-msgstr "如果你持久化的对象有关联的对象(associated objects)(例如上例中的 <literal>kittens</literal> 集合) 那么对这些对象(译注:pk 和 kittens)进行持久化的顺序是任意的(也就是说可以先对 kittens 进行持久化也可以先对 pk 进行持久化), 除非你在外键列上有 <literal>NOT NULL</literal> 约束。 Hibernate 不会违反外键约束,但是如果你用错误的顺序持久化对象(译注:在 pk 持久化之前持久化kitten),那么可能会违反 <literal>NOT NULL</literal> 约束。 "
+msgid ""
+"If the object you make persistent has associated objects (e.g. the "
+"<literal>kittens</literal> collection in the previous example), these "
+"objects can be made persistent in any order you like unless you have a "
+"<literal>NOT NULL</literal> constraint upon a foreign key column. There is "
+"never a risk of violating foreign key constraints. However, you might "
+"violate a <literal>NOT NULL</literal> constraint if you <literal>save()</"
+"literal> the objects in the wrong order."
+msgstr ""
+"如果你持久化的对象有关联的对象(associated objects)(例如上例中的 "
+"<literal>kittens</literal> 集合) 那么对这些对象(译注:pk 和 kittens)进行持"
+"久化的顺序是任意的(也就是说可以先对 kittens 进行持久化也可以先对 pk 进行持久"
+"化), 除非你在外键列上有 <literal>NOT NULL</literal> 约束。 Hibernate 不会违"
+"反外键约束,但是如果你用错误的顺序持久化对象(译注:在 pk 持久化之前持久化"
+"kitten),那么可能会违反 <literal>NOT NULL</literal> 约束。 "
#. Tag: para
+#: session_api.xml:148
#, no-c-format
-msgid "Usually you do not bother with this detail, as you will normally use Hibernate's <emphasis>transitive persistence</emphasis> feature to save the associated objects automatically. Then, even <literal>NOT NULL</literal> constraint violations do not occur - Hibernate will take care of everything. Transitive persistence is discussed later in this chapter."
-msgstr "通常你不会为这些细节烦心,因为你很可能会使用 Hibernate 的<emphasis>传播性持久化(transitive persistence)</emphasis>功能自动保存相关联那些对象。这样连违反 <literal>NOT NULL</literal> 约束的情况都不会出现了 — Hibernate 会管好所有的事情。传播性持久化(transitive persistence)将在本章稍后讨论。"
+msgid ""
+"Usually you do not bother with this detail, as you will normally use "
+"Hibernate's <emphasis>transitive persistence</emphasis> feature to save the "
+"associated objects automatically. Then, even <literal>NOT NULL</literal> "
+"constraint violations do not occur - Hibernate will take care of everything. "
+"Transitive persistence is discussed later in this chapter."
+msgstr ""
+"通常你不会为这些细节烦心,因为你很可能会使用 Hibernate 的<emphasis>传播性持久"
+"化(transitive persistence)</emphasis>功能自动保存相关联那些对象。这样连违"
+"反 <literal>NOT NULL</literal> 约束的情况都不会出现了 — Hibernate 会管好所有"
+"的事情。传播性持久化(transitive persistence)将在本章稍后讨论。"
#. Tag: title
+#: session_api.xml:157
#, no-c-format
msgid "Loading an object"
msgstr "装载对象"
#. Tag: para
+#: session_api.xml:159
#, no-c-format
-msgid "The <literal>load()</literal> methods of <literal>Session</literal> provide a way of retrieving a persistent instance if you know its identifier. <literal>load()</literal> takes a class object and loads the state into a newly instantiated instance of that class in a persistent state."
-msgstr "如果你知道某个实例的持久化标识(identifier),你就可以使用 <literal>Session</literal> 的 <literal>load()</literal> 方法来获取它。<literal>load()</literal> 的另一个参数是指定类的对象。本方法会创建指定类的持久化实例,并从数据库加载其数据(state)。 "
+msgid ""
+"The <literal>load()</literal> methods of <literal>Session</literal> provide "
+"a way of retrieving a persistent instance if you know its identifier. "
+"<literal>load()</literal> takes a class object and loads the state into a "
+"newly instantiated instance of that class in a persistent state."
+msgstr ""
+"如果你知道某个实例的持久化标识(identifier),你就可以使用 <literal>Session</"
+"literal> 的 <literal>load()</literal> 方法来获取它。<literal>load()</"
+"literal> 的另一个参数是指定类的对象。本方法会创建指定类的持久化实例,并从数据"
+"库加载其数据(state)。 "
+#. Tag: programlisting
+#: session_api.xml:165
+#, fuzzy, no-c-format
+msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
+msgstr "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"
+
+#. Tag: programlisting
+#: session_api.xml:167
+#, fuzzy, no-c-format
+msgid ""
+"// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
+msgstr ""
+"<![CDATA[// you need to wrap primitive identifiers\n"
+"long id = 1234;\n"
+"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
+"(id) );]]>"
+
#. Tag: para
+#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
-msgstr "此外,你可以把数据(state)加载到指定的对象实例上(覆盖掉该实例原来的数据)。"
+msgstr ""
+"此外,你可以把数据(state)加载到指定的对象实例上(覆盖掉该实例原来的数据)。"
+#. Tag: programlisting
+#: session_api.xml:171
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();"
+msgstr ""
+"<![CDATA[Cat cat = new DomesticCat();\n"
+"// load pk's state into cat\n"
+"sess.load( cat, new Long(pkId) );\n"
+"Set kittens = cat.getKittens();]]>"
+
#. Tag: para
+#: session_api.xml:173
#, no-c-format
-msgid "Be aware that <literal>load()</literal> will throw an unrecoverable exception if there is no matching database row. If the class is mapped with a proxy, <literal>load()</literal> just returns an uninitialized proxy and does not actually hit the database until you invoke a method of the proxy. This is useful if you wish to create an association to an object without actually loading it from the database. It also allows multiple instances to be loaded as a batch if <literal>batch-size</literal> is defined for the class mapping."
-msgstr "请注意如果没有匹配的数据库记录,<literal>load()</literal> 方法可能抛出无法恢复的异常(unrecoverable exception)。如果类的映射使用了代理(proxy),<literal>load()</literal> 方法会返回一个未初始化的代理,直到你调用该代理的某方法时才会去访问数据库。 若你希望在某对象中创建一个指向另一个对象的关联,又不想在从数据库中装载该对象时同时装载相关联的那个对象,那么这种操作方式就用得上的了。如果为相应类映射关系设置了 <literal>batch-size</literal>,那么使用这种操作方式允许多个对象被一批装载(因为返回的是代理,无需从数据库中抓取所有对象的数据)。 "
+msgid ""
+"Be aware that <literal>load()</literal> will throw an unrecoverable "
+"exception if there is no matching database row. If the class is mapped with "
+"a proxy, <literal>load()</literal> just returns an uninitialized proxy and "
+"does not actually hit the database until you invoke a method of the proxy. "
+"This is useful if you wish to create an association to an object without "
+"actually loading it from the database. It also allows multiple instances to "
+"be loaded as a batch if <literal>batch-size</literal> is defined for the "
+"class mapping."
+msgstr ""
+"请注意如果没有匹配的数据库记录,<literal>load()</literal> 方法可能抛出无法恢"
+"复的异常(unrecoverable exception)。如果类的映射使用了代理(proxy),"
+"<literal>load()</literal> 方法会返回一个未初始化的代理,直到你调用该代理的某"
+"方法时才会去访问数据库。 若你希望在某对象中创建一个指向另一个对象的关联,又不"
+"想在从数据库中装载该对象时同时装载相关联的那个对象,那么这种操作方式就用得上"
+"的了。如果为相应类映射关系设置了 <literal>batch-size</literal>,那么使用这种"
+"操作方式允许多个对象被一批装载(因为返回的是代理,无需从数据库中抓取所有对象"
+"的数据)。 "
#. Tag: para
+#: session_api.xml:182
#, no-c-format
-msgid "If you are not certain that a matching row exists, you should use the <literal>get()</literal> method which hits the database immediately and returns null if there is no matching row."
-msgstr "如果你不确定是否有匹配的行存在,应该使用 <literal>get()</literal> 方法,它会立刻访问数据库,如果没有对应的记录,会返回 null。 "
+msgid ""
+"If you are not certain that a matching row exists, you should use the "
+"<literal>get()</literal> method which hits the database immediately and "
+"returns null if there is no matching row."
+msgstr ""
+"如果你不确定是否有匹配的行存在,应该使用 <literal>get()</literal> 方法,它会"
+"立刻访问数据库,如果没有对应的记录,会返回 null。 "
+#. Tag: programlisting
+#: session_api.xml:186
+#, fuzzy, no-c-format
+msgid ""
+"Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;"
+msgstr ""
+"<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id);\n"
+"if (cat==null) {\n"
+" cat = new Cat();\n"
+" sess.save(cat, id);\n"
+"}\n"
+"return cat;]]>"
+
#. Tag: para
+#: session_api.xml:188
#, no-c-format
-msgid "You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</literal>, using a <literal>LockMode</literal>. See the API documentation for more information."
-msgstr "你甚至可以选用某个 <literal>LockMode</literal>,用 SQL 的 <literal>SELECT ... FOR UPDATE</literal> 装载对象。 请查阅 API 文档以获取更多信息。 "
+msgid ""
+"You can even load an object using an SQL <literal>SELECT ... FOR UPDATE</"
+"literal>, using a <literal>LockMode</literal>. See the API documentation for "
+"more information."
+msgstr ""
+"你甚至可以选用某个 <literal>LockMode</literal>,用 SQL 的 "
+"<literal>SELECT ... FOR UPDATE</literal> 装载对象。 请查阅 API 文档以获取更多"
+"信息。 "
+#. Tag: programlisting
+#: session_api.xml:192
+#, fuzzy, no-c-format
+msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
+msgstr "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);]]>"
+
#. Tag: para
+#: session_api.xml:194
#, no-c-format
-msgid "Any associated instances or contained collections will <emphasis>not</emphasis> be selected <literal>FOR UPDATE</literal>, unless you decide to specify <literal>lock</literal> or <literal>all</literal> as a cascade style for the association."
-msgstr "注意,任何关联的对象或者包含的集合都<emphasis>不会</emphasis>被以 <literal>FOR UPDATE</literal> 方式返回, 除非你指定了 <literal>lock</literal> 或者 <literal>all</literal> 作为关联(association)的级联风格(cascade style)。 "
+msgid ""
+"Any associated instances or contained collections will <emphasis>not</"
+"emphasis> be selected <literal>FOR UPDATE</literal>, unless you decide to "
+"specify <literal>lock</literal> or <literal>all</literal> as a cascade style "
+"for the association."
+msgstr ""
+"注意,任何关联的对象或者包含的集合都<emphasis>不会</emphasis>被以 "
+"<literal>FOR UPDATE</literal> 方式返回, 除非你指定了 <literal>lock</"
+"literal> 或者 <literal>all</literal> 作为关联(association)的级联风格"
+"(cascade style)。 "
#. Tag: para
+#: session_api.xml:199
#, no-c-format
-msgid "It is possible to re-load an object and all its collections at any time, using the <literal>refresh()</literal> method. This is useful when database triggers are used to initialize some of the properties of the object."
-msgstr "任何时候都可以使用 <literal>refresh()</literal> 方法强迫装载对象和它的集合。如果你使用数据库触发器功能来处理对象的某些属性,这个方法就很有用了。"
+msgid ""
+"It is possible to re-load an object and all its collections at any time, "
+"using the <literal>refresh()</literal> method. This is useful when database "
+"triggers are used to initialize some of the properties of the object."
+msgstr ""
+"任何时候都可以使用 <literal>refresh()</literal> 方法强迫装载对象和它的集合。"
+"如果你使用数据库触发器功能来处理对象的某些属性,这个方法就很有用了。"
+#. Tag: programlisting
+#: session_api.xml:204
+#, fuzzy, no-c-format
+msgid ""
+"sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)"
+msgstr ""
+"<![CDATA[sess.save(cat);\n"
+"sess.flush(); //force the SQL INSERT\n"
+"sess.refresh(cat); //re-read the state (after the trigger executes)]]>"
+
#. Tag: para
-#, no-c-format
-msgid "How much does Hibernate load from the database and how many SQL <literal>SELECT</literal>s will it use? This depends on the <emphasis>fetching strategy</emphasis>. This is explained in <xref linkend=\"performance-fetching\" />."
-msgstr "此处通常会出现一个重要问题: Hibernate 会从数据库中装载多少东西?会执行多少条相应的 SQL<literal>SELECT</literal> 语句?这取决于<emphasis>抓取策略(fetching strategy)</emphasis>,我们会在 <xref linkend=\"performance-fetching\" /> 中解释。 "
+#: session_api.xml:206
+#, fuzzy, no-c-format
+msgid ""
+"How much does Hibernate load from the database and how many SQL "
+"<literal>SELECT</literal>s will it use? This depends on the "
+"<emphasis>fetching strategy</emphasis>. This is explained in <xref linkend="
+"\"performance-fetching\"/>."
+msgstr ""
+"此处通常会出现一个重要问题: Hibernate 会从数据库中装载多少东西?会执行多少条"
+"相应的 SQL<literal>SELECT</literal> 语句?这取决于<emphasis>抓取策略"
+"(fetching strategy)</emphasis>,我们会在 <xref linkend=\"performance-"
+"fetching\" /> 中解释。 "
#. Tag: title
+#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "查询"
#. Tag: para
+#: session_api.xml:215
#, no-c-format
-msgid "If you do not know the identifiers of the objects you are looking for, you need a query. Hibernate supports an easy-to-use but powerful object oriented query language (HQL). For programmatic query creation, Hibernate supports a sophisticated Criteria and Example query feature (QBC and QBE). You can also express your query in the native SQL of your database, with optional support from Hibernate for result set conversion into objects."
-msgstr "如果不知道所要寻找的对象的持久化标识,那么你需要使用查询。Hibernate 支持强大且易于使用的面向对象查询语言(HQL)。如果希望通过编程的方式创建查询,Hibernate 提供了完善的按条件(Query By Criteria,QBC)以及按样例(Query By Example,QBE)进行查询的功能。你也可以用原生 SQL(native SQL)描述查询,Hibernate 额外提供了将结果集(result set)转化为对象的支持。 "
+msgid ""
+"If you do not know the identifiers of the objects you are looking for, you "
+"need a query. Hibernate supports an easy-to-use but powerful object oriented "
+"query language (HQL). For programmatic query creation, Hibernate supports a "
+"sophisticated Criteria and Example query feature (QBC and QBE). You can also "
+"express your query in the native SQL of your database, with optional support "
+"from Hibernate for result set conversion into objects."
+msgstr ""
+"如果不知道所要寻找的对象的持久化标识,那么你需要使用查询。Hibernate 支持强大"
+"且易于使用的面向对象查询语言(HQL)。如果希望通过编程的方式创建查询,"
+"Hibernate 提供了完善的按条件(Query By Criteria,QBC)以及按样例(Query By "
+"Example,QBE)进行查询的功能。你也可以用原生 SQL(native SQL)描述查询,"
+"Hibernate 额外提供了将结果集(result set)转化为对象的支持。 "
#. Tag: title
+#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "执行查询"
#. Tag: para
+#: session_api.xml:226
#, no-c-format
-msgid "HQL and native SQL queries are represented with an instance of <literal>org.hibernate.Query</literal>. This interface offers methods for parameter binding, result set handling, and for the execution of the actual query. You always obtain a <literal>Query</literal> using the current <literal>Session</literal>:"
-msgstr "HQL 和原生 SQL(native SQL)查询要通过为 <literal>org.hibernate.Query</literal> 的实例来表达。 这个接口提供了参数绑定、结果集处理以及运行实际查询的方法。你总是可以通过当前 <literal>Session</literal> 获取一个 <literal>Query</literal> 对象:"
+msgid ""
+"HQL and native SQL queries are represented with an instance of <literal>org."
+"hibernate.Query</literal>. This interface offers methods for parameter "
+"binding, result set handling, and for the execution of the actual query. You "
+"always obtain a <literal>Query</literal> using the current <literal>Session</"
+"literal>:"
+msgstr ""
+"HQL 和原生 SQL(native SQL)查询要通过为 <literal>org.hibernate.Query</"
+"literal> 的实例来表达。 这个接口提供了参数绑定、结果集处理以及运行实际查询的"
+"方法。你总是可以通过当前 <literal>Session</literal> 获取一个 <literal>Query</"
+"literal> 对象:"
+#. Tag: programlisting
+#: session_api.xml:232
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
+msgstr ""
+"<![CDATA[List cats = session.createQuery(\n"
+" \"from Cat as cat where cat.birthdate < ?\")\n"
+" .setDate(0, date)\n"
+" .list();\n"
+"\n"
+"List mothers = session.createQuery(\n"
+" \"select mother from Cat as cat join cat.mother as mother where cat.name "
+"= ?\")\n"
+" .setString(0, name)\n"
+" .list();\n"
+"\n"
+"List kittens = session.createQuery(\n"
+" \"from Cat as cat where cat.mother = ?\")\n"
+" .setEntity(0, pk)\n"
+" .list();\n"
+"\n"
+"Cat mother = (Cat) session.createQuery(\n"
+" \"select cat.mother from Cat as cat where cat = ?\")\n"
+" .setEntity(0, izi)\n"
+" .uniqueResult();]]\n"
+"\n"
+"Query mothersWithKittens = (Cat) session.createQuery(\n"
+" \"select mother from Cat as mother left join fetch mother.kittens\");\n"
+"Set uniqueMothers = new HashSet(mothersWithKittens.list());]]>"
+
#. Tag: para
+#: session_api.xml:234
#, no-c-format
-msgid "A query is usually executed by invoking <literal>list()</literal>. The result of the query will be loaded completely into a collection in memory. Entity instances retrieved by a query are in a persistent state. The <literal>uniqueResult()</literal> method offers a shortcut if you know your query will only return a single object. Queries that make use of eager fetching of collections usually return duplicates of the root objects, but with their collections initialized. You can filter these duplicates through a <literal>Set</literal>."
-msgstr "一个查询通常在调用 <literal>list()</literal> 时被执行,执行结果会完全装载进内存中的一个集合(collection)。查询返回的对象处于持久(persistent)状态。如果你知道的查询只会返回一个对象,可使用 <literal>list()</literal> 的快捷方式 <literal>uniqueResult()</literal>。注意,使用集合预先抓取的查询往往会返回多次根对象(他们的集合类都被初始化了)。你可以通过一个<literal>集合(Set)</literal>来过滤这些重复对象。"
+msgid ""
+"A query is usually executed by invoking <literal>list()</literal>. The "
+"result of the query will be loaded completely into a collection in memory. "
+"Entity instances retrieved by a query are in a persistent state. The "
+"<literal>uniqueResult()</literal> method offers a shortcut if you know your "
+"query will only return a single object. Queries that make use of eager "
+"fetching of collections usually return duplicates of the root objects, but "
+"with their collections initialized. You can filter these duplicates through "
+"a <literal>Set</literal>."
+msgstr ""
+"一个查询通常在调用 <literal>list()</literal> 时被执行,执行结果会完全装载进内"
+"存中的一个集合(collection)。查询返回的对象处于持久(persistent)状态。如果"
+"你知道的查询只会返回一个对象,可使用 <literal>list()</literal> 的快捷方式 "
+"<literal>uniqueResult()</literal>。注意,使用集合预先抓取的查询往往会返回多次"
+"根对象(他们的集合类都被初始化了)。你可以通过一个<literal>集合(Set)</"
+"literal>来过滤这些重复对象。"
#. Tag: title
+#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "迭代式获取结果(Iterating results)"
#. Tag: para
+#: session_api.xml:246
#, no-c-format
-msgid "Occasionally, you might be able to achieve better performance by executing the query using the <literal>iterate()</literal> method. This will usually be the case if you expect that the actual entity instances returned by the query will already be in the session or second-level cache. If they are not already cached, <literal>iterate()</literal> will be slower than <literal>list()</literal> and might require many database hits for a simple query, usually <emphasis>1</emphasis> for the initial select which only returns identifiers, and <emphasis>n</emphasis> additional selects to initialize the actual instances."
-msgstr "某些情况下,你可以使用 <literal>iterate()</literal> 方法得到更好的性能。 这通常是你预期返回的结果在 session,或二级缓存(second-level cache)中已经存在时的情况。如若不然,<literal>iterate()</literal> 会比 <literal>list()</literal> 慢,而且可能简单查询也需要进行多次数据库访问:<literal>iterate()</literal> 会首先使用 <emphasis>1</emphasis> 条语句得到所有对象的持久化标识(identifiers),再根据持久化标识执行 <emphasis>n</emphasis> 条附加的 select 语句实例化实际的对象。 "
+msgid ""
+"Occasionally, you might be able to achieve better performance by executing "
+"the query using the <literal>iterate()</literal> method. This will usually "
+"be the case if you expect that the actual entity instances returned by the "
+"query will already be in the session or second-level cache. If they are not "
+"already cached, <literal>iterate()</literal> will be slower than "
+"<literal>list()</literal> and might require many database hits for a simple "
+"query, usually <emphasis>1</emphasis> for the initial select which only "
+"returns identifiers, and <emphasis>n</emphasis> additional selects to "
+"initialize the actual instances."
+msgstr ""
+"某些情况下,你可以使用 <literal>iterate()</literal> 方法得到更好的性能。 这通"
+"常是你预期返回的结果在 session,或二级缓存(second-level cache)中已经存在时"
+"的情况。如若不然,<literal>iterate()</literal> 会比 <literal>list()</"
+"literal> 慢,而且可能简单查询也需要进行多次数据库访问:<literal>iterate()</"
+"literal> 会首先使用 <emphasis>1</emphasis> 条语句得到所有对象的持久化标识"
+"(identifiers),再根据持久化标识执行 <emphasis>n</emphasis> 条附加的 select "
+"语句实例化实际的对象。 "
+#. Tag: programlisting
+#: session_api.xml:257
+#, fuzzy, no-c-format
+msgid ""
+"// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}"
+msgstr ""
+"<![CDATA[// fetch ids\n"
+"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
+"iterate();\n"
+"while ( iter.hasNext() ) {\n"
+" Qux qux = (Qux) iter.next(); // fetch the object\n"
+" // something we couldnt express in the query\n"
+" if ( qux.calculateComplicatedAlgorithm() ) {\n"
+" // delete the current instance\n"
+" iter.remove();\n"
+" // dont need to process the rest\n"
+" break;\n"
+" }\n"
+"}]]>"
+
#. Tag: title
+#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "返回元组(tuples)的查询"
#. Tag: para
+#: session_api.xml:263
#, no-c-format
-msgid "Hibernate queries sometimes return tuples of objects. Each tuple is returned as an array:"
-msgstr "(译注:元组(tuples)指一条结果行包含多个对象) Hibernate 查询有时返回元组(tuples),每个元组(tuples)以数组的形式返回: "
+msgid ""
+"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
+"as an array:"
+msgstr ""
+"(译注:元组(tuples)指一条结果行包含多个对象) Hibernate 查询有时返回元组"
+"(tuples),每个元组(tuples)以数组的形式返回: "
+#. Tag: programlisting
+#: session_api.xml:266
+#, fuzzy, no-c-format
+msgid ""
+"Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}"
+msgstr ""
+"<![CDATA[Iterator kittensAndMothers = sess.createQuery(\n"
+" \"select kitten, mother from Cat kitten join kitten.mother mother"
+"\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( kittensAndMothers.hasNext() ) {\n"
+" Object[] tuple = (Object[]) kittensAndMothers.next();\n"
+" Cat kitten = (Cat) tuple[0];\n"
+" Cat mother = (Cat) tuple[1];\n"
+" ....\n"
+"}]]>"
+
#. Tag: title
+#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "标量(Scalar)结果"
#. Tag: para
+#: session_api.xml:272
#, no-c-format
-msgid "Queries can specify a property of a class in the <literal>select</literal> clause. They can even call SQL aggregate functions. Properties or aggregates are considered \"scalar\" results and not entities in persistent state."
-msgstr "查询可在 <literal>select</literal> 从句中指定类的属性,甚至可以调用 SQL 统计(aggregate)函数。属性或统计结果被认定为\"标量(Scalar)\"的结果(而不是持久(persistent state)的实体)。 "
+msgid ""
+"Queries can specify a property of a class in the <literal>select</literal> "
+"clause. They can even call SQL aggregate functions. Properties or aggregates "
+"are considered \"scalar\" results and not entities in persistent state."
+msgstr ""
+"查询可在 <literal>select</literal> 从句中指定类的属性,甚至可以调用 SQL 统计"
+"(aggregate)函数。属性或统计结果被认定为\"标量(Scalar)\"的结果(而不是持久"
+"(persistent state)的实体)。 "
+#. Tag: programlisting
+#: session_api.xml:277
+#, fuzzy, no-c-format
+msgid ""
+"Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}"
+msgstr ""
+"<![CDATA[Iterator results = sess.createQuery(\n"
+" \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
+"+\n"
+" \"group by cat.color\")\n"
+" .list()\n"
+" .iterator();\n"
+"\n"
+"while ( results.hasNext() ) {\n"
+" Object[] row = (Object[]) results.next();\n"
+" Color type = (Color) row[0];\n"
+" Date oldest = (Date) row[1];\n"
+" Integer count = (Integer) row[2];\n"
+" .....\n"
+"}]]>"
+
#. Tag: title
+#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "绑定参数"
#. Tag: para
+#: session_api.xml:283
#, no-c-format
-msgid "Methods on <literal>Query</literal> are provided for binding values to named parameters or JDBC-style <literal>?</literal> parameters. <emphasis>Contrary to JDBC, Hibernate numbers parameters from zero.</emphasis> Named parameters are identifiers of the form <literal>:name</literal> in the query string. The advantages of named parameters are as follows:"
-msgstr "接口 <literal>Query</literal> 提供了对命名参数(named parameters)、JDBC 风格的<literal>问号(?)</literal>参数进行绑定的方法。<emphasis>不同于 JDBC,Hibernate 对参数从 0 开始计数。</emphasis> 命名参数(named parameters)在查询字符串中是形如 <literal>:name</literal> 的标识符。命名参数(named parameters)的优点是: "
+msgid ""
+"Methods on <literal>Query</literal> are provided for binding values to named "
+"parameters or JDBC-style <literal>?</literal> parameters. <emphasis>Contrary "
+"to JDBC, Hibernate numbers parameters from zero.</emphasis> Named parameters "
+"are identifiers of the form <literal>:name</literal> in the query string. "
+"The advantages of named parameters are as follows:"
+msgstr ""
+"接口 <literal>Query</literal> 提供了对命名参数(named parameters)、JDBC 风格"
+"的<literal>问号(?)</literal>参数进行绑定的方法。<emphasis>不同于 JDBC,"
+"Hibernate 对参数从 0 开始计数。</emphasis> 命名参数(named parameters)在查询"
+"字符串中是形如 <literal>:name</literal> 的标识符。命名参数(named "
+"parameters)的优点是: "
#. Tag: para
+#: session_api.xml:292
#, no-c-format
-msgid "named parameters are insensitive to the order they occur in the query string"
+msgid ""
+"named parameters are insensitive to the order they occur in the query string"
msgstr "命名参数(named parameters)与其在查询串中出现的顺序无关"
#. Tag: para
+#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "它们可在同一查询串中多次出现 "
#. Tag: para
+#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "它们本身是自我说明的"
+#. Tag: programlisting
+#: session_api.xml:305
+#, fuzzy, no-c-format
+msgid ""
+"//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+"<![CDATA[//named parameter (preferred)\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
+"\");\n"
+"q.setString(\"name\", \"Fritz\");\n"
+"Iterator cats = q.iterate();]]>"
+
+#. Tag: programlisting
+#: session_api.xml:307
+#, fuzzy, no-c-format
+msgid ""
+"//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();"
+msgstr ""
+"<![CDATA[//positional parameter\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
+"q.setString(0, \"Izi\");\n"
+"Iterator cats = q.iterate();]]>"
+
+#. Tag: programlisting
+#: session_api.xml:309
+#, fuzzy, no-c-format
+msgid ""
+"//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();"
+msgstr ""
+"<![CDATA[//named parameter list\n"
+"List names = new ArrayList();\n"
+"names.add(\"Izi\");\n"
+"names.add(\"Fritz\");\n"
+"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
+"namesList)\");\n"
+"q.setParameterList(\"namesList\", names);\n"
+"List cats = q.list();]]>"
+
#. Tag: title
+#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "分页"
#. Tag: para
+#: session_api.xml:315
#, no-c-format
-msgid "If you need to specify bounds upon your result set, that is, the maximum number of rows you want to retrieve and/or the first row you want to retrieve, you can use methods of the <literal>Query</literal> interface:"
-msgstr "如果你需要指定结果集的范围(希望返回的最大行数/或开始的行数),应该使用 <literal>Query</literal> 接口提供的方法: "
+msgid ""
+"If you need to specify bounds upon your result set, that is, the maximum "
+"number of rows you want to retrieve and/or the first row you want to "
+"retrieve, you can use methods of the <literal>Query</literal> interface:"
+msgstr ""
+"如果你需要指定结果集的范围(希望返回的最大行数/或开始的行数),应该使用 "
+"<literal>Query</literal> 接口提供的方法: "
+#. Tag: programlisting
+#: session_api.xml:320
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();"
+msgstr ""
+"<![CDATA[Query q = sess.createQuery(\"from DomesticCat cat\");\n"
+"q.setFirstResult(20);\n"
+"q.setMaxResults(10);\n"
+"List cats = q.list();]]>"
+
#. Tag: para
+#: session_api.xml:322
#, no-c-format
-msgid "Hibernate knows how to translate this limit query into the native SQL of your DBMS."
-msgstr "Hibernate 知道如何将这个有限定条件的查询转换成你的数据库的原生 SQL(native SQL)。"
+msgid ""
+"Hibernate knows how to translate this limit query into the native SQL of "
+"your DBMS."
+msgstr ""
+"Hibernate 知道如何将这个有限定条件的查询转换成你的数据库的原生 SQL(native "
+"SQL)。"
#. Tag: title
+#: session_api.xml:327
#, no-c-format
msgid "Scrollable iteration"
msgstr "可滚动遍历(Scrollable iteration)"
#. Tag: para
+#: session_api.xml:329
#, no-c-format
-msgid "If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the <literal>Query</literal> interface can be used to obtain a <literal>ScrollableResults</literal> object that allows flexible navigation of the query results."
-msgstr "如果你的 JDBC 驱动支持可滚动的 <literal>ResuleSet</literal>,<literal>Query</literal> 接口可以使用 <literal>ScrollableResults</literal>,允许你在查询结果中灵活游走。 "
+msgid ""
+"If your JDBC driver supports scrollable <literal>ResultSet</literal>s, the "
+"<literal>Query</literal> interface can be used to obtain a "
+"<literal>ScrollableResults</literal> object that allows flexible navigation "
+"of the query results."
+msgstr ""
+"如果你的 JDBC 驱动支持可滚动的 <literal>ResuleSet</literal>,<literal>Query</"
+"literal> 接口可以使用 <literal>ScrollableResults</literal>,允许你在查询结果"
+"中灵活游走。 "
+#. Tag: programlisting
+#: session_api.xml:334
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
+"( cats.get(1) );\n"
+"\n"
+"}\n"
+"cats.close()"
+msgstr ""
+"<![CDATA[Query q = sess.createQuery(\"select cat.name, cat from DomesticCat "
+"cat \" +\n"
+" \"order by cat.name\");\n"
+"ScrollableResults cats = q.scroll();\n"
+"if ( cats.first() ) {\n"
+"\n"
+" // find the first name on each page of an alphabetical list of cats by "
+"name\n"
+" firstNamesOfPages = new ArrayList();\n"
+" do {\n"
+" String name = cats.getString(0);\n"
+" firstNamesOfPages.add(name);\n"
+" }\n"
+" while ( cats.scroll(PAGE_SIZE) );\n"
+"\n"
+" // Now get the first page of cats\n"
+" pageOfCats = new ArrayList();\n"
+" cats.beforeFirst();\n"
+" int i=0;\n"
+" while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add( cats.get"
+"(1) );\n"
+"\n"
+"}\n"
+"cats.close()]]>"
+
#. Tag: para
+#: session_api.xml:336
#, no-c-format
-msgid "Note that an open database connection and cursor is required for this functionality. Use <literal>setMaxResult()</literal>/<literal>setFirstResult()</literal> if you need offline pagination functionality."
-msgstr "请注意,使用此功能需要保持数据库连接(以及游标(cursor))处于一直打开状态。如果你需要断开连接使用分页功能,请使用 <literal>setMaxResult()</literal>/<literal>setFirstResult()</literal>。 "
+msgid ""
+"Note that an open database connection and cursor is required for this "
+"functionality. Use <literal>setMaxResult()</literal>/<literal>setFirstResult"
+"()</literal> if you need offline pagination functionality."
+msgstr ""
+"请注意,使用此功能需要保持数据库连接(以及游标(cursor))处于一直打开状态。"
+"如果你需要断开连接使用分页功能,请使用 <literal>setMaxResult()</literal>/"
+"<literal>setFirstResult()</literal>。 "
#. Tag: title
+#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "外置命名查询(Externalizing named queries)"
#. Tag: para
+#: session_api.xml:345
#, no-c-format
-msgid "You can also define named queries in the mapping document. Remember to use a <literal>CDATA</literal> section if your query contains characters that could be interpreted as markup."
-msgstr "你可以在映射文件中定义命名查询(named queries)。如果你的查询串中包含可能被解释为 XML 标记(markup)的字符,别忘了用<literal>CDATA</literal>包裹起来。"
+msgid ""
+"Queries can also be configured as so called named queries using annotations "
+"or Hibernate mapping documents. <literal>@NamedQuery</literal> and "
+"<literal>@NamedQueries</literal> can be defined at the class level as seen "
+"in <xref linkend=\"example-named-query-annotation\"/> . 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: title
+#: session_api.xml:355
+#, no-c-format
+msgid "Defining a named query using <classname>@NamedQuery</classname>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:358
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@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
+#: session_api.xml:361
+#, fuzzy, no-c-format
+msgid ""
+"Using a mapping document can be configured using the <literal><query></"
+"literal> node. Remember to use a <literal>CDATA</literal> section if your "
+"query contains characters that could be interpreted as markup."
+msgstr ""
+"你可以在映射文件中定义命名查询(named queries)。如果你的查询串中包含可能被解"
+"释为 XML 标记(markup)的字符,别忘了用<literal>CDATA</literal>包裹起来。"
+
+#. Tag: title
+#: session_api.xml:367
#, no-c-format
-msgid "Parameter binding and executing is done programatically:"
+msgid "Defining a named query using <literal><query></literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:370
+#, fuzzy, no-c-format
+msgid ""
+"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>"
+msgstr ""
+"<![CDATA[<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
+" from eg.DomesticCat as cat\n"
+" where cat.name = ?\n"
+" and cat.weight > ?\n"
+"] ]></query>]]>"
+
+#. Tag: para
+#: session_api.xml:373
+#, fuzzy, no-c-format
+msgid ""
+"Parameter binding and executing is done programatically as seen in <xref "
+"linkend=\"example-parameter-binding-named-query\"/>."
msgstr "参数绑定及执行以编程方式(programatically)完成:"
+#. Tag: title
+#: session_api.xml:377
+#, no-c-format
+msgid "Parameter binding of a named query"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:379
+#, fuzzy, no-c-format
+msgid ""
+"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();"
+msgstr ""
+"<![CDATA[Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
+"q.setString(0, name);\n"
+"q.setInt(1, minWeight);\n"
+"List cats = q.list();]]>"
+
#. Tag: para
+#: session_api.xml:382
#, no-c-format
-msgid "The actual program code is independent of the query language that is used. You can also define native SQL queries in metadata, or migrate existing queries to Hibernate by placing them in mapping files."
-msgstr "请注意实际的程序代码与所用的查询语言无关,你也可在元数据中定义原生 SQL(native SQL)查询,或将原有的其他的查询语句放在配置文件中,这样就可以让 Hibernate 统一管理,达到迁移的目的。 "
+msgid ""
+"The actual program code is independent of the query language that is used. "
+"You can also define native SQL queries in metadata, or migrate existing "
+"queries to Hibernate by placing them in mapping files."
+msgstr ""
+"请注意实际的程序代码与所用的查询语言无关,你也可在元数据中定义原生 SQL"
+"(native SQL)查询,或将原有的其他的查询语句放在配置文件中,这样就可以让 "
+"Hibernate 统一管理,达到迁移的目的。 "
#. Tag: para
+#: session_api.xml:387
#, no-c-format
-msgid "Also note that a query declaration inside a <literal><hibernate-mapping></literal> element requires a global unique name for the query, while a query declaration inside a <literal><class></literal> element is made unique automatically by prepending the fully qualified name of the class. For example <literal>eg.Cat.ByNameAndMaximumWeight</literal>."
-msgstr "也请注意在 <literal><hibernate-mapping></literal> 元素中声明的查询必须有一个全局唯一的名字,而在 <literal><class></literal> 元素中声明的查询自动具有全局名,是通过类的全名加以限定的。比如 <literal>eg.Cat.ByNameAndMaximumWeight</literal>。 "
+msgid ""
+"Also note that a query declaration inside a <literal><hibernate-"
+"mapping></literal> element requires a global unique name for the query, "
+"while a query declaration inside a <literal><class></literal> element "
+"is made unique automatically by prepending the fully qualified name of the "
+"class. For example <literal>eg.Cat.ByNameAndMaximumWeight</literal>."
+msgstr ""
+"也请注意在 <literal><hibernate-mapping></literal> 元素中声明的查询必须"
+"有一个全局唯一的名字,而在 <literal><class></literal> 元素中声明的查询自"
+"动具有全局名,是通过类的全名加以限定的。比如 <literal>eg.Cat."
+"ByNameAndMaximumWeight</literal>。 "
#. Tag: title
+#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "过滤集合"
#. Tag: para
+#: session_api.xml:399
#, no-c-format
-msgid "A collection <emphasis>filter</emphasis> is a special type of query that can be applied to a persistent collection or array. The query string can refer to <literal>this</literal>, meaning the current collection element."
-msgstr "集合<emphasis>过滤器(filter)</emphasis>是一种用于一个持久化集合或者数组的特殊的查询。查询字符串中可以使用 <literal>\"this\"</literal> 来引用集合中的当前元素。 "
+msgid ""
+"A collection <emphasis>filter</emphasis> is a special type of query that can "
+"be applied to a persistent collection or array. The query string can refer "
+"to <literal>this</literal>, meaning the current collection element."
+msgstr ""
+"集合<emphasis>过滤器(filter)</emphasis>是一种用于一个持久化集合或者数组的特"
+"殊的查询。查询字符串中可以使用 <literal>\"this\"</literal> 来引用集合中的当前"
+"元素。 "
+#. Tag: programlisting
+#: session_api.xml:404
+#, fuzzy, no-c-format
+msgid ""
+"Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");"
+msgstr ""
+"<![CDATA[Collection blackKittens = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"where this.color = ?\")\n"
+" .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
+" .list()\n"
+");]]>"
+
#. Tag: para
+#: session_api.xml:406
#, no-c-format
-msgid "The returned collection is considered a bag that is a copy of the given collection. The original collection is not modified. This is contrary to the implication of the name \"filter\", but consistent with expected behavior."
-msgstr "返回的集合可以被认为是一个包(bag,无顺序可重复的集合(collection)),它是所给集合的副本。 原来的集合不会被改动(这与“过滤器(filter)”的隐含的含义不符,不过与我们期待的行为一致)。 "
+msgid ""
+"The returned collection is considered a bag that is a copy of the given "
+"collection. The original collection is not modified. This is contrary to the "
+"implication of the name \"filter\", but consistent with expected behavior."
+msgstr ""
+"返回的集合可以被认为是一个包(bag,无顺序可重复的集合(collection)),它是所"
+"给集合的副本。 原来的集合不会被改动(这与“过滤器(filter)”的隐含的含义不符,"
+"不过与我们期待的行为一致)。 "
#. Tag: para
+#: session_api.xml:411
#, no-c-format
-msgid "Observe that filters do not require a <literal>from</literal> clause, although they can have one if required. Filters are not limited to returning the collection elements themselves."
-msgstr "请注意过滤器(filter)并不需要 <literal>from</literal> 子句(当然需要的话它们也可以加上)。过滤器(filter)不限定于只能返回集合元素本身。 "
+msgid ""
+"Observe that filters do not require a <literal>from</literal> clause, "
+"although they can have one if required. Filters are not limited to returning "
+"the collection elements themselves."
+msgstr ""
+"请注意过滤器(filter)并不需要 <literal>from</literal> 子句(当然需要的话它们"
+"也可以加上)。过滤器(filter)不限定于只能返回集合元素本身。 "
+#. Tag: programlisting
+#: session_api.xml:415
+#, fuzzy, no-c-format
+msgid ""
+"Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();"
+msgstr ""
+"<![CDATA[Collection blackKittenMates = session.createFilter(\n"
+" pk.getKittens(), \n"
+" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
+" .list();]]>"
+
#. Tag: para
+#: session_api.xml:417
#, no-c-format
-msgid "Even an empty filter query is useful, e.g. to load a subset of elements in a large collection:"
-msgstr "即使无条件的过滤器(filter)也是有意义的。例如,用于加载一个大集合的子集: "
+msgid ""
+"Even an empty filter query is useful, e.g. to load a subset of elements in a "
+"large collection:"
+msgstr ""
+"即使无条件的过滤器(filter)也是有意义的。例如,用于加载一个大集合的子集: "
+#. Tag: programlisting
+#: session_api.xml:420
+#, fuzzy, no-c-format
+msgid ""
+"Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();"
+msgstr ""
+"<![CDATA[Collection tenKittens = session.createFilter(\n"
+" mother.getKittens(), \"\")\n"
+" .setFirstResult(0).setMaxResults(10)\n"
+" .list();]]>"
+
#. Tag: title
+#: session_api.xml:424
#, no-c-format
msgid "Criteria queries"
msgstr "条件查询(Criteria queries)"
#. Tag: para
+#: session_api.xml:426
#, no-c-format
-msgid "HQL is extremely powerful, but some developers prefer to build queries dynamically using an object-oriented API, rather than building query strings. Hibernate provides an intuitive <literal>Criteria</literal> query API for these cases:"
-msgstr "HQL 极为强大,但是有些人希望能够动态的使用一种面向对象 API 创建查询,而非在他们的 Java 代码中嵌入字符串。对于那部分人来说,Hibernate 提供了直观的 <literal>Criteria</literal> 查询 API。 "
+msgid ""
+"HQL is extremely powerful, but some developers prefer to build queries "
+"dynamically using an object-oriented API, rather than building query "
+"strings. Hibernate provides an intuitive <literal>Criteria</literal> query "
+"API for these cases:"
+msgstr ""
+"HQL 极为强大,但是有些人希望能够动态的使用一种面向对象 API 创建查询,而非在他"
+"们的 Java 代码中嵌入字符串。对于那部分人来说,Hibernate 提供了直观的 "
+"<literal>Criteria</literal> 查询 API。 "
+#. Tag: programlisting
+#: session_api.xml:431
+#, fuzzy, no-c-format
+msgid ""
+"Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();"
+msgstr ""
+"<![CDATA[Criteria crit = session.createCriteria(Cat.class);\n"
+"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
+"crit.setMaxResults(10);\n"
+"List cats = crit.list();]]>"
+
#. Tag: para
-#, no-c-format
-msgid "The <literal>Criteria</literal> and the associated <literal>Example</literal> API are discussed in more detail in <xref linkend=\"querycriteria\" />."
-msgstr "<literal>Criteria</literal> 以及相关的<literal>样例(Example)</literal>API 将会在 <xref linkend=\"querycriteria\"/> 中详细讨论。"
+#: session_api.xml:433
+#, fuzzy, no-c-format
+msgid ""
+"The <literal>Criteria</literal> and the associated <literal>Example</"
+"literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"
+">."
+msgstr ""
+"<literal>Criteria</literal> 以及相关的<literal>样例(Example)</literal>API "
+"将会在 <xref linkend=\"querycriteria\"/> 中详细讨论。"
#. Tag: title
+#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "使用原生 SQL 的查询"
#. Tag: para
+#: session_api.xml:441
#, no-c-format
-msgid "You can express a query in SQL, using <literal>createSQLQuery()</literal> and let Hibernate manage the mapping from result sets to objects. You can at any time call <literal>session.connection()</literal> and use the JDBC <literal>Connection</literal> directly. If you choose to use the Hibernate API, you must enclose SQL aliases in braces:"
-msgstr "你可以使用 <literal>createSQLQuery()</literal> 方法,用 SQL 来描述查询,并由 Hibernate 将结果集转换成对象。请注意,你可以在任何时候调用 <literal>session.connection()</literal> 来获得并使用 JDBC <literal>Connection</literal> 对象。 如果你选择使用 Hibernate 的 API,你必须把 SQL 别名用大括号包围起来: "
+msgid ""
+"You can express a query in SQL, using <literal>createSQLQuery()</literal> "
+"and let Hibernate manage the mapping from result sets to objects. You can at "
+"any time call <literal>session.connection()</literal> and use the JDBC "
+"<literal>Connection</literal> directly. If you choose to use the Hibernate "
+"API, you must enclose SQL aliases in braces:"
+msgstr ""
+"你可以使用 <literal>createSQLQuery()</literal> 方法,用 SQL 来描述查询,并由 "
+"Hibernate 将结果集转换成对象。请注意,你可以在任何时候调用 <literal>session."
+"connection()</literal> 来获得并使用 JDBC <literal>Connection</literal> 对"
+"象。 如果你选择使用 Hibernate 的 API,你必须把 SQL 别名用大括号包围起来: "
+#. Tag: programlisting
+#: session_api.xml:448
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} WHERE "
+"ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();"
+msgstr ""
+"<![CDATA[List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} "
+"WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list();]]>"
+
+#. Tag: programlisting
+#: session_api.xml:450
+#, fuzzy, no-c-format
+msgid ""
+"List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()"
+msgstr ""
+"<![CDATA[List cats = session.createSQLQuery(\n"
+" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
+" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" "
+"+\n"
+" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
+" .addEntity(\"cat\", Cat.class)\n"
+".list()]]>"
+
#. Tag: para
-#, no-c-format
-msgid "SQL queries can contain named and positional parameters, just like Hibernate queries. More information about native SQL queries in Hibernate can be found in <xref linkend=\"querysql\" />."
-msgstr "和 Hibernate 查询一样,SQL 查询也可以包含命名参数和占位参数。可以在 <xref linkend=\"querysql\"/> 找到更多关于 Hibernate 中原生 SQL(native SQL)的信息。"
+#: session_api.xml:452
+#, fuzzy, no-c-format
+msgid ""
+"SQL queries can contain named and positional parameters, just like Hibernate "
+"queries. More information about native SQL queries in Hibernate can be found "
+"in <xref linkend=\"querysql\"/>."
+msgstr ""
+"和 Hibernate 查询一样,SQL 查询也可以包含命名参数和占位参数。可以在 <xref "
+"linkend=\"querysql\"/> 找到更多关于 Hibernate 中原生 SQL(native SQL)的信"
+"息。"
#. Tag: title
+#: session_api.xml:459
#, no-c-format
msgid "Modifying persistent objects"
msgstr "修改持久对象"
#. Tag: para
+#: session_api.xml:461
#, no-c-format
-msgid "<emphasis>Transactional persistent instances</emphasis> (i.e. objects loaded, saved, created or queried by the <literal>Session</literal>) can be manipulated by the application, and any changes to persistent state will be persisted when the <literal>Session</literal> is <emphasis>flushed</emphasis>. This is discussed later in this chapter. There is no need to call a particular method (like <literal>update()</literal>, which has a different purpose) to make your modifications persistent. The most straightforward way to update the state of an object is to <literal>load()</literal> it and then manipulate it directly while the <literal>Session</literal> is open:"
-msgstr "<emphasis>事务中的持久实例</emphasis>(就是通过 <literal>session</literal> 装载、保存、创建或者查询出的对象) 被应用程序操作所造成的任何修改都会在 <literal>Session</literal> 被<emphasis>刷出(flushed)</emphasis>的时候被持久化(本章后面会详细讨论)。这里不需要调用某个特定的方法(比如 <literal>update()</literal>,设计它的目的是不同的)将你的修改持久化。所以最直接的更新一个对象的方法就是在 <literal>Session</literal> 处于打开状态时 <literal>load()</literal> 它,然后直接修改即可: "
+msgid ""
+"<emphasis>Transactional persistent instances</emphasis> (i.e. objects "
+"loaded, saved, created or queried by the <literal>Session</literal>) can be "
+"manipulated by the application, and any changes to persistent state will be "
+"persisted when the <literal>Session</literal> is <emphasis>flushed</"
+"emphasis>. This is discussed later in this chapter. There is no need to call "
+"a particular method (like <literal>update()</literal>, which has a different "
+"purpose) to make your modifications persistent. The most straightforward way "
+"to update the state of an object is to <literal>load()</literal> it and then "
+"manipulate it directly while the <literal>Session</literal> is open:"
+msgstr ""
+"<emphasis>事务中的持久实例</emphasis>(就是通过 <literal>session</literal> 装"
+"载、保存、创建或者查询出的对象) 被应用程序操作所造成的任何修改都会在 "
+"<literal>Session</literal> 被<emphasis>刷出(flushed)</emphasis>的时候被持久"
+"化(本章后面会详细讨论)。这里不需要调用某个特定的方法(比如 <literal>update"
+"()</literal>,设计它的目的是不同的)将你的修改持久化。所以最直接的更新一个对"
+"象的方法就是在 <literal>Session</literal> 处于打开状态时 <literal>load()</"
+"literal> 它,然后直接修改即可: "
+#. Tag: programlisting
+#: session_api.xml:473
+#, fuzzy, no-c-format
+msgid ""
+"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted"
+msgstr ""
+"<![CDATA[DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long"
+"(69) );\n"
+"cat.setName(\"PK\");\n"
+"sess.flush(); // changes to cat are automatically detected and persisted]]>"
+
#. Tag: para
+#: session_api.xml:475
#, no-c-format
-msgid "Sometimes this programming model is inefficient, as it requires in the same session both an SQL <literal>SELECT</literal> to load an object and an SQL <literal>UPDATE</literal> to persist its updated state. Hibernate offers an alternate approach by using detached instances."
-msgstr "有时这种程序模型效率低下,因为它在同一 Session 里需要一条 SQL <literal>SELECT</literal> 语句(用于加载对象) 以及一条 SQL <literal>UPDATE</literal> 语句(持久化更新的状态)。为此 Hibernate 提供了另一种途径,使用脱管(detached)实例。 "
+msgid ""
+"Sometimes this programming model is inefficient, as it requires in the same "
+"session both an SQL <literal>SELECT</literal> to load an object and an SQL "
+"<literal>UPDATE</literal> to persist its updated state. Hibernate offers an "
+"alternate approach by using detached instances."
+msgstr ""
+"有时这种程序模型效率低下,因为它在同一 Session 里需要一条 SQL "
+"<literal>SELECT</literal> 语句(用于加载对象) 以及一条 SQL <literal>UPDATE</"
+"literal> 语句(持久化更新的状态)。为此 Hibernate 提供了另一种途径,使用脱管"
+"(detached)实例。 "
#. Tag: para
-#, no-c-format
-msgid "Hibernate does not offer its own API for direct execution of <literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate is a <emphasis>state management</emphasis> service, you do not have to think in <emphasis>statements</emphasis> to use it. JDBC is a perfect API for executing SQL statements, you can get a JDBC <literal>Connection</literal> at any time by calling <literal>session.connection()</literal>. Furthermore, the notion of mass operations conflicts with object/relational mapping for online transaction processing-oriented applications. Future versions of Hibernate can, however, provide special mass operation functions. See <xref linkend=\"batch\" /> for some possible batch operation tricks."
-msgstr "请注意 Hibernate 本身不提供直接执行 <literal>UPDATE</literal> 或 <literal>DELETE</literal> 语句的 API。Hibernate 提供的是 <emphasis>state management</emphasis> 服务,你不必考虑要使用的 <emphasis>statements</emphasis>。JDBC 是出色的执行 SQL 语句的 API,任何时候调用 <literal>session.connection()</literal> 你都可以得到一个 <literal>Connection</literal> 对象。 此外,在联机事务处理(OLTP)程序中,大量操作(mass operations)与对象/关系映射的观点是相冲突的。Hibernate 的将来版本可能会提供专门的进行大量操作(mass operation)的功能。参考 <xref linkend=\"batch\"/>,寻找一些可用的批量(batch)操作技巧。"
+#: session_api.xml:481
+#, fuzzy, no-c-format
+msgid ""
+"Hibernate does not offer its own API for direct execution of "
+"<literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate "
+"is a <emphasis>state management</emphasis> service, you do not have to think "
+"in <emphasis>statements</emphasis> to use it. JDBC is a perfect API for "
+"executing SQL statements, you can get a JDBC <literal>Connection</literal> "
+"at any time by calling <literal>session.connection()</literal>. Furthermore, "
+"the notion of mass operations conflicts with object/relational mapping for "
+"online transaction processing-oriented applications. Future versions of "
+"Hibernate can, however, provide special mass operation functions. See <xref "
+"linkend=\"batch\"/> for some possible batch operation tricks."
+msgstr ""
+"请注意 Hibernate 本身不提供直接执行 <literal>UPDATE</literal> 或 "
+"<literal>DELETE</literal> 语句的 API。Hibernate 提供的是 <emphasis>state "
+"management</emphasis> 服务,你不必考虑要使用的 <emphasis>statements</"
+"emphasis>。JDBC 是出色的执行 SQL 语句的 API,任何时候调用 <literal>session."
+"connection()</literal> 你都可以得到一个 <literal>Connection</literal> 对象。 "
+"此外,在联机事务处理(OLTP)程序中,大量操作(mass operations)与对象/关系映"
+"射的观点是相冲突的。Hibernate 的将来版本可能会提供专门的进行大量操作(mass "
+"operation)的功能。参考 <xref linkend=\"batch\"/>,寻找一些可用的批量"
+"(batch)操作技巧。"
#. Tag: title
+#: session_api.xml:497
#, no-c-format
msgid "Modifying detached objects"
msgstr "修改脱管(Detached)对象"
#. Tag: para
+#: session_api.xml:499
#, no-c-format
-msgid "Many applications need to retrieve an object in one transaction, send it to the UI layer for manipulation, then save the changes in a new transaction. Applications that use this kind of approach in a high-concurrency environment usually use versioned data to ensure isolation for the \"long\" unit of work."
-msgstr "很多程序需要在某个事务中获取对象,然后将对象发送到界面层去操作,最后在一个新的事务保存所做的修改。在高并发访问的环境中使用这种方式,通常使用附带版本信息的数据来保证这些“长“工作单元之间的隔离。"
+msgid ""
+"Many applications need to retrieve an object in one transaction, send it to "
+"the UI layer for manipulation, then save the changes in a new transaction. "
+"Applications that use this kind of approach in a high-concurrency "
+"environment usually use versioned data to ensure isolation for the \"long\" "
+"unit of work."
+msgstr ""
+"很多程序需要在某个事务中获取对象,然后将对象发送到界面层去操作,最后在一个新"
+"的事务保存所做的修改。在高并发访问的环境中使用这种方式,通常使用附带版本信息"
+"的数据来保证这些“长“工作单元之间的隔离。"
#. Tag: para
+#: session_api.xml:505
#, no-c-format
-msgid "Hibernate supports this model by providing for reattachment of detached instances using the <literal>Session.update()</literal> or <literal>Session.merge()</literal> methods:"
-msgstr "Hibernate 通过提供 <literal>Session.update()</literal> 或 <literal>Session.merge()</literal> 重新关联脱管实例的办法来支持这种模型。"
+msgid ""
+"Hibernate supports this model by providing for reattachment of detached "
+"instances using the <literal>Session.update()</literal> or <literal>Session."
+"merge()</literal> methods:"
+msgstr ""
+"Hibernate 通过提供 <literal>Session.update()</literal> 或 <literal>Session."
+"merge()</literal> 重新关联脱管实例的办法来支持这种模型。"
+#. Tag: programlisting
+#: session_api.xml:509
+#, fuzzy, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate"
+msgstr ""
+"<![CDATA[// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
+"Cat potentialMate = new Cat();\n"
+"firstSession.save(potentialMate);\n"
+"\n"
+"// in a higher layer of the application\n"
+"cat.setMate(potentialMate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.update(cat); // update cat\n"
+"secondSession.update(mate); // update mate]]>"
+
#. Tag: para
+#: session_api.xml:511
#, no-c-format
-msgid "If the <literal>Cat</literal> with identifier <literal>catId</literal> had already been loaded by <literal>secondSession</literal> when the application tried to reattach it, an exception would have been thrown."
-msgstr "如果具有 <literal>catId</literal> 持久化标识的 <literal>Cat</literal> 之前已经被<literal>另一Session(secondSession)</literal>装载了, 应用程序进行重关联操作(reattach)的时候会抛出一个异常。"
+msgid ""
+"If the <literal>Cat</literal> with identifier <literal>catId</literal> had "
+"already been loaded by <literal>secondSession</literal> when the application "
+"tried to reattach it, an exception would have been thrown."
+msgstr ""
+"如果具有 <literal>catId</literal> 持久化标识的 <literal>Cat</literal> 之前已"
+"经被<literal>另一Session(secondSession)</literal>装载了, 应用程序进行重关"
+"联操作(reattach)的时候会抛出一个异常。"
#. Tag: para
+#: session_api.xml:516
#, no-c-format
-msgid "Use <literal>update()</literal> if you are certain that the session does not contain an already persistent instance with the same identifier. Use <literal>merge()</literal> if you want to merge your modifications at any time without consideration of the state of the session. In other words, <literal>update()</literal> is usually the first method you would call in a fresh session, ensuring that the reattachment of your detached instances is the first operation that is executed."
-msgstr "如果你确定当前 session 没有包含与之具有相同持久化标识的持久实例,使用 <literal>update()</literal>。如果想随时合并你的的改动而不考虑 session 的状态,使用 <literal>merge()</literal>。换句话说,在一个新 session 中通常第一个调用的是 <literal>update()</literal> 方法,以便保证重新关联脱管(detached)对象的操作首先被执行。 "
+msgid ""
+"Use <literal>update()</literal> if you are certain that the session does not "
+"contain an already persistent instance with the same identifier. Use "
+"<literal>merge()</literal> if you want to merge your modifications at any "
+"time without consideration of the state of the session. In other words, "
+"<literal>update()</literal> is usually the first method you would call in a "
+"fresh session, ensuring that the reattachment of your detached instances is "
+"the first operation that is executed."
+msgstr ""
+"如果你确定当前 session 没有包含与之具有相同持久化标识的持久实例,使用 "
+"<literal>update()</literal>。如果想随时合并你的的改动而不考虑 session 的状"
+"态,使用 <literal>merge()</literal>。换句话说,在一个新 session 中通常第一个"
+"调用的是 <literal>update()</literal> 方法,以便保证重新关联脱管(detached)对"
+"象的操作首先被执行。 "
#. Tag: para
-#, no-c-format
-msgid "The application should individually <literal>update()</literal> detached instances that are reachable from the given detached instance <emphasis>only</emphasis> if it wants their state to be updated. This can be automated using <emphasis>transitive persistence</emphasis>. See <xref linkend=\"objectstate-transitive\" /> for more information."
-msgstr "如果希望相关联的脱管对象(通过引用“可到达”的脱管对象)的数据也要更新到数据库时(并且也<emphasis>仅仅</emphasis>在这种情况),可以对该相关联的脱管对象单独调用 <literal>update()</literal> 当然这些可以自动完成,即通过使用<emphasis>传播性持久化(transitive persistence)</emphasis>,请看 <xref linkend=\"objectstate-transitive\"/>。"
+#: session_api.xml:524
+#, fuzzy, no-c-format
+msgid ""
+"The application should individually <literal>update()</literal> detached "
+"instances that are reachable from the given detached instance "
+"<emphasis>only</emphasis> if it wants their state to be updated. This can be "
+"automated using <emphasis>transitive persistence</emphasis>. See <xref "
+"linkend=\"objectstate-transitive\"/> for more information."
+msgstr ""
+"如果希望相关联的脱管对象(通过引用“可到达”的脱管对象)的数据也要更新到数据库"
+"时(并且也<emphasis>仅仅</emphasis>在这种情况),可以对该相关联的脱管对象单独"
+"调用 <literal>update()</literal> 当然这些可以自动完成,即通过使用<emphasis>传"
+"播性持久化(transitive persistence)</emphasis>,请看 <xref linkend="
+"\"objectstate-transitive\"/>。"
#. Tag: para
+#: session_api.xml:530
#, no-c-format
-msgid "The <literal>lock()</literal> method also allows an application to reassociate an object with a new session. However, the detached instance has to be unmodified."
-msgstr "<literal>lock()</literal> 方法也允许程序重新关联某个对象到一个新 session 上。不过,该脱管(detached)的对象必须是没有修改过的。"
+msgid ""
+"The <literal>lock()</literal> method also allows an application to "
+"reassociate an object with a new session. However, the detached instance has "
+"to be unmodified."
+msgstr ""
+"<literal>lock()</literal> 方法也允许程序重新关联某个对象到一个新 session 上。"
+"不过,该脱管(detached)的对象必须是没有修改过的。"
+#. Tag: programlisting
+#: session_api.xml:534
+#, fuzzy, no-c-format
+msgid ""
+"//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);"
+msgstr ""
+"<![CDATA[//just reassociate:\n"
+"sess.lock(fritz, LockMode.NONE);\n"
+"//do a version check, then reassociate:\n"
+"sess.lock(izi, LockMode.READ);\n"
+"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
+"sess.lock(pk, LockMode.UPGRADE);]]>"
+
#. Tag: para
+#: session_api.xml:536
#, no-c-format
-msgid "Note that <literal>lock()</literal> can be used with various <literal>LockMode</literal>s. See the API documentation and the chapter on transaction handling for more information. Reattachment is not the only usecase for <literal>lock()</literal>."
-msgstr "请注意,<literal>lock()</literal> 可以搭配多种 <literal>LockMode</literal>,更多信息请阅读 API 文档以及关于事务处理(transaction handling)的章节。重新关联不是 <literal>lock()</literal> 的唯一用途。 "
+msgid ""
+"Note that <literal>lock()</literal> can be used with various "
+"<literal>LockMode</literal>s. See the API documentation and the chapter on "
+"transaction handling for more information. Reattachment is not the only "
+"usecase for <literal>lock()</literal>."
+msgstr ""
+"请注意,<literal>lock()</literal> 可以搭配多种 <literal>LockMode</literal>,"
+"更多信息请阅读 API 文档以及关于事务处理(transaction handling)的章节。重新关"
+"联不是 <literal>lock()</literal> 的唯一用途。 "
#. Tag: para
-#, no-c-format
-msgid "Other models for long units of work are discussed in <xref linkend=\"transactions-optimistic\" />."
-msgstr "其他用于长时间工作单元的模型会在 <xref linkend=\"transactions-optimistic\"/> 中讨论。"
+#: session_api.xml:541
+#, fuzzy, no-c-format
+msgid ""
+"Other models for long units of work are discussed in <xref linkend="
+"\"transactions-optimistic\"/>."
+msgstr ""
+"其他用于长时间工作单元的模型会在 <xref linkend=\"transactions-optimistic\"/> "
+"中讨论。"
#. Tag: title
+#: session_api.xml:546
#, no-c-format
msgid "Automatic state detection"
msgstr "自动状态检测"
#. Tag: para
+#: session_api.xml:548
#, no-c-format
-msgid "Hibernate users have requested a general purpose method that either saves a transient instance by generating a new identifier or updates/reattaches the detached instances associated with its current identifier. The <literal>saveOrUpdate()</literal> method implements this functionality."
-msgstr "Hibernate 的用户曾要求一个既可自动分配新持久化标识(identifier)保存瞬时(transient)对象,又可更新/重新关联脱管(detached)实例的通用方法。<literal>saveOrUpdate()</literal> 方法实现了这个功能。"
+msgid ""
+"Hibernate users have requested a general purpose method that either saves a "
+"transient instance by generating a new identifier or updates/reattaches the "
+"detached instances associated with its current identifier. The "
+"<literal>saveOrUpdate()</literal> method implements this functionality."
+msgstr ""
+"Hibernate 的用户曾要求一个既可自动分配新持久化标识(identifier)保存瞬时"
+"(transient)对象,又可更新/重新关联脱管(detached)实例的通用方法。"
+"<literal>saveOrUpdate()</literal> 方法实现了这个功能。"
+#. Tag: programlisting
+#: session_api.xml:554
+#, fuzzy, no-c-format
+msgid ""
+"// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)"
+msgstr ""
+"<![CDATA[// in the first session\n"
+"Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
+"\n"
+"// in a higher tier of the application\n"
+"Cat mate = new Cat();\n"
+"cat.setMate(mate);\n"
+"\n"
+"// later, in a new session\n"
+"secondSession.saveOrUpdate(cat); // update existing state (cat has a non-"
+"null id)\n"
+"secondSession.saveOrUpdate(mate); // save the new instance (mate has a null "
+"id)]]>"
+
#. Tag: para
+#: session_api.xml:556
#, no-c-format
-msgid "The usage and semantics of <literal>saveOrUpdate()</literal> seems to be confusing for new users. Firstly, so long as you are not trying to use instances from one session in another new session, you should not need to use <literal>update()</literal>, <literal>saveOrUpdate()</literal>, or <literal>merge()</literal>. Some whole applications will never use either of these methods."
-msgstr "<literal>saveOrUpdate()</literal> 用途和语义可能会使新用户感到迷惑。首先,只要你没有尝试在某个 session 中使用来自另一 session 的实例,你就应该不需要使用 <literal>update()</literal>, <literal>saveOrUpdate()</literal>,或 <literal>merge()</literal>。有些程序从来不用这些方法。"
+msgid ""
+"The usage and semantics of <literal>saveOrUpdate()</literal> seems to be "
+"confusing for new users. Firstly, so long as you are not trying to use "
+"instances from one session in another new session, you should not need to "
+"use <literal>update()</literal>, <literal>saveOrUpdate()</literal>, or "
+"<literal>merge()</literal>. Some whole applications will never use either of "
+"these methods."
+msgstr ""
+"<literal>saveOrUpdate()</literal> 用途和语义可能会使新用户感到迷惑。首先,只"
+"要你没有尝试在某个 session 中使用来自另一 session 的实例,你就应该不需要使"
+"用 <literal>update()</literal>, <literal>saveOrUpdate()</literal>,或 "
+"<literal>merge()</literal>。有些程序从来不用这些方法。"
#. Tag: para
+#: session_api.xml:563
#, no-c-format
-msgid "Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are used in the following scenario:"
-msgstr "通常下面的场景会使用 <literal>update()</literal> 或 <literal>saveOrUpdate()</literal>:"
+msgid ""
+"Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are "
+"used in the following scenario:"
+msgstr ""
+"通常下面的场景会使用 <literal>update()</literal> 或 <literal>saveOrUpdate()</"
+"literal>:"
#. Tag: para
+#: session_api.xml:569
#, no-c-format
msgid "the application loads an object in the first session"
msgstr "程序在第一个 session 中加载对象"
#. Tag: para
+#: session_api.xml:573
#, no-c-format
msgid "the object is passed up to the UI tier"
msgstr "该对象被传递到表现层"
#. Tag: para
+#: session_api.xml:577
#, no-c-format
msgid "some modifications are made to the object"
msgstr "对象发生了一些改动"
#. Tag: para
+#: session_api.xml:581
#, no-c-format
msgid "the object is passed back down to the business logic tier"
msgstr "该对象被返回到业务逻辑层"
#. Tag: para
+#: session_api.xml:585
#, no-c-format
-msgid "the application persists these modifications by calling <literal>update()</literal> in a second session"
+msgid ""
+"the application persists these modifications by calling <literal>update()</"
+"literal> in a second session"
msgstr "程序调用第二个 session 的 <literal>update()</literal> 方法持久这些改动"
#. Tag: para
+#: session_api.xml:590
#, no-c-format
msgid "<literal>saveOrUpdate()</literal> does the following:"
msgstr "<literal>saveOrUpdate()</literal> 做下面的事:"
#. Tag: para
+#: session_api.xml:594
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr "如果对象已经在本 session 中持久化了,不做任何事"
#. Tag: para
+#: session_api.xml:599
#, no-c-format
-msgid "if another object associated with the session has the same identifier, throw an exception"
-msgstr "如果另一个与本 session 关联的对象拥有相同的持久化标识(identifier),抛出一个异常"
+msgid ""
+"if another object associated with the session has the same identifier, throw "
+"an exception"
+msgstr ""
+"如果另一个与本 session 关联的对象拥有相同的持久化标识(identifier),抛出一个"
+"异常"
#. Tag: para
+#: session_api.xml:604
#, no-c-format
msgid "if the object has no identifier property, <literal>save()</literal> it"
-msgstr "如果对象没有持久化标识(identifier)属性,对其调用 <literal>save()</literal>"
+msgstr ""
+"如果对象没有持久化标识(identifier)属性,对其调用 <literal>save()</literal>"
#. Tag: para
+#: session_api.xml:609
#, no-c-format
-msgid "if the object's identifier has the value assigned to a newly instantiated object, <literal>save()</literal> it"
-msgstr "如果对象的持久标识(identifier)表明其是一个新实例化的对象,对其调用 <literal>save()</literal>。"
+msgid ""
+"if the object's identifier has the value assigned to a newly instantiated "
+"object, <literal>save()</literal> it"
+msgstr ""
+"如果对象的持久标识(identifier)表明其是一个新实例化的对象,对其调用 "
+"<literal>save()</literal>。"
#. Tag: para
+#: session_api.xml:614
#, no-c-format
-msgid "if the object is versioned by a <literal><version></literal> or <literal><timestamp></literal>, and the version property value is the same value assigned to a newly instantiated object, <literal>save()</literal> it"
-msgstr "如果对象是附带版本信息的(通过 <literal><version></literal> 或 <literal><timestamp></literal>)并且版本属性的值表明其是一个新实例化的对象,<literal>save()</literal> 它。 "
+msgid ""
+"if the object is versioned by a <literal><version></literal> or "
+"<literal><timestamp></literal>, and the version property value is the "
+"same value assigned to a newly instantiated object, <literal>save()</"
+"literal> it"
+msgstr ""
+"如果对象是附带版本信息的(通过 <literal><version></literal> 或 "
+"<literal><timestamp></literal>)并且版本属性的值表明其是一个新实例化的"
+"对象,<literal>save()</literal> 它。 "
#. Tag: para
+#: session_api.xml:622
#, no-c-format
msgid "otherwise <literal>update()</literal> the object"
msgstr "否则 <literal>update()</literal> 这个对象"
#. Tag: para
+#: session_api.xml:626
#, no-c-format
msgid "and <literal>merge()</literal> is very different:"
msgstr "<literal>merge()</literal> 可非常不同:"
#. Tag: para
+#: session_api.xml:630
#, no-c-format
-msgid "if there is a persistent instance with the same identifier currently associated with the session, copy the state of the given object onto the persistent instance"
-msgstr "如果 session 中存在相同持久化标识(identifier)的实例,用用户给出的对象的状态覆盖旧有的持久实例"
+msgid ""
+"if there is a persistent instance with the same identifier currently "
+"associated with the session, copy the state of the given object onto the "
+"persistent instance"
+msgstr ""
+"如果 session 中存在相同持久化标识(identifier)的实例,用用户给出的对象的状态"
+"覆盖旧有的持久实例"
#. Tag: para
+#: session_api.xml:636
#, no-c-format
-msgid "if there is no persistent instance currently associated with the session, try to load it from the database, or create a new persistent instance"
-msgstr "如果 session 没有相应的持久实例,则尝试从数据库中加载,或创建新的持久化实例"
+msgid ""
+"if there is no persistent instance currently associated with the session, "
+"try to load it from the database, or create a new persistent instance"
+msgstr ""
+"如果 session 没有相应的持久实例,则尝试从数据库中加载,或创建新的持久化实例"
#. Tag: para
+#: session_api.xml:642
#, no-c-format
msgid "the persistent instance is returned"
msgstr "最后返回该持久实例"
#. Tag: para
+#: session_api.xml:646
#, no-c-format
-msgid "the given instance does not become associated with the session, it remains detached"
+msgid ""
+"the given instance does not become associated with the session, it remains "
+"detached"
msgstr "用户给出的这个对象没有被关联到 session 上,它依旧是脱管的"
#. Tag: title
+#: session_api.xml:653
#, no-c-format
msgid "Deleting persistent objects"
msgstr "删除持久对象"
#. Tag: para
+#: session_api.xml:655
#, no-c-format
-msgid "<literal>Session.delete()</literal> will remove an object's state from the database. Your application, however, can still hold a reference to a deleted object. It is best to think of <literal>delete()</literal> as making a persistent instance, transient."
-msgstr "使用 <literal>Session.delete()</literal> 会把对象的状态从数据库中移除。当然,你的应用程序可能仍然持有一个指向已删除对象的引用。所以,最好这样理解:<literal>delete()</literal> 的用途是把一个持久实例变成瞬时(transient)实例。 "
+msgid ""
+"<literal>Session.delete()</literal> will remove an object's state from the "
+"database. Your application, however, can still hold a reference to a deleted "
+"object. It is best to think of <literal>delete()</literal> as making a "
+"persistent instance, transient."
+msgstr ""
+"使用 <literal>Session.delete()</literal> 会把对象的状态从数据库中移除。当然,"
+"你的应用程序可能仍然持有一个指向已删除对象的引用。所以,最好这样理解:"
+"<literal>delete()</literal> 的用途是把一个持久实例变成瞬时(transient)实"
+"例。 "
+#. Tag: programlisting
+#: session_api.xml:660
+#, fuzzy, no-c-format
+msgid "sess.delete(cat);"
+msgstr "<![CDATA[sess.delete(cat);]]>"
+
#. Tag: para
+#: session_api.xml:662
#, no-c-format
-msgid "You can delete objects in any order, without risk of foreign key constraint violations. It is still possible to violate a <literal>NOT NULL</literal> constraint on a foreign key column by deleting objects in the wrong order, e.g. if you delete the parent, but forget to delete the children."
-msgstr "你可以用你喜欢的任何顺序删除对象,不用担心外键约束冲突。当然,如果你搞错了顺序,还是有可能引发在外键字段定义的 <literal>NOT NULL</literal> 约束冲突。例如你删除了父对象,但是忘记删除其子对象。"
+msgid ""
+"You can delete objects in any order, without risk of foreign key constraint "
+"violations. It is still possible to violate a <literal>NOT NULL</literal> "
+"constraint on a foreign key column by deleting objects in the wrong order, e."
+"g. if you delete the parent, but forget to delete the children."
+msgstr ""
+"你可以用你喜欢的任何顺序删除对象,不用担心外键约束冲突。当然,如果你搞错了顺"
+"序,还是有可能引发在外键字段定义的 <literal>NOT NULL</literal> 约束冲突。例如"
+"你删除了父对象,但是忘记删除其子对象。"
#. Tag: title
+#: session_api.xml:670
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "在两个不同数据库间复制对象"
#. Tag: para
+#: session_api.xml:672
#, no-c-format
-msgid "It is sometimes useful to be able to take a graph of persistent instances and make them persistent in a different datastore, without regenerating identifier values."
-msgstr "偶尔会用到不重新生成持久化标识(identifier),将持久实例以及其关联的实例持久到不同的数据库中的操作。 "
+msgid ""
+"It is sometimes useful to be able to take a graph of persistent instances "
+"and make them persistent in a different datastore, without regenerating "
+"identifier values."
+msgstr ""
+"偶尔会用到不重新生成持久化标识(identifier),将持久实例以及其关联的实例持久"
+"到不同的数据库中的操作。 "
+#. Tag: programlisting
+#: session_api.xml:676
+#, fuzzy, no-c-format
+msgid ""
+"//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();"
+msgstr ""
+"<![CDATA[//retrieve a cat from one database\n"
+"Session session1 = factory1.openSession();\n"
+"Transaction tx1 = session1.beginTransaction();\n"
+"Cat cat = session1.get(Cat.class, catId);\n"
+"tx1.commit();\n"
+"session1.close();\n"
+"\n"
+"//reconcile with a second database\n"
+"Session session2 = factory2.openSession();\n"
+"Transaction tx2 = session2.beginTransaction();\n"
+"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
+"tx2.commit();\n"
+"session2.close();]]>"
+
#. Tag: para
+#: session_api.xml:678
#, no-c-format
-msgid "The <literal>ReplicationMode</literal> determines how <literal>replicate()</literal> will deal with conflicts with existing rows in the database:"
-msgstr "<literal>ReplicationMode</literal> 决定在和数据库中已存在记录由冲突时,<literal>replicate()</literal> 如何处理。 "
+msgid ""
+"The <literal>ReplicationMode</literal> determines how <literal>replicate()</"
+"literal> will deal with conflicts with existing rows in the database:"
+msgstr ""
+"<literal>ReplicationMode</literal> 决定在和数据库中已存在记录由冲突时,"
+"<literal>replicate()</literal> 如何处理。 "
#. Tag: para
+#: session_api.xml:684
#, no-c-format
-msgid "<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is an existing database row with the same identifier"
-msgstr "<literal>ReplicationMode.IGNORE</literal>:当某个现有数据库记录具有相同标识符时忽略它"
+msgid ""
+"<literal>ReplicationMode.IGNORE</literal>: ignores the object when there is "
+"an existing database row with the same identifier"
+msgstr ""
+"<literal>ReplicationMode.IGNORE</literal>:当某个现有数据库记录具有相同标识符"
+"时忽略它"
#. Tag: para
+#: session_api.xml:689
#, no-c-format
-msgid "<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing database row with the same identifier"
-msgstr "<literal>ReplicationMode.OVERWRITE</literal>:用相同的标识符覆盖现有数据库记录"
+msgid ""
+"<literal>ReplicationMode.OVERWRITE</literal>: overwrites any existing "
+"database row with the same identifier"
+msgstr ""
+"<literal>ReplicationMode.OVERWRITE</literal>:用相同的标识符覆盖现有数据库记"
+"录"
#. Tag: para
+#: session_api.xml:694
#, no-c-format
-msgid "<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there is an existing database row with the same identifier"
-msgstr "<literal>ReplicationMode.EXCEPTION</literal>:当某个现有数据库记录具有相同标识符时抛出异常"
+msgid ""
+"<literal>ReplicationMode.EXCEPTION</literal>: throws an exception if there "
+"is an existing database row with the same identifier"
+msgstr ""
+"<literal>ReplicationMode.EXCEPTION</literal>:当某个现有数据库记录具有相同标"
+"识符时抛出异常"
#. Tag: para
+#: session_api.xml:700
#, no-c-format
-msgid "<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its version number is earlier than the version number of the object, or ignore the object otherwise"
-msgstr "<literal>ReplicationMode.LATEST_VERSION</literal>:如果当前的版本较新,则覆盖,否则忽略"
+msgid ""
+"<literal>ReplicationMode.LATEST_VERSION</literal>: overwrites the row if its "
+"version number is earlier than the version number of the object, or ignore "
+"the object otherwise"
+msgstr ""
+"<literal>ReplicationMode.LATEST_VERSION</literal>:如果当前的版本较新,则覆"
+"盖,否则忽略"
#. Tag: para
+#: session_api.xml:706
#, no-c-format
-msgid "Usecases for this feature include reconciling data entered into different database instances, upgrading system configuration information during product upgrades, rolling back changes made during non-ACID transactions and more."
-msgstr "这个功能的用途包括使录入的数据在不同数据库中一致,产品升级时升级系统配置信息,回滚 non-ACID 事务中的修改等等。(译注,non-ACID,非 ACID;ACID,Atomic,Consistent,Isolated and Durable 的缩写)"
+msgid ""
+"Usecases for this feature include reconciling data entered into different "
+"database instances, upgrading system configuration information during "
+"product upgrades, rolling back changes made during non-ACID transactions and "
+"more."
+msgstr ""
+"这个功能的用途包括使录入的数据在不同数据库中一致,产品升级时升级系统配置信"
+"息,回滚 non-ACID 事务中的修改等等。(译注,non-ACID,非 ACID;ACID,Atomic,"
+"Consistent,Isolated and Durable 的缩写)"
#. Tag: title
+#: session_api.xml:713
#, no-c-format
msgid "Flushing the Session"
msgstr "Session 刷出(flush)"
#. Tag: para
+#: session_api.xml:715
#, no-c-format
-msgid "Sometimes the <literal>Session</literal> will execute the SQL statements needed to synchronize the JDBC connection's state with the state of objects held in memory. This process, called <emphasis>flush</emphasis>, occurs by default at the following points:"
-msgstr "每间隔一段时间,<literal>Session</literal> 会执行一些必需的 SQL 语句来把内存中的对象的状态同步到 JDBC 连接中。这个过程被称为<emphasis>刷出(flush)</emphasis>,默认会在下面的时间点执行: "
+msgid ""
+"Sometimes the <literal>Session</literal> will execute the SQL statements "
+"needed to synchronize the JDBC connection's state with the state of objects "
+"held in memory. This process, called <emphasis>flush</emphasis>, occurs by "
+"default at the following points:"
+msgstr ""
+"每间隔一段时间,<literal>Session</literal> 会执行一些必需的 SQL 语句来把内存"
+"中的对象的状态同步到 JDBC 连接中。这个过程被称为<emphasis>刷出(flush)</"
+"emphasis>,默认会在下面的时间点执行: "
#. Tag: para
+#: session_api.xml:723
#, no-c-format
msgid "before some query executions"
msgstr "在某些查询执行之前"
#. Tag: para
+#: session_api.xml:727
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()</literal>"
msgstr "在调用 <literal>org.hibernate.Transaction.commit()</literal> 的时候"
#. Tag: para
+#: session_api.xml:732
#, no-c-format
msgid "from <literal>Session.flush()</literal>"
msgstr "在调用 <literal>Session.flush()</literal> 的时候"
#. Tag: para
+#: session_api.xml:736
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "涉及的 SQL 语句会按照下面的顺序发出执行: "
#. Tag: para
+#: session_api.xml:740
#, no-c-format
-msgid "all entity insertions in the same order the corresponding objects were saved using <literal>Session.save()</literal>"
-msgstr "所有对实体进行插入的语句,其顺序按照对象执行 <literal>Session.save()</literal> 的时间顺序 "
+msgid ""
+"all entity insertions in the same order the corresponding objects were saved "
+"using <literal>Session.save()</literal>"
+msgstr ""
+"所有对实体进行插入的语句,其顺序按照对象执行 <literal>Session.save()</"
+"literal> 的时间顺序 "
#. Tag: para
+#: session_api.xml:745
#, no-c-format
msgid "all entity updates"
msgstr "所有对实体进行更新的语句"
#. Tag: para
+#: session_api.xml:749
#, no-c-format
msgid "all collection deletions"
msgstr "所有进行集合删除的语句"
#. Tag: para
+#: session_api.xml:753
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr "所有对集合元素进行删除,更新或者插入的语句"
#. Tag: para
+#: session_api.xml:757
#, no-c-format
msgid "all collection insertions"
msgstr "所有进行集合插入的语句"
#. Tag: para
+#: session_api.xml:761
#, no-c-format
-msgid "all entity deletions in the same order the corresponding objects were deleted using <literal>Session.delete()</literal>"
-msgstr "所有对实体进行删除的语句,其顺序按照对象执行 <literal>Session.delete()</literal> 的时间顺序 "
+msgid ""
+"all entity deletions in the same order the corresponding objects were "
+"deleted using <literal>Session.delete()</literal>"
+msgstr ""
+"所有对实体进行删除的语句,其顺序按照对象执行 <literal>Session.delete()</"
+"literal> 的时间顺序 "
#. Tag: para
+#: session_api.xml:766
#, no-c-format
-msgid "An exception is that objects using <literal>native</literal> ID generation are inserted when they are saved."
-msgstr "有一个例外是,如果对象使用 <literal>native</literal> 方式来生成 ID(持久化标识)的话,它们一执行 save 就会被插入。"
+msgid ""
+"An exception is that objects using <literal>native</literal> ID generation "
+"are inserted when they are saved."
+msgstr ""
+"有一个例外是,如果对象使用 <literal>native</literal> 方式来生成 ID(持久化标"
+"识)的话,它们一执行 save 就会被插入。"
#. Tag: para
+#: session_api.xml:769
#, no-c-format
-msgid "Except when you explicitly <literal>flush()</literal>, there are absolutely no guarantees about <emphasis>when</emphasis> the <literal>Session</literal> executes the JDBC calls, only the <emphasis>order</emphasis> in which they are executed. However, Hibernate does guarantee that the <literal>Query.list(..)</literal> will never return stale or incorrect data."
-msgstr "除非你明确地发出了 <literal>flush()</literal> 指令,关于 Session<emphasis> 何时</emphasis>会执行这些 JDBC 调用是完全无法保证的,只能保证它们执行的前后顺序。当然,Hibernate 保证,<literal>Query.list(..)</literal> 绝对不会返回已经失效的数据,也不会返回错误数据。 "
+msgid ""
+"Except when you explicitly <literal>flush()</literal>, there are absolutely "
+"no guarantees about <emphasis>when</emphasis> the <literal>Session</literal> "
+"executes the JDBC calls, only the <emphasis>order</emphasis> in which they "
+"are executed. However, Hibernate does guarantee that the <literal>Query.list"
+"(..)</literal> will never return stale or incorrect data."
+msgstr ""
+"除非你明确地发出了 <literal>flush()</literal> 指令,关于 Session<emphasis> 何"
+"时</emphasis>会执行这些 JDBC 调用是完全无法保证的,只能保证它们执行的前后顺"
+"序。当然,Hibernate 保证,<literal>Query.list(..)</literal> 绝对不会返回已经"
+"失效的数据,也不会返回错误数据。 "
#. Tag: para
-#, no-c-format
-msgid "It is possible to change the default behavior so that flush occurs less frequently. The <literal>FlushMode</literal> class defines three different modes: only flush at commit time when the Hibernate <literal>Transaction</literal> API is used, flush automatically using the explained routine, or never flush unless <literal>flush()</literal> is called explicitly. The last mode is useful for long running units of work, where a <literal>Session</literal> is kept open and disconnected for a long time (see <xref linkend=\"transactions-optimistic-longsession\" />)."
-msgstr "也可以改变默认的设置,来让刷出(flush)操作发生的不那么频繁。<literal>FlushMode</literal> 类定义了三种不同的方式。仅在提交时刷出(仅当 Hibernate 的 <literal>Transaction</literal> API 被使用时有效),按照刚才说的方式刷出,以及除非明确使用 <literal>flush()</literal> 否则从不刷出。 最后一种模式对于那些需要长时间保持 <literal>Session</literal> 为打开或者断线状态的长时间运行的工作单元很有用。(参见 <xref linkend=\"transactions-optimistic-longsession\"/>)。"
+#: session_api.xml:776
+#, fuzzy, no-c-format
+msgid ""
+"It is possible to change the default behavior so that flush occurs less "
+"frequently. The <literal>FlushMode</literal> class defines three different "
+"modes: only flush at commit time when the Hibernate <literal>Transaction</"
+"literal> API is used, flush automatically using the explained routine, or "
+"never flush unless <literal>flush()</literal> is called explicitly. The last "
+"mode is useful for long running units of work, where a <literal>Session</"
+"literal> is kept open and disconnected for a long time (see <xref linkend="
+"\"transactions-optimistic-longsession\"/>)."
+msgstr ""
+"也可以改变默认的设置,来让刷出(flush)操作发生的不那么频繁。"
+"<literal>FlushMode</literal> 类定义了三种不同的方式。仅在提交时刷出(仅当 "
+"Hibernate 的 <literal>Transaction</literal> API 被使用时有效),按照刚才说的"
+"方式刷出,以及除非明确使用 <literal>flush()</literal> 否则从不刷出。 最后一种"
+"模式对于那些需要长时间保持 <literal>Session</literal> 为打开或者断线状态的长"
+"时间运行的工作单元很有用。(参见 <xref linkend=\"transactions-optimistic-"
+"longsession\"/>)。"
+#. Tag: programlisting
+#: session_api.xml:786
+#, fuzzy, no-c-format
+msgid ""
+"sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();"
+msgstr ""
+"<![CDATA[sess = sf.openSession();\n"
+"Transaction tx = sess.beginTransaction();\n"
+"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
+"\n"
+"Cat izi = (Cat) sess.load(Cat.class, id);\n"
+"izi.setName(iznizi);\n"
+"\n"
+"// might return stale data\n"
+"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
+"\n"
+"// change to izi is not flushed!\n"
+"...\n"
+"tx.commit(); // flush occurs\n"
+"sess.close();]]>"
+
#. Tag: para
-#, no-c-format
-msgid "During flush, an exception might occur (e.g. if a DML operation violates a constraint). Since handling exceptions involves some understanding of Hibernate's transactional behavior, we discuss it in <xref linkend=\"transactions\" />."
-msgstr "刷出(flush)期间,可能会抛出异常(例如一个 DML 操作违反了约束)。异常处理涉及到对 Hibernate 事务性行为的理解,因此我们将在 <xref linkend=\"transactions\"/> 中讨论。 "
+#: session_api.xml:788
+#, fuzzy, no-c-format
+msgid ""
+"During flush, an exception might occur (e.g. if a DML operation violates a "
+"constraint). Since handling exceptions involves some understanding of "
+"Hibernate's transactional behavior, we discuss it in <xref linkend="
+"\"transactions\"/>."
+msgstr ""
+"刷出(flush)期间,可能会抛出异常(例如一个 DML 操作违反了约束)。异常处理涉"
+"及到对 Hibernate 事务性行为的理解,因此我们将在 <xref linkend=\"transactions"
+"\"/> 中讨论。 "
#. Tag: title
+#: session_api.xml:795
#, no-c-format
msgid "Transitive persistence"
msgstr "传播性持久化(transitive persistence)"
#. Tag: para
+#: session_api.xml:797
#, no-c-format
-msgid "It is quite cumbersome to save, delete, or reattach individual objects, especially if you deal with a graph of associated objects. A common case is a parent/child relationship. Consider the following example:"
-msgstr "对每一个对象都要执行保存,删除或重关联操作让人感觉有点麻烦,尤其是在处理许多彼此关联的对象的时候。一个常见的例子是父子关系。考虑下面的例子:"
+msgid ""
+"It is quite cumbersome to save, delete, or reattach individual objects, "
+"especially if you deal with a graph of associated objects. A common case is "
+"a parent/child relationship. Consider the following example:"
+msgstr ""
+"对每一个对象都要执行保存,删除或重关联操作让人感觉有点麻烦,尤其是在处理许多"
+"彼此关联的对象的时候。一个常见的例子是父子关系。考虑下面的例子:"
#. Tag: para
+#: session_api.xml:802
#, no-c-format
-msgid "If the children in a parent/child relationship would be value typed (e.g. a collection of addresses or strings), their life cycle would depend on the parent and no further action would be required for convenient \"cascading\" of state changes. When the parent is saved, the value-typed child objects are saved and when the parent is deleted, the children will be deleted, etc. This works for operations such as the removal of a child from the collection. Since value-typed objects cannot have shared references, Hibernate will detect this and delete the child from the database."
-msgstr "如果一个父子关系中的子对象是值类型(value typed)(例如,地址或字符串的集合)的,他们的生命周期会依赖于父对象,可以享受方便的级联操作(Cascading),不需要额外的动作。父对象被保存时,这些值类型(value typed)子对象也将被保存;父对象被删除时,子对象也将被删除。这对将一个子对象从集合中移除是同样有效:Hibernate 会检测到,并且因为值类型(value typed)的对象不可能被其他对象引用,所以 Hibernate 会在数据库中删除这个子对象。 "
+msgid ""
+"If the children in a parent/child relationship would be value typed (e.g. a "
+"collection of addresses or strings), their life cycle would depend on the "
+"parent and no further action would be required for convenient \"cascading\" "
+"of state changes. When the parent is saved, the value-typed child objects "
+"are saved and when the parent is deleted, the children will be deleted, etc. "
+"This works for operations such as the removal of a child from the "
+"collection. Since value-typed objects cannot have shared references, "
+"Hibernate will detect this and delete the child from the database."
+msgstr ""
+"如果一个父子关系中的子对象是值类型(value typed)(例如,地址或字符串的集合)"
+"的,他们的生命周期会依赖于父对象,可以享受方便的级联操作(Cascading),不需要"
+"额外的动作。父对象被保存时,这些值类型(value typed)子对象也将被保存;父对象"
+"被删除时,子对象也将被删除。这对将一个子对象从集合中移除是同样有效:"
+"Hibernate 会检测到,并且因为值类型(value typed)的对象不可能被其他对象引用,"
+"所以 Hibernate 会在数据库中删除这个子对象。 "
#. Tag: para
+#: session_api.xml:812
#, no-c-format
-msgid "Now consider the same scenario with parent and child objects being entities, not value-types (e.g. categories and items, or parent and child cats). Entities have their own life cycle and support shared references. Removing an entity from the collection does not mean it can be deleted), and there is by default no cascading of state from one entity to any other associated entities. Hibernate does not implement <emphasis>persistence by reachability</emphasis> by default."
-msgstr "现在考虑同样的场景,不过父子对象都是实体(entities)类型,而非值类型(value typed)(例如,类别与个体,或母猫和小猫)。实体有自己的生命期,允许共享对其的引用(因此从集合中移除一个实体,不意味着它可以被删除),并且实体到其他关联实体之间默认没有级联操作的设置。 Hibernate 默认不实现所谓的<emphasis>可到达即持久化(persistence by reachability)</emphasis>的策略。 "
+msgid ""
+"Now consider the same scenario with parent and child objects being entities, "
+"not value-types (e.g. categories and items, or parent and child cats). "
+"Entities have their own life cycle and support shared references. Removing "
+"an entity from the collection does not mean it can be deleted), and there is "
+"by default no cascading of state from one entity to any other associated "
+"entities. Hibernate does not implement <emphasis>persistence by "
+"reachability</emphasis> by default."
+msgstr ""
+"现在考虑同样的场景,不过父子对象都是实体(entities)类型,而非值类型(value "
+"typed)(例如,类别与个体,或母猫和小猫)。实体有自己的生命期,允许共享对其的"
+"引用(因此从集合中移除一个实体,不意味着它可以被删除),并且实体到其他关联实"
+"体之间默认没有级联操作的设置。 Hibernate 默认不实现所谓的<emphasis>可到达即持"
+"久化(persistence by reachability)</emphasis>的策略。 "
#. Tag: para
+#: session_api.xml:820
#, no-c-format
-msgid "For each basic operation of the Hibernate session - including <literal>persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), evict(), replicate()</literal> - there is a corresponding cascade style. Respectively, the cascade styles are named <literal>create, merge, save-update, delete, lock, refresh, evict, replicate</literal>. If you want an operation to be cascaded along an association, you must indicate that in the mapping document. For example:"
-msgstr "每个 Hibernate session 的基本操作 — 包括 <literal>persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), evict(), replicate()</literal> — 都有对应的级联风格(cascade style)。这些级联风格(cascade style)风格分别命名为 <literal>create, merge, save-update, delete, lock, refresh, evict, replicate</literal>。如果你希望一个操作被顺着关联关系级联传播,你必须在映射文件中指出这一点。例如:"
+msgid ""
+"For each basic operation of the Hibernate session - including "
+"<literal>persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), "
+"evict(), replicate()</literal> - there is a corresponding cascade style. "
+"Respectively, the cascade styles are named <literal>create, merge, save-"
+"update, delete, lock, refresh, evict, replicate</literal>. If you want an "
+"operation to be cascaded along an association, you must indicate that in the "
+"mapping document. For example:"
+msgstr ""
+"每个 Hibernate session 的基本操作 — 包括 <literal>persist(), merge(), "
+"saveOrUpdate(), delete(), lock(), refresh(), evict(), replicate()</literal> "
+"— 都有对应的级联风格(cascade style)。这些级联风格(cascade style)风格分别"
+"命名为 <literal>create, merge, save-update, delete, lock, refresh, evict, "
+"replicate</literal>。如果你希望一个操作被顺着关联关系级联传播,你必须在映射文"
+"件中指出这一点。例如:"
+#. Tag: programlisting
+#: session_api.xml:828
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
+msgstr "<![CDATA[<one-to-one name=\"person\" cascade=\"persist\"/>]]>"
+
#. Tag: para
+#: session_api.xml:830
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr "级联风格(cascade style)是可组合的:"
+#. Tag: programlisting
+#: session_api.xml:832
+#, fuzzy, no-c-format
+msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
+msgstr ""
+"<![CDATA[<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>]]>"
+
#. Tag: para
+#: session_api.xml:834
#, no-c-format
-msgid "You can even use <literal>cascade=\"all\"</literal> to specify that <emphasis>all</emphasis> operations should be cascaded along the association. The default <literal>cascade=\"none\"</literal> specifies that no operations are to be cascaded."
-msgstr "你可以使用 <literal>cascade=\"all\"</literal> 来指定<emphasis>全部</emphasis>操作都顺着关联关系级联(cascaded)。默认值是 <literal>cascade=\"none\"</literal>,即任何操作都不会被级联(cascaded)。 "
+msgid ""
+"You can even use <literal>cascade=\"all\"</literal> to specify that "
+"<emphasis>all</emphasis> operations should be cascaded along the "
+"association. The default <literal>cascade=\"none\"</literal> specifies that "
+"no operations are to be cascaded."
+msgstr ""
+"你可以使用 <literal>cascade=\"all\"</literal> 来指定<emphasis>全部</emphasis>"
+"操作都顺着关联关系级联(cascaded)。默认值是 <literal>cascade=\"none\"</"
+"literal>,即任何操作都不会被级联(cascaded)。 "
#. Tag: para
+#: session_api.xml:839
#, no-c-format
-msgid "A special cascade style, <literal>delete-orphan</literal>, applies only to one-to-many associations, and indicates that the <literal>delete()</literal> operation should be applied to any child object that is removed from the association."
-msgstr "注意有一个特殊的级联风格(cascade style) <literal>delete-orphan</literal>,只应用于 one-to-many 关联,表明 <literal>delete()</literal> 操作应该被应用于所有从关联中删除的对象。"
+msgid ""
+"In case you are using annotatons you probably have noticed the "
+"<literal>cascade</literal> attribute taking an array of "
+"<classname>CascadeType</classname> as a value. The cascade concept in JPA is "
+"very is similar to the transitive persistence and cascading of operations as "
+"described above, but with slightly different semantics and cascading types:"
+msgstr ""
#. Tag: para
+#: session_api.xml:848
#, no-c-format
-msgid "Recommendations:"
-msgstr "建议:"
+msgid ""
+"<literal>CascadeType.PERSIST</literal>: cascades the persist (create) "
+"operation to associated entities persist() is called or if the entity is "
+"managed"
+msgstr ""
#. Tag: para
+#: session_api.xml:854
#, no-c-format
-msgid "It does not usually make sense to enable cascade on a <literal><many-to-one></literal> or <literal><many-to-many></literal> association. Cascade is often useful for <literal><one-to-one></literal> and <literal><one-to-many></literal> associations."
-msgstr "通常在 <literal><many-to-one></literal> 或 <literal><many-to-many></literal> 关系中应用级联(cascade)没什么意义。级联(cascade)通常在 <literal><one-to-one></literal> 和 <literal><one-to-many></literal> 关系中比较有用。 "
+msgid ""
+"<literal>CascadeType.MERGE</literal>: cascades the merge operation to "
+"associated entities if merge() is called or if the entity is managed"
+msgstr ""
#. Tag: para
+#: session_api.xml:860
#, no-c-format
-msgid "If the child object's lifespan is bounded by the lifespan of the parent object, make it a <emphasis>life cycle object</emphasis> by specifying <literal>cascade=\"all,delete-orphan\"</literal>."
-msgstr "如果子对象的寿命限定在父亲对象的寿命之内,可通过指定 <literal>cascade=\"all,delete-orphan\"</literal> 将其变为<emphasis>自动生命周期管理的对象(lifecycle object)</emphasis>。 "
+msgid ""
+"<literal>CascadeType.REMOVE</literal>: cascades the remove operation to "
+"associated entities if delete() is called"
+msgstr ""
#. Tag: para
+#: session_api.xml:865
#, no-c-format
-msgid "Otherwise, you might not need cascade at all. But if you think that you will often be working with the parent and children together in the same transaction, and you want to save yourself some typing, consider using <literal>cascade=\"persist,merge,save-update\"</literal>."
-msgstr "其他情况,你可根本不需要级联(cascade)。但是如果你认为你会经常在某个事务中同时用到父对象与子对象,并且你希望少打点儿字,可以考虑使用 <literal>cascade=\"persist,merge,save-update\"</literal>。"
+msgid ""
+"<literal>CascadeType.REFRESH:</literal> cascades the refresh operation to "
+"associated entities if refresh() is called"
+msgstr ""
#. Tag: para
+#: session_api.xml:870
#, no-c-format
-msgid "Mapping an association (either a single valued association, or a collection) with <literal>cascade=\"all\"</literal> marks the association as a <emphasis>parent/child</emphasis> style relationship where save/update/delete of the parent results in save/update/delete of the child or children."
-msgstr "可以使用 <literal>cascade=\"all\"</literal> 将一个关联关系(无论是对值对象的关联,或者对一个集合的关联)标记为<emphasis>父/子</emphasis>关系的关联。 这样对父对象进行 save/update/delete 操作就会导致子对象也进行 save/update/delete 操作。"
+msgid ""
+"<literal>CascadeType.DETACH:</literal> cascades the detach operation to "
+"associated entities if detach() is called"
+msgstr ""
#. Tag: para
+#: session_api.xml:875
+#, fuzzy, no-c-format
+msgid "<literal>CascadeType.ALL</literal>: all of the above"
+msgstr "<literal>saveOrUpdate()</literal> 做下面的事:"
+
+#. Tag: para
+#: session_api.xml:880
#, no-c-format
-msgid "Furthermore, a mere reference to a child from a persistent parent will result in save/update of the child. This metaphor is incomplete, however. A child which becomes unreferenced by its parent is <emphasis>not</emphasis> automatically deleted, except in the case of a <literal><one-to-many></literal> association mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise semantics of cascading operations for a parent/child relationship are as follows:"
-msgstr "此外,一个持久的父对象对子对象的浅引用(mere reference)会导致子对象被同步 save/update。不过,这个隐喻(metaphor)的说法并不完整。除非关联是 <literal><one-to-many></literal> 关联并且被标记为 <literal>cascade=\"delete-orphan\"</literal>,否则父对象失去对某个子对象的引用<emphasis>不会</emphasis>导致该子对象被自动删除。父子关系的级联(cascading)操作准确语义如下: "
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc..."
+msgstr ""
#. Tag: para
+#: session_api.xml:884
#, no-c-format
-msgid "If a parent is passed to <literal>persist()</literal>, all children are passed to <literal>persist()</literal>"
-msgstr "如果父对象被 <literal>persist()</literal>,那么所有子对象也会被 <literal>persist()</literal>"
+msgid ""
+"A special cascade style, <literal>delete-orphan</literal>, applies only to "
+"one-to-many associations, and indicates that the <literal>delete()</literal> "
+"operation should be applied to any child object that is removed from the "
+"association. Using annotations there is no <literal>CascadeType.DELETE-"
+"ORPHAN</literal> equivalent. Instead you can use the attribute "
+"<literal>orphanRemoval as seen in </literal><xref linkend=\"example-one-to-"
+"many-with-orphan-removal\"/>. If an entity is removed from a "
+"<classname>@OneToMany</classname> collection or an associated entity is "
+"dereferenced from a <classname>@OneToOne</classname> association, this "
+"associated entity can be marked for deletion if <literal>orphanRemoval</"
+"literal> is set to true."
+msgstr ""
+#. Tag: title
+#: session_api.xml:897
+#, no-c-format
+msgid "<literal>@OneToMany</literal> with <literal>orphanRemoval</literal>"
+msgstr ""
+
+#. Tag: programlisting
+#: session_api.xml:900
+#, no-c-format
+msgid ""
+"@Entity \n"
+"public class Customer {\n"
+" private Set<Order> orders;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
+" public Set<Order> getOrders() { return orders; }\n"
+"\n"
+" public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
+"\n"
+" [...]\n"
+"}\n"
+"\n"
+"@Entity \n"
+"public class Order { ... }\n"
+"\n"
+"Customer customer = em.find(Customer.class, 1l);\n"
+"Order order = em.find(Order.class, 1l);\n"
+"customer.getOrders().remove(order); //order will be deleted by cascade"
+msgstr ""
+
#. Tag: para
+#: session_api.xml:903
#, no-c-format
-msgid "If a parent is passed to <literal>merge()</literal>, all children are passed to <literal>merge()</literal>"
-msgstr "如果父对象被 <literal>merge()</literal>,那么所有子对象也会被 <literal>merge()</literal>"
+msgid "Recommendations:"
+msgstr "建议:"
#. Tag: para
+#: session_api.xml:907
+#, fuzzy, no-c-format
+msgid ""
+"It does not usually make sense to enable cascade on a many-to-one or many-to-"
+"many association. In fact the <literal>@ManyToOne</literal> and "
+"<literal>@ManyToMany</literal> don't even offer a <literal>orphanRemoval</"
+"literal> attribute. Cascading is often useful for one-to-one and one-to-many "
+"associations."
+msgstr ""
+"通常在 <literal><many-to-one></literal> 或 <literal><many-to-"
+"many></literal> 关系中应用级联(cascade)没什么意义。级联(cascade)通常"
+"在 <literal><one-to-one></literal> 和 <literal><one-to-many></"
+"literal> 关系中比较有用。 "
+
+#. Tag: para
+#: session_api.xml:915
+#, fuzzy, no-c-format
+msgid ""
+"If the child object's lifespan is bounded by the lifespan of the parent "
+"object, make it a <emphasis>life cycle object</emphasis> by specifying "
+"<literal>cascade=\"all,delete-orphan\"(<literal>@OneToMany"
+"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)</literal>."
+msgstr ""
+"如果子对象的寿命限定在父亲对象的寿命之内,可通过指定 <literal>cascade=\"all,"
+"delete-orphan\"</literal> 将其变为<emphasis>自动生命周期管理的对象"
+"(lifecycle object)</emphasis>。 "
+
+#. Tag: para
+#: session_api.xml:923
#, no-c-format
-msgid "If a parent is passed to <literal>save()</literal>, <literal>update()</literal> or <literal>saveOrUpdate()</literal>, all children are passed to <literal>saveOrUpdate()</literal>"
-msgstr "如果父对象被 <literal>save()</literal>,<literal>update()</literal> 或 <literal>saveOrUpdate()</literal>,那么所有子对象则会被 <literal>saveOrUpdate()</literal>"
+msgid ""
+"Otherwise, you might not need cascade at all. But if you think that you will "
+"often be working with the parent and children together in the same "
+"transaction, and you want to save yourself some typing, consider using "
+"<literal>cascade=\"persist,merge,save-update\"</literal>."
+msgstr ""
+"其他情况,你可根本不需要级联(cascade)。但是如果你认为你会经常在某个事务中同"
+"时用到父对象与子对象,并且你希望少打点儿字,可以考虑使用 <literal>cascade="
+"\"persist,merge,save-update\"</literal>。"
#. Tag: para
+#: session_api.xml:931
#, no-c-format
-msgid "If a transient or detached child becomes referenced by a persistent parent, it is passed to <literal>saveOrUpdate()</literal>"
-msgstr "如果某个持久的父对象引用了瞬时(transient)或者脱管(detached)的子对象,那么子对象将会被 <literal>saveOrUpdate()</literal>"
+msgid ""
+"Mapping an association (either a single valued association, or a collection) "
+"with <literal>cascade=\"all\"</literal> marks the association as a "
+"<emphasis>parent/child</emphasis> style relationship where save/update/"
+"delete of the parent results in save/update/delete of the child or children."
+msgstr ""
+"可以使用 <literal>cascade=\"all\"</literal> 将一个关联关系(无论是对值对象的"
+"关联,或者对一个集合的关联)标记为<emphasis>父/子</emphasis>关系的关联。 这样"
+"对父对象进行 save/update/delete 操作就会导致子对象也进行 save/update/delete "
+"操作。"
#. Tag: para
+#: session_api.xml:937
+#, fuzzy, no-c-format
+msgid ""
+"Furthermore, a mere reference to a child from a persistent parent will "
+"result in save/update of the child. This metaphor is incomplete, however. A "
+"child which becomes unreferenced by its parent is <emphasis>not</emphasis> "
+"automatically deleted, except in the case of a one-to-many association "
+"mapped with <literal>cascade=\"delete-orphan\"</literal>. The precise "
+"semantics of cascading operations for a parent/child relationship are as "
+"follows:"
+msgstr ""
+"此外,一个持久的父对象对子对象的浅引用(mere reference)会导致子对象被同步 "
+"save/update。不过,这个隐喻(metaphor)的说法并不完整。除非关联是 "
+"<literal><one-to-many></literal> 关联并且被标记为 <literal>cascade="
+"\"delete-orphan\"</literal>,否则父对象失去对某个子对象的引用<emphasis>不会</"
+"emphasis>导致该子对象被自动删除。父子关系的级联(cascading)操作准确语义如"
+"下: "
+
+#. Tag: para
+#: session_api.xml:948
#, no-c-format
-msgid "If a parent is deleted, all children are passed to <literal>delete()</literal>"
+msgid ""
+"If a parent is passed to <literal>persist()</literal>, all children are "
+"passed to <literal>persist()</literal>"
+msgstr ""
+"如果父对象被 <literal>persist()</literal>,那么所有子对象也会被 "
+"<literal>persist()</literal>"
+
+#. Tag: para
+#: session_api.xml:953
+#, no-c-format
+msgid ""
+"If a parent is passed to <literal>merge()</literal>, all children are passed "
+"to <literal>merge()</literal>"
+msgstr ""
+"如果父对象被 <literal>merge()</literal>,那么所有子对象也会被 <literal>merge"
+"()</literal>"
+
+#. Tag: para
+#: session_api.xml:958
+#, no-c-format
+msgid ""
+"If a parent is passed to <literal>save()</literal>, <literal>update()</"
+"literal> or <literal>saveOrUpdate()</literal>, all children are passed to "
+"<literal>saveOrUpdate()</literal>"
+msgstr ""
+"如果父对象被 <literal>save()</literal>,<literal>update()</literal> 或 "
+"<literal>saveOrUpdate()</literal>,那么所有子对象则会被 <literal>saveOrUpdate"
+"()</literal>"
+
+#. Tag: para
+#: session_api.xml:964
+#, no-c-format
+msgid ""
+"If a transient or detached child becomes referenced by a persistent parent, "
+"it is passed to <literal>saveOrUpdate()</literal>"
+msgstr ""
+"如果某个持久的父对象引用了瞬时(transient)或者脱管(detached)的子对象,那么"
+"子对象将会被 <literal>saveOrUpdate()</literal>"
+
+#. Tag: para
+#: session_api.xml:970
+#, no-c-format
+msgid ""
+"If a parent is deleted, all children are passed to <literal>delete()</"
+"literal>"
msgstr "如果父对象被删除,那么所有子对象也会被 <literal>delete()</literal>"
#. Tag: para
+#: session_api.xml:975
#, no-c-format
-msgid "If a child is dereferenced by a persistent parent, <emphasis>nothing special happens</emphasis> - the application should explicitly delete the child if necessary - unless <literal>cascade=\"delete-orphan\"</literal>, in which case the \"orphaned\" child is deleted."
-msgstr "除非被标记为 <literal>cascade=\"delete-orphan\"</literal>(删除“孤儿”模式,此时不被任何一个父对象引用的子对象会被删除),否则子对象失掉父对象对其的引用时,<emphasis>什么事也不会发生</emphasis>。如果有特殊需要,应用程序可通过显式调用 delete() 删除子对象。"
+msgid ""
+"If a child is dereferenced by a persistent parent, <emphasis>nothing special "
+"happens</emphasis> - the application should explicitly delete the child if "
+"necessary - unless <literal>cascade=\"delete-orphan\"</literal>, in which "
+"case the \"orphaned\" child is deleted."
+msgstr ""
+"除非被标记为 <literal>cascade=\"delete-orphan\"</literal>(删除“孤儿”模式,此"
+"时不被任何一个父对象引用的子对象会被删除),否则子对象失掉父对象对其的引用"
+"时,<emphasis>什么事也不会发生</emphasis>。如果有特殊需要,应用程序可通过显式"
+"调用 delete() 删除子对象。"
#. Tag: para
+#: session_api.xml:983
#, no-c-format
-msgid "Finally, note that cascading of operations can be applied to an object graph at <emphasis>call time</emphasis> or at <emphasis>flush time</emphasis>. All operations, if enabled, are cascaded to associated entities reachable when the operation is executed. However, <literal>save-update</literal> and <literal>delete-orphan</literal> are transitive for all associated entities reachable during flush of the <literal>Session</literal>."
-msgstr "最后,注意操作的级联可能是在<emphasis>调用期(call time)</emphasis>或者<emphasis>写入期(flush time)</emphasis>作用到对象图上的。所有的操作,如果允许,都在操作被执行的时候级联到可触及的关联实体上。然而,<literal>save-upate</literal> 和 <literal>delete-orphan</literal> 是在<literal>Session</literal> flush 的时候才作用到所有可触及的被关联对象上的。 "
+msgid ""
+"Finally, note that cascading of operations can be applied to an object graph "
+"at <emphasis>call time</emphasis> or at <emphasis>flush time</emphasis>. All "
+"operations, if enabled, are cascaded to associated entities reachable when "
+"the operation is executed. However, <literal>save-update</literal> and "
+"<literal>delete-orphan</literal> are transitive for all associated entities "
+"reachable during flush of the <literal>Session</literal>."
+msgstr ""
+"最后,注意操作的级联可能是在<emphasis>调用期(call time)</emphasis>或者"
+"<emphasis>写入期(flush time)</emphasis>作用到对象图上的。所有的操作,如果允"
+"许,都在操作被执行的时候级联到可触及的关联实体上。然而,<literal>save-upate</"
+"literal> 和 <literal>delete-orphan</literal> 是在<literal>Session</literal> "
+"flush 的时候才作用到所有可触及的被关联对象上的。 "
#. Tag: title
+#: session_api.xml:993
#, no-c-format
msgid "Using metadata"
msgstr "使用元数据"
#. Tag: para
+#: session_api.xml:995
#, no-c-format
-msgid "Hibernate requires a rich meta-level model of all entity and value types. This model can be useful to the application itself. For example, the application might use Hibernate's metadata to implement a \"smart\" deep-copy algorithm that understands which objects should be copied (eg. mutable value types) and which objects that should not (e.g. immutable value types and, possibly, associated entities)."
-msgstr "Hibernate 中有一个非常丰富的元级别(meta-level)的模型,含有所有的实体和值类型数据的元数据。 有时这个模型对应用程序本身也会非常有用。比如说,应用程序可能在实现一种“智能”的深度拷贝算法时,通过使用 Hibernate 的元数据来了解哪些对象应该被拷贝(比如,可变的值类型数据),那些不应该(不可变的值类型数据,也许还有某些被关联的实体)。 "
+msgid ""
+"Hibernate requires a rich meta-level model of all entity and value types. "
+"This model can be useful to the application itself. For example, the "
+"application might use Hibernate's metadata to implement a \"smart\" deep-"
+"copy algorithm that understands which objects should be copied (eg. mutable "
+"value types) and which objects that should not (e.g. immutable value types "
+"and, possibly, associated entities)."
+msgstr ""
+"Hibernate 中有一个非常丰富的元级别(meta-level)的模型,含有所有的实体和值类"
+"型数据的元数据。 有时这个模型对应用程序本身也会非常有用。比如说,应用程序可能"
+"在实现一种“智能”的深度拷贝算法时,通过使用 Hibernate 的元数据来了解哪些对象应"
+"该被拷贝(比如,可变的值类型数据),那些不应该(不可变的值类型数据,也许还有"
+"某些被关联的实体)。 "
#. Tag: para
+#: session_api.xml:1002
#, no-c-format
-msgid "Hibernate exposes metadata via the <literal>ClassMetadata</literal> and <literal>CollectionMetadata</literal> interfaces and the <literal>Type</literal> hierarchy. Instances of the metadata interfaces can be obtained from the <literal>SessionFactory</literal>."
-msgstr "Hibernate 提供了 <literal>ClassMetadata</literal> 接口,<literal>CollectionMetadata</literal> 接口和 <literal>Type</literal> 层次体系来访问元数据。可以通过 <literal>SessionFactory</literal> 获取元数据接口的实例。 "
+msgid ""
+"Hibernate exposes metadata via the <literal>ClassMetadata</literal> and "
+"<literal>CollectionMetadata</literal> interfaces and the <literal>Type</"
+"literal> hierarchy. Instances of the metadata interfaces can be obtained "
+"from the <literal>SessionFactory</literal>."
+msgstr ""
+"Hibernate 提供了 <literal>ClassMetadata</literal> 接口,"
+"<literal>CollectionMetadata</literal> 接口和 <literal>Type</literal> 层次体系"
+"来访问元数据。可以通过 <literal>SessionFactory</literal> 获取元数据接口的实"
+"例。 "
+#. Tag: programlisting
+#: session_api.xml:1007
+#, fuzzy, no-c-format
+msgid ""
+"Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}"
+msgstr ""
+"<![CDATA[Cat fritz = ......;\n"
+"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
+"\n"
+"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
+"String[] propertyNames = catMeta.getPropertyNames();\n"
+"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
+"\n"
+"// get a Map of all properties which are not collections or associations\n"
+"Map namedValues = new HashMap();\n"
+"for ( int i=0; i<propertyNames.length; i++ ) {\n"
+" if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
+"isCollectionType() ) {\n"
+" namedValues.put( propertyNames[i], propertyValues[i] );\n"
+" }\n"
+"}]]>"
+
#~ msgid ""
-#~ "<![CDATA[DomesticCat fritz = new DomesticCat();\n"
-#~ "fritz.setColor(Color.GINGER);\n"
-#~ "fritz.setSex('M');\n"
-#~ "fritz.setName(\"Fritz\");\n"
-#~ "Long generatedId = (Long) sess.save(fritz);]]>"
+#~ "A special cascade style, <literal>delete-orphan</literal>, applies only "
+#~ "to one-to-many associations, and indicates that the <literal>delete()</"
+#~ "literal> operation should be applied to any child object that is removed "
+#~ "from the association."
#~ msgstr ""
-#~ "<![CDATA[DomesticCat fritz = new DomesticCat();\n"
-#~ "fritz.setColor(Color.GINGER);\n"
-#~ "fritz.setSex('M');\n"
-#~ "fritz.setName(\"Fritz\");\n"
-#~ "Long generatedId = (Long) sess.save(fritz);]]>"
-#~ msgid ""
-#~ "<![CDATA[DomesticCat pk = new DomesticCat();\n"
-#~ "pk.setColor(Color.TABBY);\n"
-#~ "pk.setSex('F');\n"
-#~ "pk.setName(\"PK\");\n"
-#~ "pk.setKittens( new HashSet() );\n"
-#~ "pk.addKitten(fritz);\n"
-#~ "sess.save( pk, new Long(1234) );]]>"
-#~ msgstr ""
-#~ "<![CDATA[DomesticCat pk = new DomesticCat();\n"
-#~ "pk.setColor(Color.TABBY);\n"
-#~ "pk.setSex('F');\n"
-#~ "pk.setName(\"PK\");\n"
-#~ "pk.setKittens( new HashSet() );\n"
-#~ "pk.addKitten(fritz);\n"
-#~ "sess.save( pk, new Long(1234) );]]>"
-#~ msgid "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"
-#~ msgstr "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"
-#~ msgid ""
-#~ "<![CDATA[// you need to wrap primitive identifiers\n"
-#~ "long id = 1234;\n"
-#~ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
-#~ "(id) );]]>"
-#~ msgstr ""
-#~ "<![CDATA[// you need to wrap primitive identifiers\n"
-#~ "long id = 1234;\n"
-#~ "DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long"
-#~ "(id) );]]>"
-#~ msgid ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "// load pk's state into cat\n"
-#~ "sess.load( cat, new Long(pkId) );\n"
-#~ "Set kittens = cat.getKittens();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat cat = new DomesticCat();\n"
-#~ "// load pk's state into cat\n"
-#~ "sess.load( cat, new Long(pkId) );\n"
-#~ "Set kittens = cat.getKittens();]]>"
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id);\n"
-#~ "if (cat==null) {\n"
-#~ " cat = new Cat();\n"
-#~ " sess.save(cat, id);\n"
-#~ "}\n"
-#~ "return cat;]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id);\n"
-#~ "if (cat==null) {\n"
-#~ " cat = new Cat();\n"
-#~ " sess.save(cat, id);\n"
-#~ "}\n"
-#~ "return cat;]]>"
-#~ msgid ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);]]>"
-#~ msgid ""
-#~ "<![CDATA[sess.save(cat);\n"
-#~ "sess.flush(); //force the SQL INSERT\n"
-#~ "sess.refresh(cat); //re-read the state (after the trigger executes)]]>"
-#~ msgstr ""
-#~ "<![CDATA[sess.save(cat);\n"
-#~ "sess.flush(); //force the SQL INSERT\n"
-#~ "sess.refresh(cat); //re-read the state (after the trigger executes)]]>"
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.birthdate < ?\")\n"
-#~ " .setDate(0, date)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List mothers = session.createQuery(\n"
-#~ " \"select mother from Cat as cat join cat.mother as mother where cat."
-#~ "name = ?\")\n"
-#~ " .setString(0, name)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List kittens = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.mother = ?\")\n"
-#~ " .setEntity(0, pk)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "Cat mother = (Cat) session.createQuery(\n"
-#~ " \"select cat.mother from Cat as cat where cat = ?\")\n"
-#~ " .setEntity(0, izi)\n"
-#~ " .uniqueResult();]]\n"
-#~ "\n"
-#~ "Query mothersWithKittens = (Cat) session.createQuery(\n"
-#~ " \"select mother from Cat as mother left join fetch mother.kittens"
-#~ "\");\n"
-#~ "Set uniqueMothers = new HashSet(mothersWithKittens.list());]]>"
-#~ msgstr ""
-#~ "<![CDATA[List cats = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.birthdate < ?\")\n"
-#~ " .setDate(0, date)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List mothers = session.createQuery(\n"
-#~ " \"select mother from Cat as cat join cat.mother as mother where cat."
-#~ "name = ?\")\n"
-#~ " .setString(0, name)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "List kittens = session.createQuery(\n"
-#~ " \"from Cat as cat where cat.mother = ?\")\n"
-#~ " .setEntity(0, pk)\n"
-#~ " .list();\n"
-#~ "\n"
-#~ "Cat mother = (Cat) session.createQuery(\n"
-#~ " \"select cat.mother from Cat as cat where cat = ?\")\n"
-#~ " .setEntity(0, izi)\n"
-#~ " .uniqueResult();]]\n"
-#~ "\n"
-#~ "Query mothersWithKittens = (Cat) session.createQuery(\n"
-#~ " \"select mother from Cat as mother left join fetch mother.kittens"
-#~ "\");\n"
-#~ "Set uniqueMothers = new HashSet(mothersWithKittens.list());]]>"
-#~ msgid ""
-#~ "<![CDATA[// fetch ids\n"
-#~ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
-#~ "iterate();\n"
-#~ "while ( iter.hasNext() ) {\n"
-#~ " Qux qux = (Qux) iter.next(); // fetch the object\n"
-#~ " // something we couldnt express in the query\n"
-#~ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
-#~ " // delete the current instance\n"
-#~ " iter.remove();\n"
-#~ " // dont need to process the rest\n"
-#~ " break;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[// fetch ids\n"
-#~ "Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
-#~ "iterate();\n"
-#~ "while ( iter.hasNext() ) {\n"
-#~ " Qux qux = (Qux) iter.next(); // fetch the object\n"
-#~ " // something we couldnt express in the query\n"
-#~ " if ( qux.calculateComplicatedAlgorithm() ) {\n"
-#~ " // delete the current instance\n"
-#~ " iter.remove();\n"
-#~ " // dont need to process the rest\n"
-#~ " break;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgid ""
-#~ "<![CDATA[Iterator kittensAndMothers = sess.createQuery(\n"
-#~ " \"select kitten, mother from Cat kitten join kitten.mother "
-#~ "mother\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( kittensAndMothers.hasNext() ) {\n"
-#~ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
-#~ " Cat kitten = (Cat) tuple[0];\n"
-#~ " Cat mother = (Cat) tuple[1];\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[Iterator kittensAndMothers = sess.createQuery(\n"
-#~ " \"select kitten, mother from Cat kitten join kitten.mother "
-#~ "mother\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( kittensAndMothers.hasNext() ) {\n"
-#~ " Object[] tuple = (Object[]) kittensAndMothers.next();\n"
-#~ " Cat kitten = (Cat) tuple[0];\n"
-#~ " Cat mother = (Cat) tuple[1];\n"
-#~ " ....\n"
-#~ "}]]>"
-#~ msgid ""
-#~ "<![CDATA[Iterator results = sess.createQuery(\n"
-#~ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat "
-#~ "\" +\n"
-#~ " \"group by cat.color\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( results.hasNext() ) {\n"
-#~ " Object[] row = (Object[]) results.next();\n"
-#~ " Color type = (Color) row[0];\n"
-#~ " Date oldest = (Date) row[1];\n"
-#~ " Integer count = (Integer) row[2];\n"
-#~ " .....\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[Iterator results = sess.createQuery(\n"
-#~ " \"select cat.color, min(cat.birthdate), count(cat) from Cat cat "
-#~ "\" +\n"
-#~ " \"group by cat.color\")\n"
-#~ " .list()\n"
-#~ " .iterator();\n"
-#~ "\n"
-#~ "while ( results.hasNext() ) {\n"
-#~ " Object[] row = (Object[]) results.next();\n"
-#~ " Color type = (Color) row[0];\n"
-#~ " Date oldest = (Date) row[1];\n"
-#~ " Integer count = (Integer) row[2];\n"
-#~ " .....\n"
-#~ "}]]>"
-#~ msgid ""
-#~ "<![CDATA[//named parameter (preferred)\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
-#~ "\");\n"
-#~ "q.setString(\"name\", \"Fritz\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgstr ""
-#~ "<![CDATA[//named parameter (preferred)\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
-#~ "\");\n"
-#~ "q.setString(\"name\", \"Fritz\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgid ""
-#~ "<![CDATA[//positional parameter\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
-#~ "q.setString(0, \"Izi\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgstr ""
-#~ "<![CDATA[//positional parameter\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
-#~ "q.setString(0, \"Izi\");\n"
-#~ "Iterator cats = q.iterate();]]>"
-#~ msgid ""
-#~ "<![CDATA[//named parameter list\n"
-#~ "List names = new ArrayList();\n"
-#~ "names.add(\"Izi\");\n"
-#~ "names.add(\"Fritz\");\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
-#~ "namesList)\");\n"
-#~ "q.setParameterList(\"namesList\", names);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[//named parameter list\n"
-#~ "List names = new ArrayList();\n"
-#~ "names.add(\"Izi\");\n"
-#~ "names.add(\"Fritz\");\n"
-#~ "Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
-#~ "namesList)\");\n"
-#~ "q.setParameterList(\"namesList\", names);\n"
-#~ "List cats = q.list();]]>"
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.createQuery(\"from DomesticCat cat\");\n"
-#~ "q.setFirstResult(20);\n"
-#~ "q.setMaxResults(10);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Query q = sess.createQuery(\"from DomesticCat cat\");\n"
-#~ "q.setFirstResult(20);\n"
-#~ "q.setMaxResults(10);\n"
-#~ "List cats = q.list();]]>"
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.createQuery(\"select cat.name, cat from "
-#~ "DomesticCat cat \" +\n"
-#~ " \"order by cat.name\");\n"
-#~ "ScrollableResults cats = q.scroll();\n"
-#~ "if ( cats.first() ) {\n"
-#~ "\n"
-#~ " // find the first name on each page of an alphabetical list of cats "
-#~ "by name\n"
-#~ " firstNamesOfPages = new ArrayList();\n"
-#~ " do {\n"
-#~ " String name = cats.getString(0);\n"
-#~ " firstNamesOfPages.add(name);\n"
-#~ " }\n"
-#~ " while ( cats.scroll(PAGE_SIZE) );\n"
-#~ "\n"
-#~ " // Now get the first page of cats\n"
-#~ " pageOfCats = new ArrayList();\n"
-#~ " cats.beforeFirst();\n"
-#~ " int i=0;\n"
-#~ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add( cats.get"
-#~ "(1) );\n"
-#~ "\n"
-#~ "}\n"
-#~ "cats.close()]]>"
-#~ msgstr ""
-#~ "<![CDATA[Query q = sess.createQuery(\"select cat.name, cat from "
-#~ "DomesticCat cat \" +\n"
-#~ " \"order by cat.name\");\n"
-#~ "ScrollableResults cats = q.scroll();\n"
-#~ "if ( cats.first() ) {\n"
-#~ "\n"
-#~ " // find the first name on each page of an alphabetical list of cats "
-#~ "by name\n"
-#~ " firstNamesOfPages = new ArrayList();\n"
-#~ " do {\n"
-#~ " String name = cats.getString(0);\n"
-#~ " firstNamesOfPages.add(name);\n"
-#~ " }\n"
-#~ " while ( cats.scroll(PAGE_SIZE) );\n"
-#~ "\n"
-#~ " // Now get the first page of cats\n"
-#~ " pageOfCats = new ArrayList();\n"
-#~ " cats.beforeFirst();\n"
-#~ " int i=0;\n"
-#~ " while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add( cats.get"
-#~ "(1) );\n"
-#~ "\n"
-#~ "}\n"
-#~ "cats.close()]]>"
-#~ msgid ""
-#~ "<![CDATA[<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
-#~ " from eg.DomesticCat as cat\n"
-#~ " where cat.name = ?\n"
-#~ " and cat.weight > ?\n"
-#~ "] ]></query>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
-#~ " from eg.DomesticCat as cat\n"
-#~ " where cat.name = ?\n"
-#~ " and cat.weight > ?\n"
-#~ "] ]></query>]]>"
-#~ msgid ""
-#~ "<![CDATA[Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
-#~ "q.setString(0, name);\n"
-#~ "q.setInt(1, minWeight);\n"
-#~ "List cats = q.list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
-#~ "q.setString(0, name);\n"
-#~ "q.setInt(1, minWeight);\n"
-#~ "List cats = q.list();]]>"
-#~ msgid ""
-#~ "<![CDATA[Collection blackKittens = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"where this.color = ?\")\n"
-#~ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
-#~ " .list()\n"
-#~ ");]]>"
-#~ msgstr ""
-#~ "<![CDATA[Collection blackKittens = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"where this.color = ?\")\n"
-#~ " .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
-#~ " .list()\n"
-#~ ");]]>"
-#~ msgid ""
-#~ "<![CDATA[Collection blackKittenMates = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Collection blackKittenMates = session.createFilter(\n"
-#~ " pk.getKittens(), \n"
-#~ " \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"
-#~ " .list();]]>"
-#~ msgid ""
-#~ "<![CDATA[Collection tenKittens = session.createFilter(\n"
-#~ " mother.getKittens(), \"\")\n"
-#~ " .setFirstResult(0).setMaxResults(10)\n"
-#~ " .list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Collection tenKittens = session.createFilter(\n"
-#~ " mother.getKittens(), \"\")\n"
-#~ " .setFirstResult(0).setMaxResults(10)\n"
-#~ " .list();]]>"
-#~ msgid ""
-#~ "<![CDATA[Criteria crit = session.createCriteria(Cat.class);\n"
-#~ "crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
-#~ "crit.setMaxResults(10);\n"
-#~ "List cats = crit.list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[Criteria crit = session.createCriteria(Cat.class);\n"
-#~ "crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
-#~ "crit.setMaxResults(10);\n"
-#~ "List cats = crit.list();]]>"
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT "
-#~ "{cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list();]]>"
-#~ msgstr ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT "
-#~ "{cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list();]]>"
-#~ msgid ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
-#~ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... "
-#~ "\" +\n"
-#~ " \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list()]]>"
-#~ msgstr ""
-#~ "<![CDATA[List cats = session.createSQLQuery(\n"
-#~ " \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"
-#~ " \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... "
-#~ "\" +\n"
-#~ " \"FROM CAT {cat} WHERE ROWNUM<10\")\n"
-#~ " .addEntity(\"cat\", Cat.class)\n"
-#~ ".list()]]>"
-#~ msgid ""
-#~ "<![CDATA[DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long"
-#~ "(69) );\n"
-#~ "cat.setName(\"PK\");\n"
-#~ "sess.flush(); // changes to cat are automatically detected and "
-#~ "persisted]]>"
-#~ msgstr ""
-#~ "<![CDATA[DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long"
-#~ "(69) );\n"
-#~ "cat.setName(\"PK\");\n"
-#~ "sess.flush(); // changes to cat are automatically detected and "
-#~ "persisted]]>"
-#~ msgid ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
-#~ "Cat potentialMate = new Cat();\n"
-#~ "firstSession.save(potentialMate);\n"
-#~ "\n"
-#~ "// in a higher layer of the application\n"
-#~ "cat.setMate(potentialMate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.update(cat); // update cat\n"
-#~ "secondSession.update(mate); // update mate]]>"
-#~ msgstr ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
-#~ "Cat potentialMate = new Cat();\n"
-#~ "firstSession.save(potentialMate);\n"
-#~ "\n"
-#~ "// in a higher layer of the application\n"
-#~ "cat.setMate(potentialMate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.update(cat); // update cat\n"
-#~ "secondSession.update(mate); // update mate]]>"
-#~ msgid ""
-#~ "<![CDATA[//just reassociate:\n"
-#~ "sess.lock(fritz, LockMode.NONE);\n"
-#~ "//do a version check, then reassociate:\n"
-#~ "sess.lock(izi, LockMode.READ);\n"
-#~ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
-#~ "sess.lock(pk, LockMode.UPGRADE);]]>"
-#~ msgstr ""
-#~ "<![CDATA[//just reassociate:\n"
-#~ "sess.lock(fritz, LockMode.NONE);\n"
-#~ "//do a version check, then reassociate:\n"
-#~ "sess.lock(izi, LockMode.READ);\n"
-#~ "//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
-#~ "sess.lock(pk, LockMode.UPGRADE);]]>"
-#~ msgid ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
-#~ "\n"
-#~ "// in a higher tier of the application\n"
-#~ "Cat mate = new Cat();\n"
-#~ "cat.setMate(mate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.saveOrUpdate(cat); // update existing state (cat has a "
-#~ "non-null id)\n"
-#~ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a "
-#~ "null id)]]>"
-#~ msgstr ""
-#~ "<![CDATA[// in the first session\n"
-#~ "Cat cat = (Cat) firstSession.load(Cat.class, catID);\n"
-#~ "\n"
-#~ "// in a higher tier of the application\n"
-#~ "Cat mate = new Cat();\n"
-#~ "cat.setMate(mate);\n"
-#~ "\n"
-#~ "// later, in a new session\n"
-#~ "secondSession.saveOrUpdate(cat); // update existing state (cat has a "
-#~ "non-null id)\n"
-#~ "secondSession.saveOrUpdate(mate); // save the new instance (mate has a "
-#~ "null id)]]>"
-#~ msgid "<![CDATA[sess.delete(cat);]]>"
-#~ msgstr "<![CDATA[sess.delete(cat);]]>"
-#~ msgid ""
-#~ "<![CDATA[//retrieve a cat from one database\n"
-#~ "Session session1 = factory1.openSession();\n"
-#~ "Transaction tx1 = session1.beginTransaction();\n"
-#~ "Cat cat = session1.get(Cat.class, catId);\n"
-#~ "tx1.commit();\n"
-#~ "session1.close();\n"
-#~ "\n"
-#~ "//reconcile with a second database\n"
-#~ "Session session2 = factory2.openSession();\n"
-#~ "Transaction tx2 = session2.beginTransaction();\n"
-#~ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
-#~ "tx2.commit();\n"
-#~ "session2.close();]]>"
-#~ msgstr ""
-#~ "<![CDATA[//retrieve a cat from one database\n"
-#~ "Session session1 = factory1.openSession();\n"
-#~ "Transaction tx1 = session1.beginTransaction();\n"
-#~ "Cat cat = session1.get(Cat.class, catId);\n"
-#~ "tx1.commit();\n"
-#~ "session1.close();\n"
-#~ "\n"
-#~ "//reconcile with a second database\n"
-#~ "Session session2 = factory2.openSession();\n"
-#~ "Transaction tx2 = session2.beginTransaction();\n"
-#~ "session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
-#~ "tx2.commit();\n"
-#~ "session2.close();]]>"
-#~ msgid ""
-#~ "<![CDATA[sess = sf.openSession();\n"
-#~ "Transaction tx = sess.beginTransaction();\n"
-#~ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale "
-#~ "state\n"
-#~ "\n"
-#~ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
-#~ "izi.setName(iznizi);\n"
-#~ "\n"
-#~ "// might return stale data\n"
-#~ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
-#~ "\n"
-#~ "// change to izi is not flushed!\n"
-#~ "...\n"
-#~ "tx.commit(); // flush occurs\n"
-#~ "sess.close();]]>"
-#~ msgstr ""
-#~ "<![CDATA[sess = sf.openSession();\n"
-#~ "Transaction tx = sess.beginTransaction();\n"
-#~ "sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale "
-#~ "state\n"
-#~ "\n"
-#~ "Cat izi = (Cat) sess.load(Cat.class, id);\n"
-#~ "izi.setName(iznizi);\n"
-#~ "\n"
-#~ "// might return stale data\n"
-#~ "sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
-#~ "\n"
-#~ "// change to izi is not flushed!\n"
-#~ "...\n"
-#~ "tx.commit(); // flush occurs\n"
-#~ "sess.close();]]>"
-#~ msgid "<![CDATA[<one-to-one name=\"person\" cascade=\"persist\"/>]]>"
-#~ msgstr "<![CDATA[<one-to-one name=\"person\" cascade=\"persist\"/>]]>"
-#~ msgid ""
-#~ "<![CDATA[<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>]]>"
-#~ msgid ""
-#~ "<![CDATA[Cat fritz = ......;\n"
-#~ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
-#~ "\n"
-#~ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
-#~ "String[] propertyNames = catMeta.getPropertyNames();\n"
-#~ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
-#~ "\n"
-#~ "// get a Map of all properties which are not collections or associations\n"
-#~ "Map namedValues = new HashMap();\n"
-#~ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
-#~ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
-#~ "isCollectionType() ) {\n"
-#~ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[Cat fritz = ......;\n"
-#~ "ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
-#~ "\n"
-#~ "Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
-#~ "String[] propertyNames = catMeta.getPropertyNames();\n"
-#~ "Type[] propertyTypes = catMeta.getPropertyTypes();\n"
-#~ "\n"
-#~ "// get a Map of all properties which are not collections or associations\n"
-#~ "Map namedValues = new HashMap();\n"
-#~ "for ( int i=0; i<propertyNames.length; i++ ) {\n"
-#~ " if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
-#~ "isCollectionType() ) {\n"
-#~ " namedValues.put( propertyNames[i], propertyValues[i] );\n"
-#~ " }\n"
-#~ "}]]>"
-
+#~ "注意有一个特殊的级联风格(cascade style) <literal>delete-orphan</"
+#~ "literal>,只应用于 one-to-many 关联,表明 <literal>delete()</literal> 操作"
+#~ "应该被应用于所有从关联中删除的对象。"
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/tutorial.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/tutorial.po 2010-07-21 00:58:10 UTC (rev 19978)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/tutorial.po 2010-07-21 01:11:34 UTC (rev 19979)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: tutorial\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-11T05:38:16\n"
+"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-16 09:56+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
@@ -16,1950 +16,3104 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: tutorial.xml:34
#, no-c-format
msgid "Tutorial"
msgstr "教程"
#. Tag: para
+#: tutorial.xml:36
#, no-c-format
-msgid "Intended for new users, this chapter provides an step-by-step introduction to Hibernate, starting with a simple application using an in-memory database. The tutorial is based on an earlier tutorial developed by Michael Gloegl. All code is contained in the <filename>tutorials/web</filename> directory of the project source."
-msgstr "面向新用户,从一个简单的使用内存数据库的例子开始,本章提供对 Hibernate 的逐步介绍。本教程基于 Michael Gloegl 早期编写的手册。所有代码都包含在 <filename>tutorials/web</filename> 目录下。"
+msgid ""
+"Intended for new users, this chapter provides an step-by-step introduction "
+"to Hibernate, starting with a simple application using an in-memory "
+"database. The tutorial is based on an earlier tutorial developed by Michael "
+"Gloegl. All code is contained in the <filename>tutorials/web</filename> "
+"directory of the project source."
+msgstr ""
+"面向新用户,从一个简单的使用内存数据库的例子开始,本章提供对 Hibernate 的逐步"
+"介绍。本教程基于 Michael Gloegl 早期编写的手册。所有代码都包含在 "
+"<filename>tutorials/web</filename> 目录下。"
#. Tag: para
+#: tutorial.xml:45
#, no-c-format
-msgid "This tutorial expects the user have knowledge of both Java and SQL. If you have a limited knowledge of JAVA or SQL, it is advised that you start with a good introduction to that technology prior to attempting to learn Hibernate."
-msgstr "本教程期望用户具备 Java 和 SQL 知识。如果你这方面的知识有限,我们建议你在学习 Hibernate 之前先好好了解这些技术。"
+msgid ""
+"This tutorial expects the user have knowledge of both Java and SQL. If you "
+"have a limited knowledge of JAVA or SQL, it is advised that you start with a "
+"good introduction to that technology prior to attempting to learn Hibernate."
+msgstr ""
+"本教程期望用户具备 Java 和 SQL 知识。如果你这方面的知识有限,我们建议你在学"
+"习 Hibernate 之前先好好了解这些技术。"
#. Tag: para
+#: tutorial.xml:54
#, no-c-format
-msgid "The distribution contains another example application under the <filename>tutorial/eg</filename> project source directory."
-msgstr "本版本在源代码目录 <filename>tutorial/eg</filename> 下还包含另外一个例程。"
+msgid ""
+"The distribution contains another example application under the "
+"<filename>tutorial/eg</filename> project source directory."
+msgstr ""
+"本版本在源代码目录 <filename>tutorial/eg</filename> 下还包含另外一个例程。"
#. Tag: title
+#: tutorial.xml:62
#, no-c-format
msgid "Part 1 - The first Hibernate Application"
msgstr "第一部分 - 第一个 Hibernate 应用程序"
#. Tag: para
+#: tutorial.xml:64
#, no-c-format
-msgid "For this example, we will set up a small database application that can store events we want to attend and information about the host(s) of these events."
-msgstr "在这个例子里,我们将设立一个小应用程序可以保存我们希望参加的活动(events)和这些活动主办方的相关信息。(译者注:在本教程的后面部分,我们将直接使用 event 而不是它的中文翻译“活动”,以免混淆。)"
+msgid ""
+"For this example, we will set up a small database application that can store "
+"events we want to attend and information about the host(s) of these events."
+msgstr ""
+"在这个例子里,我们将设立一个小应用程序可以保存我们希望参加的活动(events)和"
+"这些活动主办方的相关信息。(译者注:在本教程的后面部分,我们将直接使用 event "
+"而不是它的中文翻译“活动”,以免混淆。)"
#. Tag: para
+#: tutorial.xml:70
#, no-c-format
-msgid "Although you can use whatever database you feel comfortable using, we will use <ulink url=\"http://hsqldb.org/\">HSQLDB</ulink> (an in-memory, Java database) to avoid describing installation/setup of any particular database servers."
-msgstr "虽然你可以使用任何数据库,我们还是用 <ulink url=\"http://hsqldb.org/\">HSQLDB</ulink>(一个用 Java 编写的内存数据库)来避免花费篇章对数据库服务器的安装/配置进行解释。"
+msgid ""
+"Although you can use whatever database you feel comfortable using, we will "
+"use <ulink url=\"http://hsqldb.org/\">HSQLDB</ulink> (an in-memory, Java "
+"database) to avoid describing installation/setup of any particular database "
+"servers."
+msgstr ""
+"虽然你可以使用任何数据库,我们还是用 <ulink url=\"http://hsqldb.org/"
+"\">HSQLDB</ulink>(一个用 Java 编写的内存数据库)来避免花费篇章对数据库服务器"
+"的安装/配置进行解释。"
#. Tag: title
+#: tutorial.xml:79
#, no-c-format
msgid "Setup"
msgstr "设置"
#. Tag: para
+#: tutorial.xml:81
#, no-c-format
-msgid "The first thing we need to do is to set up the development environment. We will be using the \"standard layout\" advocated by alot of build tools such as <ulink url=\"http://maven.org\">Maven</ulink>. Maven, in particular, has a good resource describing this <ulink url=\"http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html\">layout</ulink>. As this tutorial is to be a web application, we will be creating and making use of <filename>src/main/java</filename>, <filename>src/main/resources</filename> and <filename>src/main/webapp</filename> directories."
-msgstr "我们需要做的第一件事情是设置开发环境。我们将使用许多构建工具如 <ulink url=\"http://maven.org\">Maven</ulink> 所鼓吹的“标准格式”。特别是 Maven,它的资源对这个<ulink url=\"http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html\">格式(layout)</ulink>有着很好的描述。因为本教程使用的是 web 应用程序,我么将创建和使用 <filename>src/main/java</filename>、<filename>src/main/resources</filename> 和 <filename>src/main/webapp</filename> 目录。"
+msgid ""
+"The first thing we need to do is to set up the development environment. We "
+"will be using the \"standard layout\" advocated by alot of build tools such "
+"as <ulink url=\"http://maven.org\">Maven</ulink>. Maven, in particular, has "
+"a good resource describing this <ulink url=\"http://maven.apache.org/guides/"
+"introduction/introduction-to-the-standard-directory-layout.html\">layout</"
+"ulink>. As this tutorial is to be a web application, we will be creating and "
+"making use of <filename>src/main/java</filename>, <filename>src/main/"
+"resources</filename> and <filename>src/main/webapp</filename> directories."
+msgstr ""
+"我们需要做的第一件事情是设置开发环境。我们将使用许多构建工具如 <ulink url="
+"\"http://maven.org\">Maven</ulink> 所鼓吹的“标准格式”。特别是 Maven,它的资源"
+"对这个<ulink url=\"http://maven.apache.org/guides/introduction/introduction-"
+"to-the-standard-directory-layout.html\">格式(layout)</ulink>有着很好的描"
+"述。因为本教程使用的是 web 应用程序,我么将创建和使用 <filename>src/main/"
+"java</filename>、<filename>src/main/resources</filename> 和 <filename>src/"
+"main/webapp</filename> 目录。"
#. Tag: para
+#: tutorial.xml:91
#, no-c-format
-msgid "We will be using Maven in this tutorial, taking advantage of its transitive dependency management capabilities as well as the ability of many IDEs to automatically set up a project for us based on the maven descriptor."
-msgstr "在本教程里我们将使用 Maven,利用其 transitive dependency 管理以及根据 Maven 描述符用 IDE 自动设置项目的能力。"
+msgid ""
+"We will be using Maven in this tutorial, taking advantage of its transitive "
+"dependency management capabilities as well as the ability of many IDEs to "
+"automatically set up a project for us based on the maven descriptor."
+msgstr ""
+"在本教程里我们将使用 Maven,利用其 transitive dependency 管理以及根据 Maven "
+"描述符用 IDE 自动设置项目的能力。"
-#. Tag: para
+#. Tag: programlisting
+#: tutorial.xml:97
#, no-c-format
-msgid "It is not a requirement to use Maven. If you wish to use something else to build this tutoial (such as Ant), the layout will remain the same. The only change is that you will need to manually account for all the needed dependencies. If you use something like <ulink url=\"http://ant.apache.org/ivy/\">Ivy</ulink> providing transitive dependency management you would still use the dependencies mentioned below. Otherwise, you'd need to grab <emphasis>all</emphasis> dependencies, both explicit and transitive, and add them to the project's classpath. If working from the Hibernate distribution bundle, this would mean <filename>hibernate3.jar</filename>, all artifacts in the <filename>lib/required</filename> directory and all files from either the <filename>lib/bytecode/cglib</filename> or <filename>lib/bytecode/javassist</filename> directory; additionally you will need both the servlet-api jar and one of the slf4j logging backends."
-msgstr "Maven 并不要求这样。如果你希望使用其他技术来构建这个教程(如 Ant),格式将保持不变。唯一的改变是你将需要手工管理所有的依赖关系。如果你使用 <ulink url=\"http://ant.apache.org/ivy/\">Ivy</ulink> 来提供 transitive dependency 管理,你将仍然下面提到的依赖关系。否则,你将需要找到所有的依赖关系(显性的和过渡的)并把它们添加到项目的 classpath 里。如果使用 Hibernate 捆绑版本,这意味着 <filename>hibernate3.jar</filename>、<filename>lib/required</filename> 目录下的所有 artifact 和 <filename>lib/bytecode/cglib</filename> 或 <filename>lib/bytecode/javassist</filename> 下的所有文件,此外你将需要 servlet-api jar 和一个 slf4j 日志后台文件。 "
+msgid ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
+msgstr ""
+"<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven."
+"apache.org/xsd/maven-4.0.0.xsd\">\n"
+"\n"
+" <modelVersion>4.0.0</modelVersion>\n"
+"\n"
+" <groupId>org.hibernate.tutorials</groupId>\n"
+" <artifactId>hibernate-tutorial</artifactId>\n"
+" <version>1.0.0-SNAPSHOT</version>\n"
+" <name>First Hibernate Tutorial</name>\n"
+"\n"
+" <build>\n"
+" <!-- we dont want the version to be part of the generated war file "
+"name -->\n"
+" <finalName>${artifactId}</finalName>\n"
+" </build>\n"
+"\n"
+" <dependencies>\n"
+" <dependency>\n"
+" <groupId>org.hibernate</groupId>\n"
+" <artifactId>hibernate-core</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Because this is a web app, we also have a dependency on the "
+"servlet api. -->\n"
+" <dependency>\n"
+" <groupId>javax.servlet</groupId>\n"
+" <artifactId>servlet-api</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate uses slf4j for logging, for our purposes here use the "
+"simple backend -->\n"
+" <dependency>\n"
+" <groupId>org.slf4j</groupId>\n"
+" <artifactId>slf4j-simple</artifactId>\n"
+" </dependency>\n"
+"\n"
+" <!-- Hibernate gives you a choice of bytecode providers between "
+"cglib and javassist -->\n"
+" <dependency>\n"
+" <groupId>javassist</groupId>\n"
+" <artifactId>javassist</artifactId>\n"
+" </dependency>\n"
+" </dependencies>\n"
+"\n"
+"</project>]]>"
#. Tag: para
+#: tutorial.xml:100
+#, fuzzy, no-c-format
+msgid ""
+"It is not a requirement to use Maven. If you wish to use something else to "
+"build this tutorial (such as Ant), the layout will remain the same. The only "
+"change is that you will need to manually account for all the needed "
+"dependencies. If you use something like <ulink url=\"http://ant.apache.org/"
+"ivy/\">Ivy</ulink> providing transitive dependency management you would "
+"still use the dependencies mentioned below. Otherwise, you'd need to grab "
+"<emphasis>all</emphasis> dependencies, both explicit and transitive, and add "
+"them to the project's classpath. If working from the Hibernate distribution "
+"bundle, this would mean <filename>hibernate3.jar</filename>, all artifacts "
+"in the <filename>lib/required</filename> directory and all files from either "
+"the <filename>lib/bytecode/cglib</filename> or <filename>lib/bytecode/"
+"javassist</filename> directory; additionally you will need both the servlet-"
+"api jar and one of the slf4j logging backends."
+msgstr ""
+"Maven 并不要求这样。如果你希望使用其他技术来构建这个教程(如 Ant),格式将保"
+"持不变。唯一的改变是你将需要手工管理所有的依赖关系。如果你使用 <ulink url="
+"\"http://ant.apache.org/ivy/\">Ivy</ulink> 来提供 transitive dependency 管"
+"理,你将仍然下面提到的依赖关系。否则,你将需要找到所有的依赖关系(显性的和过"
+"渡的)并把它们添加到项目的 classpath 里。如果使用 Hibernate 捆绑版本,这意味"
+"着 <filename>hibernate3.jar</filename>、<filename>lib/required</filename> 目"
+"录下的所有 artifact 和 <filename>lib/bytecode/cglib</filename> 或 "
+"<filename>lib/bytecode/javassist</filename> 下的所有文件,此外你将需要 "
+"servlet-api jar 和一个 slf4j 日志后台文件。 "
+
+#. Tag: para
+#: tutorial.xml:117
#, no-c-format
-msgid "Save this file as <filename>pom.xml</filename> in the project root directory."
+msgid ""
+"Save this file as <filename>pom.xml</filename> in the project root directory."
msgstr "把这个文件保存为项目根目录下的 <filename>pom.xml</filename>。"
#. Tag: title
+#: tutorial.xml:124
#, no-c-format
msgid "The first class"
msgstr "第一个 class"
#. Tag: para
+#: tutorial.xml:126
#, no-c-format
-msgid "Next, we create a class that represents the event we want to store in the database; it is a simple JavaBean class with some properties:"
-msgstr "接下来我们创建一个类,用来代表那些我们希望储存在数据库里的 event,这是一个具有一些属性的简单 JavaBean 类:"
+msgid ""
+"Next, we create a class that represents the event we want to store in the "
+"database; it is a simple JavaBean class with some properties:"
+msgstr ""
+"接下来我们创建一个类,用来代表那些我们希望储存在数据库里的 event,这是一个具"
+"有一些属性的简单 JavaBean 类:"
+#. Tag: programlisting
+#: tutorial.xml:131
+#, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+msgstr ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"public class Event {\n"
+" private Long id;\n"
+"\n"
+" private String title;\n"
+" private Date date;\n"
+"\n"
+" public Event() {}\n"
+"\n"
+" public Long getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" private void setId(Long id) {\n"
+" this.id = id;\n"
+" }\n"
+"\n"
+" public Date getDate() {\n"
+" return date;\n"
+" }\n"
+"\n"
+" public void setDate(Date date) {\n"
+" this.date = date;\n"
+" }\n"
+"\n"
+" public String getTitle() {\n"
+" return title;\n"
+" }\n"
+"\n"
+" public void setTitle(String title) {\n"
+" this.title = title;\n"
+" }\n"
+"}]]>"
+
#. Tag: para
+#: tutorial.xml:133
#, no-c-format
-msgid "This class uses standard JavaBean naming conventions for property getter and setter methods, as well as private visibility for the fields. Although this is the recommended design, it is not required. Hibernate can also access fields directly, the benefit of accessor methods is robustness for refactoring."
-msgstr "你可以看到这个类对属性的存取方法(getter and setter method)使用了标准 JavaBean 命名约定,同时把类属性(field)的访问级别设成私有的(private)。这是推荐的设计,但并不是必须的。Hibernate 也可以直接访问这些 field,而使用访问方法(accessor method)的好处是提供了重构时的健壮性(robustness)。"
+msgid ""
+"This class uses standard JavaBean naming conventions for property getter and "
+"setter methods, as well as private visibility for the fields. Although this "
+"is the recommended design, it is not required. Hibernate can also access "
+"fields directly, the benefit of accessor methods is robustness for "
+"refactoring."
+msgstr ""
+"你可以看到这个类对属性的存取方法(getter and setter method)使用了标准 "
+"JavaBean 命名约定,同时把类属性(field)的访问级别设成私有的(private)。这是"
+"推荐的设计,但并不是必须的。Hibernate 也可以直接访问这些 field,而使用访问方"
+"法(accessor method)的好处是提供了重构时的健壮性(robustness)。"
#. Tag: para
+#: tutorial.xml:141
#, no-c-format
-msgid "The <literal>id</literal> property holds a unique identifier value for a particular event. All persistent entity classes (there are less important dependent classes as well) will need such an identifier property if we want to use the full feature set of Hibernate. In fact, most applications, especially web applications, need to distinguish objects by identifier, so you should consider this a feature rather than a limitation. However, we usually do not manipulate the identity of an object, hence the setter method should be private. Only Hibernate will assign identifiers when an object is saved. Hibernate can access public, private, and protected accessor methods, as well as public, private and protected fields directly. The choice is up to you and you can match it to fit your application design."
-msgstr "对一特定的 event, <literal>id</literal> 属性持有唯一的标识符(identifier)的值。如果我们希望使用 Hibernate 提供的所有特性,那么所有的持久化实体(persistent entity)类(这里也包括一些次要依赖类)都需要一个这样的标识符属性。而事实上,大多数应用程序(特别是 web 应用程序)都需要通过标识符来区别对象,所以你应该考虑使用标识符属性而不是把它当作一种限制。然而,我们通常不会操作对象的标识(identity),因此它的 setter 方法的访问级别应该声明 private。这样当对象被保存的时候,只有 Hibernate 可以为它分配标识符值。你可看到Hibernate可以直接访问 public,private 和 protected 的访问方法和 field。所以选择哪种方式完全取决于你,你可以使你的选择与你的应用程序设计相吻合。 "
+msgid ""
+"The <literal>id</literal> property holds a unique identifier value for a "
+"particular event. All persistent entity classes (there are less important "
+"dependent classes as well) will need such an identifier property if we want "
+"to use the full feature set of Hibernate. In fact, most applications, "
+"especially web applications, need to distinguish objects by identifier, so "
+"you should consider this a feature rather than a limitation. However, we "
+"usually do not manipulate the identity of an object, hence the setter method "
+"should be private. Only Hibernate will assign identifiers when an object is "
+"saved. Hibernate can access public, private, and protected accessor methods, "
+"as well as public, private and protected fields directly. The choice is up "
+"to you and you can match it to fit your application design."
+msgstr ""
+"对一特定的 event, <literal>id</literal> 属性持有唯一的标识符(identifier)的"
+"值。如果我们希望使用 Hibernate 提供的所有特性,那么所有的持久化实体"
+"(persistent entity)类(这里也包括一些次要依赖类)都需要一个这样的标识符属"
+"性。而事实上,大多数应用程序(特别是 web 应用程序)都需要通过标识符来区别对"
+"象,所以你应该考虑使用标识符属性而不是把它当作一种限制。然而,我们通常不会操"
+"作对象的标识(identity),因此它的 setter 方法的访问级别应该声明 private。这"
+"样当对象被保存的时候,只有 Hibernate 可以为它分配标识符值。你可看到Hibernate"
+"可以直接访问 public,private 和 protected 的访问方法和 field。所以选择哪种方"
+"式完全取决于你,你可以使你的选择与你的应用程序设计相吻合。 "
#. Tag: para
+#: tutorial.xml:156
#, no-c-format
-msgid "The no-argument constructor is a requirement for all persistent classes; Hibernate has to create objects for you, using Java Reflection. The constructor can be private, however package or public visibility is required for runtime proxy generation and efficient data retrieval without bytecode instrumentation."
-msgstr "所有的持久化类(persistent classes)都要求有无参的构造器,因为 Hibernate 必须使用 Java 反射机制来为你创建对象。构造器(constructor)的访问级别可以是 private,然而当生成运行时代理(runtime proxy)的时候则要求使用至少是 package 级别的访问控制,这样在没有字节码指令(bytecode instrumentation)的情况下,从持久化类里获取数据会更有效率。 "
+msgid ""
+"The no-argument constructor is a requirement for all persistent classes; "
+"Hibernate has to create objects for you, using Java Reflection. The "
+"constructor can be private, however package or public visibility is required "
+"for runtime proxy generation and efficient data retrieval without bytecode "
+"instrumentation."
+msgstr ""
+"所有的持久化类(persistent classes)都要求有无参的构造器,因为 Hibernate 必须"
+"使用 Java 反射机制来为你创建对象。构造器(constructor)的访问级别可以是 "
+"private,然而当生成运行时代理(runtime proxy)的时候则要求使用至少是 package "
+"级别的访问控制,这样在没有字节码指令(bytecode instrumentation)的情况下,从"
+"持久化类里获取数据会更有效率。 "
#. Tag: para
+#: tutorial.xml:164
#, no-c-format
-msgid "Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</filename> directory."
-msgstr "把这个文件保存到 <filename>src/main/java/org/hibernate/tutorial/domain</filename> 目录下。"
+msgid ""
+"Save this file to the <filename>src/main/java/org/hibernate/tutorial/domain</"
+"filename> directory."
+msgstr ""
+"把这个文件保存到 <filename>src/main/java/org/hibernate/tutorial/domain</"
+"filename> 目录下。"
#. Tag: title
+#: tutorial.xml:171
#, no-c-format
msgid "The mapping file"
msgstr "映射文件"
#. Tag: para
+#: tutorial.xml:173
#, no-c-format
-msgid "Hibernate needs to know how to load and store objects of the persistent class. This is where the Hibernate mapping file comes into play. The mapping file tells Hibernate what table in the database it has to access, and what columns in that table it should use."
-msgstr "Hibernate 需要知道怎样去加载(load)和存储(store)持久化类的对象。这正是 Hibernate 映射文件发挥作用的地方。映射文件告诉 Hibernate 它应该访问数据库(database)里面的哪个表(table)及应该使用表里面的哪些字段(column)。"
+msgid ""
+"Hibernate needs to know how to load and store objects of the persistent "
+"class. This is where the Hibernate mapping file comes into play. The mapping "
+"file tells Hibernate what table in the database it has to access, and what "
+"columns in that table it should use."
+msgstr ""
+"Hibernate 需要知道怎样去加载(load)和存储(store)持久化类的对象。这正是 "
+"Hibernate 映射文件发挥作用的地方。映射文件告诉 Hibernate 它应该访问数据库"
+"(database)里面的哪个表(table)及应该使用表里面的哪些字段(column)。"
#. Tag: para
+#: tutorial.xml:181
#, no-c-format
msgid "The basic structure of a mapping file looks like this:"
msgstr "一个映射文件的基本结构看起来像这样:"
-#. Tag: para
+#. Tag: programlisting
+#: tutorial.xml:185
#, no-c-format
-msgid "Hibernate DTD is sophisticated. You can use it for auto-completion of XML mapping elements and attributes in your editor or IDE. Opening up the DTD file in your text editor is the easiest way to get an overview of all elements and attributes, and to view the defaults, as well as some comments. Hibernate will not load the DTD file from the web, but first look it up from the classpath of the application. The DTD file is included in <filename>hibernate-core.jar</filename> (it is also included in the <filename>hibernate3.jar</filename>, if using the distribution bundle)."
-msgstr "注意 Hibernate 的 DTD 是非常复杂的。你的编辑器或者 IDE 里使用它来自动完成那些用来映射的 XML 元素(element)和属性(attribute)。你也可以在文本编辑器里打开 DTD — 这是最简单的方式来概览所有的元素和 attribute,并查看它们的缺省值以及注释。注意 Hibernate 不会从 web 加载 DTD 文件,但它会首先在应用程序的 classpath 中查找。DTD 文件已包括在 <literal>hibernate3.jar</literal> 里,同时也在 Hibernate 发布包的 <literal>src/</literal> 目录下。 "
+msgid ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<![CDATA[<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE hibernate-mapping PUBLIC\n"
+" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
+"\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"[...]\n"
+"</hibernate-mapping>]]>"
#. Tag: para
+#: tutorial.xml:187
#, no-c-format
-msgid "We will omit the DTD declaration in future examples to shorten the code. It is, of course, not optional."
-msgstr "为缩短代码长度,在以后的例子里我们会省略 DTD 的声明。当然,在实际的应用程序中,DTD 声明是必需的。 "
+msgid ""
+"Hibernate DTD is sophisticated. You can use it for auto-completion of XML "
+"mapping elements and attributes in your editor or IDE. Opening up the DTD "
+"file in your text editor is the easiest way to get an overview of all "
+"elements and attributes, and to view the defaults, as well as some comments. "
+"Hibernate will not load the DTD file from the web, but first look it up from "
+"the classpath of the application. The DTD file is included in "
+"<filename>hibernate-core.jar</filename> (it is also included in the "
+"<filename>hibernate3.jar</filename>, if using the distribution bundle)."
+msgstr ""
+"注意 Hibernate 的 DTD 是非常复杂的。你的编辑器或者 IDE 里使用它来自动完成那些"
+"用来映射的 XML 元素(element)和属性(attribute)。你也可以在文本编辑器里打"
+"开 DTD — 这是最简单的方式来概览所有的元素和 attribute,并查看它们的缺省值以及"
+"注释。注意 Hibernate 不会从 web 加载 DTD 文件,但它会首先在应用程序的 "
+"classpath 中查找。DTD 文件已包括在 <literal>hibernate3.jar</literal> 里,同时"
+"也在 Hibernate 发布包的 <literal>src/</literal> 目录下。 "
#. Tag: para
+#: tutorial.xml:200
#, no-c-format
-msgid "Between the two <literal>hibernate-mapping</literal> tags, include a <literal>class</literal> element. All persistent entity classes (again, there might be dependent classes later on, which are not first-class entities) need a mapping to a table in the SQL database:"
-msgstr "在 <literal>hibernate-mapping</literal> 标签(tag)之间, 含有一个 <literal>class</literal> 元素。所有的持久化实体类(再次声明,或许接下来会有依赖类,就是那些次要的实体)都需要一个这样的映射,来把类对象映射到 SQL 数据库里的表:"
+msgid ""
+"We will omit the DTD declaration in future examples to shorten the code. It "
+"is, of course, not optional."
+msgstr ""
+"为缩短代码长度,在以后的例子里我们会省略 DTD 的声明。当然,在实际的应用程序"
+"中,DTD 声明是必需的。 "
#. Tag: para
+#: tutorial.xml:206
#, no-c-format
-msgid "So far we have told Hibernate how to persist and load object of class <literal>Event</literal> to the table <literal>EVENTS</literal>. Each instance is now represented by a row in that table. Now we can continue by mapping the unique identifier property to the tables primary key. As we do not want to care about handling this identifier, we configure Hibernate's identifier generation strategy for a surrogate primary key column:"
-msgstr "到目前为止,我们告诉了 Hibernate 怎样把 <literal>Events</literal> 类的对象持久化到数据库的 <literal>EVENTS</literal> 表里,以及怎样从 <literal>EVENTS</literal> 表加载到 <literal>Events</literal> 类的对象。每个实例对应着数据库表中的一行。现在我们将继续讨论有关唯一标识符属性到数据库表的映射。另外,由于我们不关心怎样处理这个标识符,我们就配置由 Hibernate 的标识符生成策略来产生代理主键字段:"
+msgid ""
+"Between the two <literal>hibernate-mapping</literal> tags, include a "
+"<literal>class</literal> element. All persistent entity classes (again, "
+"there might be dependent classes later on, which are not first-class "
+"entities) need a mapping to a table in the SQL database:"
+msgstr ""
+"在 <literal>hibernate-mapping</literal> 标签(tag)之间, 含有一个 "
+"<literal>class</literal> 元素。所有的持久化实体类(再次声明,或许接下来会有依"
+"赖类,就是那些次要的实体)都需要一个这样的映射,来把类对象映射到 SQL 数据库里"
+"的表:"
+#. Tag: programlisting
+#: tutorial.xml:213
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+"\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: tutorial.xml:215
#, no-c-format
-msgid "The <literal>id</literal> element is the declaration of the identifier property. The <literal>name=\"id\"</literal> mapping attribute declares the name of the JavaBean property and tells Hibernate to use the <literal>getId()</literal> and <literal>setId()</literal> methods to access the property. The column attribute tells Hibernate which column of the <literal>EVENTS</literal> table holds the primary key value."
-msgstr "<literal>id</literal> 元素是对 identifier 属性的声明。<literal>name=\"id\"</literal> 映射属性声明了 JavaBean 属性的名称并告诉 Hibernate 使用 <literal>getId()</literal> 和 <literal>setId()</literal> 方法来访问这个属性。column 属性告诉 Hibernate <literal>EVENTS</literal> 表的哪个字段持有主键值。"
+msgid ""
+"So far we have told Hibernate how to persist and load object of class "
+"<literal>Event</literal> to the table <literal>EVENTS</literal>. Each "
+"instance is now represented by a row in that table. Now we can continue by "
+"mapping the unique identifier property to the tables primary key. As we do "
+"not want to care about handling this identifier, we configure Hibernate's "
+"identifier generation strategy for a surrogate primary key column:"
+msgstr ""
+"到目前为止,我们告诉了 Hibernate 怎样把 <literal>Events</literal> 类的对象持"
+"久化到数据库的 <literal>EVENTS</literal> 表里,以及怎样从 <literal>EVENTS</"
+"literal> 表加载到 <literal>Events</literal> 类的对象。每个实例对应着数据库表"
+"中的一行。现在我们将继续讨论有关唯一标识符属性到数据库表的映射。另外,由于我"
+"们不关心怎样处理这个标识符,我们就配置由 Hibernate 的标识符生成策略来产生代理"
+"主键字段:"
+#. Tag: programlisting
+#: tutorial.xml:225
+#, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: tutorial.xml:227
#, no-c-format
-msgid "The nested <literal>generator</literal> element specifies the identifier generation strategy (aka how are identifier values generated?). In this case we choose <literal>native</literal>, which offers a level of portability depending on the configured database dialect. Hibernate supports database generated, globally unique, as well as application assigned, identifiers. Identifier value generation is also one of Hibernate's many extension points and you can plugin in your own strategy."
-msgstr "嵌套的 <literal>generator</literal> 元素指定标识符的生成策略(也就是标识符值是怎么产生的)。在这个例子里,我们选择 <literal>native</literal>,它提供了取决于数据库方言的可移植性。Hibernate 数据库生成的、全局性唯一的以及应用程序分配的标识符。标识符值的生成也是 Hibernate 的扩展功能之一,你可以插入自己的策略。"
+msgid ""
+"The <literal>id</literal> element is the declaration of the identifier "
+"property. The <literal>name=\"id\"</literal> mapping attribute declares the "
+"name of the JavaBean property and tells Hibernate to use the <literal>getId()"
+"</literal> and <literal>setId()</literal> methods to access the property. "
+"The column attribute tells Hibernate which column of the <literal>EVENTS</"
+"literal> table holds the primary key value."
+msgstr ""
+"<literal>id</literal> 元素是对 identifier 属性的声明。<literal>name=\"id\"</"
+"literal> 映射属性声明了 JavaBean 属性的名称并告诉 Hibernate 使用 "
+"<literal>getId()</literal> 和 <literal>setId()</literal> 方法来访问这个属性。"
+"column 属性告诉 Hibernate <literal>EVENTS</literal> 表的哪个字段持有主键值。"
#. Tag: para
+#: tutorial.xml:237
#, no-c-format
-msgid "<literal>native</literal> is no longer consider the best strategy in terms of portability. for further discussion, see <xref linkend=\"portability-idgen\" />"
-msgstr "从移植性来说,<literal>native</literal> 不再被认为是最好的策略。进一步的讨论,请参考 <xref linkend=\"portability-idgen\" />。 "
+msgid ""
+"The nested <literal>generator</literal> element specifies the identifier "
+"generation strategy (aka how are identifier values generated?). In this case "
+"we choose <literal>native</literal>, which offers a level of portability "
+"depending on the configured database dialect. Hibernate supports database "
+"generated, globally unique, as well as application assigned, identifiers. "
+"Identifier value generation is also one of Hibernate's many extension points "
+"and you can plugin in your own strategy."
+msgstr ""
+"嵌套的 <literal>generator</literal> 元素指定标识符的生成策略(也就是标识符值"
+"是怎么产生的)。在这个例子里,我们选择 <literal>native</literal>,它提供了取"
+"决于数据库方言的可移植性。Hibernate 数据库生成的、全局性唯一的以及应用程序分"
+"配的标识符。标识符值的生成也是 Hibernate 的扩展功能之一,你可以插入自己的策"
+"略。"
#. Tag: para
+#: tutorial.xml:249
+#, fuzzy, no-c-format
+msgid ""
+"<literal>native</literal> is no longer consider the best strategy in terms "
+"of portability. for further discussion, see"
+msgstr ""
+"从移植性来说,<literal>native</literal> 不再被认为是最好的策略。进一步的讨"
+"论,请参考 <xref linkend=\"portability-idgen\" />。 "
+
+#. Tag: para
+#: tutorial.xml:255
#, no-c-format
-msgid "Lastly, we need to tell Hibernate about the remaining entity class properties. By default, no properties of the class are considered persistent:"
-msgstr "最后我们在映射文件里面包含需要持久化属性的声明。默认情况下,类里面的属性都被视为非持久化的: "
+msgid ""
+"Lastly, we need to tell Hibernate about the remaining entity class "
+"properties. By default, no properties of the class are considered persistent:"
+msgstr ""
+"最后我们在映射文件里面包含需要持久化属性的声明。默认情况下,类里面的属性都被"
+"视为非持久化的: "
+#. Tag: programlisting
+#: tutorial.xml:261
+#, no-c-format
+msgid ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<![CDATA[\n"
+"<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Event\" table=\"EVENTS\">\n"
+" <id name=\"id\" column=\"EVENT_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/>\n"
+" <property name=\"title\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+
#. Tag: para
+#: tutorial.xml:263
#, no-c-format
-msgid "Similar to the <literal>id</literal> element, the <literal>name</literal> attribute of the <literal>property</literal> element tells Hibernate which getter and setter methods to use. In this case, Hibernate will search for <literal>getDate()</literal>, <literal>setDate()</literal>, <literal>getTitle()</literal> and <literal>setTitle()</literal> methods."
-msgstr "和 <literal>id</literal> 元素一样,<literal>property</literal> 元素的 <literal>name</literal> 属性告诉 Hibernate 使用哪个 getter 和 setter 方法。在此例中,Hibernate 会寻找 <literal>getDate()</literal>、<literal>setDate()</literal>、<literal>getTitle()</literal> 和 <literal>setTitle()</literal> 方法。 "
+msgid ""
+"Similar to the <literal>id</literal> element, the <literal>name</literal> "
+"attribute of the <literal>property</literal> element tells Hibernate which "
+"getter and setter methods to use. In this case, Hibernate will search for "
+"<literal>getDate()</literal>, <literal>setDate()</literal>, <literal>getTitle"
+"()</literal> and <literal>setTitle()</literal> methods."
+msgstr ""
+"和 <literal>id</literal> 元素一样,<literal>property</literal> 元素的 "
+"<literal>name</literal> 属性告诉 Hibernate 使用哪个 getter 和 setter 方法。在"
+"此例中,Hibernate 会寻找 <literal>getDate()</literal>、<literal>setDate()</"
+"literal>、<literal>getTitle()</literal> 和 <literal>setTitle()</literal> 方"
+"法。 "
#. Tag: para
+#: tutorial.xml:274
#, no-c-format
-msgid "Why does the <literal>date</literal> property mapping include the <literal>column</literal> attribute, but the <literal>title</literal> does not? Without the <literal>column</literal> attribute, Hibernate by default uses the property name as the column name. This works for <literal>title</literal>, however, <literal>date</literal> is a reserved keyword in most databases so you will need to map it to a different name."
-msgstr "为什么 <literal>date</literal> 属性的映射含有 <literal>column</literal> attribute,而 <literal>title</literal> 却没有?当没有设定 <literal>column</literal> attribute 的时候,Hibernate 缺省地使用 JavaBean 的属性名作为字段名。对于 <literal>title</literal>,这样工作得很好。然而,<literal>date</literal> 在多数的数据库里,是一个保留关键字,所以我们最好把它映射成一个不同的名字。 "
+msgid ""
+"Why does the <literal>date</literal> property mapping include the "
+"<literal>column</literal> attribute, but the <literal>title</literal> does "
+"not? Without the <literal>column</literal> attribute, Hibernate by default "
+"uses the property name as the column name. This works for <literal>title</"
+"literal>, however, <literal>date</literal> is a reserved keyword in most "
+"databases so you will need to map it to a different name."
+msgstr ""
+"为什么 <literal>date</literal> 属性的映射含有 <literal>column</literal> "
+"attribute,而 <literal>title</literal> 却没有?当没有设定 <literal>column</"
+"literal> attribute 的时候,Hibernate 缺省地使用 JavaBean 的属性名作为字段名。"
+"对于 <literal>title</literal>,这样工作得很好。然而,<literal>date</literal> "
+"在多数的数据库里,是一个保留关键字,所以我们最好把它映射成一个不同的名字。 "
#. Tag: para
+#: tutorial.xml:284
#, no-c-format
-msgid "The <literal>title</literal> mapping also lacks a <literal>type</literal> attribute. The types declared and used in the mapping files are not Java data types; they are not SQL database types either. These types are called <emphasis>Hibernate mapping types</emphasis>, converters which can translate from Java to SQL data types and vice versa. Again, Hibernate will try to determine the correct conversion and mapping type itself if the <literal>type</literal> attribute is not present in the mapping. In some cases this automatic detection using Reflection on the Java class might not have the default you expect or need. This is the case with the <literal>date</literal> property. Hibernate cannot know if the property, which is of <literal>java.util.Date</literal>, should map to a SQL <literal>date</literal>, <literal>timestamp</literal>, or <literal>time</literal> column. Full date and time information is preserved by mapping the property with a <literal>timestamp</literal>!
converter."
-msgstr "另一有趣的事情是 <literal>title</literal> 属性缺少一个 <literal>type</literal> attribute。我们在映射文件里声明并使用的类型,却不是我们期望的那样,是 Java 数据类型,同时也不是 SQL 数据库的数据类型。这些类型就是所谓的 Hibernate 映射类型<emphasis>(mapping types)</emphasis>,它们能把 Java 数据类型转换到 SQL 数据类型,反之亦然。再次重申,如果在映射文件中没有设置 <literal>type</literal> 属性的话,Hibernate 会自己试着去确定正确的转换类型和它的映射类型。在某些情况下这个自动检测机制(在 Java 类上使用反射机制)不会产生你所期待或需要的缺省值。<literal>date</literal> 属性就是个很好的例子,Hibernate 无法知道这个属性(<literal>java.util.Date</literal> 类型的)应该被映射成:SQL <literal>date</literal>,或 <literal>timestamp</literal>,还是 <literal>time</litera!
l> 字段。在此例中,把这个属性映射成 <literal>timestamp</literal> 转换器,这样我们预留了日期和时间的全部信息。 "
+msgid ""
+"The <literal>title</literal> mapping also lacks a <literal>type</literal> "
+"attribute. The types declared and used in the mapping files are not Java "
+"data types; they are not SQL database types either. These types are called "
+"<emphasis>Hibernate mapping types</emphasis>, converters which can translate "
+"from Java to SQL data types and vice versa. Again, Hibernate will try to "
+"determine the correct conversion and mapping type itself if the "
+"<literal>type</literal> attribute is not present in the mapping. In some "
+"cases this automatic detection using Reflection on the Java class might not "
+"have the default you expect or need. This is the case with the "
+"<literal>date</literal> property. Hibernate cannot know if the property, "
+"which is of <literal>java.util.Date</literal>, should map to a SQL "
+"<literal>date</literal>, <literal>timestamp</literal>, or <literal>time</"
+"literal> column. Full date and time information is preserved by mapping the "
+"property with a <literal>timestamp</literal> converter."
+msgstr ""
+"另一有趣的事情是 <literal>title</literal> 属性缺少一个 <literal>type</"
+"literal> attribute。我们在映射文件里声明并使用的类型,却不是我们期望的那样,"
+"是 Java 数据类型,同时也不是 SQL 数据库的数据类型。这些类型就是所谓的 "
+"Hibernate 映射类型<emphasis>(mapping types)</emphasis>,它们能把 Java 数据"
+"类型转换到 SQL 数据类型,反之亦然。再次重申,如果在映射文件中没有设置 "
+"<literal>type</literal> 属性的话,Hibernate 会自己试着去确定正确的转换类型和"
+"它的映射类型。在某些情况下这个自动检测机制(在 Java 类上使用反射机制)不会产"
+"生你所期待或需要的缺省值。<literal>date</literal> 属性就是个很好的例子,"
+"Hibernate 无法知道这个属性(<literal>java.util.Date</literal> 类型的)应该被"
+"映射成:SQL <literal>date</literal>,或 <literal>timestamp</literal>,还是 "
+"<literal>time</literal> 字段。在此例中,把这个属性映射成 <literal>timestamp</"
+"literal> 转换器,这样我们预留了日期和时间的全部信息。 "
#. Tag: para
+#: tutorial.xml:300
#, no-c-format
-msgid "Hibernate makes this mapping type determination using reflection when the mapping files are processed. This can take time and resources, so if startup performance is important you should consider explicitly defining the type to use."
-msgstr "当处理映射文件时,Hibernate 用反射(reflection)来决定这个映射类型。这需要时间和资源,所以如果你注重启动性能,你应该考虑显性地定义所用的类型。"
+msgid ""
+"Hibernate makes this mapping type determination using reflection when the "
+"mapping files are processed. This can take time and resources, so if startup "
+"performance is important you should consider explicitly defining the type to "
+"use."
+msgstr ""
+"当处理映射文件时,Hibernate 用反射(reflection)来决定这个映射类型。这需要时"
+"间和资源,所以如果你注重启动性能,你应该考虑显性地定义所用的类型。"
#. Tag: para
+#: tutorial.xml:307
#, no-c-format
-msgid "Save this mapping file as <filename>src/main/resources/org/hibernate/tutorial/domain/Event.hbm.xml</filename>."
-msgstr "把这个映射文件保存为 <filename>src/main/resources/org/hibernate/tutorial/domain/Event.hbm.xml</filename>。"
+msgid ""
+"Save this mapping file as <filename>src/main/resources/org/hibernate/"
+"tutorial/domain/Event.hbm.xml</filename>."
+msgstr ""
+"把这个映射文件保存为 <filename>src/main/resources/org/hibernate/tutorial/"
+"domain/Event.hbm.xml</filename>。"
#. Tag: title
+#: tutorial.xml:315
#, no-c-format
msgid "Hibernate configuration"
msgstr "Hibernate 配置"
#. Tag: para
+#: tutorial.xml:317
#, no-c-format
-msgid "At this point, you should have the persistent class and its mapping file in place. It is now time to configure Hibernate. First let's set up HSQLDB to run in \"server mode\""
-msgstr "此时,你应该有了持久化类和它的映射文件。现在是配置 Hibernate 的时候了。首先让我们设立 HSQLDB 使其运行在“服务器模式”。"
+msgid ""
+"At this point, you should have the persistent class and its mapping file in "
+"place. It is now time to configure Hibernate. First let's set up HSQLDB to "
+"run in \"server mode\""
+msgstr ""
+"此时,你应该有了持久化类和它的映射文件。现在是配置 Hibernate 的时候了。首先让"
+"我们设立 HSQLDB 使其运行在“服务器模式”。"
#. Tag: para
+#: tutorial.xml:324
#, no-c-format
msgid "We do this do that the data remains between runs."
msgstr "数据在程序运行期间需要保持有效。 "
#. Tag: para
+#: tutorial.xml:329
#, no-c-format
-msgid "We will utilize the Maven exec plugin to launch the HSQLDB server by running: <command> mvn exec:java -Dexec.mainClass=\"org.hsqldb.Server\" -Dexec.args=\"-database.0 file:target/data/tutorial\"</command> You will see it start up and bind to a TCP/IP socket; this is where our application will connect later. If you want to start with a fresh database during this tutorial, shutdown HSQLDB, delete all files in the <filename>target/data</filename> directory, and start HSQLDB again."
-msgstr "在开发的根目录下创建一个 <literal>data</literal> 目录 - 这是 HSQL DB 存储数据文件的地方。此时在 data 目录中运行 <literal>java -classpath ../lib/hsqldb.jar org.hsqldb.Server</literal> 就可启动数据库。你可以在 log 中看到它的启动,及绑定到 TCP/IP 套接字,这正是我们的应用程序稍后会连接的地方。如果你希望在本例中运行一个全新的数据库,就在窗口中按下 <literal>CTRL + C</literal> 来关闭 HSQL 数据库,并删除 <literal>data/</literal> 目录下的所有文件,再重新启动 HSQL 数据库。 "
+msgid ""
+"We will utilize the Maven exec plugin to launch the HSQLDB server by "
+"running: <command> mvn exec:java -Dexec.mainClass=\"org.hsqldb.Server\" -"
+"Dexec.args=\"-database.0 file:target/data/tutorial\"</command> You will see "
+"it start up and bind to a TCP/IP socket; this is where our application will "
+"connect later. If you want to start with a fresh database during this "
+"tutorial, shutdown HSQLDB, delete all files in the <filename>target/data</"
+"filename> directory, and start HSQLDB again."
+msgstr ""
+"在开发的根目录下创建一个 <literal>data</literal> 目录 - 这是 HSQL DB 存储数"
+"据文件的地方。此时在 data 目录中运行 <literal>java -classpath ../lib/hsqldb."
+"jar org.hsqldb.Server</literal> 就可启动数据库。你可以在 log 中看到它的启动,"
+"及绑定到 TCP/IP 套接字,这正是我们的应用程序稍后会连接的地方。如果你希望在本"
+"例中运行一个全新的数据库,就在窗口中按下 <literal>CTRL + C</literal> 来关闭 "
+"HSQL 数据库,并删除 <literal>data/</literal> 目录下的所有文件,再重新启动 "
+"HSQL 数据库。 "
#. Tag: para
+#: tutorial.xml:340
#, no-c-format
-msgid "Hibernate will be connecting to the database on behalf of your application, so it needs to know how to obtain connections. For this tutorial we will be using a standalone connection pool (as opposed to a <interfacename>javax.sql.DataSource</interfacename>). Hibernate comes with support for two third-party open source JDBC connection pools: <ulink url=\"https://sourceforge.net/projects/c3p0\">c3p0</ulink> and <ulink url=\"http://proxool.sourceforge.net/\">proxool</ulink>. However, we will be using the Hibernate built-in connection pool for this tutorial."
-msgstr "Hibernate 将为你的应用程序连接到数据库,所以它需要知道如何获取连接。在这个教程里,我们使用一个独立连接池(和 <interfacename>javax.sql.DataSource</interfacename> 相反)。Hibernate 支持两个第三方的开源 JDBC 连接池:<ulink url=\"https://sourceforge.net/projects/c3p0\">c3p0</ulink> 和 <ulink url=\"http://proxool.sourceforge.net/\">proxool</ulink>。然而,在本教程里我们将使用 Hibernate 内置的连接池。"
+msgid ""
+"Hibernate will be connecting to the database on behalf of your application, "
+"so it needs to know how to obtain connections. For this tutorial we will be "
+"using a standalone connection pool (as opposed to a <interfacename>javax.sql."
+"DataSource</interfacename>). Hibernate comes with support for two third-"
+"party open source JDBC connection pools: <ulink url=\"https://sourceforge."
+"net/projects/c3p0\">c3p0</ulink> and <ulink url=\"http://proxool.sourceforge."
+"net/\">proxool</ulink>. However, we will be using the Hibernate built-in "
+"connection pool for this tutorial."
+msgstr ""
+"Hibernate 将为你的应用程序连接到数据库,所以它需要知道如何获取连接。在这个教"
+"程里,我们使用一个独立连接池(和 <interfacename>javax.sql.DataSource</"
+"interfacename> 相反)。Hibernate 支持两个第三方的开源 JDBC 连接池:<ulink "
+"url=\"https://sourceforge.net/projects/c3p0\">c3p0</ulink> 和 <ulink url="
+"\"http://proxool.sourceforge.net/\">proxool</ulink>。然而,在本教程里我们将使"
+"用 Hibernate 内置的连接池。"
#. Tag: para
+#: tutorial.xml:351
#, no-c-format
-msgid "The built-in Hibernate connection pool is in no way intended for production use. It lacks several features found on any decent connection pool."
+msgid ""
+"The built-in Hibernate connection pool is in no way intended for production "
+"use. It lacks several features found on any decent connection pool."
msgstr "嵌入的 Hibernate 连接池不用于产品环境。它缺乏连接池里的几个功能。"
#. Tag: para
+#: tutorial.xml:357
#, no-c-format
-msgid "For Hibernate's configuration, we can use a simple <literal>hibernate.properties</literal> file, a more sophisticated <literal>hibernate.cfg.xml</literal> file, or even complete programmatic setup. Most users prefer the XML configuration file:"
-msgstr "为了保存 Hibernate 的配置,我们可以使用一个简单的 <literal>hibernate.properties</literal> 文件,或者一个稍微复杂的 <literal>hibernate.cfg.xml</literal>,甚至可以完全使用程序来配置 Hibernate。多数用户更喜欢使用 XML 配置文件: "
+msgid ""
+"For Hibernate's configuration, we can use a simple <literal>hibernate."
+"properties</literal> file, a more sophisticated <literal>hibernate.cfg.xml</"
+"literal> file, or even complete programmatic setup. Most users prefer the "
+"XML configuration file:"
+msgstr ""
+"为了保存 Hibernate 的配置,我们可以使用一个简单的 <literal>hibernate."
+"properties</literal> 文件,或者一个稍微复杂的 <literal>hibernate.cfg.xml</"
+"literal>,甚至可以完全使用程序来配置 Hibernate。多数用户更喜欢使用 XML 配置文"
+"件: "
+#. Tag: programlisting
+#: tutorial.xml:363
+#, no-c-format
+msgid ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+msgstr ""
+"<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
+"<!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"
+"\n"
+" <session-factory>\n"
+"\n"
+" <!-- Database connection settings -->\n"
+" <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
+"property>\n"
+" <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
+"property>\n"
+" <property name=\"connection.username\">sa</property>\n"
+" <property name=\"connection.password\"></property>\n"
+"\n"
+" <!-- JDBC connection pool (use the built-in) -->\n"
+" <property name=\"connection.pool_size\">1</property>\n"
+"\n"
+" <!-- SQL dialect -->\n"
+" <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
+"property>\n"
+"\n"
+" <!-- Enable Hibernate's automatic session context management -->\n"
+" <property name=\"current_session_context_class\">thread</property>\n"
+"\n"
+" <!-- Disable the second-level cache -->\n"
+" <property name=\"cache.provider_class\">org.hibernate.cache."
+"NoCacheProvider</property>\n"
+"\n"
+" <!-- Echo all executed SQL to stdout -->\n"
+" <property name=\"show_sql\">true</property>\n"
+"\n"
+" <!-- Drop and re-create the database schema on startup -->\n"
+" <property name=\"hbm2ddl.auto\">update</property>\n"
+"\n"
+" <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/>\n"
+"\n"
+" </session-factory>\n"
+"\n"
+"</hibernate-configuration>]]>"
+
#. Tag: para
+#: tutorial.xml:366
#, no-c-format
msgid "Notice that this configuration file specifies a different DTD"
msgstr "请注意,这个配置文件指定了一个不同的 DTD。"
#. Tag: para
+#: tutorial.xml:369
#, no-c-format
-msgid "You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory is a global factory responsible for a particular database. If you have several databases, for easier startup you should use several <literal><session-factory></literal> configurations in several configuration files."
-msgstr "注意这个 XML 配置使用了一个不同的 DTD。在这里,我们配置了 Hibernate 的<literal>SessionFactory</literal> — 一个关联于特定数据库全局的工厂(factory)。如果你要使用多个数据库,就要用多个的 <literal><session-factory></literal>,通常把它们放在多个配置文件中(为了更容易启动)。 "
+msgid ""
+"You configure Hibernate's <literal>SessionFactory</literal>. SessionFactory "
+"is a global factory responsible for a particular database. If you have "
+"several databases, for easier startup you should use several <literal><"
+"session-factory></literal> configurations in several configuration files."
+msgstr ""
+"注意这个 XML 配置使用了一个不同的 DTD。在这里,我们配置了 Hibernate 的"
+"<literal>SessionFactory</literal> — 一个关联于特定数据库全局的工厂"
+"(factory)。如果你要使用多个数据库,就要用多个的 <literal><session-"
+"factory></literal>,通常把它们放在多个配置文件中(为了更容易启动)。 "
#. Tag: para
+#: tutorial.xml:376
#, no-c-format
-msgid "The first four <literal>property</literal> elements contain the necessary configuration for the JDBC connection. The dialect <literal>property</literal> element specifies the particular SQL variant Hibernate generates."
-msgstr "签名 4 个 <literal>property</literal> 元素包含了 JDBC 连接所必需的配置。方言 <literal>property</literal> 元素指定了 Hibernate 生成的特定 SQL 语句。"
+msgid ""
+"The first four <literal>property</literal> elements contain the necessary "
+"configuration for the JDBC connection. The dialect <literal>property</"
+"literal> element specifies the particular SQL variant Hibernate generates."
+msgstr ""
+"签名 4 个 <literal>property</literal> 元素包含了 JDBC 连接所必需的配置。方言 "
+"<literal>property</literal> 元素指定了 Hibernate 生成的特定 SQL 语句。"
#. Tag: para
-#, no-c-format
-msgid "In most cases, Hibernate is able to properly determine which dialect to use. See <xref linkend=\"portability-dialectresolver\" /> for more information."
-msgstr "在大多数情况下,Hibernate 都能够正确地决定所使用的方言。更多信息请参考 <xref linkend=\"portability-dialectresolver\" />。 "
+#: tutorial.xml:383
+#, fuzzy, no-c-format
+msgid ""
+"In most cases, Hibernate is able to properly determine which dialect to use. "
+"See <xref linkend=\"portability-dialectresolver\"/> for more information."
+msgstr ""
+"在大多数情况下,Hibernate 都能够正确地决定所使用的方言。更多信息请参考 <xref "
+"linkend=\"portability-dialectresolver\" />。 "
#. Tag: para
+#: tutorial.xml:389
#, no-c-format
-msgid "Hibernate's automatic session management for persistence contexts is particularly useful in this context. The <literal>hbm2ddl.auto</literal> option turns on automatic generation of database schemas directly into the database. This can also be turned off by removing the configuration option, or redirected to a file with the help of the <literal>SchemaExport</literal> Ant task. Finally, add the mapping file(s) for persistent classes to the configuration."
-msgstr "最开始的 4 个 <literal>property</literal> 元素包含必要的 JDBC 连接信息。方言(dialect)的 <literal>property</literal> 元素指明 Hibernate 生成的特定 SQL 变量。你很快会看到,Hibernate 对持久化上下文的自动 session 管理就会派上用场。 打开 <literal>hbm2ddl.auto</literal> 选项将自动生成数据库模式(schema)- 直接加入数据库中。当然这个选项也可以被关闭(通过去除这个配置选项)或者通过 Ant 任务 <literal>SchemaExport</literal> 的帮助来把数据库 schema 重定向到文件中。最后,在配置中为持久化类加入映射文件。 "
+msgid ""
+"Hibernate's automatic session management for persistence contexts is "
+"particularly useful in this context. The <literal>hbm2ddl.auto</literal> "
+"option turns on automatic generation of database schemas directly into the "
+"database. This can also be turned off by removing the configuration option, "
+"or redirected to a file with the help of the <literal>SchemaExport</literal> "
+"Ant task. Finally, add the mapping file(s) for persistent classes to the "
+"configuration."
+msgstr ""
+"最开始的 4 个 <literal>property</literal> 元素包含必要的 JDBC 连接信息。方言"
+"(dialect)的 <literal>property</literal> 元素指明 Hibernate 生成的特定 SQL "
+"变量。你很快会看到,Hibernate 对持久化上下文的自动 session 管理就会派上用"
+"场。 打开 <literal>hbm2ddl.auto</literal> 选项将自动生成数据库模式(schema)"
+"- 直接加入数据库中。当然这个选项也可以被关闭(通过去除这个配置选项)或者通"
+"过 Ant 任务 <literal>SchemaExport</literal> 的帮助来把数据库 schema 重定向到"
+"文件中。最后,在配置中为持久化类加入映射文件。 "
#. Tag: para
+#: tutorial.xml:398
#, no-c-format
-msgid "Save this file as <filename>hibernate.cfg.xml</filename> into the <filename>src/main/resources</filename> directory."
-msgstr "把这个文件保存为 <filename>src/main/resources</filename> 目录下的 <filename>hibernate.cfg.xml</filename>。"
+msgid ""
+"Save this file as <filename>hibernate.cfg.xml</filename> into the "
+"<filename>src/main/resources</filename> directory."
+msgstr ""
+"把这个文件保存为 <filename>src/main/resources</filename> 目录下的 "
+"<filename>hibernate.cfg.xml</filename>。"
#. Tag: title
+#: tutorial.xml:406
#, no-c-format
msgid "Building with Maven"
msgstr "用 Maven 构建 "
#. Tag: para
+#: tutorial.xml:408
#, no-c-format
-msgid "We will now build the tutorial with Maven. You will need to have Maven installed; it is available from the <ulink url=\"http://maven.apache.org/download.html\">Maven download page</ulink>. Maven will read the <filename>/pom.xml</filename> file we created earlier and know how to perform some basic project tasks. First, lets run the <literal>compile</literal> goal to make sure we can compile everything so far:"
-msgstr "我们将用 Maven 构建这个教程。你将需要安装 Maven;你可以从 <ulink url=\"http://maven.apache.org/download.html\">Maven 下载页面</ulink>获得 Maven。Maen 将读取我们先前创建的 <filename>/pom.xml</filename> 并知道执行基本的项目任务。首先,让我们运行 <literal>compile</literal> 目标来确保我们可以编译到目前为止的所有程序:"
+msgid ""
+"We will now build the tutorial with Maven. You will need to have Maven "
+"installed; it is available from the <ulink url=\"http://maven.apache.org/"
+"download.html\">Maven download page</ulink>. Maven will read the <filename>/"
+"pom.xml</filename> file we created earlier and know how to perform some "
+"basic project tasks. First, lets run the <literal>compile</literal> goal to "
+"make sure we can compile everything so far:"
+msgstr ""
+"我们将用 Maven 构建这个教程。你将需要安装 Maven;你可以从 <ulink url="
+"\"http://maven.apache.org/download.html\">Maven 下载页面</ulink>获得 Maven。"
+"Maen 将读取我们先前创建的 <filename>/pom.xml</filename> 并知道执行基本的项目"
+"任务。首先,让我们运行 <literal>compile</literal> 目标来确保我们可以编译到目"
+"前为止的所有程序:"
+#. Tag: programlisting
+#: tutorial.xml:418
+#, no-c-format
+msgid ""
+"<![CDATA[[hibernateTutorial]$ mvn compile\n"
+"[INFO] Scanning for projects...\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Building First Hibernate Tutorial\n"
+"[INFO] task-segment: [compile]\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] [resources:resources]\n"
+"[INFO] Using default encoding to copy filtered resources.\n"
+"[INFO] [compiler:compile]\n"
+"[INFO] Compiling 1 source file to /home/steve/projects/sandbox/"
+"hibernateTutorial/target/classes\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] BUILD SUCCESSFUL\n"
+"[INFO] "
+"------------------------------------------------------------------------\n"
+"[INFO] Total time: 2 seconds\n"
+"[INFO] Finished at: Tue Jun 09 12:25:25 CDT 2009\n"
+"[INFO] Final Memory: 5M/547M\n"
+"[INFO] "
+"------------------------------------------------------------------------]]>"
+msgstr ""
+
#. Tag: title
+#: tutorial.xml:423
#, no-c-format
msgid "Startup and helpers"
msgstr "启动和辅助类"
#. Tag: para
+#: tutorial.xml:425
#, no-c-format
-msgid "It is time to load and store some <literal>Event</literal> objects, but first you have to complete the setup with some infrastructure code. You have to startup Hibernate by building a global <interfacename>org.hibernate.SessionFactory</interfacename> object and storing it somewhere for easy access in application code. A <interfacename>org.hibernate.SessionFactory</interfacename> is used to obtain <interfacename>org.hibernate.Session</interfacename> instances. A <interfacename>org.hibernate.Session</interfacename> represents a single-threaded unit of work. The <interfacename>org.hibernate.SessionFactory</interfacename> is a thread-safe global object that is instantiated once."
-msgstr "是时候来加载和储存一些 <literal>Event</literal> 对象了,但首先我们得编写一些基础的代码以完成设置。我们必须启动 Hibernate,此过程包括创建一个全局的 <literal>SessoinFactory</literal>,并把它储存在应用程序代码容易访问的地方。<literal>SessionFactory</literal> 可以创建并打开新的 <literal>Session</literal>。一个 <literal>Session</literal> 代表一个单线程的单元操作,<interfacename>org.hibernate.SessionFactory</interfacename> 则是个线程安全的全局对象,只需要被实例化一次。 "
+msgid ""
+"It is time to load and store some <literal>Event</literal> objects, but "
+"first you have to complete the setup with some infrastructure code. You have "
+"to startup Hibernate by building a global <interfacename>org.hibernate."
+"SessionFactory</interfacename> object and storing it somewhere for easy "
+"access in application code. A <interfacename>org.hibernate.SessionFactory</"
+"interfacename> is used to obtain <interfacename>org.hibernate.Session</"
+"interfacename> instances. A <interfacename>org.hibernate.Session</"
+"interfacename> represents a single-threaded unit of work. The "
+"<interfacename>org.hibernate.SessionFactory</interfacename> is a thread-safe "
+"global object that is instantiated once."
+msgstr ""
+"是时候来加载和储存一些 <literal>Event</literal> 对象了,但首先我们得编写一些"
+"基础的代码以完成设置。我们必须启动 Hibernate,此过程包括创建一个全局的 "
+"<literal>SessoinFactory</literal>,并把它储存在应用程序代码容易访问的地方。"
+"<literal>SessionFactory</literal> 可以创建并打开新的 <literal>Session</"
+"literal>。一个 <literal>Session</literal> 代表一个单线程的单元操作,"
+"<interfacename>org.hibernate.SessionFactory</interfacename> 则是个线程安全的"
+"全局对象,只需要被实例化一次。 "
#. Tag: para
+#: tutorial.xml:439
#, no-c-format
-msgid "We will create a <literal>HibernateUtil</literal> helper class that takes care of startup and makes accessing the <interfacename>org.hibernate.SessionFactory</interfacename> more convenient."
-msgstr "我们将创建一个 <literal>HibernateUtil</literal> 辅助类(helper class)来负责启动 Hibernate 和更方便地操作 <interfacename>org.hibernate.SessionFactory</interfacename>。让我们来看一下它的实现:"
+msgid ""
+"We will create a <literal>HibernateUtil</literal> helper class that takes "
+"care of startup and makes accessing the <interfacename>org.hibernate."
+"SessionFactory</interfacename> more convenient."
+msgstr ""
+"我们将创建一个 <literal>HibernateUtil</literal> 辅助类(helper class)来负责"
+"启动 Hibernate 和更方便地操作 <interfacename>org.hibernate.SessionFactory</"
+"interfacename>。让我们来看一下它的实现:"
+#. Tag: programlisting
+#: tutorial.xml:445
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.util;\n"
+"\n"
+"import org.hibernate.SessionFactory;\n"
+"import org.hibernate.cfg.Configuration;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory = buildSessionFactory"
+"();\n"
+"\n"
+" private static SessionFactory buildSessionFactory() {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" return new Configuration().configure().buildSessionFactory();\n"
+" }\n"
+" catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"package util;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+" private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+" // Create the SessionFactory from hibernate.cfg.xml\n"
+" sessionFactory = new Configuration().configure()."
+"buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Make sure you log the exception, as it might be swallowed\n"
+" System.err.println(\"Initial SessionFactory creation failed.\" + "
+"ex);\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static SessionFactory getSessionFactory() {\n"
+" return sessionFactory;\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:447
#, no-c-format
-msgid "Save this code as <filename>src/main/java/org/hibernate/tutorial/util/HibernateUtil.java</filename>"
-msgstr "把这段代码保存为 <filename>src/main/java/org/hibernate/tutorial/util/HibernateUtil.java</filename>。"
+msgid ""
+"Save this code as <filename>src/main/java/org/hibernate/tutorial/util/"
+"HibernateUtil.java</filename>"
+msgstr ""
+"把这段代码保存为 <filename>src/main/java/org/hibernate/tutorial/util/"
+"HibernateUtil.java</filename>。"
#. Tag: para
+#: tutorial.xml:452
#, no-c-format
-msgid "This class not only produces the global <interfacename>org.hibernate.SessionFactory</interfacename> reference in its static initializer; it also hides the fact that it uses a static singleton. We might just as well have looked up the <interfacename>org.hibernate.SessionFactory</interfacename> reference from JNDI in an application server or any other location for that matter."
-msgstr "这个类不但在它的静态初始化过程(仅当加载这个类的时候被 JVM 执行一次)中产生全局的 <interfacename>org.hibernate.SessionFactory</interfacename>,而且隐藏了它使用了静态 singleton 的事实。它也可能在应用程序服务器中的 JNDI 查找 <interfacename>org.hibernate.SessionFactory</interfacename>。"
+msgid ""
+"This class not only produces the global <interfacename>org.hibernate."
+"SessionFactory</interfacename> reference in its static initializer; it also "
+"hides the fact that it uses a static singleton. We might just as well have "
+"looked up the <interfacename>org.hibernate.SessionFactory</interfacename> "
+"reference from JNDI in an application server or any other location for that "
+"matter."
+msgstr ""
+"这个类不但在它的静态初始化过程(仅当加载这个类的时候被 JVM 执行一次)中产生全"
+"局的 <interfacename>org.hibernate.SessionFactory</interfacename>,而且隐藏了"
+"它使用了静态 singleton 的事实。它也可能在应用程序服务器中的 JNDI 查找 "
+"<interfacename>org.hibernate.SessionFactory</interfacename>。"
#. Tag: para
+#: tutorial.xml:461
#, no-c-format
-msgid "If you give the <interfacename>org.hibernate.SessionFactory</interfacename> a name in your configuration, Hibernate will try to bind it to JNDI under that name after it has been built. Another, better option is to use a JMX deployment and let the JMX-capable container instantiate and bind a <literal>HibernateService</literal> to JNDI. Such advanced options are discussed later."
-msgstr "如果你在配置文件中给 <interfacename>org.hibernate.SessionFactory</interfacename> 一个名字,在 它创建后,Hibernate 会试着把它绑定到 JNDI。要完全避免这样的代码,你也可以使用 JMX 部署,让具有 JMX 能力的容器来实例化 <literal>HibernateService</literal> 并把它绑定到 JNDI。这些高级可选项在后面的章节中会讨论到。"
+msgid ""
+"If you give the <interfacename>org.hibernate.SessionFactory</interfacename> "
+"a name in your configuration, Hibernate will try to bind it to JNDI under "
+"that name after it has been built. Another, better option is to use a JMX "
+"deployment and let the JMX-capable container instantiate and bind a "
+"<literal>HibernateService</literal> to JNDI. Such advanced options are "
+"discussed later."
+msgstr ""
+"如果你在配置文件中给 <interfacename>org.hibernate.SessionFactory</"
+"interfacename> 一个名字,在 它创建后,Hibernate 会试着把它绑定到 JNDI。要完全"
+"避免这样的代码,你也可以使用 JMX 部署,让具有 JMX 能力的容器来实例化 "
+"<literal>HibernateService</literal> 并把它绑定到 JNDI。这些高级可选项在后面的"
+"章节中会讨论到。"
#. Tag: para
+#: tutorial.xml:470
#, no-c-format
-msgid "You now need to configure a logging system. Hibernate uses commons logging and provides two choices: Log4j and JDK 1.4 logging. Most developers prefer Log4j: copy <literal>log4j.properties</literal> from the Hibernate distribution in the <literal>etc/</literal> directory to your <literal>src</literal> directory, next to <literal>hibernate.cfg.xml</literal>. If you prefer to have more verbose output than that provided in the example configuration, you can change the settings. By default, only the Hibernate startup message is shown on stdout."
-msgstr "再次编译这个应用程序应该不会有问题。最后我们需要配置一个日志(logging)系统 — Hibernate 使用通用日志接口,允许你在 Log4j 和 JDK 1.4 日志之间进行选择。多数开发者更喜欢 Log4j:从 Hibernate 的发布包中(它在 <literal>etc/</literal> 目录下)拷贝 <literal>log4j.properties</literal> 到你的 <literal>src</literal> 目录,与 <literal>hibernate.cfg.xml</literal> 放在一起。看一下配置示例,如果你希望看到更加详细的输出信息,你可以修改配置。默认情况下,只有 Hibernate 的启动信息才会显示在标准输出上。 "
+msgid ""
+"You now need to configure a logging system. Hibernate uses commons logging "
+"and provides two choices: Log4j and JDK 1.4 logging. Most developers prefer "
+"Log4j: copy <literal>log4j.properties</literal> from the Hibernate "
+"distribution in the <literal>etc/</literal> directory to your <literal>src</"
+"literal> directory, next to <literal>hibernate.cfg.xml</literal>. If you "
+"prefer to have more verbose output than that provided in the example "
+"configuration, you can change the settings. By default, only the Hibernate "
+"startup message is shown on stdout."
+msgstr ""
+"再次编译这个应用程序应该不会有问题。最后我们需要配置一个日志(logging)系统 — "
+"Hibernate 使用通用日志接口,允许你在 Log4j 和 JDK 1.4 日志之间进行选择。多数"
+"开发者更喜欢 Log4j:从 Hibernate 的发布包中(它在 <literal>etc/</literal> 目"
+"录下)拷贝 <literal>log4j.properties</literal> 到你的 <literal>src</literal> "
+"目录,与 <literal>hibernate.cfg.xml</literal> 放在一起。看一下配置示例,如果"
+"你希望看到更加详细的输出信息,你可以修改配置。默认情况下,只有 Hibernate 的启"
+"动信息才会显示在标准输出上。 "
#. Tag: para
+#: tutorial.xml:480
#, no-c-format
-msgid "The tutorial infrastructure is complete and you are now ready to do some real work with Hibernate."
+msgid ""
+"The tutorial infrastructure is complete and you are now ready to do some "
+"real work with Hibernate."
msgstr "示例的基本框架完成了 — 现在我们可以用 Hibernate 来做些真正的工作。 "
#. Tag: title
+#: tutorial.xml:488
#, no-c-format
msgid "Loading and storing objects"
msgstr "加载并存储对象"
#. Tag: para
-#, no-c-format
-msgid "We are now ready to start doing some real worjk with Hibernate. Let's start by writing an <literal>EventManager</literal> class with a <literal>main()</literal> method:"
-msgstr "我们终于可以使用 Hibernate 来加载和存储对象了,编写一个带有 <literal>main()</literal> 方法的 <literal>EventManager</literal> 类: "
+#: tutorial.xml:490
+#, fuzzy, no-c-format
+msgid ""
+"We are now ready to start doing some real work with Hibernate. Let's start "
+"by writing an <literal>EventManager</literal> class with a <literal>main()</"
+"literal> method:"
+msgstr ""
+"我们终于可以使用 Hibernate 来加载和存储对象了,编写一个带有 <literal>main()</"
+"literal> 方法的 <literal>EventManager</literal> 类: "
+#. Tag: programlisting
+#: tutorial.xml:496
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial;\n"
+"\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.*;\n"
+"\n"
+"import org.hibernate.tutorial.domain.Event;\n"
+"import org.hibernate.tutorial.util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"import org.hibernate.Session;\n"
+"\n"
+"import java.util.Date;\n"
+"\n"
+"import util.HibernateUtil;\n"
+"\n"
+"public class EventManager {\n"
+"\n"
+" public static void main(String[] args) {\n"
+" EventManager mgr = new EventManager();\n"
+"\n"
+" if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+"\n"
+" HibernateUtil.getSessionFactory().close();\n"
+" }\n"
+"\n"
+" private void createAndStoreEvent(String title, Date theDate) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+"\n"
+" session.beginTransaction();\n"
+"\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" session.save(theEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:498
#, no-c-format
-msgid "In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</literal> object and handed it over to Hibernate. At that point, Hibernate takes care of the SQL and executes an <literal>INSERT</literal> on the database."
-msgstr "在 <literal>createAndStoreEvent()</literal> 来里我们创建了一个新的 <literal>Event</literal> 对象并把它传递给 Hibernate。现在 Hibernate 负责与 SQL 打交道,并把 <literal>INSERT</literal> 命令传给数据库。"
+msgid ""
+"In <literal>createAndStoreEvent()</literal> we created a new <literal>Event</"
+"literal> object and handed it over to Hibernate. At that point, Hibernate "
+"takes care of the SQL and executes an <literal>INSERT</literal> on the "
+"database."
+msgstr ""
+"在 <literal>createAndStoreEvent()</literal> 来里我们创建了一个新的 "
+"<literal>Event</literal> 对象并把它传递给 Hibernate。现在 Hibernate 负责与 "
+"SQL 打交道,并把 <literal>INSERT</literal> 命令传给数据库。"
#. Tag: para
-#, no-c-format
-msgid "A <interface>org.hibernate.Session</interface> is designed to represent a single unit of work (a single atmoic piece of work to be performed). For now we will keep things simple and assume a one-to-one granularity between a Hibernate <interface>org.hibernate.Session</interface> and a database transaction. To shield our code from the actual underlying transaction system we use the Hibernate <interfacename>org.hibernate.Transaction</interfacename> API. In this particular case we are using JDBC-based transactional semantics, but it could also run with JTA."
-msgstr "一个 <interface>org.hibernate.Session</interface> 就是个单一的工作单元。我们暂时让事情简单一些,并假设 Hibernate <interface>org.hibernate.Session</interface> 和数据库事务是一一对应的。为了让我们的代码从底层的事务系统中脱离出来(此例中是 JDBC,但也可能是 JTA),我们使用 <interfacename>org.hibernate.Transaction</interfacename> API。在这个例子里我们使用基于 JDBC 的事务性 semantic,但它也可以和 JTA 一起运行。"
+#: tutorial.xml:505
+#, fuzzy, no-c-format
+msgid ""
+"A <interface>org.hibernate.Session</interface> is designed to represent a "
+"single unit of work (a single atomic piece of work to be performed). For now "
+"we will keep things simple and assume a one-to-one granularity between a "
+"Hibernate <interface>org.hibernate.Session</interface> and a database "
+"transaction. To shield our code from the actual underlying transaction "
+"system we use the Hibernate <interfacename>org.hibernate.Transaction</"
+"interfacename> API. In this particular case we are using JDBC-based "
+"transactional semantics, but it could also run with JTA."
+msgstr ""
+"一个 <interface>org.hibernate.Session</interface> 就是个单一的工作单元。我们"
+"暂时让事情简单一些,并假设 Hibernate <interface>org.hibernate.Session</"
+"interface> 和数据库事务是一一对应的。为了让我们的代码从底层的事务系统中脱离出"
+"来(此例中是 JDBC,但也可能是 JTA),我们使用 <interfacename>org.hibernate."
+"Transaction</interfacename> API。在这个例子里我们使用基于 JDBC 的事务性 "
+"semantic,但它也可以和 JTA 一起运行。"
#. Tag: para
+#: tutorial.xml:518
#, no-c-format
-msgid "What does <literal>sessionFactory.getCurrentSession()</literal> do? First, you can call it as many times and anywhere you like once you get hold of your <interfacename>org.hibernate.SessionFactory</interfacename>. The <literal>getCurrentSession()</literal> method always returns the \"current\" unit of work. Remember that we switched the configuration option for this mechanism to \"thread\" in our <filename>src/main/resources/hibernate.cfg.xml</filename>? Due to that setting, the context of a current unit of work is bound to the current Java thread that executes the application."
-msgstr "<literal>sessionFactory.getCurrentSession()</literal> 是干什么的呢?首先,只要你持有 <interfacename>org.hibernate.SessionFactory</interfacename>,大可在任何时候、任何地点调用这个方法。<literal>getCurrentSession()</literal> 方法总会返回“当前的”工作单元。记得我们在 <filename>src/main/resources/hibernate.cfg.xml</filename> 中把这一配置选项调整为 \"thread\" 了吗?因此,因此,当前工作单元被绑定到当前执行我们应用程序的 Java 线程。但是,这并非是完全准确的,你还得考虑工作单元的生命周期范围(scope),它何时开始,又何时结束。"
+msgid ""
+"What does <literal>sessionFactory.getCurrentSession()</literal> do? First, "
+"you can call it as many times and anywhere you like once you get hold of "
+"your <interfacename>org.hibernate.SessionFactory</interfacename>. The "
+"<literal>getCurrentSession()</literal> method always returns the \"current\" "
+"unit of work. Remember that we switched the configuration option for this "
+"mechanism to \"thread\" in our <filename>src/main/resources/hibernate.cfg."
+"xml</filename>? Due to that setting, the context of a current unit of work "
+"is bound to the current Java thread that executes the application."
+msgstr ""
+"<literal>sessionFactory.getCurrentSession()</literal> 是干什么的呢?首先,只"
+"要你持有 <interfacename>org.hibernate.SessionFactory</interfacename>,大可在"
+"任何时候、任何地点调用这个方法。<literal>getCurrentSession()</literal> 方法总"
+"会返回“当前的”工作单元。记得我们在 <filename>src/main/resources/hibernate."
+"cfg.xml</filename> 中把这一配置选项调整为 \"thread\" 了吗?因此,因此,当前工"
+"作单元被绑定到当前执行我们应用程序的 Java 线程。但是,这并非是完全准确的,你还"
+"得考虑工作单元的生命周期范围(scope),它何时开始,又何时结束。"
#. Tag: para
+#: tutorial.xml:532
#, no-c-format
-msgid "Hibernate offers three methods of current session tracking. The \"thread\" based method is not intended for production use; it is merely useful for prototyping and tutorials such as this one. Current session tracking is discussed in more detail later on."
-msgstr "Hibernate 提供三种跟踪当前会话的方法。基于“线程”的方法不适合于产品环境,它仅用于 prototyping 和教学用途。后面将更详细地讨论会话跟踪。"
+msgid ""
+"Hibernate offers three methods of current session tracking. The \"thread\" "
+"based method is not intended for production use; it is merely useful for "
+"prototyping and tutorials such as this one. Current session tracking is "
+"discussed in more detail later on."
+msgstr ""
+"Hibernate 提供三种跟踪当前会话的方法。基于“线程”的方法不适合于产品环境,它仅"
+"用于 prototyping 和教学用途。后面将更详细地讨论会话跟踪。"
#. Tag: para
+#: tutorial.xml:541
#, no-c-format
-msgid "A <interface>org.hibernate.Session</interface> begins when the first call to <literal>getCurrentSession()</literal> is made for the current thread. It is then bound by Hibernate to the current thread. When the transaction ends, either through commit or rollback, Hibernate automatically unbinds the <interface>org.hibernate.Session</interface> from the thread and closes it for you. If you call <literal>getCurrentSession()</literal> again, you get a new <interface>org.hibernate.Session</interface> and can start a new unit of work."
-msgstr "<interface>org.hibernate.Session</interface> 在第一次被使用的时候,即第一次调用 <literal>getCurrentSession()</literal> 的时候,其生命周期就开始。然后它被 Hibernate 绑定到当前线程。当事务结束的时候,不管是提交还是回滚,Hibernate 会自动把 <interface>org.hibernate.Session</interface> 从当前线程剥离,并且关闭它。假若你再次调用 <literal>getCurrentSession()</literal>,你会得到一个新的 <interface>org.hibernate.Session</interface>,并且开始一个新的工作单元。"
+msgid ""
+"A <interface>org.hibernate.Session</interface> begins when the first call to "
+"<literal>getCurrentSession()</literal> is made for the current thread. It is "
+"then bound by Hibernate to the current thread. When the transaction ends, "
+"either through commit or rollback, Hibernate automatically unbinds the "
+"<interface>org.hibernate.Session</interface> from the thread and closes it "
+"for you. If you call <literal>getCurrentSession()</literal> again, you get a "
+"new <interface>org.hibernate.Session</interface> and can start a new unit of "
+"work."
+msgstr ""
+"<interface>org.hibernate.Session</interface> 在第一次被使用的时候,即第一次调"
+"用 <literal>getCurrentSession()</literal> 的时候,其生命周期就开始。然后它被 "
+"Hibernate 绑定到当前线程。当事务结束的时候,不管是提交还是回滚,Hibernate 会"
+"自动把 <interface>org.hibernate.Session</interface> 从当前线程剥离,并且关闭"
+"它。假若你再次调用 <literal>getCurrentSession()</literal>,你会得到一个新的 "
+"<interface>org.hibernate.Session</interface>,并且开始一个新的工作单元。"
#. Tag: para
+#: tutorial.xml:554
#, no-c-format
-msgid "Related to the unit of work scope, should the Hibernate <interface>org.hibernate.Session</interface> be used to execute one or several database operations? The above example uses one <interface>org.hibernate.Session</interface> for one operation. However this is pure coincidence; the example is just not complex enough to show any other approach. The scope of a Hibernate <interface>org.hibernate.Session</interface> is flexible but you should never design your application to use a new Hibernate <interface>org.hibernate.Session</interface> for <emphasis>every</emphasis> database operation. Even though it is used in the following examples, consider <emphasis>session-per-operation</emphasis> an anti-pattern. A real web application is shown later in the tutorial which will help illustrate this."
-msgstr "和工作单元的生命周期这个话题相关,Hibernate <interface>org.hibernate.Session</interface> 是否被应该用来执行多次数据库操作?上面的例子对每一次操作使用了一个 <interface>org.hibernate.Session</interface>,这完全是巧合,这个例子不是很复杂,无法展示其他方式。Hibernate <interface>org.hibernate.Session</interface> 的生命周期可以很灵活,但是你绝不要把你的应用程序设计成为<emphasis>每一次</emphasis>数据库操作都用一个新的 Hibernate <interface>org.hibernate.Session</interface>。因此就算下面的例子(它们都很简单)中你可以看到这种用法,记住<emphasis>每次操作一个 session</emphasis> 是一个反模式。在本教程的后面会展示一个真正的(web)程序。"
+msgid ""
+"Related to the unit of work scope, should the Hibernate <interface>org."
+"hibernate.Session</interface> be used to execute one or several database "
+"operations? The above example uses one <interface>org.hibernate.Session</"
+"interface> for one operation. However this is pure coincidence; the example "
+"is just not complex enough to show any other approach. The scope of a "
+"Hibernate <interface>org.hibernate.Session</interface> is flexible but you "
+"should never design your application to use a new Hibernate <interface>org."
+"hibernate.Session</interface> for <emphasis>every</emphasis> database "
+"operation. Even though it is used in the following examples, consider "
+"<emphasis>session-per-operation</emphasis> an anti-pattern. A real web "
+"application is shown later in the tutorial which will help illustrate this."
+msgstr ""
+"和工作单元的生命周期这个话题相关,Hibernate <interface>org.hibernate."
+"Session</interface> 是否被应该用来执行多次数据库操作?上面的例子对每一次操作"
+"使用了一个 <interface>org.hibernate.Session</interface>,这完全是巧合,这个例"
+"子不是很复杂,无法展示其他方式。Hibernate <interface>org.hibernate.Session</"
+"interface> 的生命周期可以很灵活,但是你绝不要把你的应用程序设计成为<emphasis>"
+"每一次</emphasis>数据库操作都用一个新的 Hibernate <interface>org.hibernate."
+"Session</interface>。因此就算下面的例子(它们都很简单)中你可以看到这种用法,"
+"记住<emphasis>每次操作一个 session</emphasis> 是一个反模式。在本教程的后面会"
+"展示一个真正的(web)程序。"
#. Tag: para
-#, no-c-format
-msgid "See <xref linkend=\"transactions\" /> for more information about transaction handling and demarcation. The previous example also skipped any error handling and rollback."
-msgstr "关于事务处理及事务边界界定的详细信息,请参看 <xref linkend=\"transactions\" /> 。在上面的例子中,我们也忽略了所有的错误与回滚的处理。 "
+#: tutorial.xml:571
+#, fuzzy, no-c-format
+msgid ""
+"See <xref linkend=\"transactions\"/> for more information about transaction "
+"handling and demarcation. The previous example also skipped any error "
+"handling and rollback."
+msgstr ""
+"关于事务处理及事务边界界定的详细信息,请参看 <xref linkend=\"transactions\" /"
+"> 。在上面的例子中,我们也忽略了所有的错误与回滚的处理。 "
#. Tag: para
+#: tutorial.xml:577
#, no-c-format
-msgid "To run this, we will make use of the Maven exec plugin to call our class with the necessary classpath setup: <command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"store\"</command>"
-msgstr "要运行它,我们将使用 Maven exec 插件以及必要的 classpath 设置来进行调用:<command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"store\"</command>。"
+msgid ""
+"To run this, we will make use of the Maven exec plugin to call our class "
+"with the necessary classpath setup: <command>mvn exec:java -Dexec.mainClass="
+"\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"store\"</command>"
+msgstr ""
+"要运行它,我们将使用 Maven exec 插件以及必要的 classpath 设置来进行调用:"
+"<command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager"
+"\" -Dexec.args=\"store\"</command>。"
#. Tag: para
+#: tutorial.xml:584
#, no-c-format
msgid "You may need to perform <command>mvn compile</command> first."
msgstr "你可能需要先执行 <command>mvn compile</command>。"
#. Tag: para
+#: tutorial.xml:589
#, no-c-format
-msgid "You should see Hibernate starting up and, depending on your configuration, lots of log output. Towards the end, the following line will be displayed:"
-msgstr "你应该会看到,编译以后,Hibernate 根据你的配置启动,并产生一大堆的输出日志。在日志最后你会看到下面这行: "
+msgid ""
+"You should see Hibernate starting up and, depending on your configuration, "
+"lots of log output. Towards the end, the following line will be displayed:"
+msgstr ""
+"你应该会看到,编译以后,Hibernate 根据你的配置启动,并产生一大堆的输出日志。"
+"在日志最后你会看到下面这行: "
+#. Tag: programlisting
+#: tutorial.xml:594
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) "
+"values (?, ?, ?)]]>"
+msgstr ""
+"[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values "
+"(?, ?, ?)"
+
#. Tag: para
+#: tutorial.xml:596
#, no-c-format
msgid "This is the <literal>INSERT</literal> executed by Hibernate."
msgstr "执行 HQL <literal>INSERT</literal> 语句的例子如下: "
#. Tag: para
+#: tutorial.xml:600
#, no-c-format
msgid "To list stored events an option is added to the main method:"
-msgstr "我们想要列出所有已经被存储的 events,就要增加一个条件分支选项到 main 方法中:"
+msgstr ""
+"我们想要列出所有已经被存储的 events,就要增加一个条件分支选项到 main 方法中:"
+#. Tag: programlisting
+#: tutorial.xml:604
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" }\n"
+" else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\n"
+" \"Event: \" + theEvent.getTitle() + \" Time: \" + "
+"theEvent.getDate()\n"
+" );\n"
+" }\n"
+" }]]>"
+msgstr ""
+"if (args[0].equals(\"store\")) {\n"
+" mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+"}\n"
+"else if (args[0].equals(\"list\")) {\n"
+" List events = mgr.listEvents();\n"
+" for (int i = 0; i < events.size(); i++) {\n"
+" Event theEvent = (Event) events.get(i);\n"
+" System.out.println(\"Event: \" + theEvent.getTitle() +\n"
+" \" Time: \" + theEvent.getDate());\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:606
#, no-c-format
msgid "A new <literal>listEvents() method is also added</literal>:"
msgstr "我们也增加一个新的 <literal>listEvents()</literal> 方法: "
+#. Tag: programlisting
+#: tutorial.xml:610
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private List listEvents() {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+" session.getTransaction().commit();\n"
+" return result;\n"
+" }]]>"
+msgstr ""
+"private List listEvents() {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+"\n"
+" session.beginTransaction();\n"
+"\n"
+" List result = session.createQuery(\"from Event\").list();\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" return result;\n"
+"}"
+
#. Tag: para
-#, no-c-format
-msgid "Here, we are using a Hibernate Query Language (HQL) query to load all existing <literal>Event</literal> objects from the database. Hibernate will generate the appropriate SQL, send it to the database and populate <literal>Event</literal> objects with the data. You can create more complex queries with HQL. See <xref linkend=\"queryhql\" /> for more information."
-msgstr "我们在这里是用一个 HQL(Hibernate Query Language-Hibernate查询语言)查询语句来从数据库中加载所有存在的 <literal>Event</literal> 对象。Hibernate 会生成适当的 SQL,把它发送到数据库,并操作从查询得到数据的 <literal>Event</literal> 对象。当然,你可以使用 HQL 来创建更加复杂的查询。更多信息请参考 <xref linkend=\"queryhql\"/>。 "
+#: tutorial.xml:612
+#, fuzzy, no-c-format
+msgid ""
+"Here, we are using a Hibernate Query Language (HQL) query to load all "
+"existing <literal>Event</literal> objects from the database. Hibernate will "
+"generate the appropriate SQL, send it to the database and populate "
+"<literal>Event</literal> objects with the data. You can create more complex "
+"queries with HQL. See <xref linkend=\"queryhql\"/> for more information."
+msgstr ""
+"我们在这里是用一个 HQL(Hibernate Query Language-Hibernate查询语言)查询语句"
+"来从数据库中加载所有存在的 <literal>Event</literal> 对象。Hibernate 会生成适"
+"当的 SQL,把它发送到数据库,并操作从查询得到数据的 <literal>Event</literal> "
+"对象。当然,你可以使用 HQL 来创建更加复杂的查询。更多信息请参考 <xref "
+"linkend=\"queryhql\"/>。 "
#. Tag: para
+#: tutorial.xml:620
#, no-c-format
-msgid "Now we can call our new functionality, again using the Maven exec plugin: <command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"list\"</command>"
-msgstr "现在我们可以再次用 Maven exec plugin - <command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"list\"</command> 调用新的功能了。"
+msgid ""
+"Now we can call our new functionality, again using the Maven exec plugin: "
+"<command>mvn exec:java -Dexec.mainClass=\"org.hibernate.tutorial.EventManager"
+"\" -Dexec.args=\"list\"</command>"
+msgstr ""
+"现在我们可以再次用 Maven exec plugin - <command>mvn exec:java -Dexec."
+"mainClass=\"org.hibernate.tutorial.EventManager\" -Dexec.args=\"list\"</"
+"command> 调用新的功能了。"
#. Tag: title
+#: tutorial.xml:630
#, no-c-format
msgid "Part 2 - Mapping associations"
msgstr "第二部分 - 关联映射"
#. Tag: para
+#: tutorial.xml:632
#, no-c-format
-msgid "So far we have mapped a single persistent entity class to a table in isolation. Let's expand on that a bit and add some class associations. We will add people to the application and store a list of events in which they participate."
-msgstr "我们已经映射了一个持久化实体类到表上。让我们在这个基础上增加一些类之间的关联。首先我们往应用程序里增加人(people)的概念,并存储他们所参与的一个 Event 列表。(译者注:与 Event 一样,我们在后面将直接使用 person 来表示“人”而不是它的中文翻译) "
+msgid ""
+"So far we have mapped a single persistent entity class to a table in "
+"isolation. Let's expand on that a bit and add some class associations. We "
+"will add people to the application and store a list of events in which they "
+"participate."
+msgstr ""
+"我们已经映射了一个持久化实体类到表上。让我们在这个基础上增加一些类之间的关"
+"联。首先我们往应用程序里增加人(people)的概念,并存储他们所参与的一个 Event "
+"列表。(译者注:与 Event 一样,我们在后面将直接使用 person 来表示“人”而不是它"
+"的中文翻译) "
#. Tag: title
+#: tutorial.xml:640
#, no-c-format
msgid "Mapping the Person class"
msgstr "映射 Person 类"
#. Tag: para
+#: tutorial.xml:642
#, no-c-format
msgid "The first cut of the <literal>Person</literal> class looks like this:"
msgstr "最初简单的 <literal>Person</literal> 类: "
+#. Tag: programlisting
+#: tutorial.xml:646
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.domain;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}]]>"
+msgstr ""
+"package events;\n"
+"\n"
+"public class Person {\n"
+"\n"
+" private Long id;\n"
+" private int age;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" public Person() {}\n"
+"\n"
+" // Accessor methods for all properties, private setter for 'id'\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:648
#, no-c-format
-msgid "Save this to a file named <filename>src/main/java/org/hibernate/tutorial/domain/Person.java</filename>"
-msgstr "把它保存为文件 <filename>src/main/java/org/hibernate/tutorial/domain/Person.java</filename>。"
+msgid ""
+"Save this to a file named <filename>src/main/java/org/hibernate/tutorial/"
+"domain/Person.java</filename>"
+msgstr ""
+"把它保存为文件 <filename>src/main/java/org/hibernate/tutorial/domain/Person."
+"java</filename>。"
#. Tag: para
+#: tutorial.xml:653
#, no-c-format
-msgid "Next, create the new mapping file as <filename>src/main/resources/org/hibernate/tutorial/domain/Person.hbm.xml</filename>"
-msgstr "然后,创建新的映射文件 <filename>src/main/resources/org/hibernate/tutorial/domain/Person.hbm.xml</filename>。"
+msgid ""
+"Next, create the new mapping file as <filename>src/main/resources/org/"
+"hibernate/tutorial/domain/Person.hbm.xml</filename>"
+msgstr ""
+"然后,创建新的映射文件 <filename>src/main/resources/org/hibernate/tutorial/"
+"domain/Person.hbm.xml</filename>。"
+#. Tag: programlisting
+#: tutorial.xml:658
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
+"\n"
+" <class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>]]>"
+msgstr ""
+"<hibernate-mapping>\n"
+"\n"
+" <class name=\"events.Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+" </class>\n"
+"\n"
+"</hibernate-mapping>"
+
#. Tag: para
+#: tutorial.xml:660
#, no-c-format
msgid "Finally, add the new mapping to Hibernate's configuration:"
msgstr "最后,把新的映射加入到 Hibernate 的配置中:"
+#. Tag: programlisting
+#: tutorial.xml:664
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>]]>"
+msgstr ""
+"<mapping resource=\"events/Event.hbm.xml\"/>\n"
+"<mapping resource=\"events/Person.hbm.xml\"/>"
+
#. Tag: para
+#: tutorial.xml:666
#, no-c-format
-msgid "Create an association between these two entities. Persons can participate in events, and events have participants. The design questions you have to deal with are: directionality, multiplicity, and collection behavior."
-msgstr "现在我们在这两个实体之间创建一个关联。显然,persons 可以参与一系列 events,而 events 也有不同的参加者(persons)。我们需要处理的设计问题是关联方向(directionality),阶数(multiplicity)和集合(collection)的行为。 "
+msgid ""
+"Create an association between these two entities. Persons can participate in "
+"events, and events have participants. The design questions you have to deal "
+"with are: directionality, multiplicity, and collection behavior."
+msgstr ""
+"现在我们在这两个实体之间创建一个关联。显然,persons 可以参与一系列 events,"
+"而 events 也有不同的参加者(persons)。我们需要处理的设计问题是关联方向"
+"(directionality),阶数(multiplicity)和集合(collection)的行为。 "
#. Tag: title
+#: tutorial.xml:676
#, no-c-format
msgid "A unidirectional Set-based association"
msgstr "单向 Set-based 的关联"
#. Tag: para
+#: tutorial.xml:678
#, no-c-format
-msgid "By adding a collection of events to the <literal>Person</literal> class, you can easily navigate to the events for a particular person, without executing an explicit query - by calling <literal>Person#getEvents</literal>. Multi-valued associations are represented in Hibernate by one of the Java Collection Framework contracts; here we choose a <interfacename>java.util.Set</interfacename> because the collection will not contain duplicate elements and the ordering is not relevant to our examples:"
-msgstr "我们将向 <literal>Person</literal> 类增加一连串的 events。那样,通过调用 <literal>aPerson.getEvents()</literal>,就可以轻松地导航到特定 person 所参与的 events,而不用去执行一个显式的查询。我们使用 Java 的集合类(collection):<literal>Set</literal>,因为 set 不包含重复的元素及与我们无关的排序。 "
+msgid ""
+"By adding a collection of events to the <literal>Person</literal> class, you "
+"can easily navigate to the events for a particular person, without executing "
+"an explicit query - by calling <literal>Person#getEvents</literal>. Multi-"
+"valued associations are represented in Hibernate by one of the Java "
+"Collection Framework contracts; here we choose a <interfacename>java.util."
+"Set</interfacename> because the collection will not contain duplicate "
+"elements and the ordering is not relevant to our examples:"
+msgstr ""
+"我们将向 <literal>Person</literal> 类增加一连串的 events。那样,通过调用 "
+"<literal>aPerson.getEvents()</literal>,就可以轻松地导航到特定 person 所参与"
+"的 events,而不用去执行一个显式的查询。我们使用 Java 的集合类(collection):"
+"<literal>Set</literal>,因为 set 不包含重复的元素及与我们无关的排序。 "
+#. Tag: programlisting
+#: tutorial.xml:689
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}]]>"
+msgstr ""
+"public class Person {\n"
+"\n"
+" private Set events = new HashSet();\n"
+"\n"
+" public Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" public void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:691
#, no-c-format
-msgid "Before mapping this association, let's consider the other side. We could just keep this unidirectional or create another collection on the <literal>Event</literal>, if we wanted to be able to navigate it from both directions. This is not necessary, from a functional perspective. You can always execute an explicit query to retrieve the participants for a particular event. This is a design choice left to you, but what is clear from this discussion is the multiplicity of the association: \"many\" valued on both sides is called a <emphasis>many-to-many</emphasis> association. Hence, we use Hibernate's many-to-many mapping:"
-msgstr "在映射这个关联之前,先考虑一下此关联的另外一端。很显然,我们可以保持这个关联是单向的。或者,我们可以在 <literal>Event</literal> 里创建另外一个集合,如果希望能够双向地导航,如:<literal>anEvent.getParticipants()</literal>。从功能的角度来说,这并不是必须的。因为你总可以显式地执行一个查询,以获得某个特定 event 的所有参与者。这是个在设计时需要做出的选择,完全由你来决定,但此讨论中关于关联的阶数是清楚的:即两端都是“多”值的,我们把它叫做<emphasis>多对多(many-to-many)</emphasis>关联。因而,我们使用 Hibernate 的多对多映射: "
+msgid ""
+"Before mapping this association, let's consider the other side. We could "
+"just keep this unidirectional or create another collection on the "
+"<literal>Event</literal>, if we wanted to be able to navigate it from both "
+"directions. This is not necessary, from a functional perspective. You can "
+"always execute an explicit query to retrieve the participants for a "
+"particular event. This is a design choice left to you, but what is clear "
+"from this discussion is the multiplicity of the association: \"many\" valued "
+"on both sides is called a <emphasis>many-to-many</emphasis> association. "
+"Hence, we use Hibernate's many-to-many mapping:"
+msgstr ""
+"在映射这个关联之前,先考虑一下此关联的另外一端。很显然,我们可以保持这个关联"
+"是单向的。或者,我们可以在 <literal>Event</literal> 里创建另外一个集合,如果"
+"希望能够双向地导航,如:<literal>anEvent.getParticipants()</literal>。从功能"
+"的角度来说,这并不是必须的。因为你总可以显式地执行一个查询,以获得某个特定 "
+"event 的所有参与者。这是个在设计时需要做出的选择,完全由你来决定,但此讨论中"
+"关于关联的阶数是清楚的:即两端都是“多”值的,我们把它叫做<emphasis>多对多"
+"(many-to-many)</emphasis>关联。因而,我们使用 Hibernate 的多对多映射: "
+#. Tag: programlisting
+#: tutorial.xml:704
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>]]>"
+msgstr ""
+"<class name=\"events.Person\" table=\"PERSON\">\n"
+" <id name=\"id\" column=\"PERSON_ID\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <property name=\"age\"/>\n"
+" <property name=\"firstname\"/>\n"
+" <property name=\"lastname\"/>\n"
+"\n"
+" <set name=\"events\" table=\"PERSON_EVENT\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <many-to-many column=\"EVENT_ID\" class=\"events.Event\"/>\n"
+" </set>\n"
+"\n"
+"</class>"
+
#. Tag: para
+#: tutorial.xml:706
#, no-c-format
-msgid "Hibernate supports a broad range of collection mappings, a <literal>set</literal> being most common. For a many-to-many association, or <emphasis>n:m</emphasis> entity relationship, an association table is required. Each row in this table represents a link between a person and an event. The table name is decalred using the <literal>table</literal> attribute of the <literal>set</literal> element. The identifier column name in the association, for the person side, is defined with the <literal>key</literal> element, the column name for the event's side with the <literal>column</literal> attribute of the <literal>many-to-many</literal>. You also have to tell Hibernate the class of the objects in your collection (the class on the other side of the collection of references)."
-msgstr "Hibernate 支持各种各样的集合映射,<literal><set></literal> 使用的最为普遍。对于多对多关联(或叫 <emphasis>n:m</emphasis> 实体关系), 需要一个关联表(association table)。<literal>表</literal>里面的每一行代表从 person 到 event 的一个关联。表名是由 <literal>set</literal> 元素的 <literal>table</literal> 属性配置的。关联里面的标识符字段名,对于 person 的一端,是由 <literal><key></literal> 元素定义,而 event 一端的字段名是由 <literal><many-to-many></literal> 元素的 <literal>column</literal> 属性定义。你也必须告诉 Hibernate 集合中对象的类(也就是位于这个集合所代表的关联另外一端的类)。 "
+msgid ""
+"Hibernate supports a broad range of collection mappings, a <literal>set</"
+"literal> being most common. For a many-to-many association, or <emphasis>n:"
+"m</emphasis> entity relationship, an association table is required. Each row "
+"in this table represents a link between a person and an event. The table "
+"name is decalred using the <literal>table</literal> attribute of the "
+"<literal>set</literal> element. The identifier column name in the "
+"association, for the person side, is defined with the <literal>key</literal> "
+"element, the column name for the event's side with the <literal>column</"
+"literal> attribute of the <literal>many-to-many</literal>. You also have to "
+"tell Hibernate the class of the objects in your collection (the class on the "
+"other side of the collection of references)."
+msgstr ""
+"Hibernate 支持各种各样的集合映射,<literal><set></literal> 使用的最为普"
+"遍。对于多对多关联(或叫 <emphasis>n:m</emphasis> 实体关系), 需要一个关联表"
+"(association table)。<literal>表</literal>里面的每一行代表从 person 到 "
+"event 的一个关联。表名是由 <literal>set</literal> 元素的 <literal>table</"
+"literal> 属性配置的。关联里面的标识符字段名,对于 person 的一端,是由 "
+"<literal><key></literal> 元素定义,而 event 一端的字段名是由 "
+"<literal><many-to-many></literal> 元素的 <literal>column</literal> 属性"
+"定义。你也必须告诉 Hibernate 集合中对象的类(也就是位于这个集合所代表的关联另"
+"外一端的类)。 "
#. Tag: para
+#: tutorial.xml:722
#, no-c-format
msgid "The database schema for this mapping is therefore:"
msgstr "因而这个映射的数据库 schema 是:"
+#. Tag: programlisting
+#: tutorial.xml:726
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+"_____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | |\n"
+" |_____________| |__________________| | PERSON |\n"
+" | | | | |_____________|\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | |\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE |\n"
+" |_____________| | FIRSTNAME |\n"
+" | LASTNAME |\n"
+" |_____________|"
+
#. Tag: title
+#: tutorial.xml:731
#, no-c-format
msgid "Working the association"
msgstr "使关联工作"
#. Tag: para
+#: tutorial.xml:733
#, no-c-format
-msgid "Now we will bring some people and events together in a new method in <literal>EventManager</literal>:"
-msgstr "我们把一些 people 和 events 一起放到 <literal>EventManager</literal> 的新方法中: "
+msgid ""
+"Now we will bring some people and events together in a new method in "
+"<literal>EventManager</literal>:"
+msgstr ""
+"我们把一些 people 和 events 一起放到 <literal>EventManager</literal> 的新方法"
+"中: "
+#. Tag: programlisting
+#: tutorial.xml:737
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addPersonToEvent(Long personId, Long eventId) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" aPerson.getEvents().add(anEvent);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:739
#, no-c-format
-msgid "After loading a <literal>Person</literal> and an <literal>Event</literal>, simply modify the collection using the normal collection methods. There is no explicit call to <literal>update()</literal> or <literal>save()</literal>; Hibernate automatically detects that the collection has been modified and needs to be updated. This is called <emphasis>automatic dirty checking</emphasis>. You can also try it by modifying the name or the date property of any of your objects. As long as they are in <emphasis>persistent</emphasis> state, that is, bound to a particular Hibernate <interfacename>org.hibernate.Session</interfacename>, Hibernate monitors any changes and executes SQL in a write-behind fashion. The process of synchronizing the memory state with the database, usually only at the end of a unit of work, is called <emphasis>flushing</emphasis>. In our code, the unit of work ends with a commit, or rollback, of the database transaction."
-msgstr "在加载一 <literal>Person</literal> 和 <literal>Event</literal> 后,使用普通的集合方法就可容易地修改我们定义的集合。如你所见,没有显式的 <literal>update()</literal> 或 <literal>save()</literal>,Hibernate 会自动检测到集合已经被修改并需要更新回数据库。这叫做自动脏检查(<emphasis>automatic dirty checking</emphasis>),你也可以尝试修改任何对象的 name 或者 date 属性,只要他们处于<emphasis>持久化</emphasis>状态,也就是被绑定到某个 Hibernate 的 <literal>Session</literal> 上(如:他们刚刚在一个单元操作被加载或者保存),Hibernate 监视任何改变并在后台隐式写的方式执行 SQL。同步内存状态和数据库的过程,通常只在单元操作结束的时候发生,称此过程为清理缓存<emphasis>(flushing)</emphasis>。在我们的代码中,工作单元由数据库事务的提交(或者回滚)来结束——!
这是由 <literal>CurrentSessionContext</literal> 类的 <literal>thread</literal> 配置选项定义的。 "
+msgid ""
+"After loading a <literal>Person</literal> and an <literal>Event</literal>, "
+"simply modify the collection using the normal collection methods. There is "
+"no explicit call to <literal>update()</literal> or <literal>save()</"
+"literal>; Hibernate automatically detects that the collection has been "
+"modified and needs to be updated. This is called <emphasis>automatic dirty "
+"checking</emphasis>. You can also try it by modifying the name or the date "
+"property of any of your objects. As long as they are in "
+"<emphasis>persistent</emphasis> state, that is, bound to a particular "
+"Hibernate <interfacename>org.hibernate.Session</interfacename>, Hibernate "
+"monitors any changes and executes SQL in a write-behind fashion. The process "
+"of synchronizing the memory state with the database, usually only at the end "
+"of a unit of work, is called <emphasis>flushing</emphasis>. In our code, the "
+"unit of work ends with a commit, or rollback, of the database transaction."
+msgstr ""
+"在加载一 <literal>Person</literal> 和 <literal>Event</literal> 后,使用普通的"
+"集合方法就可容易地修改我们定义的集合。如你所见,没有显式的 <literal>update()"
+"</literal> 或 <literal>save()</literal>,Hibernate 会自动检测到集合已经被修改"
+"并需要更新回数据库。这叫做自动脏检查(<emphasis>automatic dirty checking</"
+"emphasis>),你也可以尝试修改任何对象的 name 或者 date 属性,只要他们处于"
+"<emphasis>持久化</emphasis>状态,也就是被绑定到某个 Hibernate 的 "
+"<literal>Session</literal> 上(如:他们刚刚在一个单元操作被加载或者保存),"
+"Hibernate 监视任何改变并在后台隐式写的方式执行 SQL。同步内存状态和数据库的过"
+"程,通常只在单元操作结束的时候发生,称此过程为清理缓存<emphasis>(flushing)"
+"</emphasis>。在我们的代码中,工作单元由数据库事务的提交(或者回滚)来结束——这"
+"是由 <literal>CurrentSessionContext</literal> 类的 <literal>thread</literal> "
+"配置选项定义的。 "
#. Tag: para
+#: tutorial.xml:758
#, no-c-format
-msgid "You can load person and event in different units of work. Or you can modify an object outside of a <interfacename>org.hibernate.Session</interfacename>, when it is not in persistent state (if it was persistent before, this state is called <emphasis>detached</emphasis>). You can even modify a collection when it is detached:"
-msgstr "当然,你也可以在不同的单元操作里面加载 person 和 event。或在 <literal>Session</literal> 以外修改不是处在持久化(persistent)状态下的对象(如果该对象以前曾经被持久化,那么我们称这个状态为<emphasis>脱管(detached)</emphasis>)。你甚至可以在一个集合被脱管时修改它: "
+msgid ""
+"You can load person and event in different units of work. Or you can modify "
+"an object outside of a <interfacename>org.hibernate.Session</interfacename>, "
+"when it is not in persistent state (if it was persistent before, this state "
+"is called <emphasis>detached</emphasis>). You can even modify a collection "
+"when it is detached:"
+msgstr ""
+"当然,你也可以在不同的单元操作里面加载 person 和 event。或在 "
+"<literal>Session</literal> 以外修改不是处在持久化(persistent)状态下的对象"
+"(如果该对象以前曾经被持久化,那么我们称这个状态为<emphasis>脱管(detached)"
+"</emphasis>)。你甚至可以在一个集合被脱管时修改它: "
+#. Tag: programlisting
+#: tutorial.xml:767
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p."
+"events where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use "
+"it detached\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory()."
+"getCurrentSession();\n"
+" session2.beginTransaction();\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addPersonToEvent(Long personId, Long eventId) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session\n"
+" .createQuery(\"select p from Person p left join fetch p.events "
+"where p.id = :pid\")\n"
+" .setParameter(\"pid\", personId)\n"
+" .uniqueResult(); // Eager fetch the collection so we can use it "
+"detached\n"
+"\n"
+" Event anEvent = (Event) session.load(Event.class, eventId);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"\n"
+" // End of first unit of work\n"
+"\n"
+" aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
+"detached\n"
+"\n"
+" // Begin second unit of work\n"
+"\n"
+" Session session2 = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session2.beginTransaction();\n"
+"\n"
+" session2.update(aPerson); // Reattachment of aPerson\n"
+"\n"
+" session2.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:769
#, no-c-format
-msgid "The call to <literal>update</literal> makes a detached object persistent again by binding it to a new unit of work, so any modifications you made to it while detached can be saved to the database. This includes any modifications (additions/deletions) you made to a collection of that entity object."
-msgstr "对 <literal>update</literal> 的调用使一个脱管对象重新持久化,你可以说它被绑定到一个新的单元操作上,所以在脱管状态下对它所做的任何修改都会被保存到数据库里。这也包括你对这个实体对象的集合所作的任何改动(增加/删除)。 "
+msgid ""
+"The call to <literal>update</literal> makes a detached object persistent "
+"again by binding it to a new unit of work, so any modifications you made to "
+"it while detached can be saved to the database. This includes any "
+"modifications (additions/deletions) you made to a collection of that entity "
+"object."
+msgstr ""
+"对 <literal>update</literal> 的调用使一个脱管对象重新持久化,你可以说它被绑定"
+"到一个新的单元操作上,所以在脱管状态下对它所做的任何修改都会被保存到数据库"
+"里。这也包括你对这个实体对象的集合所作的任何改动(增加/删除)。 "
#. Tag: para
+#: tutorial.xml:778
#, no-c-format
-msgid "This is not much use in our example, but it is an important concept you can incorporate into your own application. Complete this exercise by adding a new action to the main method of the <literal>EventManager</literal> and call it from the command line. If you need the identifiers of a person and an event - the <literal>save()</literal> method returns it (you might have to modify some of the previous methods to return that identifier):"
-msgstr "这对我们当前的情形不是很有用,但它是非常重要的概念,你可以把它融入到你自己的应用程序设计中。在<literal>EventManager</literal>的 main 方法中添加一个新的动作,并从命令行运行它来完成我们所做的练习。如果你需要 person 及 event 的标识符 — 那就用 <literal>save()</literal> 方法返回它(你可能需要修改前面的一些方法来返回那个标识符): "
+msgid ""
+"This is not much use in our example, but it is an important concept you can "
+"incorporate into your own application. Complete this exercise by adding a "
+"new action to the main method of the <literal>EventManager</literal> and "
+"call it from the command line. If you need the identifiers of a person and "
+"an event - the <literal>save()</literal> method returns it (you might have "
+"to modify some of the previous methods to return that identifier):"
+msgstr ""
+"这对我们当前的情形不是很有用,但它是非常重要的概念,你可以把它融入到你自己的"
+"应用程序设计中。在<literal>EventManager</literal>的 main 方法中添加一个新的动"
+"作,并从命令行运行它来完成我们所做的练习。如果你需要 person 及 event 的标识"
+"符 — 那就用 <literal>save()</literal> 方法返回它(你可能需要修改前面的一些方"
+"法来返回那个标识符): "
+#. Tag: programlisting
+#: tutorial.xml:786
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
+"());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" "
+"+ eventId);\n"
+" }]]>"
+msgstr ""
+"else if (args[0].equals(\"addpersontoevent\")) {\n"
+" Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
+" Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
+" mgr.addPersonToEvent(personId, eventId);\n"
+" System.out.println(\"Added person \" + personId + \" to event \" + "
+"eventId);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:788
#, no-c-format
-msgid "This is an example of an association between two equally important classes : two entities. As mentioned earlier, there are other classes and types in a typical model, usually \"less important\". Some you have already seen, like an <literal>int</literal> or a <classname>java.lang.String</classname>. We call these classes <emphasis>value types</emphasis>, and their instances <emphasis>depend</emphasis> on a particular entity. Instances of these types do not have their own identity, nor are they shared between entities. Two persons do not reference the same <literal>firstname</literal> object, even if they have the same first name. Value types cannot only be found in the JDK , but you can also write dependent classes yourself such as an <literal>Address</literal> or <literal>MonetaryAmount</literal> class. In fact, in a Hibernate application all JDK classes are considered value types."
-msgstr "上面是个关于两个同等重要的实体类间关联的例子。像前面所提到的那样,在特定的模型中也存在其它的类和类型,这些类和类型通常是“次要的”。你已看到过其中的一些,像 <literal>int</literal> 或 <literal>String</literal>。我们称这些类为<emphasis>值类型(value type)</emphasis>,它们的实例<emphasis>依赖(depend)</emphasis>在某个特定的实体上。这些类型的实例没有它们自己的标识(identity),也不能在实体间被共享(比如,两个 person 不能引用同一个 <literal>firstname</literal> 对象,即使他们有相同的 first name)。当然,值类型并不仅仅在 JDK 中存在(事实上,在一个 Hibernate 应用程序中,所有的 JDK 类都被视为值类型),而且你也可以编写你自己的依赖类,例如 <literal>Address</literal>,<literal>MonetaryAmount</literal>。 "
+msgid ""
+"This is an example of an association between two equally important classes : "
+"two entities. As mentioned earlier, there are other classes and types in a "
+"typical model, usually \"less important\". Some you have already seen, like "
+"an <literal>int</literal> or a <classname>java.lang.String</classname>. We "
+"call these classes <emphasis>value types</emphasis>, and their instances "
+"<emphasis>depend</emphasis> on a particular entity. Instances of these types "
+"do not have their own identity, nor are they shared between entities. Two "
+"persons do not reference the same <literal>firstname</literal> object, even "
+"if they have the same first name. Value types cannot only be found in the "
+"JDK , but you can also write dependent classes yourself such as an "
+"<literal>Address</literal> or <literal>MonetaryAmount</literal> class. In "
+"fact, in a Hibernate application all JDK classes are considered value types."
+msgstr ""
+"上面是个关于两个同等重要的实体类间关联的例子。像前面所提到的那样,在特定的模"
+"型中也存在其它的类和类型,这些类和类型通常是“次要的”。你已看到过其中的一些,"
+"像 <literal>int</literal> 或 <literal>String</literal>。我们称这些类为"
+"<emphasis>值类型(value type)</emphasis>,它们的实例<emphasis>依赖(depend)"
+"</emphasis>在某个特定的实体上。这些类型的实例没有它们自己的标识(identity),"
+"也不能在实体间被共享(比如,两个 person 不能引用同一个 <literal>firstname</"
+"literal> 对象,即使他们有相同的 first name)。当然,值类型并不仅仅在 JDK 中存"
+"在(事实上,在一个 Hibernate 应用程序中,所有的 JDK 类都被视为值类型),而且"
+"你也可以编写你自己的依赖类,例如 <literal>Address</literal>,"
+"<literal>MonetaryAmount</literal>。 "
#. Tag: para
+#: tutorial.xml:806
#, no-c-format
-msgid "You can also design a collection of value types. This is conceptually different from a collection of references to other entities, but looks almost the same in Java."
-msgstr "你也可以设计一个值类型的集合,这在概念上与引用其它实体的集合有很大的不同,但是在 Java 里面看起来几乎是一样的。 "
+msgid ""
+"You can also design a collection of value types. This is conceptually "
+"different from a collection of references to other entities, but looks "
+"almost the same in Java."
+msgstr ""
+"你也可以设计一个值类型的集合,这在概念上与引用其它实体的集合有很大的不同,但"
+"是在 Java 里面看起来几乎是一样的。 "
#. Tag: title
+#: tutorial.xml:815
#, no-c-format
msgid "Collection of values"
msgstr "值类型的集合"
#. Tag: para
+#: tutorial.xml:817
#, no-c-format
-msgid "Let's add a collection of email addresses to the <literal>Person</literal> entity. This will be represented as a <interfacename>java.util.Set</interfacename> of <classname>java.lang.String</classname> instances:"
-msgstr "让我们在 <literal>Person</literal> 实体里添加一个电子邮件的集合。这将以 <classname>java.lang.String</classname> 实例的 <interfacename>java.util.Set</interfacename> 出现:"
+msgid ""
+"Let's add a collection of email addresses to the <literal>Person</literal> "
+"entity. This will be represented as a <interfacename>java.util.Set</"
+"interfacename> of <classname>java.lang.String</classname> instances:"
+msgstr ""
+"让我们在 <literal>Person</literal> 实体里添加一个电子邮件的集合。这将以 "
+"<classname>java.lang.String</classname> 实例的 <interfacename>java.util.Set</"
+"interfacename> 出现:"
+#. Tag: programlisting
+#: tutorial.xml:823
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private Set emailAddresses = new HashSet();\n"
+"\n"
+" public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+" }\n"
+"\n"
+" public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+" }]]>"
+msgstr ""
+"private Set emailAddresses = new HashSet();\n"
+"\n"
+"public Set getEmailAddresses() {\n"
+" return emailAddresses;\n"
+"}\n"
+"\n"
+"public void setEmailAddresses(Set emailAddresses) {\n"
+" this.emailAddresses = emailAddresses;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:825
#, no-c-format
msgid "The mapping of this <literal>Set</literal> is as follows:"
msgstr "这个 <literal>Set</literal> 的映射如下:"
+#. Tag: programlisting
+#: tutorial.xml:829
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+" </set>]]>"
+msgstr ""
+"<set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
+" <key column=\"PERSON_ID\"/>\n"
+" <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
+"</set>"
+
#. Tag: para
+#: tutorial.xml:831
#, no-c-format
-msgid "The difference compared with the earlier mapping is the use of the <literal>element</literal> part which tells Hibernate that the collection does not contain references to another entity, but is rather a collection whose elements are values types, here specifically of type <literal>string</literal>. The lowercase name tells you it is a Hibernate mapping type/converter. Again the <literal>table</literal> attribute of the <literal>set</literal> element determines the table name for the collection. The <literal>key</literal> element defines the foreign-key column name in the collection table. The <literal>column</literal> attribute in the <literal>element</literal> element defines the column name where the email address values will actually be stored."
-msgstr "比较这次和此前映射的差别,主要在于 <literal>element</literal> 部分,这次并没有包含对其它实体引用的集合,而是元素类型为 <literal>String</literal> 的集合(在映射中使用小写的名字”string“是向你表明它是一个 Hibernate 的映射类型或者类型转换器)。和之前一样,<literal>set</literal> 元素的 <literal>table</literal> 属性决定了用于集合的表名。<literal>key</literal> 元素定义了在集合表中外键的字段名。<literal>element</literal> 元素的 <literal>column</literal> 属性定义用于实际保存 <literal>String</literal> 值的字段名。 "
+msgid ""
+"The difference compared with the earlier mapping is the use of the "
+"<literal>element</literal> part which tells Hibernate that the collection "
+"does not contain references to another entity, but is rather a collection "
+"whose elements are values types, here specifically of type <literal>string</"
+"literal>. The lowercase name tells you it is a Hibernate mapping type/"
+"converter. Again the <literal>table</literal> attribute of the <literal>set</"
+"literal> element determines the table name for the collection. The "
+"<literal>key</literal> element defines the foreign-key column name in the "
+"collection table. The <literal>column</literal> attribute in the "
+"<literal>element</literal> element defines the column name where the email "
+"address values will actually be stored."
+msgstr ""
+"比较这次和此前映射的差别,主要在于 <literal>element</literal> 部分,这次并没"
+"有包含对其它实体引用的集合,而是元素类型为 <literal>String</literal> 的集合"
+"(在映射中使用小写的名字”string“是向你表明它是一个 Hibernate 的映射类型或者类"
+"型转换器)。和之前一样,<literal>set</literal> 元素的 <literal>table</"
+"literal> 属性决定了用于集合的表名。<literal>key</literal> 元素定义了在集合表"
+"中外键的字段名。<literal>element</literal> 元素的 <literal>column</literal> "
+"属性定义用于实际保存 <literal>String</literal> 值的字段名。 "
#. Tag: para
+#: tutorial.xml:847
#, no-c-format
msgid "Here is the updated schema:"
msgstr "看一下修改后的数据库 schema。 "
+#. Tag: programlisting
+#: tutorial.xml:851
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[\n"
+" _____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
+"*PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|\n"
+" ]]>"
+msgstr ""
+"_____________ __________________\n"
+" | | | | _____________\n"
+" | EVENTS | | PERSON_EVENT | | | "
+"___________________\n"
+" |_____________| |__________________| | PERSON | "
+"| |\n"
+" | | | | |_____________| | "
+"PERSON_EMAIL_ADDR |\n"
+" | *EVENT_ID | <--> | *EVENT_ID | | | |"
+"___________________|\n"
+" | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--"
+"> | *PERSON_ID |\n"
+" | TITLE | |__________________| | AGE | | "
+"*EMAIL_ADDR |\n"
+" |_____________| | FIRSTNAME | |"
+"___________________|\n"
+" | LASTNAME |\n"
+" |_____________|"
+
#. Tag: para
+#: tutorial.xml:853
#, no-c-format
-msgid "You can see that the primary key of the collection table is in fact a composite key that uses both columns. This also implies that there cannot be duplicate email addresses per person, which is exactly the semantics we need for a set in Java."
-msgstr "你可以看到集合表的主键实际上是个复合主键,同时使用了两个字段。这也暗示了对于同一个 person 不能有重复的 email 地址,这正是 Java 里面使用 Set 时候所需要的语义(Set 里元素不能重复)。"
+msgid ""
+"You can see that the primary key of the collection table is in fact a "
+"composite key that uses both columns. This also implies that there cannot be "
+"duplicate email addresses per person, which is exactly the semantics we need "
+"for a set in Java."
+msgstr ""
+"你可以看到集合表的主键实际上是个复合主键,同时使用了两个字段。这也暗示了对于"
+"同一个 person 不能有重复的 email 地址,这正是 Java 里面使用 Set 时候所需要的"
+"语义(Set 里元素不能重复)。"
#. Tag: para
+#: tutorial.xml:859
#, no-c-format
-msgid "You can now try to add elements to this collection, just like we did before by linking persons and events. It is the same code in Java:"
-msgstr "你现在可以试着把元素加入到这个集合,就像我们在之前关联 person 和 event 的那样。其实现的 Java 代码是相同的: "
+msgid ""
+"You can now try to add elements to this collection, just like we did before "
+"by linking persons and events. It is the same code in Java:"
+msgstr ""
+"你现在可以试着把元素加入到这个集合,就像我们在之前关联 person 和 event 的那"
+"样。其实现的 Java 代码是相同的: "
+#. Tag: programlisting
+#: tutorial.xml:864
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void addEmailToPerson(Long personId, String "
+"emailAddress) {\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+" // adding to the emailAddress collection might trigger a lazy load "
+"of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+" }]]>"
+msgstr ""
+"private void addEmailToPerson(Long personId, String emailAddress) {\n"
+"\n"
+" Session session = HibernateUtil.getSessionFactory().getCurrentSession"
+"();\n"
+" session.beginTransaction();\n"
+"\n"
+" Person aPerson = (Person) session.load(Person.class, personId);\n"
+"\n"
+" // The getEmailAddresses() might trigger a lazy load of the collection\n"
+" aPerson.getEmailAddresses().add(emailAddress);\n"
+"\n"
+" session.getTransaction().commit();\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:866
#, no-c-format
-msgid "This time we did not use a <emphasis>fetch</emphasis> query to initialize the collection. Monitor the SQL log and try to optimize this with an eager fetch."
-msgstr "这次我们没有使用 <emphasis>fetch</emphasis> 查询来初始化集合。因此,调用其 getter 方法会触发另一附加的 select 来初始化集合,这样我们才能把元素添加进去。检查 SQL log,试着通过预先抓取来优化它。 "
+msgid ""
+"This time we did not use a <emphasis>fetch</emphasis> query to initialize "
+"the collection. Monitor the SQL log and try to optimize this with an eager "
+"fetch."
+msgstr ""
+"这次我们没有使用 <emphasis>fetch</emphasis> 查询来初始化集合。因此,调用其 "
+"getter 方法会触发另一附加的 select 来初始化集合,这样我们才能把元素添加进去。"
+"检查 SQL log,试着通过预先抓取来优化它。 "
#. Tag: title
+#: tutorial.xml:875
#, no-c-format
msgid "Bi-directional associations"
msgstr "双向关联"
#. Tag: para
+#: tutorial.xml:877
#, no-c-format
-msgid "Next you will map a bi-directional association. You will make the association between person and event work from both sides in Java. The database schema does not change, so you will still have many-to-many multiplicity."
-msgstr "接下来我们将映射双向关联(bi-directional association)— 在 Java 里让 person 和 event 可以从关联的任何一端访问另一端。当然,数据库 schema 没有改变,我们仍然需要多对多的阶数。一个关系型数据库要比网络编程语言更加灵活,所以它并不需要任何像导航方向(navigation direction)的东西 — 数据可以用任何可能的方式进行查看和获取。 "
+msgid ""
+"Next you will map a bi-directional association. You will make the "
+"association between person and event work from both sides in Java. The "
+"database schema does not change, so you will still have many-to-many "
+"multiplicity."
+msgstr ""
+"接下来我们将映射双向关联(bi-directional association)— 在 Java 里让 person "
+"和 event 可以从关联的任何一端访问另一端。当然,数据库 schema 没有改变,我们仍"
+"然需要多对多的阶数。一个关系型数据库要比网络编程语言更加灵活,所以它并不需要"
+"任何像导航方向(navigation direction)的东西 — 数据可以用任何可能的方式进行查"
+"看和获取。 "
#. Tag: para
+#: tutorial.xml:885
#, no-c-format
-msgid "A relational database is more flexible than a network programming language, in that it does not need a navigation direction; data can be viewed and retrieved in any possible way."
-msgstr "关系型数据库比网络编程语言更为灵活,因为它不需要方向导航,其数据可以用任何可能的方式进行查看和提取。"
+msgid ""
+"A relational database is more flexible than a network programming language, "
+"in that it does not need a navigation direction; data can be viewed and "
+"retrieved in any possible way."
+msgstr ""
+"关系型数据库比网络编程语言更为灵活,因为它不需要方向导航,其数据可以用任何可"
+"能的方式进行查看和提取。"
#. Tag: para
+#: tutorial.xml:893
#, no-c-format
-msgid "First, add a collection of participants to the <literal>Event</literal> class:"
-msgstr "首先,把一个参与者(person)的集合加入 <literal>Event</literal> 类中: "
+msgid ""
+"First, add a collection of participants to the <literal>Event</literal> "
+"class:"
+msgstr ""
+"首先,把一个参与者(person)的集合加入 <literal>Event</literal> 类中: "
+#. Tag: programlisting
+#: tutorial.xml:898
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private Set participants = new HashSet();\n"
+"\n"
+" public Set getParticipants() {\n"
+" return participants;\n"
+" }\n"
+"\n"
+" public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+" }]]>"
+msgstr ""
+"private Set participants = new HashSet();\n"
+"\n"
+"public Set getParticipants() {\n"
+" return participants;\n"
+"}\n"
+"\n"
+"public void setParticipants(Set participants) {\n"
+" this.participants = participants;\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:900
#, no-c-format
-msgid "Now map this side of the association in <literal>Event.hbm.xml</literal>."
+msgid ""
+"Now map this side of the association in <literal>Event.hbm.xml</literal>."
msgstr "在 <literal>Event.hbm.xml</literal> 里面也映射这个关联。 "
+#. Tag: programlisting
+#: tutorial.xml:904
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" inverse="
+"\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+" </set>]]>"
+msgstr ""
+"<set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true\">\n"
+" <key column=\"EVENT_ID\"/>\n"
+" <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
+"</set>"
+
#. Tag: para
+#: tutorial.xml:906
#, no-c-format
-msgid "These are normal <literal>set</literal> mappings in both mapping documents. Notice that the column names in <literal>key</literal> and <literal>many-to-many</literal> swap in both mapping documents. The most important addition here is the <literal>inverse=\"true\"</literal> attribute in the <literal>set</literal> element of the <literal>Event</literal>'s collection mapping."
-msgstr "如你所见,两个映射文件里都有普通的 <literal>set</literal> 映射。注意在两个映射文件中,互换了 <literal>key</literal> 和 <literal>many-to-many</literal> 的字段名。这里最重要的是 <literal>Event</literal> 映射文件里增加了 <literal>set</literal> 元素的 <literal>inverse=\"true\"</literal> 属性。 "
+msgid ""
+"These are normal <literal>set</literal> mappings in both mapping documents. "
+"Notice that the column names in <literal>key</literal> and <literal>many-to-"
+"many</literal> swap in both mapping documents. The most important addition "
+"here is the <literal>inverse=\"true\"</literal> attribute in the "
+"<literal>set</literal> element of the <literal>Event</literal>'s collection "
+"mapping."
+msgstr ""
+"如你所见,两个映射文件里都有普通的 <literal>set</literal> 映射。注意在两个映"
+"射文件中,互换了 <literal>key</literal> 和 <literal>many-to-many</literal> 的"
+"字段名。这里最重要的是 <literal>Event</literal> 映射文件里增加了 "
+"<literal>set</literal> 元素的 <literal>inverse=\"true\"</literal> 属性。 "
#. Tag: para
+#: tutorial.xml:914
#, no-c-format
-msgid "What this means is that Hibernate should take the other side, the <literal>Person</literal> class, when it needs to find out information about the link between the two. This will be a lot easier to understand once you see how the bi-directional link between our two entities is created."
-msgstr "这意味着在需要的时候,Hibernate 能在关联的另一端 — <literal>Person</literal> 类得到两个实体间关联的信息。这将会极大地帮助你理解双向关联是如何在两个实体间被创建的。 "
+msgid ""
+"What this means is that Hibernate should take the other side, the "
+"<literal>Person</literal> class, when it needs to find out information about "
+"the link between the two. This will be a lot easier to understand once you "
+"see how the bi-directional link between our two entities is created."
+msgstr ""
+"这意味着在需要的时候,Hibernate 能在关联的另一端 — <literal>Person</literal> "
+"类得到两个实体间关联的信息。这将会极大地帮助你理解双向关联是如何在两个实体间"
+"被创建的。 "
#. Tag: title
+#: tutorial.xml:923
#, no-c-format
msgid "Working bi-directional links"
msgstr "使双向连起来"
#. Tag: para
+#: tutorial.xml:925
#, no-c-format
-msgid "First, keep in mind that Hibernate does not affect normal Java semantics. How did we create a link between a <literal>Person</literal> and an <literal>Event</literal> in the unidirectional example? You add an instance of <literal>Event</literal> to the collection of event references, of an instance of <literal>Person</literal>. If you want to make this link bi-directional, you have to do the same on the other side by adding a <literal>Person</literal> reference to the collection in an <literal>Event</literal>. This process of \"setting the link on both sides\" is absolutely necessary with bi-directional links."
-msgstr "首先请记住,Hibernate 并不影响通常的 Java 语义。 在单向关联的例子中,我们是怎样在 <literal>Person</literal> 和 <literal>Event</literal> 之间创建联系的?我们把 <literal>Event</literal> 实例添加到 <literal>Person</literal> 实例内的 event 引用集合里。因此很显然,如果我们要让这个关联可以双向地工作,我们需要在另外一端做同样的事情 - 把 <literal>Person</literal> 实例加入 <literal>Event</literal> 类内的 Person 引用集合。这“在关联的两端设置联系”是完全必要的而且你都得这么做。 "
+msgid ""
+"First, keep in mind that Hibernate does not affect normal Java semantics. "
+"How did we create a link between a <literal>Person</literal> and an "
+"<literal>Event</literal> in the unidirectional example? You add an instance "
+"of <literal>Event</literal> to the collection of event references, of an "
+"instance of <literal>Person</literal>. If you want to make this link bi-"
+"directional, you have to do the same on the other side by adding a "
+"<literal>Person</literal> reference to the collection in an <literal>Event</"
+"literal>. This process of \"setting the link on both sides\" is absolutely "
+"necessary with bi-directional links."
+msgstr ""
+"首先请记住,Hibernate 并不影响通常的 Java 语义。 在单向关联的例子中,我们是怎"
+"样在 <literal>Person</literal> 和 <literal>Event</literal> 之间创建联系的?我"
+"们把 <literal>Event</literal> 实例添加到 <literal>Person</literal> 实例内的 "
+"event 引用集合里。因此很显然,如果我们要让这个关联可以双向地工作,我们需要在"
+"另外一端做同样的事情 - 把 <literal>Person</literal> 实例加入 "
+"<literal>Event</literal> 类内的 Person 引用集合。这“在关联的两端设置联系”是完"
+"全必要的而且你都得这么做。 "
#. Tag: para
+#: tutorial.xml:935
#, no-c-format
-msgid "Many developers program defensively and create link management methods to correctly set both sides (for example, in <literal>Person</literal>):"
-msgstr "许多开发人员防御式地编程,创建管理关联的方法来保证正确的设置了关联的两端,比如在 <literal>Person</literal> 里: "
+msgid ""
+"Many developers program defensively and create link management methods to "
+"correctly set both sides (for example, in <literal>Person</literal>):"
+msgstr ""
+"许多开发人员防御式地编程,创建管理关联的方法来保证正确的设置了关联的两端,比"
+"如在 <literal>Person</literal> 里: "
+#. Tag: programlisting
+#: tutorial.xml:940
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ protected Set getEvents() {\n"
+" return events;\n"
+" }\n"
+"\n"
+" protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+" }\n"
+"\n"
+" public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+" }\n"
+"\n"
+" public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+" }]]>"
+msgstr ""
+"protected Set getEvents() {\n"
+" return events;\n"
+"}\n"
+"\n"
+"protected void setEvents(Set events) {\n"
+" this.events = events;\n"
+"}\n"
+"\n"
+"public void addToEvent(Event event) {\n"
+" this.getEvents().add(event);\n"
+" event.getParticipants().add(this);\n"
+"}\n"
+"\n"
+"public void removeFromEvent(Event event) {\n"
+" this.getEvents().remove(event);\n"
+" event.getParticipants().remove(this);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:942
#, no-c-format
-msgid "The get and set methods for the collection are now protected. This allows classes in the same package and subclasses to still access the methods, but prevents everybody else from altering the collections directly. Repeat the steps for the collection on the other side."
-msgstr "注意现在对于集合的 get 和 set 方法的访问级别是 protected — 这允许在位于同一个包(package)中的类以及继承自这个类的子类可以访问这些方法,但禁止其他任何人的直接访问,避免了集合内容的混乱。你应尽可能地在另一端也把集合的访问级别设成 protected。 "
+msgid ""
+"The get and set methods for the collection are now protected. This allows "
+"classes in the same package and subclasses to still access the methods, but "
+"prevents everybody else from altering the collections directly. Repeat the "
+"steps for the collection on the other side."
+msgstr ""
+"注意现在对于集合的 get 和 set 方法的访问级别是 protected — 这允许在位于同一个"
+"包(package)中的类以及继承自这个类的子类可以访问这些方法,但禁止其他任何人的"
+"直接访问,避免了集合内容的混乱。你应尽可能地在另一端也把集合的访问级别设成 "
+"protected。 "
#. Tag: para
+#: tutorial.xml:949
#, no-c-format
-msgid "What about the <literal>inverse</literal> mapping attribute? For you, and for Java, a bi-directional link is simply a matter of setting the references on both sides correctly. Hibernate, however, does not have enough information to correctly arrange SQL <literal>INSERT</literal> and <literal>UPDATE</literal> statements (to avoid constraint violations). Making one side of the association <literal>inverse</literal> tells Hibernate to consider it a <emphasis>mirror</emphasis> of the other side. That is all that is necessary for Hibernate to resolve any issues that arise when transforming a directional navigation model to a SQL database schema. The rules are straightforward: all bi-directional associations need one side as <literal>inverse</literal>. In a one-to-many association it has to be the many-side, and in many-to-many association you can select either side."
-msgstr "<literal>inverse</literal> 映射属性究竟表示什么呢?对于你和 Java 来说,一个双向关联仅仅是在两端简单地正确设置引用。然而,Hibernate 并没有足够的信息去正确地执行 <literal>INSERT</literal> 和 <literal>UPDATE</literal> 语句(以避免违反数据库约束),所以它需要一些帮助来正确的处理双向关联。把关联的一端设置为 <literal>inverse</literal> 将告诉 Hibernate 忽略关联的这一端,把这端看成是另外一端的一个<emphasis>镜象(mirror)</emphasis>。这就是所需的全部信息,Hibernate 利用这些信息来处理把一个有向导航模型转移到数据库 schema 时的所有问题。你只需要记住这个直观的规则:所有的双向关联需要有一端被设置为 <literal>inverse</literal>。在一对多关联中它必须是代表多(many)的那端。而在多对多(many-to-many)关联中,你可以任意选取一端,因为两端之!
间并没有差别。 "
+msgid ""
+"What about the <literal>inverse</literal> mapping attribute? For you, and "
+"for Java, a bi-directional link is simply a matter of setting the references "
+"on both sides correctly. Hibernate, however, does not have enough "
+"information to correctly arrange SQL <literal>INSERT</literal> and "
+"<literal>UPDATE</literal> statements (to avoid constraint violations). "
+"Making one side of the association <literal>inverse</literal> tells "
+"Hibernate to consider it a <emphasis>mirror</emphasis> of the other side. "
+"That is all that is necessary for Hibernate to resolve any issues that arise "
+"when transforming a directional navigation model to a SQL database schema. "
+"The rules are straightforward: all bi-directional associations need one side "
+"as <literal>inverse</literal>. In a one-to-many association it has to be the "
+"many-side, and in many-to-many association you can select either side."
+msgstr ""
+"<literal>inverse</literal> 映射属性究竟表示什么呢?对于你和 Java 来说,一个双"
+"向关联仅仅是在两端简单地正确设置引用。然而,Hibernate 并没有足够的信息去正确"
+"地执行 <literal>INSERT</literal> 和 <literal>UPDATE</literal> 语句(以避免违"
+"反数据库约束),所以它需要一些帮助来正确的处理双向关联。把关联的一端设置为 "
+"<literal>inverse</literal> 将告诉 Hibernate 忽略关联的这一端,把这端看成是另"
+"外一端的一个<emphasis>镜象(mirror)</emphasis>。这就是所需的全部信息,"
+"Hibernate 利用这些信息来处理把一个有向导航模型转移到数据库 schema 时的所有问"
+"题。你只需要记住这个直观的规则:所有的双向关联需要有一端被设置为 "
+"<literal>inverse</literal>。在一对多关联中它必须是代表多(many)的那端。而在"
+"多对多(many-to-many)关联中,你可以任意选取一端,因为两端之间并没有差别。 "
#. Tag: title
+#: tutorial.xml:965
#, no-c-format
msgid "Part 3 - The EventManager web application"
msgstr "第三部分 - EventManager web 应用程序"
#. Tag: para
+#: tutorial.xml:967
#, no-c-format
-msgid "A Hibernate web application uses <literal>Session</literal> and <literal>Transaction</literal> almost like a standalone application. However, some common patterns are useful. You can now write an <literal>EventManagerServlet</literal>. This servlet can list all events stored in the database, and it provides an HTML form to enter new events."
-msgstr "Hibernate web 应用程序使用 <literal>Session</literal> 和 <literal>Transaction</literal> 的方式几乎和独立应用程序是一样的。但是,有一些常见的模式(pattern)非常有用。现在我们编写一个 <literal>EventManagerServlet</literal>。这个 servlet 可以列出数据库中保存的所有的 events,还提供一个 HTML 表单来增加新的 events。 "
+msgid ""
+"A Hibernate web application uses <literal>Session</literal> and "
+"<literal>Transaction</literal> almost like a standalone application. "
+"However, some common patterns are useful. You can now write an "
+"<literal>EventManagerServlet</literal>. This servlet can list all events "
+"stored in the database, and it provides an HTML form to enter new events."
+msgstr ""
+"Hibernate web 应用程序使用 <literal>Session</literal> 和 "
+"<literal>Transaction</literal> 的方式几乎和独立应用程序是一样的。但是,有一些"
+"常见的模式(pattern)非常有用。现在我们编写一个 "
+"<literal>EventManagerServlet</literal>。这个 servlet 可以列出数据库中保存的所"
+"有的 events,还提供一个 HTML 表单来增加新的 events。 "
#. Tag: title
+#: tutorial.xml:975
#, no-c-format
msgid "Writing the basic servlet"
msgstr "编写基本的 servlet"
#. Tag: para
+#: tutorial.xml:977
#, no-c-format
-msgid "First we need create our basic processing servlet. Since our servlet only handles HTTP <literal>GET</literal> requests, we will only implement the <literal>doGet()</literal> method:"
-msgstr "这个 servlet 只处理 HTTP <literal>GET</literal> 请求,因此,我们要实现的是 <literal>doGet()</literal> 方法: "
+msgid ""
+"First we need create our basic processing servlet. Since our servlet only "
+"handles HTTP <literal>GET</literal> requests, we will only implement the "
+"<literal>doGet()</literal> method:"
+msgstr ""
+"这个 servlet 只处理 HTTP <literal>GET</literal> 请求,因此,我们要实现的是 "
+"<literal>doGet()</literal> 方法: "
+#. Tag: programlisting
+#: tutorial.xml:983
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[package org.hibernate.tutorial.web;\n"
+"\n"
+"// Imports\n"
+"\n"
+"public class EventManagerServlet extends HttpServlet {\n"
+"\n"
+" protected void doGet(\n"
+" HttpServletRequest request,\n"
+" HttpServletResponse response) throws ServletException, "
+"IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM.yyyy"
+"\" );\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().commit();\n"
+" }\n"
+" catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory().getCurrentSession()."
+"getTransaction().rollback();\n"
+" if ( ServletException.class.isInstance( ex ) ) {\n"
+" throw ( ServletException ) ex;\n"
+" }\n"
+" else {\n"
+" throw new ServletException( ex );\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+"}]]>"
+msgstr ""
+"protected void doGet(HttpServletRequest request,\n"
+" HttpServletResponse response)\n"
+" throws ServletException, IOException {\n"
+"\n"
+" SimpleDateFormat dateFormatter = new SimpleDateFormat(\"dd.MM.yyyy\");\n"
+"\n"
+" try {\n"
+" // Begin unit of work\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().beginTransaction();\n"
+"\n"
+" // Process request and render page...\n"
+"\n"
+" // End unit of work\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().getTransaction().commit();\n"
+"\n"
+" } catch (Exception ex) {\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().getTransaction().rollback();\n"
+" throw new ServletException(ex);\n"
+" }\n"
+"\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:985
#, no-c-format
-msgid "Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/EventManagerServlet.java</filename>"
-msgstr "把这个 servlet 保存为 <filename>src/main/java/org/hibernate/tutorial/web/EventManagerServlet.java</filename>。"
+msgid ""
+"Save this servlet as <filename>src/main/java/org/hibernate/tutorial/web/"
+"EventManagerServlet.java</filename>"
+msgstr ""
+"把这个 servlet 保存为 <filename>src/main/java/org/hibernate/tutorial/web/"
+"EventManagerServlet.java</filename>。"
#. Tag: para
+#: tutorial.xml:990
#, no-c-format
-msgid "The pattern applied here is called <emphasis>session-per-request</emphasis>. When a request hits the servlet, a new Hibernate <literal>Session</literal> is opened through the first call to <literal>getCurrentSession()</literal> on the <literal>SessionFactory</literal>. A database transaction is then started. All data access occurs inside a transaction irrespective of whether the data is read or written. Do not use the auto-commit mode in applications."
-msgstr "我们称这里应用的模式为每次请求一个 session<emphasis>(session-per-request)</emphasis>。当有请求到达这个 servlet 的时候,通过对 <literal>SessionFactory</literal> 的第一次调用,打开一个新的 Hibernate <literal>Session</literal>。然后启动一个数据库事务 — 所有的数据访问都是在事务中进行,不管是读还是写(我们在应用程序中不使用 auto-commit 模式)。 "
+msgid ""
+"The pattern applied here is called <emphasis>session-per-request</emphasis>. "
+"When a request hits the servlet, a new Hibernate <literal>Session</literal> "
+"is opened through the first call to <literal>getCurrentSession()</literal> "
+"on the <literal>SessionFactory</literal>. A database transaction is then "
+"started. All data access occurs inside a transaction irrespective of whether "
+"the data is read or written. Do not use the auto-commit mode in applications."
+msgstr ""
+"我们称这里应用的模式为每次请求一个 session<emphasis>(session-per-request)</"
+"emphasis>。当有请求到达这个 servlet 的时候,通过对 <literal>SessionFactory</"
+"literal> 的第一次调用,打开一个新的 Hibernate <literal>Session</literal>。然"
+"后启动一个数据库事务 — 所有的数据访问都是在事务中进行,不管是读还是写(我们在"
+"应用程序中不使用 auto-commit 模式)。 "
#. Tag: para
+#: tutorial.xml:999
#, no-c-format
-msgid "Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> for every database operation. Use one Hibernate <literal>Session</literal> that is scoped to the whole request. Use <literal>getCurrentSession()</literal>, so that it is automatically bound to the current Java thread."
-msgstr "<emphasis>不要</emphasis>为每次数据库操作都使用一个新的 Hibernate <literal>Session</literal>。将 Hibernate <literal>Session</literal> 的范围设置为整个请求。要用 <literal>getCurrentSession()</literal>,这样它自动会绑定到当前 Java 线程。"
+msgid ""
+"Do <emphasis>not</emphasis> use a new Hibernate <literal>Session</literal> "
+"for every database operation. Use one Hibernate <literal>Session</literal> "
+"that is scoped to the whole request. Use <literal>getCurrentSession()</"
+"literal>, so that it is automatically bound to the current Java thread."
+msgstr ""
+"<emphasis>不要</emphasis>为每次数据库操作都使用一个新的 Hibernate "
+"<literal>Session</literal>。将 Hibernate <literal>Session</literal> 的范围设"
+"置为整个请求。要用 <literal>getCurrentSession()</literal>,这样它自动会绑定到"
+"当前 Java 线程。"
#. Tag: para
+#: tutorial.xml:1006
#, no-c-format
-msgid "Next, the possible actions of the request are processed and the response HTML is rendered. We will get to that part soon."
-msgstr "下一步,对请求的可能动作进行处理,渲染出反馈的 HTML。我们很快就会涉及到那部分。 "
+msgid ""
+"Next, the possible actions of the request are processed and the response "
+"HTML is rendered. We will get to that part soon."
+msgstr ""
+"下一步,对请求的可能动作进行处理,渲染出反馈的 HTML。我们很快就会涉及到那部"
+"分。 "
#. Tag: para
+#: tutorial.xml:1011
#, no-c-format
-msgid "Finally, the unit of work ends when processing and rendering are complete. If any problems occurred during processing or rendering, an exception will be thrown and the database transaction rolled back. This completes the <literal>session-per-request</literal> pattern. Instead of the transaction demarcation code in every servlet, you could also write a servlet filter. See the Hibernate website and Wiki for more information about this pattern called <emphasis>Open Session in View</emphasis>. You will need it as soon as you consider rendering your view in JSP, not in a servlet."
-msgstr "最后,当处理与渲染都结束的时候,这个工作单元就结束了。假若在处理或渲染的时候有任何错误发生,会抛出一个异常,回滚数据库事务。这样,<literal>session-per-request</literal> 模式就完成了。为了避免在每个 servlet 中都编写事务边界界定的代码,可以考虑写一个 servlet 过滤器(filter)来更好地解决。关于这一模式的更多信息,请参阅 Hibernate 网站和 Wiki,这一模式叫做 <emphasis>Open Session in View</emphasis> — 只要你考虑用JSP来渲染你的视图(view),而不是在servlet中,你就会很快用到它。 "
+msgid ""
+"Finally, the unit of work ends when processing and rendering are complete. "
+"If any problems occurred during processing or rendering, an exception will "
+"be thrown and the database transaction rolled back. This completes the "
+"<literal>session-per-request</literal> pattern. Instead of the transaction "
+"demarcation code in every servlet, you could also write a servlet filter. "
+"See the Hibernate website and Wiki for more information about this pattern "
+"called <emphasis>Open Session in View</emphasis>. You will need it as soon "
+"as you consider rendering your view in JSP, not in a servlet."
+msgstr ""
+"最后,当处理与渲染都结束的时候,这个工作单元就结束了。假若在处理或渲染的时候"
+"有任何错误发生,会抛出一个异常,回滚数据库事务。这样,<literal>session-per-"
+"request</literal> 模式就完成了。为了避免在每个 servlet 中都编写事务边界界定的"
+"代码,可以考虑写一个 servlet 过滤器(filter)来更好地解决。关于这一模式的更多"
+"信息,请参阅 Hibernate 网站和 Wiki,这一模式叫做 <emphasis>Open Session in "
+"View</emphasis> — 只要你考虑用JSP来渲染你的视图(view),而不是在servlet中,"
+"你就会很快用到它。 "
#. Tag: title
+#: tutorial.xml:1025
#, no-c-format
msgid "Processing and rendering"
msgstr "处理与渲染"
#. Tag: para
+#: tutorial.xml:1027
#, no-c-format
-msgid "Now you can implement the processing of the request and the rendering of the page."
+msgid ""
+"Now you can implement the processing of the request and the rendering of the "
+"page."
msgstr "我们来实现处理请求以及渲染页面的工作。 "
+#. Tag: programlisting
+#: tutorial.xml:1031
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ // Write HTML header\n"
+" PrintWriter out = response.getWriter();\n"
+" out.println(\"<html><head><title>Event Manager</title></head><body>"
+"\");\n"
+"\n"
+" // Handle actions\n"
+" if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date.</i></"
+"b>\");\n"
+" }\n"
+" else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse"
+"(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>\");\n"
+" }\n"
+" }\n"
+"\n"
+" // Print page\n"
+" printEventForm(out);\n"
+" listEvents(out, dateFormatter);\n"
+"\n"
+" // Write HTML footer\n"
+" out.println(\"</body></html>\");\n"
+" out.flush();\n"
+" out.close();]]>"
+msgstr ""
+"// Write HTML header\n"
+"PrintWriter out = response.getWriter();\n"
+"out.println(\"<html><head><title>Event Manager</"
+"title></head><body>\");\n"
+"\n"
+"// Handle actions\n"
+"if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
+"\n"
+" String eventTitle = request.getParameter(\"eventTitle\");\n"
+" String eventDate = request.getParameter(\"eventDate\");\n"
+"\n"
+" if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
+" out.println(\"<b><i>Please enter event title and date."
+"</i></b>\");\n"
+" } else {\n"
+" createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
+" out.println(\"<b><i>Added event.</i></b>"
+"\");\n"
+" }\n"
+"}\n"
+"\n"
+"// Print page\n"
+"printEventForm(out);\n"
+"listEvents(out, dateFormatter);\n"
+"\n"
+"// Write HTML footer\n"
+"out.println(\"</body></html>\");\n"
+"out.flush();\n"
+"out.close();"
+
#. Tag: para
+#: tutorial.xml:1033
#, no-c-format
-msgid "This coding style, with a mix of Java and HTML, would not scale in a more complex application—keep in mind that we are only illustrating basic Hibernate concepts in this tutorial. The code prints an HTML header and a footer. Inside this page, an HTML form for event entry and a list of all events in the database are printed. The first method is trivial and only outputs HTML:"
-msgstr "必须承认,这种编码风格把 Java 和 HTML 混在一起,在更复杂的应用程序里不应该大量使用 — 记住,在本章里我们仅仅是展示了 Hibernate 的基本概念。这段代码打印出了 HTML 页眉和页脚,在这个页面里,还打印了一个输入 events 条目的表单单并列出了数据库里的有的 events。第一个方法微不足道,仅仅是输出 HTML:"
+msgid ""
+"This coding style, with a mix of Java and HTML, would not scale in a more "
+"complex application—keep in mind that we are only illustrating basic "
+"Hibernate concepts in this tutorial. The code prints an HTML header and a "
+"footer. Inside this page, an HTML form for event entry and a list of all "
+"events in the database are printed. The first method is trivial and only "
+"outputs HTML:"
+msgstr ""
+"必须承认,这种编码风格把 Java 和 HTML 混在一起,在更复杂的应用程序里不应该大"
+"量使用 — 记住,在本章里我们仅仅是展示了 Hibernate 的基本概念。这段代码打印出"
+"了 HTML 页眉和页脚,在这个页面里,还打印了一个输入 events 条目的表单单并列出"
+"了数据库里的有的 events。第一个方法微不足道,仅仅是输出 HTML:"
+#. Tag: programlisting
+#: tutorial.xml:1042
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
+"\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+" }]]>"
+msgstr ""
+"private void printEventForm(PrintWriter out) {\n"
+" out.println(\"<h2>Add new event:</h2>\");\n"
+" out.println(\"<form>\");\n"
+" out.println(\"Title: <input name='eventTitle' length='50'/><br/"
+">\");\n"
+" out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
+"length='10'/><br/>\");\n"
+" out.println(\"<input type='submit' name='action' value='store'/>"
+"\");\n"
+" out.println(\"</form>\");\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1044
#, no-c-format
-msgid "The <literal>listEvents()</literal> method uses the Hibernate <literal>Session</literal> bound to the current thread to execute a query:"
-msgstr "<literal>listEvents()</literal> 方法使用绑定到当前线程的 Hibernate <literal>Session</literal> 来执行查询:"
+msgid ""
+"The <literal>listEvents()</literal> method uses the Hibernate "
+"<literal>Session</literal> bound to the current thread to execute a query:"
+msgstr ""
+"<literal>listEvents()</literal> 方法使用绑定到当前线程的 Hibernate "
+"<literal>Session</literal> 来执行查询:"
+#. Tag: programlisting
+#: tutorial.xml:1050
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
+"dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" Iterator it = result.iterator();\n"
+" while (it.hasNext()) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate()) "
+"+ \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+" }]]>"
+msgstr ""
+"private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) {\n"
+"\n"
+" List result = HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().createCriteria(Event.class).list"
+"();\n"
+" if (result.size() > 0) {\n"
+" out.println(\"<h2>Events in database:</h2>\");\n"
+" out.println(\"<table border='1'>\");\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<th>Event title</th>\");\n"
+" out.println(\"<th>Event date</th>\");\n"
+" out.println(\"</tr>\");\n"
+" for (Iterator it = result.iterator(); it.hasNext();) {\n"
+" Event event = (Event) it.next();\n"
+" out.println(\"<tr>\");\n"
+" out.println(\"<td>\" + event.getTitle() + \"</td>"
+"\");\n"
+" out.println(\"<td>\" + dateFormatter.format(event.getDate"
+"()) + \"</td>\");\n"
+" out.println(\"</tr>\");\n"
+" }\n"
+" out.println(\"</table>\");\n"
+" }\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1052
#, no-c-format
-msgid "Finally, the <literal>store</literal> action is dispatched to the <literal>createAndStoreEvent()</literal> method, which also uses the <literal>Session</literal> of the current thread:"
-msgstr "最后,<literal>store</literal> 动作会被导向到 <literal>createAndStoreEvent()</literal> 方法,它也使用当前线程的 <literal>Session</literal>:"
+msgid ""
+"Finally, the <literal>store</literal> action is dispatched to the "
+"<literal>createAndStoreEvent()</literal> method, which also uses the "
+"<literal>Session</literal> of the current thread:"
+msgstr ""
+"最后,<literal>store</literal> 动作会被导向到 <literal>createAndStoreEvent()"
+"</literal> 方法,它也使用当前线程的 <literal>Session</literal>:"
+#. Tag: programlisting
+#: tutorial.xml:1058
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[ protected void createAndStoreEvent(String title, Date theDate) "
+"{\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+" }]]>"
+msgstr ""
+"protected void createAndStoreEvent(String title, Date theDate) {\n"
+" Event theEvent = new Event();\n"
+" theEvent.setTitle(title);\n"
+" theEvent.setDate(theDate);\n"
+"\n"
+" HibernateUtil.getSessionFactory()\n"
+" .getCurrentSession().save(theEvent);\n"
+"}"
+
#. Tag: para
+#: tutorial.xml:1060
#, no-c-format
-msgid "The servlet is now complete. A request to the servlet will be processed in a single <literal>Session</literal> and <literal>Transaction</literal>. As earlier in the standalone application, Hibernate can automatically bind these objects to the current thread of execution. This gives you the freedom to layer your code and access the <literal>SessionFactory</literal> in any way you like. Usually you would use a more sophisticated design and move the data access code into data access objects (the DAO pattern). See the Hibernate Wiki for more examples."
-msgstr "大功告成,这个 servlet 写完了。Hibernate 会在单一的 <literal>Session</literal> 和 <literal>Transaction</literal> 中处理到达的 servlet 请求。如同在前面的独立应用程序中那样,Hibernate 可以自动的把这些对象绑定到当前运行的线程中。这给了你用任何你喜欢的方式来对代码分层及访问 <literal>SessionFactory</literal> 的自由。通常,你会用更加完备的设计,把数据访问代码转移到数据访问对象中(DAO 模式)。请参见 Hibernate Wiki,那里有更多的例子。 "
+msgid ""
+"The servlet is now complete. A request to the servlet will be processed in a "
+"single <literal>Session</literal> and <literal>Transaction</literal>. As "
+"earlier in the standalone application, Hibernate can automatically bind "
+"these objects to the current thread of execution. This gives you the freedom "
+"to layer your code and access the <literal>SessionFactory</literal> in any "
+"way you like. Usually you would use a more sophisticated design and move the "
+"data access code into data access objects (the DAO pattern). See the "
+"Hibernate Wiki for more examples."
+msgstr ""
+"大功告成,这个 servlet 写完了。Hibernate 会在单一的 <literal>Session</"
+"literal> 和 <literal>Transaction</literal> 中处理到达的 servlet 请求。如同在"
+"前面的独立应用程序中那样,Hibernate 可以自动的把这些对象绑定到当前运行的线程"
+"中。这给了你用任何你喜欢的方式来对代码分层及访问 <literal>SessionFactory</"
+"literal> 的自由。通常,你会用更加完备的设计,把数据访问代码转移到数据访问对象"
+"中(DAO 模式)。请参见 Hibernate Wiki,那里有更多的例子。 "
#. Tag: title
+#: tutorial.xml:1074
#, no-c-format
msgid "Deploying and testing"
msgstr "部署与测试"
#. Tag: para
+#: tutorial.xml:1076
#, no-c-format
-msgid "To deploy this application for testing we must create a Web ARchive (WAR). First we must define the WAR descriptor as <filename>src/main/webapp/WEB-INF/web.xml</filename>"
-msgstr "要部署这个应用程序以进行测试,我们必须出具一个 Web ARchive (WAR)。首先我们必须定义 WAR 描述符为 <filename>src/main/webapp/WEB-INF/web.xml</filename>。"
+msgid ""
+"To deploy this application for testing we must create a Web ARchive (WAR). "
+"First we must define the WAR descriptor as <filename>src/main/webapp/WEB-INF/"
+"web.xml</filename>"
+msgstr ""
+"要部署这个应用程序以进行测试,我们必须出具一个 Web ARchive (WAR)。首先我们必"
+"须定义 WAR 描述符为 <filename>src/main/webapp/WEB-INF/web.xml</filename>。"
+#. Tag: programlisting
+#: tutorial.xml:1082
+#, fuzzy, no-c-format
+msgid ""
+"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/"
+"xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
+"servlet-class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>]]>"
+msgstr ""
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<web-app version=\"2.4\"\n"
+" xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n"
+" http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
+"\n"
+" <servlet>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <servlet-class>events.EventManagerServlet</servlet-"
+"class>\n"
+" </servlet>\n"
+"\n"
+" <servlet-mapping>\n"
+" <servlet-name>Event Manager</servlet-name>\n"
+" <url-pattern>/eventmanager</url-pattern>\n"
+" </servlet-mapping>\n"
+"</web-app>"
+
#. Tag: para
+#: tutorial.xml:1084
#, no-c-format
-msgid "To build and deploy call <literal>mvn package</literal> in your project directory and copy the <filename>hibernate-tutorial.war</filename> file into your Tomcat <filename>webapps</filename> directory."
-msgstr "在你的开发目录中,调用 <literal>ant war</literal> 来构建、打包,然后把 <literal>hibernate-tutorial.war</literal> 文件拷贝到你的 tomcat 的 <literal>webapps</literal> 目录下。假若你还没安装 Tomcat,就去下载一个,按照指南来安装。对此应用的发布,你不需要修改任何 Tomcat 的配置。 "
+msgid ""
+"To build and deploy call <literal>mvn package</literal> in your project "
+"directory and copy the <filename>hibernate-tutorial.war</filename> file into "
+"your Tomcat <filename>webapps</filename> directory."
+msgstr ""
+"在你的开发目录中,调用 <literal>ant war</literal> 来构建、打包,然后把 "
+"<literal>hibernate-tutorial.war</literal> 文件拷贝到你的 tomcat 的 "
+"<literal>webapps</literal> 目录下。假若你还没安装 Tomcat,就去下载一个,按照"
+"指南来安装。对此应用的发布,你不需要修改任何 Tomcat 的配置。 "
#. Tag: para
-#, no-c-format
-msgid "If you do not have Tomcat installed, download it from <ulink url=\"http://tomcat.apache.org/\" /> and follow the installation instructions. Our application requires no changes to the standard Tomcat configuration."
-msgstr "如果你还没有安装 Tomcat,请从 <ulink url=\"http://tomcat.apache.org/\" /> 下载并按照安装说明进行安装。我们的应用程序不需要对标准的 Tomcat 配置进行修改。 "
+#: tutorial.xml:1091
+#, fuzzy, no-c-format
+msgid ""
+"If you do not have Tomcat installed, download it from <ulink url=\"http://"
+"tomcat.apache.org/\"></ulink> and follow the installation instructions. Our "
+"application requires no changes to the standard Tomcat configuration."
+msgstr ""
+"如果你还没有安装 Tomcat,请从 <ulink url=\"http://tomcat.apache.org/\" /> 下"
+"载并按照安装说明进行安装。我们的应用程序不需要对标准的 Tomcat 配置进行修改。 "
#. Tag: para
+#: tutorial.xml:1099
#, no-c-format
-msgid "Once deployed and Tomcat is running, access the application at <literal>http://localhost:8080/hibernate-tutorial/eventmanager</literal>. Make sure you watch the Tomcat log to see Hibernate initialize when the first request hits your servlet (the static initializer in <literal>HibernateUtil</literal> is called) and to get the detailed output if any exceptions occurs."
-msgstr "在部署完,启动 Tomcat 之后,通过 <literal>http://localhost:8080/hibernate-tutorial/eventmanager</literal> 进行访问你的应用,在第一次 servlet 请求发生时,请在 Tomcat log 中确认你看到 Hibernate 被初始化了(<literal>HibernateUtil</literal> 的静态初始化器被调用),假若有任何异常抛出,也可以看到详细的输出。"
+msgid ""
+"Once deployed and Tomcat is running, access the application at "
+"<literal>http://localhost:8080/hibernate-tutorial/eventmanager</literal>. "
+"Make sure you watch the Tomcat log to see Hibernate initialize when the "
+"first request hits your servlet (the static initializer in "
+"<literal>HibernateUtil</literal> is called) and to get the detailed output "
+"if any exceptions occurs."
+msgstr ""
+"在部署完,启动 Tomcat 之后,通过 <literal>http://localhost:8080/hibernate-"
+"tutorial/eventmanager</literal> 进行访问你的应用,在第一次 servlet 请求发生"
+"时,请在 Tomcat log 中确认你看到 Hibernate 被初始化了"
+"(<literal>HibernateUtil</literal> 的静态初始化器被调用),假若有任何异常抛"
+"出,也可以看到详细的输出。"
#. Tag: title
+#: tutorial.xml:1112
#, no-c-format
msgid "Summary"
msgstr "总结"
#. Tag: para
+#: tutorial.xml:1114
#, no-c-format
-msgid "This tutorial covered the basics of writing a simple standalone Hibernate application and a small web application. More tutorials are available from the Hibernate <ulink url=\"http://hibernate.org\">website</ulink>."
-msgstr "本章覆盖了如何编写一个简单独立的 Hibernate 命令行应用程序及小型的 Hibernate web 应用程序的基本要素。更多的教程可以在 <ulink url=\"http://hibernate.org\">website</ulink> 上找到。"
-
-#~ msgid ""
-#~ "<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://"
-#~ "maven.apache.org/xsd/maven-4.0.0.xsd\">\n"
-#~ "\n"
-#~ " <modelVersion>4.0.0</modelVersion>\n"
-#~ "\n"
-#~ " <groupId>org.hibernate.tutorials</groupId>\n"
-#~ " <artifactId>hibernate-tutorial</artifactId>\n"
-#~ " <version>1.0.0-SNAPSHOT</version>\n"
-#~ " <name>First Hibernate Tutorial</name>\n"
-#~ "\n"
-#~ " <build>\n"
-#~ " <!-- we dont want the version to be part of the generated war "
-#~ "file name -->\n"
-#~ " <finalName>${artifactId}</finalName>\n"
-#~ " </build>\n"
-#~ "\n"
-#~ " <dependencies>\n"
-#~ " <dependency>\n"
-#~ " <groupId>org.hibernate</groupId>\n"
-#~ " <artifactId>hibernate-core</artifactId>\n"
-#~ " </dependency>\n"
-#~ "\n"
-#~ " <!-- Because this is a web app, we also have a dependency on the "
-#~ "servlet api. -->\n"
-#~ " <dependency>\n"
-#~ " <groupId>javax.servlet</groupId>\n"
-#~ " <artifactId>servlet-api</artifactId>\n"
-#~ " </dependency>\n"
-#~ "\n"
-#~ " <!-- Hibernate uses slf4j for logging, for our purposes here use "
-#~ "the simple backend -->\n"
-#~ " <dependency>\n"
-#~ " <groupId>org.slf4j</groupId>\n"
-#~ " <artifactId>slf4j-simple</artifactId>\n"
-#~ " </dependency>\n"
-#~ "\n"
-#~ " <!-- Hibernate gives you a choice of bytecode providers between "
-#~ "cglib and javassist -->\n"
-#~ " <dependency>\n"
-#~ " <groupId>javassist</groupId>\n"
-#~ " <artifactId>javassist</artifactId>\n"
-#~ " </dependency>\n"
-#~ " </dependencies>\n"
-#~ "\n"
-#~ "</project>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://"
-#~ "maven.apache.org/xsd/maven-4.0.0.xsd\">\n"
-#~ "\n"
-#~ " <modelVersion>4.0.0</modelVersion>\n"
-#~ "\n"
-#~ " <groupId>org.hibernate.tutorials</groupId>\n"
-#~ " <artifactId>hibernate-tutorial</artifactId>\n"
-#~ " <version>1.0.0-SNAPSHOT</version>\n"
-#~ " <name>First Hibernate Tutorial</name>\n"
-#~ "\n"
-#~ " <build>\n"
-#~ " <!-- we dont want the version to be part of the generated war "
-#~ "file name -->\n"
-#~ " <finalName>${artifactId}</finalName>\n"
-#~ " </build>\n"
-#~ "\n"
-#~ " <dependencies>\n"
-#~ " <dependency>\n"
-#~ " <groupId>org.hibernate</groupId>\n"
-#~ " <artifactId>hibernate-core</artifactId>\n"
-#~ " </dependency>\n"
-#~ "\n"
-#~ " <!-- Because this is a web app, we also have a dependency on the "
-#~ "servlet api. -->\n"
-#~ " <dependency>\n"
-#~ " <groupId>javax.servlet</groupId>\n"
-#~ " <artifactId>servlet-api</artifactId>\n"
-#~ " </dependency>\n"
-#~ "\n"
-#~ " <!-- Hibernate uses slf4j for logging, for our purposes here use "
-#~ "the simple backend -->\n"
-#~ " <dependency>\n"
-#~ " <groupId>org.slf4j</groupId>\n"
-#~ " <artifactId>slf4j-simple</artifactId>\n"
-#~ " </dependency>\n"
-#~ "\n"
-#~ " <!-- Hibernate gives you a choice of bytecode providers between "
-#~ "cglib and javassist -->\n"
-#~ " <dependency>\n"
-#~ " <groupId>javassist</groupId>\n"
-#~ " <artifactId>javassist</artifactId>\n"
-#~ " </dependency>\n"
-#~ " </dependencies>\n"
-#~ "\n"
-#~ "</project>]]>"
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Event {\n"
-#~ " private Long id;\n"
-#~ "\n"
-#~ " private String title;\n"
-#~ " private Date date;\n"
-#~ "\n"
-#~ " public Event() {}\n"
-#~ "\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id = id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Date getDate() {\n"
-#~ " return date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setDate(Date date) {\n"
-#~ " this.date = date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getTitle() {\n"
-#~ " return title;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setTitle(String title) {\n"
-#~ " this.title = title;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "public class Event {\n"
-#~ " private Long id;\n"
-#~ "\n"
-#~ " private String title;\n"
-#~ " private Date date;\n"
-#~ "\n"
-#~ " public Event() {}\n"
-#~ "\n"
-#~ " public Long getId() {\n"
-#~ " return id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void setId(Long id) {\n"
-#~ " this.id = id;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public Date getDate() {\n"
-#~ " return date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setDate(Date date) {\n"
-#~ " this.date = date;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public String getTitle() {\n"
-#~ " return title;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setTitle(String title) {\n"
-#~ " this.title = title;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<?xml version=\"1.0\"?>\n"
-#~ "<!DOCTYPE hibernate-mapping PUBLIC\n"
-#~ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
-#~ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
-#~ "\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "[...]\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ "\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/"
-#~ ">\n"
-#~ " <property name=\"title\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<![CDATA[\n"
-#~ "<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Event\" table=\"EVENTS\">\n"
-#~ " <id name=\"id\" column=\"EVENT_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"date\" type=\"timestamp\" column=\"EVENT_DATE\"/"
-#~ ">\n"
-#~ " <property name=\"title\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgid ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!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"
-#~ "\n"
-#~ " <session-factory>\n"
-#~ "\n"
-#~ " <!-- Database connection settings -->\n"
-#~ " <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
-#~ "property>\n"
-#~ " <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
-#~ "property>\n"
-#~ " <property name=\"connection.username\">sa</property>\n"
-#~ " <property name=\"connection.password\"></property>\n"
-#~ "\n"
-#~ " <!-- JDBC connection pool (use the built-in) -->\n"
-#~ " <property name=\"connection.pool_size\">1</property>\n"
-#~ "\n"
-#~ " <!-- SQL dialect -->\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Enable Hibernate's automatic session context management -->\n"
-#~ " <property name=\"current_session_context_class\">thread</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Disable the second-level cache -->\n"
-#~ " <property name=\"cache.provider_class\">org.hibernate.cache."
-#~ "NoCacheProvider</property>\n"
-#~ "\n"
-#~ " <!-- Echo all executed SQL to stdout -->\n"
-#~ " <property name=\"show_sql\">true</property>\n"
-#~ "\n"
-#~ " <!-- Drop and re-create the database schema on startup -->\n"
-#~ " <property name=\"hbm2ddl.auto\">update</property>\n"
-#~ "\n"
-#~ " <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/"
-#~ ">\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-#~ msgstr ""
-#~ "<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n"
-#~ "<!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"
-#~ "\n"
-#~ " <session-factory>\n"
-#~ "\n"
-#~ " <!-- Database connection settings -->\n"
-#~ " <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</"
-#~ "property>\n"
-#~ " <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</"
-#~ "property>\n"
-#~ " <property name=\"connection.username\">sa</property>\n"
-#~ " <property name=\"connection.password\"></property>\n"
-#~ "\n"
-#~ " <!-- JDBC connection pool (use the built-in) -->\n"
-#~ " <property name=\"connection.pool_size\">1</property>\n"
-#~ "\n"
-#~ " <!-- SQL dialect -->\n"
-#~ " <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Enable Hibernate's automatic session context management -->\n"
-#~ " <property name=\"current_session_context_class\">thread</"
-#~ "property>\n"
-#~ "\n"
-#~ " <!-- Disable the second-level cache -->\n"
-#~ " <property name=\"cache.provider_class\">org.hibernate.cache."
-#~ "NoCacheProvider</property>\n"
-#~ "\n"
-#~ " <!-- Echo all executed SQL to stdout -->\n"
-#~ " <property name=\"show_sql\">true</property>\n"
-#~ "\n"
-#~ " <!-- Drop and re-create the database schema on startup -->\n"
-#~ " <property name=\"hbm2ddl.auto\">update</property>\n"
-#~ "\n"
-#~ " <mapping resource=\"org/hibernate/tutorial/domain/Event.hbm.xml\"/"
-#~ ">\n"
-#~ "\n"
-#~ " </session-factory>\n"
-#~ "\n"
-#~ "</hibernate-configuration>]]>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.util;\n"
-#~ "\n"
-#~ "import org.hibernate.SessionFactory;\n"
-#~ "import org.hibernate.cfg.Configuration;\n"
-#~ "\n"
-#~ "public class HibernateUtil {\n"
-#~ "\n"
-#~ " private static final SessionFactory sessionFactory = "
-#~ "buildSessionFactory();\n"
-#~ "\n"
-#~ " private static SessionFactory buildSessionFactory() {\n"
-#~ " try {\n"
-#~ " // Create the SessionFactory from hibernate.cfg.xml\n"
-#~ " return new Configuration().configure().buildSessionFactory"
-#~ "();\n"
-#~ " }\n"
-#~ " catch (Throwable ex) {\n"
-#~ " // Make sure you log the exception, as it might be swallowed\n"
-#~ " System.err.println(\"Initial SessionFactory creation failed."
-#~ "\" + ex);\n"
-#~ " throw new ExceptionInInitializerError(ex);\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " public static SessionFactory getSessionFactory() {\n"
-#~ " return sessionFactory;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package util;\n"
-#~ "\n"
-#~ "import org.hibernate.*;\n"
-#~ "import org.hibernate.cfg.*;\n"
-#~ "\n"
-#~ "public class HibernateUtil {\n"
-#~ "\n"
-#~ " private static final SessionFactory sessionFactory;\n"
-#~ "\n"
-#~ " static {\n"
-#~ " try {\n"
-#~ " // Create the SessionFactory from hibernate.cfg.xml\n"
-#~ " sessionFactory = new Configuration().configure()."
-#~ "buildSessionFactory();\n"
-#~ " } catch (Throwable ex) {\n"
-#~ " // Make sure you log the exception, as it might be swallowed\n"
-#~ " System.err.println(\"Initial SessionFactory creation failed."
-#~ "\" + ex);\n"
-#~ " throw new ExceptionInInitializerError(ex);\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " public static SessionFactory getSessionFactory() {\n"
-#~ " return sessionFactory;\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial;\n"
-#~ "\n"
-#~ "import org.hibernate.Session;\n"
-#~ "\n"
-#~ "import java.util.*;\n"
-#~ "\n"
-#~ "import org.hibernate.tutorial.domain.Event;\n"
-#~ "import org.hibernate.tutorial.util.HibernateUtil;\n"
-#~ "\n"
-#~ "public class EventManager {\n"
-#~ "\n"
-#~ " public static void main(String[] args) {\n"
-#~ " EventManager mgr = new EventManager();\n"
-#~ "\n"
-#~ " if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory().close();\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void createAndStoreEvent(String title, Date theDate) {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ " session.save(theEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "import org.hibernate.Session;\n"
-#~ "\n"
-#~ "import java.util.Date;\n"
-#~ "\n"
-#~ "import util.HibernateUtil;\n"
-#~ "\n"
-#~ "public class EventManager {\n"
-#~ "\n"
-#~ " public static void main(String[] args) {\n"
-#~ " EventManager mgr = new EventManager();\n"
-#~ "\n"
-#~ " if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory().close();\n"
-#~ " }\n"
-#~ "\n"
-#~ " private void createAndStoreEvent(String title, Date theDate) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ "\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " session.save(theEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[[java] Hibernate: insert into EVENTS (EVENT_DATE, title, "
-#~ "EVENT_ID) values (?, ?, ?)]]>"
-#~ msgstr ""
-#~ "[java] Hibernate: insert into EVENTS (EVENT_DATE, title, EVENT_ID) values "
-#~ "(?, ?, ?)"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " }\n"
-#~ " else if (args[0].equals(\"list\")) {\n"
-#~ " List events = mgr.listEvents();\n"
-#~ " for (int i = 0; i < events.size(); i++) {\n"
-#~ " Event theEvent = (Event) events.get(i);\n"
-#~ " System.out.println(\n"
-#~ " \"Event: \" + theEvent.getTitle() + \" Time: \" + "
-#~ "theEvent.getDate()\n"
-#~ " );\n"
-#~ " }\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "if (args[0].equals(\"store\")) {\n"
-#~ " mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ "}\n"
-#~ "else if (args[0].equals(\"list\")) {\n"
-#~ " List events = mgr.listEvents();\n"
-#~ " for (int i = 0; i < events.size(); i++) {\n"
-#~ " Event theEvent = (Event) events.get(i);\n"
-#~ " System.out.println(\"Event: \" + theEvent.getTitle() +\n"
-#~ " \" Time: \" + theEvent.getDate());\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private List listEvents() {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ " List result = session.createQuery(\"from Event\").list();\n"
-#~ " session.getTransaction().commit();\n"
-#~ " return result;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private List listEvents() {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ "\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " List result = session.createQuery(\"from Event\").list();\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " return result;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.domain;\n"
-#~ "\n"
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Long id;\n"
-#~ " private int age;\n"
-#~ " private String firstname;\n"
-#~ " private String lastname;\n"
-#~ "\n"
-#~ " public Person() {}\n"
-#~ "\n"
-#~ " // Accessor methods for all properties, private setter for 'id'\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "package events;\n"
-#~ "\n"
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Long id;\n"
-#~ " private int age;\n"
-#~ " private String firstname;\n"
-#~ " private String lastname;\n"
-#~ "\n"
-#~ " public Person() {}\n"
-#~ "\n"
-#~ " // Accessor methods for all properties, private setter for 'id'\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<hibernate-mapping package=\"org.hibernate.tutorial.domain\">\n"
-#~ "\n"
-#~ " <class name=\"Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>]]>"
-#~ msgstr ""
-#~ "<hibernate-mapping>\n"
-#~ "\n"
-#~ " <class name=\"events.Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ " </class>\n"
-#~ "\n"
-#~ "</hibernate-mapping>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "<mapping resource=\"events/Person.hbm.xml\"/>]]>"
-#~ msgstr ""
-#~ "<mapping resource=\"events/Event.hbm.xml\"/>\n"
-#~ "<mapping resource=\"events/Person.hbm.xml\"/>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[public class Person {\n"
-#~ "\n"
-#~ " private Set events = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "public class Person {\n"
-#~ "\n"
-#~ " private Set events = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<class name=\"Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ "\n"
-#~ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <many-to-many column=\"EVENT_ID\" class=\"Event\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ "</class>]]>"
-#~ msgstr ""
-#~ "<class name=\"events.Person\" table=\"PERSON\">\n"
-#~ " <id name=\"id\" column=\"PERSON_ID\">\n"
-#~ " <generator class=\"native\"/>\n"
-#~ " </id>\n"
-#~ " <property name=\"age\"/>\n"
-#~ " <property name=\"firstname\"/>\n"
-#~ " <property name=\"lastname\"/>\n"
-#~ "\n"
-#~ " <set name=\"events\" table=\"PERSON_EVENT\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <many-to-many column=\"EVENT_ID\" class=\"events.Event\"/>\n"
-#~ " </set>\n"
-#~ "\n"
-#~ "</class>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ " _____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | |\n"
-#~ " |_____________| |__________________| | PERSON |\n"
-#~ " | | | | |_____________|\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE |\n"
-#~ " |_____________| | FIRSTNAME |\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|\n"
-#~ " ]]>"
-#~ msgstr ""
-#~ "_____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | |\n"
-#~ " |_____________| |__________________| | PERSON |\n"
-#~ " | | | | |_____________|\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | |\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE |\n"
-#~ " |_____________| | FIRSTNAME |\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) "
-#~ "{\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ " aPerson.getEvents().add(anEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addPersonToEvent(Long personId, Long eventId) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addPersonToEvent(Long personId, Long eventId) "
-#~ "{\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session\n"
-#~ " .createQuery(\"select p from Person p left join fetch p."
-#~ "events where p.id = :pid\")\n"
-#~ " .setParameter(\"pid\", personId)\n"
-#~ " .uniqueResult(); // Eager fetch the collection so we can "
-#~ "use it detached\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " // End of first unit of work\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) "
-#~ "is detached\n"
-#~ "\n"
-#~ " // Begin second unit of work\n"
-#~ "\n"
-#~ " Session session2 = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session2.beginTransaction();\n"
-#~ " session2.update(aPerson); // Reattachment of aPerson\n"
-#~ "\n"
-#~ " session2.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addPersonToEvent(Long personId, Long eventId) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session\n"
-#~ " .createQuery(\"select p from Person p left join fetch p."
-#~ "events where p.id = :pid\")\n"
-#~ " .setParameter(\"pid\", personId)\n"
-#~ " .uniqueResult(); // Eager fetch the collection so we can use "
-#~ "it detached\n"
-#~ "\n"
-#~ " Event anEvent = (Event) session.load(Event.class, eventId);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "\n"
-#~ " // End of first unit of work\n"
-#~ "\n"
-#~ " aPerson.getEvents().add(anEvent); // aPerson (and its collection) is "
-#~ "detached\n"
-#~ "\n"
-#~ " // Begin second unit of work\n"
-#~ "\n"
-#~ " Session session2 = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session2.beginTransaction();\n"
-#~ "\n"
-#~ " session2.update(aPerson); // Reattachment of aPerson\n"
-#~ "\n"
-#~ " session2.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ else if (args[0].equals(\"addpersontoevent\")) {\n"
-#~ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date"
-#~ "());\n"
-#~ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
-#~ " mgr.addPersonToEvent(personId, eventId);\n"
-#~ " System.out.println(\"Added person \" + personId + \" to event "
-#~ "\" + eventId);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "else if (args[0].equals(\"addpersontoevent\")) {\n"
-#~ " Long eventId = mgr.createAndStoreEvent(\"My Event\", new Date());\n"
-#~ " Long personId = mgr.createAndStorePerson(\"Foo\", \"Bar\");\n"
-#~ " mgr.addPersonToEvent(personId, eventId);\n"
-#~ " System.out.println(\"Added person \" + personId + \" to event \" + "
-#~ "eventId);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private Set emailAddresses = new HashSet();\n"
-#~ "\n"
-#~ " public Set getEmailAddresses() {\n"
-#~ " return emailAddresses;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setEmailAddresses(Set emailAddresses) {\n"
-#~ " this.emailAddresses = emailAddresses;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private Set emailAddresses = new HashSet();\n"
-#~ "\n"
-#~ "public Set getEmailAddresses() {\n"
-#~ " return emailAddresses;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void setEmailAddresses(Set emailAddresses) {\n"
-#~ " this.emailAddresses = emailAddresses;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ <set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR"
-#~ "\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
-#~ " </set>]]>"
-#~ msgstr ""
-#~ "<set name=\"emailAddresses\" table=\"PERSON_EMAIL_ADDR\">\n"
-#~ " <key column=\"PERSON_ID\"/>\n"
-#~ " <element type=\"string\" column=\"EMAIL_ADDR\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[\n"
-#~ " _____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | | "
-#~ "___________________\n"
-#~ " |_____________| |__________________| | PERSON | "
-#~ "| |\n"
-#~ " | | | | |_____________| | "
-#~ "PERSON_EMAIL_ADDR |\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | | |"
-#~ "___________________|\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | <--> | "
-#~ "*PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE | | "
-#~ "*EMAIL_ADDR |\n"
-#~ " |_____________| | FIRSTNAME | |"
-#~ "___________________|\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|\n"
-#~ " ]]>"
-#~ msgstr ""
-#~ "_____________ __________________\n"
-#~ " | | | | _____________\n"
-#~ " | EVENTS | | PERSON_EVENT | | | "
-#~ "___________________\n"
-#~ " |_____________| |__________________| | PERSON | "
-#~ "| |\n"
-#~ " | | | | |_____________| | "
-#~ "PERSON_EMAIL_ADDR |\n"
-#~ " | *EVENT_ID | <--> | *EVENT_ID | | "
-#~ "| |___________________|\n"
-#~ " | EVENT_DATE | | *PERSON_ID | <--> | *PERSON_ID | "
-#~ "<--> | *PERSON_ID |\n"
-#~ " | TITLE | |__________________| | AGE | | "
-#~ "*EMAIL_ADDR |\n"
-#~ " |_____________| | FIRSTNAME | |"
-#~ "___________________|\n"
-#~ " | LASTNAME |\n"
-#~ " |_____________|"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void addEmailToPerson(Long personId, String "
-#~ "emailAddress) {\n"
-#~ " Session session = HibernateUtil.getSessionFactory()."
-#~ "getCurrentSession();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ " // adding to the emailAddress collection might trigger a lazy "
-#~ "load of the collection\n"
-#~ " aPerson.getEmailAddresses().add(emailAddress);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void addEmailToPerson(Long personId, String emailAddress) {\n"
-#~ "\n"
-#~ " Session session = HibernateUtil.getSessionFactory().getCurrentSession"
-#~ "();\n"
-#~ " session.beginTransaction();\n"
-#~ "\n"
-#~ " Person aPerson = (Person) session.load(Person.class, personId);\n"
-#~ "\n"
-#~ " // The getEmailAddresses() might trigger a lazy load of the "
-#~ "collection\n"
-#~ " aPerson.getEmailAddresses().add(emailAddress);\n"
-#~ "\n"
-#~ " session.getTransaction().commit();\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private Set participants = new HashSet();\n"
-#~ "\n"
-#~ " public Set getParticipants() {\n"
-#~ " return participants;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void setParticipants(Set participants) {\n"
-#~ " this.participants = participants;\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private Set participants = new HashSet();\n"
-#~ "\n"
-#~ "public Set getParticipants() {\n"
-#~ " return participants;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void setParticipants(Set participants) {\n"
-#~ " this.participants = participants;\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ <set name=\"participants\" table=\"PERSON_EVENT\" "
-#~ "inverse=\"true\">\n"
-#~ " <key column=\"EVENT_ID\"/>\n"
-#~ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
-#~ " </set>]]>"
-#~ msgstr ""
-#~ "<set name=\"participants\" table=\"PERSON_EVENT\" inverse=\"true"
-#~ "\">\n"
-#~ " <key column=\"EVENT_ID\"/>\n"
-#~ " <many-to-many column=\"PERSON_ID\" class=\"events.Person\"/>\n"
-#~ "</set>"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ protected Set getEvents() {\n"
-#~ " return events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " protected void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void addToEvent(Event event) {\n"
-#~ " this.getEvents().add(event);\n"
-#~ " event.getParticipants().add(this);\n"
-#~ " }\n"
-#~ "\n"
-#~ " public void removeFromEvent(Event event) {\n"
-#~ " this.getEvents().remove(event);\n"
-#~ " event.getParticipants().remove(this);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "protected Set getEvents() {\n"
-#~ " return events;\n"
-#~ "}\n"
-#~ "\n"
-#~ "protected void setEvents(Set events) {\n"
-#~ " this.events = events;\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void addToEvent(Event event) {\n"
-#~ " this.getEvents().add(event);\n"
-#~ " event.getParticipants().add(this);\n"
-#~ "}\n"
-#~ "\n"
-#~ "public void removeFromEvent(Event event) {\n"
-#~ " this.getEvents().remove(event);\n"
-#~ " event.getParticipants().remove(this);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[package org.hibernate.tutorial.web;\n"
-#~ "\n"
-#~ "// Imports\n"
-#~ "\n"
-#~ "public class EventManagerServlet extends HttpServlet {\n"
-#~ "\n"
-#~ " protected void doGet(\n"
-#~ " HttpServletRequest request,\n"
-#~ " HttpServletResponse response) throws ServletException, "
-#~ "IOException {\n"
-#~ "\n"
-#~ " SimpleDateFormat dateFormatter = new SimpleDateFormat( \"dd.MM."
-#~ "yyyy\" );\n"
-#~ "\n"
-#~ " try {\n"
-#~ " // Begin unit of work\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "beginTransaction();\n"
-#~ "\n"
-#~ " // Process request and render page...\n"
-#~ "\n"
-#~ " // End unit of work\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "getTransaction().commit();\n"
-#~ " }\n"
-#~ " catch (Exception ex) {\n"
-#~ " HibernateUtil.getSessionFactory().getCurrentSession()."
-#~ "getTransaction().rollback();\n"
-#~ " if ( ServletException.class.isInstance( ex ) ) {\n"
-#~ " throw ( ServletException ) ex;\n"
-#~ " }\n"
-#~ " else {\n"
-#~ " throw new ServletException( ex );\n"
-#~ " }\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ "}]]>"
-#~ msgstr ""
-#~ "protected void doGet(HttpServletRequest request,\n"
-#~ " HttpServletResponse response)\n"
-#~ " throws ServletException, IOException {\n"
-#~ "\n"
-#~ " SimpleDateFormat dateFormatter = new SimpleDateFormat(\"dd.MM.yyyy"
-#~ "\");\n"
-#~ "\n"
-#~ " try {\n"
-#~ " // Begin unit of work\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().beginTransaction();\n"
-#~ "\n"
-#~ " // Process request and render page...\n"
-#~ "\n"
-#~ " // End unit of work\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().getTransaction().commit();\n"
-#~ "\n"
-#~ " } catch (Exception ex) {\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().getTransaction().rollback();\n"
-#~ " throw new ServletException(ex);\n"
-#~ " }\n"
-#~ "\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ // Write HTML header\n"
-#~ " PrintWriter out = response.getWriter();\n"
-#~ " out.println(\"<html><head><title>Event Manager</title></"
-#~ "head><body>\");\n"
-#~ "\n"
-#~ " // Handle actions\n"
-#~ " if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
-#~ "\n"
-#~ " String eventTitle = request.getParameter(\"eventTitle\");\n"
-#~ " String eventDate = request.getParameter(\"eventDate\");\n"
-#~ "\n"
-#~ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
-#~ " out.println(\"<b><i>Please enter event title and date.</"
-#~ "i></b>\");\n"
-#~ " }\n"
-#~ " else {\n"
-#~ " createAndStoreEvent(eventTitle, dateFormatter.parse"
-#~ "(eventDate));\n"
-#~ " out.println(\"<b><i>Added event.</i></b>\");\n"
-#~ " }\n"
-#~ " }\n"
-#~ "\n"
-#~ " // Print page\n"
-#~ " printEventForm(out);\n"
-#~ " listEvents(out, dateFormatter);\n"
-#~ "\n"
-#~ " // Write HTML footer\n"
-#~ " out.println(\"</body></html>\");\n"
-#~ " out.flush();\n"
-#~ " out.close();]]>"
-#~ msgstr ""
-#~ "// Write HTML header\n"
-#~ "PrintWriter out = response.getWriter();\n"
-#~ "out.println(\"<html><head><title>Event Manager</"
-#~ "title></head><body>\");\n"
-#~ "\n"
-#~ "// Handle actions\n"
-#~ "if ( \"store\".equals(request.getParameter(\"action\")) ) {\n"
-#~ "\n"
-#~ " String eventTitle = request.getParameter(\"eventTitle\");\n"
-#~ " String eventDate = request.getParameter(\"eventDate\");\n"
-#~ "\n"
-#~ " if ( \"\".equals(eventTitle) || \"\".equals(eventDate) ) {\n"
-#~ " out.println(\"<b><i>Please enter event title and date."
-#~ "</i></b>\");\n"
-#~ " } else {\n"
-#~ " createAndStoreEvent(eventTitle, dateFormatter.parse(eventDate));\n"
-#~ " out.println(\"<b><i>Added event.</i></b>"
-#~ "\");\n"
-#~ " }\n"
-#~ "}\n"
-#~ "\n"
-#~ "// Print page\n"
-#~ "printEventForm(out);\n"
-#~ "listEvents(out, dateFormatter);\n"
-#~ "\n"
-#~ "// Write HTML footer\n"
-#~ "out.println(\"</body></html>\");\n"
-#~ "out.flush();\n"
-#~ "out.close();"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void printEventForm(PrintWriter out) {\n"
-#~ " out.println(\"<h2>Add new event:</h2>\");\n"
-#~ " out.println(\"<form>\");\n"
-#~ " out.println(\"Title: <input name='eventTitle' length='50'/><br/>"
-#~ "\");\n"
-#~ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
-#~ "length='10'/><br/>\");\n"
-#~ " out.println(\"<input type='submit' name='action' value='store'/>"
-#~ "\");\n"
-#~ " out.println(\"</form>\");\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void printEventForm(PrintWriter out) {\n"
-#~ " out.println(\"<h2>Add new event:</h2>\");\n"
-#~ " out.println(\"<form>\");\n"
-#~ " out.println(\"Title: <input name='eventTitle' length='50'/><"
-#~ "br/>\");\n"
-#~ " out.println(\"Date (e.g. 24.12.2009): <input name='eventDate' "
-#~ "length='10'/><br/>\");\n"
-#~ " out.println(\"<input type='submit' name='action' value='store'/>"
-#~ "\");\n"
-#~ " out.println(\"</form>\");\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ private void listEvents(PrintWriter out, SimpleDateFormat "
-#~ "dateFormatter) {\n"
-#~ "\n"
-#~ " List result = HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().createCriteria(Event.class).list();\n"
-#~ " if (result.size() > 0) {\n"
-#~ " out.println(\"<h2>Events in database:</h2>\");\n"
-#~ " out.println(\"<table border='1'>\");\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<th>Event title</th>\");\n"
-#~ " out.println(\"<th>Event date</th>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " Iterator it = result.iterator();\n"
-#~ " while (it.hasNext()) {\n"
-#~ " Event event = (Event) it.next();\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<td>\" + event.getTitle() + \"</td>\");\n"
-#~ " out.println(\"<td>\" + dateFormatter.format(event.getDate"
-#~ "()) + \"</td>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " }\n"
-#~ " out.println(\"</table>\");\n"
-#~ " }\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "private void listEvents(PrintWriter out, SimpleDateFormat dateFormatter) "
-#~ "{\n"
-#~ "\n"
-#~ " List result = HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().createCriteria(Event.class).list"
-#~ "();\n"
-#~ " if (result.size() > 0) {\n"
-#~ " out.println(\"<h2>Events in database:</h2>\");\n"
-#~ " out.println(\"<table border='1'>\");\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<th>Event title</th>\");\n"
-#~ " out.println(\"<th>Event date</th>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " for (Iterator it = result.iterator(); it.hasNext();) {\n"
-#~ " Event event = (Event) it.next();\n"
-#~ " out.println(\"<tr>\");\n"
-#~ " out.println(\"<td>\" + event.getTitle() + \"</td>"
-#~ "\");\n"
-#~ " out.println(\"<td>\" + dateFormatter.format(event."
-#~ "getDate()) + \"</td>\");\n"
-#~ " out.println(\"</tr>\");\n"
-#~ " }\n"
-#~ " out.println(\"</table>\");\n"
-#~ " }\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[ protected void createAndStoreEvent(String title, Date "
-#~ "theDate) {\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().save(theEvent);\n"
-#~ " }]]>"
-#~ msgstr ""
-#~ "protected void createAndStoreEvent(String title, Date theDate) {\n"
-#~ " Event theEvent = new Event();\n"
-#~ " theEvent.setTitle(title);\n"
-#~ " theEvent.setDate(theDate);\n"
-#~ "\n"
-#~ " HibernateUtil.getSessionFactory()\n"
-#~ " .getCurrentSession().save(theEvent);\n"
-#~ "}"
-
-#, fuzzy
-#~ msgid ""
-#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#~ "<web-app version=\"2.4\"\n"
-#~ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun."
-#~ "com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
-#~ "\n"
-#~ " <servlet>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <servlet-class>org.hibernate.tutorial.web.EventManagerServlet</"
-#~ "servlet-class>\n"
-#~ " </servlet>\n"
-#~ "\n"
-#~ " <servlet-mapping>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <url-pattern>/eventmanager</url-pattern>\n"
-#~ " </servlet-mapping>\n"
-#~ "</web-app>]]>"
-#~ msgstr ""
-#~ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#~ "<web-app version=\"2.4\"\n"
-#~ " xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n"
-#~ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-#~ " xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n"
-#~ " http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n"
-#~ "\n"
-#~ " <servlet>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <servlet-class>events.EventManagerServlet</servlet-"
-#~ "class>\n"
-#~ " </servlet>\n"
-#~ "\n"
-#~ " <servlet-mapping>\n"
-#~ " <servlet-name>Event Manager</servlet-name>\n"
-#~ " <url-pattern>/eventmanager</url-pattern>\n"
-#~ " </servlet-mapping>\n"
-#~ "</web-app>"
-
+msgid ""
+"This tutorial covered the basics of writing a simple standalone Hibernate "
+"application and a small web application. More tutorials are available from "
+"the Hibernate <ulink url=\"http://hibernate.org\">website</ulink>."
+msgstr ""
+"本章覆盖了如何编写一个简单独立的 Hibernate 命令行应用程序及小型的 Hibernate "
+"web 应用程序的基本要素。更多的教程可以在 <ulink url=\"http://hibernate.org"
+"\">website</ulink> 上找到。"
More information about the hibernate-commits
mailing list